CN117608477A - Storage system management method and device, electronic equipment and storage medium - Google Patents

Storage system management method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN117608477A
CN117608477A CN202311587036.XA CN202311587036A CN117608477A CN 117608477 A CN117608477 A CN 117608477A CN 202311587036 A CN202311587036 A CN 202311587036A CN 117608477 A CN117608477 A CN 117608477A
Authority
CN
China
Prior art keywords
solid state
data
socket
target
disk
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
CN202311587036.XA
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.)
Beijing Topsec Technology Co Ltd
Beijing Topsec Network Security Technology Co Ltd
Beijing Topsec Software Co Ltd
Original Assignee
Beijing Topsec Technology Co Ltd
Beijing Topsec Network Security Technology Co Ltd
Beijing Topsec Software 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 Beijing Topsec Technology Co Ltd, Beijing Topsec Network Security Technology Co Ltd, Beijing Topsec Software Co Ltd filed Critical Beijing Topsec Technology Co Ltd
Priority to CN202311587036.XA priority Critical patent/CN117608477A/en
Publication of CN117608477A publication Critical patent/CN117608477A/en
Pending legal-status Critical Current

Links

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/0614Improving the reliability of storage systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/062Securing storage systems
    • G06F3/0623Securing storage systems in relation to content
    • 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 application relates to the technical field of storage management and discloses a management method and device of a storage system, electronic equipment and a storage medium; the storage system comprises n solid state disks and a mechanical hard disk taking the n solid state disks as a cache disk; the management method of the storage system comprises the following steps: acquiring data to be written; respectively storing data to be written in n solid state disks; under the condition that preset writing conditions are met, determining a first target hard disk from the n solid state disks; sending a writing instruction to a first target hard disk, and triggering the first target hard disk to write the data to be written into the mechanical hard disk; releasing data to be written in the m solid state disks; m is 1 or more and n-1 or less. Thus, the space utilization rate of the cache disk composed of the solid state disk can be improved under the condition of maintaining the reliability of data.

Description

Storage system management method and device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of storage management technologies, and in particular, to a storage system management method and apparatus, an electronic device, and a storage medium.
Background
Currently, common storage media are classified into mechanical hard disks and solid state disks. The working principle of the mechanical hard disk is that a magnetic head is positioned by a mechanical arm to perform read-write operation. Because the movement of the mechanical arm and the positioning of the magnetic head need a certain time, the access speed of the mechanical hard disk is slower, and the requirement of a user on quick data access cannot be met. Compared with a mechanical hard disk, the solid state disk has the advantages of low access delay, high read-write speed and high reliability. However, the capacity of solid state disks is relatively small and relatively expensive. Therefore, the capacity advantage of the mechanical hard disk and the performance advantage of the solid state hard disk are combined. An SSD (Solid State Disk) is usually added to a mechanical hard Disk or a group of mechanical hard disks as a buffer Disk. The frequently accessed data blocks are cached in the SSD, and can be directly read from the SSD under the condition that the computer system needs to read the data, without waiting for the rotation delay and seek time of the mechanical hard disk, thereby improving the reading speed. Meanwhile, by using a write-back strategy, data to be written is firstly cached on the SSD and then written into the mechanical hard disk by the SSD, the influence of write operation on an application program can be reduced, and therefore the overall write-in performance is improved.
If only one SSD is set as a buffer disk, under the condition that the SSD is damaged, data cannot be written into a mechanical hard disk, and the condition that the data is lost is caused, so that a large amount of data needs to be repaired, and further the storage system is greatly affected. To solve this problem, two SSDs are set in the related art to constitute one RAID1 (mirrored disk). In this way, in the event that one of the SSDs is damaged, the other SSD can normally provide service. However, the two SSDs form one RAID1, and the data between the two SSDs need to be completely consistent, so that the space capable of caching the data on the two SSDs is substantially equal to the capacity of one SSD, and the utilization rate of the caching space is low.
It should be noted that the information disclosed in the foregoing background section is only for enhancing understanding of the background of the present application and thus may include information that does not form the prior art that is already known to those of ordinary skill in the art.
Disclosure of Invention
The following presents a simplified summary in order to provide a basic understanding of some aspects of the disclosed embodiments. This summary is not an extensive overview, and is intended to neither identify key/critical elements nor delineate the scope of such embodiments, but is intended as a prelude to the more detailed description that follows.
The embodiment of the application provides a management method and device of a storage system, electronic equipment and a storage medium, so that the space utilization rate of a cache disk formed by a solid state disk is improved under the condition of maintaining the reliability of data.
In some embodiments, the storage system includes n solid state disks and a mechanical hard disk with the n solid state disks as a cache disk; n is an integer greater than or equal to 2; the management method of the storage system comprises the following steps: acquiring data to be written; respectively storing the data to be written in n solid state disks; under the condition that preset writing conditions are met, determining a first target hard disk from n solid state disks; sending a writing instruction to the first target hard disk, and triggering the first target hard disk to write the data to be written into the mechanical hard disk; releasing the data to be written in the m solid state disks; and m is more than or equal to 1 and less than or equal to n-1.
In the implementation manner, the data to be written is written into the plurality of solid state disks under the condition that the data to be written is obtained, so that data loss caused under the condition that part of the solid state disks are damaged can be avoided. Under the condition that the data to be written is written into the mechanical hard disk, releasing the data to be written in part of the solid state disk, wherein the data to be written is stored in the mechanical hard disk, so that even if the solid state disk storing the data to be written is damaged, the data to be written can be obtained from the mechanical hard disk, and the reliability of the data is ensured. Meanwhile, the data to be written is released from part of the solid state disk, so that the capacity of part of the solid state disk can be released, and the space utilization rate of a cache disk formed by the solid state disk can be improved under the condition that the reliability of the data is maintained.
In some embodiments, each solid state disk is divided into a plurality of pockets; storing the data to be written in the n solid state disks respectively, including: establishing an association relation between target sockets; the target socket is a socket used for storing the data to be written in each solid state disk; and respectively storing the data to be written in each target socket.
In the implementation manner, the association relationship between the target pockets is established, and then the data to be written is written into the target pockets with the association relationship. When the data to be written is searched, other pockets storing the same data to be written can be simply and conveniently searched through the association relation, so that the data to be written can be conveniently and quickly obtained from the pockets of other solid state disks under the condition that the solid state disk storing the data to be written is damaged.
In some embodiments, establishing the association between the target socket includes: respectively selecting one target socket from the n solid state disks; for each target socket, adding first copy information in metadata of the target socket; the first copy information comprises identification information of all target pockets except the target pocket.
In the implementation manner, the association relationship between the target pockets can be established by adding the first copy information to the metadata and only modifying the metadata. And the association relation between the target pockets is conveniently and flexibly established.
In some embodiments, the metadata for each socket includes usage state information that characterizes whether the socket is in a usable state; after the data to be written are stored, the use state information of each target socket is a first value; the first value is used for identifying that the socket is in an unusable state; releasing the data to be written in the m solid state disks comprises the following steps: selecting m to-be-released pockets in m solid state disks from the target pockets; modifying the use state information of each to-be-released socket from a first value to a second value; the second value is used to identify that the socket is in a usable state.
In the implementation manner, the to-be-released socket is in the usable state by modifying the use state information of the to-be-released socket. Therefore, when the solid state disk receives new data to be written, the data to be written can be written into the socket in a usable state. Therefore, the purpose of releasing the capacity of the solid state disk can be achieved by modifying the use state information of the to-be-released socket.
In some embodiments, after releasing the data to be written in the m solid state disks, the method further includes: deleting the copy information of each to-be-released socket; and deleting the identification information of each to-be-released socket in the metadata of each reserved socket aiming at the reserved socket except for the to-be-released socket in each target socket.
In the implementation manner, after the data to be written in the solid state disk are released, the copy information of each socket to be released is deleted. Therefore, after the data to be written in the solid state disk is released, the association relationship among the target sockets in each solid state disk is changed. Therefore, after the data to be written in the solid state disk is released, the copy information is updated. After the data to be written in part of the solid state disk are released, the association relation of each target socket in the solid state disk can still be accurately inquired.
In some embodiments, the preset writing conditions include at least one of: the writing times of the n solid state disks are smaller than the first preset times; the usable capacity of the solid state disk is smaller than the first preset capacity.
In the above implementation manner, when the writing times of each solid state disk are smaller than the first preset times, that is, each solid state disk is in an idle state. At the moment, a first target hard disk is determined from the solid state disk, and the first target hard disk is triggered to write the data to be written into the mechanical hard disk. The method and the device can reduce the influence on interaction between the solid state disk and the upper application, thereby improving the experience of the user. In order to ensure the reliability of the data, the solid state disk can release the data to be written under the condition that the stored data to be written is written into the mechanical hard disk. Therefore, under the condition that the available capacity of the solid state disk is smaller than the first preset capacity, a first target hard disk is determined from the solid state disk, and the first target hard disk is triggered to write the data to be written into the mechanical hard disk. The capacity of the solid state disk is convenient to be released subsequently, so that the space utilization rate of the solid state disk is improved.
In some embodiments, the method for managing a storage system further includes: sending read-out instructions aiming at the same target data to n solid state disks so as to enable each solid state disk to search the target data; under the condition that the target data are not found in the n solid state disks, sending a read-out instruction of the target data to the mechanical hard disk so as to acquire the target data from the mechanical hard disk; storing the target data in k second target solid state disks in the n solid state disks; and k is more than or equal to 1 and less than or equal to n-1.
In the implementation manner, under the condition that the solid state disk does not store the target data, storing the target data in k second target solid state disks in the n solid state disks. The method can facilitate the upper layer application to quickly acquire the target data under the condition of reading the same target data next time. Meanwhile, since the mechanical hard disk has stored therein the target data. Therefore, even if the solid state disk is damaged, the target data can still be read from the mechanical hard disk, so that the reliability of the target data is ensured. Therefore, the target data is not stored in all the solid state disks, and the space waste of the solid state disks can be reduced under the condition of ensuring the rapid and reliable reading of the target data.
In some embodiments, each solid state disk is divided into a plurality of pockets; determining k second target solid state disks by the following method: respectively acquiring the number of the sockets in a usable state in the n solid state disks; and determining the first k solid state disks as the second target solid state disks according to the sequence from high to low of the number.
In the implementation manner, the solid state disk is selected from high to low as the second target solid state disk according to the number of the pockets in the usable state. The target data can be stored in more solid state disks of the usable socket. So as to avoid larger capacity empty difference of each solid state disk.
In some embodiments, the method for managing a storage system further includes: and under the condition that the writing times of the n solid state disks are smaller than the second preset times, releasing the used capacity of the solid state disks according to the usable capacity of each solid state disk.
In the above implementation manner, the used capacity of the solid state disk is released under the condition that the writing times of the n solid state disks are smaller than the second preset times. Under the condition that interaction between the solid state disk and the upper application is not affected, the capacity of more solid state disks can be released, so that the follow-up solid state disk can normally store new data.
In some embodiments, each solid state disk is divided into a plurality of pockets; releasing the used capacity of the solid state disk according to the usable capacity of each solid state disk, including: acquiring the usable capacities of n solid state disks; determining the solid state disk with the usable capacity lower than the second preset capacity as a hard disk to be cleaned; releasing the used capacity of the hard disk to be cleaned according to the existence condition of dirty data of each socket in the hard disk to be cleaned; the dirty data existence condition is used for representing whether dirty data exist in the socket.
In the implementation manner, the solid state disk with the usable capacity lower than the second preset capacity is determined to be the hard disk to be cleaned, so that the cleaned solid state disk is the solid state disk with more capacity. Therefore, the situation that the capacity of part of the solid state disk is used up under the condition that the capacity of part of the solid state disk is more is avoided. The residual capacity of each solid state disk can be balanced.
In some embodiments, according to the existence of dirty data of each socket in the hard disk to be cleaned, releasing the used capacity of the hard disk to be cleaned includes: determining the socket without dirty data in the hard disk to be cleaned as the socket to be cleaned; releasing the to-be-cleaned socket according to the priority of the to-be-cleaned socket; the priority is used for representing the frequency of data stored in the to-be-cleaned socket to be accessed.
In the implementation manner, the higher the priority corresponding to the to-be-cleaned socket is, the higher the frequency of the data in the to-be-cleaned socket is accessed. According to the priority of the to-be-cleaned socket, the to-be-cleaned socket is released, and the to-be-cleaned socket with lower access frequency can be cleaned conveniently. Thereby reducing the impact of the speed of accessing the solid state disk by the upper layer application.
In some embodiments, in the management device of the storage system provided in the embodiments of the present application, the storage system includes n solid state disks and a mechanical hard disk that uses the n solid state disks as a cache disk; n is an integer greater than or equal to 2; the device comprises: the acquisition module is used for acquiring data to be written; the solid state disk writing module is used for respectively storing the data to be written in n solid state disks; the hard disk determining module is used for determining a first target hard disk from the n solid state hard disks under the condition that preset writing conditions are met; the mechanical hard disk writing module is used for sending a writing instruction to the first target hard disk and triggering the first target hard disk to write the data to be written into the mechanical hard disk; the releasing module is used for releasing the data to be written in the m solid state disks; and m is more than or equal to 1 and less than or equal to n-1.
In some embodiments, an electronic device provided in the embodiments of the present application includes a processor and a memory, where the memory stores computer executable instructions that can be executed by the processor, and the processor executes the computer executable instructions to implement a method for managing a storage system as described above.
In some embodiments, a storage medium provided in the embodiments of the present application stores computer executable instructions that, when invoked and executed by a processor, cause the processor to implement the method for managing a storage system described above.
The foregoing general description and the following description are exemplary and explanatory only and are not restrictive of the application.
Drawings
One or more embodiments are illustrated by way of example and not limitation in the figures of the accompanying drawings, in which like references indicate similar elements, and in which like reference numerals refer to similar elements, and in which:
FIG. 1 is a schematic diagram of a memory system according to an embodiment of the present disclosure;
FIG. 2 is a schematic diagram of a method for managing a storage system according to an embodiment of the present application;
FIG. 3 is a schematic diagram of a data storage structure according to an embodiment of the present application;
FIG. 4 is a schematic view of a bucket distribution of a solid state disk according to an embodiment of the present disclosure;
FIG. 5 is a schematic diagram of a management device of a storage system according to an embodiment of the present application;
fig. 6 is a schematic diagram of an electronic device according to an embodiment of the present application.
Reference numerals:
1: a storage system; 2: a solid state disk; 3: a mechanical hard disk; 4: a socket in a usable state; 5: a bucket storing dirty data; 6: a bucket that does not store dirty data; 7: an acquisition module; 8: a solid state disk writing module; 9: a hard disk determining module; 10: a mechanical hard disk writing module; 11: a release module; 12: a processor; 13: a memory; 14: a communication interface; 15: a bus.
Detailed Description
For a more complete understanding of the features and technical content of the embodiments of the present application, reference should be made to the following detailed description of the embodiments of the present application, taken in conjunction with the accompanying drawings, which are for purposes of illustration only and not intended to limit the embodiments of the present application. In the following description of the technology, for purposes of explanation, numerous details are set forth in order to provide a thorough understanding of the disclosed embodiments. However, one or more embodiments may still be practiced without these details. In other instances, well-known structures and devices may be shown simplified in order to simplify the drawing.
The terms first, second and the like in the description and in the claims of the embodiments and in the above-described figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate in order to describe embodiments of the present application described herein. Furthermore, the terms "comprise" and "have," as well as any variations thereof, are intended to cover a non-exclusive inclusion.
The term "plurality" means two or more, unless otherwise indicated.
The term "corresponding" may refer to an association or binding relationship, and the correspondence between a and B refers to an association or binding relationship between a and B.
In some embodiments, the storage system includes n solid state disks and a mechanical hard disk that uses the n solid state disks as a buffer disk, where n is an integer greater than or equal to 2. Referring to fig. 1, fig. 1 is a schematic diagram illustrating a structural composition of a memory system. The storage system 1 comprises two solid state disks 2 and five mechanical hard disks 3 taking the two solid state disks 2 as cache disks. It will be appreciated that fig. 1 is only an example, and is not intended to limit the structure of the storage system, for example, the number of solid state disks 2 in the storage system may be more than 2, and the number of mechanical disks may be a value other than 5.
In order to improve the space utilization rate of a cache disk composed of a solid state disk under the condition of maintaining the reliability of data, the embodiment of the application provides a management method for the storage system, which can be applied to an upper layer application of electronic equipment, and the solid state disk and a mechanical hard disk are accessed through a processor running the upper layer application so as to realize the management of the storage system.
Referring to fig. 2, an embodiment of the present application provides a method for managing a storage system, including:
step S101, obtaining data to be written.
Step S102, data to be written are respectively stored in n solid state disks.
Step S103, determining a first target hard disk from the n solid state hard disks under the condition that the preset writing condition is met.
Step S104, a writing instruction is sent to the first target hard disk, and the first target hard disk is triggered to write the data to be written into the mechanical hard disk.
Step S105, releasing data to be written in the m solid state disks; m is 1 or more and n-1 or less.
By adopting the management method of the storage system, which is provided by the embodiment of the application, the data to be written is written into the plurality of solid state disks under the condition that the data to be written is obtained, so that the data loss caused under the condition that part of the solid state disks are damaged can be avoided. And under the condition that the data to be written is written into the mechanical hard disk, releasing the data to be written into part of the solid state disk. Because the data to be written is already stored in the mechanical hard disk, even if the solid state disk storing the data to be written is damaged, the data to be written can still be obtained from the mechanical hard disk, so that the reliability of the data is ensured. Meanwhile, the data to be written is released in part of the solid state disk. Therefore, the capacity in part of the solid state disk can be released, and the space utilization rate of the cache disk formed by the solid state disk can be improved under the condition that the reliability of data is maintained.
In some embodiments, the data to be written characterizes data to be written to a mechanical hard disk. Wherein the data to be written can be obtained by the upper layer application according to the relevant service.
In some embodiments, each solid state disk may be divided into a plurality of buckets. At this time, the process of respectively storing the data to be written in the n solid state disks in step S102 may include:
and establishing an association relation between the target pockets, and respectively storing data to be written in each target pocket. The target socket is a socket for storing data to be written in each solid state disk. In the embodiment of the application, at least one socket can be selected from each solid state disk as the target socket, so that the storage of data to be written in n solid state disks is realized, and the data loss caused under the condition that part of the solid state disks are damaged is avoided. By establishing the association relation between the target pockets, other pockets storing the same data to be written can be simply and conveniently searched when the data to be written is searched, so that the data to be written can be quickly obtained from the pockets of other solid state disks under the condition that the solid state disk storing the data to be written is damaged.
In the embodiment of the present application, the process of establishing the association relationship between the target sockets may include: respectively selecting a target socket from the n solid state disks; for each target socket, adding first copy information in metadata of the target socket; the first copy information includes identification information of all target pockets except the target pocket. The first copy information is used for recording identification information of the socket storing the same data. In this way, the association relationship between the target pockets can be quickly and conveniently established by adding the first copy information in the metadata.
Optionally, in this embodiment, a socket in a usable state may be randomly selected from the solid state disk as the target socket.
In some embodiments, metadata of the socket of each solid state disk may be stored in a storage space accessible to an upper layer application, for example, but not by way of limitation, may be stored in a memory.
In some embodiments, a duplicate field may be provided in the metadata. The replica field describes a socket storing the same data by the identification information of the socket. That is, the contents of the replica field are used to represent a socket in which the same data is stored. And adding copy information in the replica field to establish an association relationship between the target socket.
In the embodiment of the present application, the identification information refers to information that can uniquely identify the socket. One example of this is, for example: the storage system comprises n solid state disks, and u pockets are arranged in each solid state disk. Assuming that the identification information is a positive integer from 1 to n×u, the identification information allocated to the socket is one of 1 to n×u, and the identification information allocated to different sockets is different. Another example is, for example: the storage system comprises n solid state disks, and u pockets are arranged in each solid state disk. Assume that the numbers of the solid state disks are from 1 to n, and the numbers of different solid state disks are different. The serial numbers of the pockets in a single solid state disk are from 1 to u, and the serial numbers of different pockets in the same solid state disk are different. The identification information can be the number of the solid state disk and the number of the socket. For example: n+u. For example, taking a storage system including 2 solid state disks, i.e., a solid state disk a and a solid state disk B, as an example. The metadata of each socket in the solid state disk A and the metadata of each socket in the solid state disk B are stored in the memory. The upper layer application selects a usable socket from the solid state disk A as a first target socket, and acquires identification information a of the first target socket. The upper layer application selects a usable socket from the solid state disk B as a second target socket, and acquires identification information B of the second target socket. The upper layer application searches the metadata c describing the first target socket in the memory, and adds copy information with the content of 'identification information a' in a replica field of the metadata c. The upper layer application searches the metadata d of the second target socket in the memory, and adds copy information with the content of 'identification information b' in the replica field of the metadata d. Therefore, an association relationship is established between the first target socket and the second target socket. And the upper layer application respectively stores the data to be written in the first target socket and the second target socket.
In the embodiment of the present application, the process of establishing the association relationship between the target sockets may further be: respectively selecting a target socket from the n solid state disks; and storing the association relation of each target socket in a preset association relation table. The preset association table is stored in a storage space accessible to the upper layer application, for example, but not limited to, a memory. Exemplary: the association relation table is displayed in a table form, and the identification information of the target socket with the association relation is stored in the same table. The socket corresponding to the identification information in the same table stores the same data to be written.
In some embodiments, as shown in connection with fig. 3, the data to be written may be stored in the target socket in the order of dirty field, size field, socket_offset field, hdd_id field, hdd_offset field, data field. And a plurality of data to be written can be stored in one socket. Wherein the dirty field characterizes whether dirty data exists in the bucket. The size field characterizes the length of the data to be written in sectors. The bucket_offset field characterizes in which position of the bucket the data to be written is present. The hdd_id field characterizes the number of the mechanical hard disk storing the data to be written. Wherein, the serial numbers of the mechanical hard disks in the storage system are unique. The hdd_offset field characterizes the offset of the mechanical hard disk corresponding to the start position of the data to be written. The data field is the data to be written. The upper layer application may determine the location of the data to be written in the mechanical hard disk by means of the hdd_id field, the hdd_offset field and the size field.
Alternatively, the preset writing condition may include at least one of:
the writing times of the n solid state disks are smaller than the first preset times;
the usable capacity of the solid state disk is smaller than the first preset capacity.
Therefore, under the condition that the service of the solid state disk is busy, the data to be written is written into the mechanical hard disk, and the response of the solid state disk to the upper application is possibly not timely, so that the user experience is poor. And triggering the solid state disk to write the data to be written into the mechanical hard disk under the condition that the writing times of the n solid state disks are smaller than the first preset times, so that the solid state disk writes the data to be written into the mechanical hard disk under the condition that the service of the solid state disk is not busy. The condition that the response of the solid state disk to the upper application is not timely can be reduced, and therefore the user experience is enhanced. Because the usable capacity of the solid state disk is smaller than the first preset capacity, the solid state disk can not be normally stored when the data to be written need to be stored later. Therefore, under the condition that the usable capacity of the solid state disk is smaller than the first preset capacity, the solid state disk is triggered to write the data to be written into the mechanical hard disk, so that the subsequent solid state disk can normally store new data.
In some embodiments, the number of writes to the solid state disk, i.e., the number of writes per second to the solid state disk. The first preset number of times is, for example, 30. The first preset times are set by researchers according to the number of common writing times when the solid state disk is in a state that the service is not busy.
In some embodiments, researchers determine, based on experience, that in the case where the usable capacity of the solid state disk is lower than a certain number, the next time the solid state disk stores new data to be written may be affected. Thereby setting a first preset capacity.
Optionally, when the preset writing condition is that the available capacity of the solid state disk is smaller than the first preset capacity, the solid state disk with the smallest available capacity of the n solid state disks may be determined as the first target hard disk. Optionally, when the preset writing condition is that the writing times of the n solid state disks are smaller than the first preset times, one first target hard disk may be determined from the n solid state disks by the following method: the method comprises the steps of respectively obtaining usable capacity of each solid state disk; and under the condition that the capacity difference is larger than the preset capacity difference, determining the solid state disk with the lowest usable capacity as the first target hard disk. And under the condition that the capacity difference value is not larger than the preset capacity difference value, randomly selecting one solid state disk to determine the solid state disk as the first target hard disk. The capacity difference is the absolute value of the difference between the usable capacities of the two solid state disks.
Optionally, when the preset writing condition is that the writing times of the n solid state disks are smaller than the first preset times, one first target hard disk may be determined from the n solid state disks by the following method: respectively acquiring the number of the pockets of each solid state disk in a usable state; and under the condition that the number difference value is larger than the preset number difference value, determining the solid state disk with the lowest number of the pockets in the usable state as the first target hard disk. And randomly selecting one solid state disk to determine the solid state disk as a first target hard disk under the condition that the number difference value is not larger than the preset number difference value. The number difference is the absolute value of the difference between the number of the pockets in the usable state in the two solid state disks.
For example, taking a storage system including 3 solid state disks, which are a solid state disk C, a solid state disk D, and a solid state disk E as an example. Assuming that the number of the pockets in the usable state in the solid state disk C is 20, the number of the pockets in the usable state in the solid state disk D is 15, and the number of the pockets in the usable state in the solid state disk E is 8. Therefore, the number difference between the solid state disk C and the solid state disk D is 5. The number difference between the solid state disk C and the solid state disk E is 12. The number difference between the solid state disk D and the solid state disk E is 7. If the preset number difference is 5, the number difference is larger than the preset number difference, and the solid state disk E with the lowest number of the pockets in the usable state is selected as the first target hard disk. If the preset number difference is 20, the number difference is not larger than the preset number difference, and one solid state disk is randomly selected from the solid state disk C, the solid state disk D and the solid state disk E to serve as a first target hard disk.
In some embodiments, there may be more capacity remaining in one of the solid state disks and less capacity remaining in the other solid state disk due to the larger number difference between the two solid state disks. At this time, in order to avoid unbalance of the remaining capacity space between the solid state disks. The researcher sets the preset number of differences based on the empirical values.
Alternatively, in the embodiment of the present application, one solid state disk may be directly and randomly selected from n solid state disks to determine the solid state disk as the first target hard disk.
Optionally, in some embodiments, the metadata of each bucket may include a dirty data presence condition, where the dirty data presence condition is used to characterize whether dirty data exists in the bucket. Before the data to be written are not stored, the existence condition of the dirty data of each target socket is a fourth value; the fourth value is used for identifying that no dirty data exists in the identifier; after triggering the first target hard disk to write the data to be written into the mechanical hard disk, modifying the existence condition of the dirty data of each socket to be released from a fourth value to a third value; the third value is used to identify the presence of dirty data in the bucket. Wherein the dirty data characterizes data to be written in the unwritten mechanical hard disk. Therefore, by modifying the existence condition of dirty data, the upper layer application can be facilitated to know whether the data in the socket is written into the mechanical hard disk, so that the subsequent quick release of the socket is facilitated.
In some embodiments, as shown in connection with fig. 4, fig. 4 is a schematic view of a socket distribution of a solid state disk. As shown in fig. 4, the solid state disk may be divided into a plurality of pockets according to the size of the pockets. Meanwhile, the socket is divided into different states according to the stored data, for example: each bucket is divided into a bucket4 in a usable state, a bucket5 storing dirty data and a bucket6 not storing the dirty data. And under the condition that two solid state disks exist, the association relationship exists among the sockets of the two solid state disks, which store dirty data.
Optionally, metadata of each socket may include usage status information, where the usage status information is used to characterize whether the socket is in a usable state; after the data to be written are stored, the use state information of each target socket is a first value; the first value is used for identifying that the socket is in an unusable state; when releasing data to be written in the m solid state disks, selecting m to-be-released pockets in the m solid state disks from all target pockets; modifying the use state information of each socket to be released from a first value to a second value; the second value is used to identify that the socket is in a usable state. Therefore, the use state information of the socket is changed into the usable state, and the data can be stored in the socket later when the data needing to be stored in the solid state disk is received. The usable capacity in the solid state disk can be changed rapidly and conveniently by only modifying the use state information.
In some embodiments, the used field of metadata characterizes the usage state information. The bucket with an used field of 1 is the bucket in the usable state. The bucket with an used field of 0 is a bucket in an unusable state.
Optionally, how to select m solid state disks from n solid state disks by: respectively acquiring the number of the pockets of each solid state disk in a usable state; under the condition that the number difference is larger than the preset number difference, selecting m solid state disks according to the sequence from low to high of the number of the pockets in a usable state. And randomly selecting m solid state disks under the condition that the number difference value is not larger than the preset number difference value. The number difference is the absolute value of the difference between the number of the pockets in the usable state in the two solid state disks.
Optionally, the process of releasing the data to be written in the m solid state disks may include: selecting m to-be-released pockets from m solid state disks from all target pockets; sending a deleting instruction to the solid state disk corresponding to the m to-be-released pockets, and triggering the solid state disk to delete the data stored in the m to-be-released pockets.
In the embodiment of the application, m to-be-released pockets in m solid state disks can be selected from all target pockets by the following modes: the method comprises the steps of respectively obtaining usable capacity of each solid state disk; and determining the target socket in the first m solid state disks as the socket to be released according to the order of the available capacity from low to high.
Optionally, under the condition that the use state information of each to-be-released socket is modified from the first value to the second value, or the solid state disk is triggered to delete data stored in m to-be-released sockets, copy information of each to-be-released socket can be deleted, and for reserved sockets except for the to-be-released socket in each target socket, identification information of each to-be-released socket in metadata of each reserved socket can be deleted. In this way, the association relationship among the target pockets is changed due to the release of the data to be written in part of the solid state disk. Therefore, after the data to be written in the m solid state disks are released, the copy information is updated. After the data to be written in part of the solid state disk are released, the association relation of each target socket in the solid state disk can still be accurately inquired.
In some embodiments, the storage system includes 3 solid state disks, which are solid state disk F, solid state disk G, and solid state disk H, respectively. And respectively storing the data to be written in the 3 solid state disks. For example: selecting a third target socket from the solid state disk F, selecting a fourth target socket from the solid state disk G, and selecting a fifth target socket from the solid state disk H; and storing the data to be written into the third target socket, the fourth target socket and the fifth target socket respectively. At this time, "identification information gg" of the fourth target socket and "identification information hh" of the fifth target socket are stored in the metadata of the third target socket. The metadata of the fourth target socket stores the identification information ff of the third target socket and the identification information hh of the fifth target socket. The metadata of the fifth target socket stores the identification information ff of the third target socket and the identification information gg of the fourth target socket. If m is equal to 2, and the third target socket and the fourth target socket are selected as the to-be-released socket, the fifth target socket is the reserved socket. After releasing the data to be written stored in the third target socket and the fourth target socket, deleting the identification information ff and the identification information gg in the metadata of the fifth target socket. At this time, no copy information exists in the metadata of the fifth target socket. If m is equal to 1, and the fourth target socket is selected as the socket to be released, the third target socket and the fifth target socket are reserved sockets. After releasing the data to be written stored in the fourth target socket, deleting the 'identification information gg' in the metadata of the third target socket, and deleting the 'identification information gg' in the metadata of the fifth target socket. At this time, the metadata of the third target socket stores "identification information hh". The metadata of the fifth target socket stores "identification information ff".
Optionally, after the data to be written is saved, the dirty data existence condition of each target socket is a third value. After releasing the data to be written in the m solid state disks, the existence condition of dirty data of each socket to be released can be modified from a third value to a fourth value.
Optionally, the method for managing a storage system may further include: sending read-out instructions aiming at the same target data to n solid state disks so as to enable each solid state disk to search the target data; under the condition that no target data is found in the n solid state disks, sending a read-out instruction of the target data to the mechanical hard disk so as to acquire the target data from the mechanical hard disk; storing the target data in k second target solid state disks in the n solid state disks; k is 1 or more and n-1 or less. In this way, under the condition that the target data are not found in the n solid state disks, the target data are searched from the mechanical hard disk, and the target data are stored in the m solid state disks. The upper layer application can be enabled to read from the solid state disk rapidly when the target data is searched next time. Meanwhile, since the mechanical hard disk has stored therein the target data. Therefore, even if the solid state disk is damaged, the target data can still be read from the mechanical hard disk, so that the reliability of the target data is ensured. Therefore, the target data is not stored in all the solid state disks, and the space waste of the solid state disks can be reduced under the condition of ensuring the rapid and reliable reading of the target data.
In the embodiment of the application, k second target solid state disks may be determined by: respectively acquiring the number of the pockets in a usable state in the n solid state disks; and determining the first k solid state disks as second target solid state disks according to the sequence from high to low in number. In this way, the first k solid state disks are determined to be the second target solid state disks according to the order of the number from high to low. The target data can be stored in more solid state disks of the usable socket. The method and the device can avoid larger capacity vacancy differences of the solid state disks, namely, avoid smaller capacity vacancy of part of the solid state disks under the condition that the capacity vacancy of part of the solid state disks is larger.
When k is greater than or equal to 2, the process of storing the target data in k second target solid state disks in the n solid state disks may include: establishing an association relation between alternative sockets; the candidate socket is used for storing target data in each solid state disk; and respectively storing target data in each candidate socket.
In some embodiments, the process of establishing the association between the candidate socket may include: respectively selecting one alternative socket from the k second target solid state disks; for each alternative socket, adding second copy information into metadata of the alternative socket; the second copy information includes identification information of all candidate pockets except the candidate pocket. In this way, the association relationship between the candidate socket can be conveniently created by adding the second copy information.
The storage system includes 3 solid state disks, i.e., a solid state disk I, a solid state disk J, and a solid state disk K, for example. The upper layer application can respectively send reading instructions aiming at the target data 'e' to the solid state disk I, the solid state disk J and the solid state disk K. Under the condition that the solid state disk I, the solid state disk J and the solid state disk K do not store the target data "e", the upper layer application sends a read instruction of the target data "e" to the mechanical hard disk, and then the target data "e" is obtained from the mechanical hard disk. Assuming that K is equal to 2, the number of the sockets in the usable state in the obtained solid state disk I is 20, the number of the sockets in the usable state in the obtained solid state disk J is 25, and the number of the sockets in the usable state in the obtained solid state disk K is 30. And determining the solid state disk K and the solid state disk J as a second target solid state disk according to the sequence from high to low of the number of the pockets in the usable state. The upper layer application selects a usable socket from the solid state disk K as a sixth target socket, and acquires identification information f of the sixth target socket. The upper layer application selects a usable socket from the solid state disk J as a seventh target socket, and acquires identification information J of the seventh target socket. The upper layer application searches the metadata h describing the sixth target socket in the memory, and adds copy information with the content of 'identification information j' in a replica field of the metadata h. The upper layer application searches the metadata i of the seventh target socket in the memory, and adds copy information with the content of 'identification information f' in the replica field of the metadata i. The upper layer application then stores the target data "e" into the sixth target socket and the seventh target socket.
In some embodiments, the length of the data to be written may be an integer multiple of a sector. The minimum length of data to be written is 1 sector, i.e. 512 bytes. The length of the target data is an integer multiple of the sector. The minimum target data length is 1 sector.
In some embodiments, the size of the socket set in the solid state disk is consistent with the erase size of the solid state disk. For example: the erasing size of the solid state disk is 512KB, and the size of the socket arranged in the solid state disk is 512KB.
Optionally, the method for managing a storage system may further include: and under the condition that the writing times of the n solid state disks are smaller than the second preset times, releasing the used capacity of the solid state disks according to the usable capacity of each solid state disk. The usable capacity is used for representing the capacity occupied by the socket in a usable state, or the usable capacity is used for representing the capacity of storable data in the solid state disk. In the case where the usable capacity is used to characterize the capacity occupied by a socket in a usable state, the used capacity is used to characterize the capacity occupied by a socket in an unusable state. Under the condition that the usable capacity is used for representing the capacity of the storable data in the solid state disk, the used capacity is used for representing the occupied capacity of the stored data in the solid state disk. In this way, under the condition that the writing times of the n solid state disks are smaller than the second preset times, the used capacity of the solid state disks is released. Under the condition that interaction between the solid state disk and the upper application is not affected, the capacity of more solid state disks can be released, so that the follow-up solid state disk can normally store new data.
In some embodiments, the first preset number of times may be equal to the second preset number of times. The second preset times are set by researchers according to the number of common writing times when the solid state disk is in a state that the service is not busy.
In some embodiments, the process of releasing the used capacity of the solid state disk according to the available capacity of each solid state disk may include: acquiring usable capacities of n solid state disks; determining the solid state disk with the usable capacity lower than the second preset capacity as a hard disk to be cleaned; and releasing the used capacity of the hard disk to be cleaned according to the existence condition of dirty data of each socket in the hard disk to be cleaned.
In some embodiments, researchers determine, based on experience, that in the case where the usable capacity of the solid state disk is lower than a certain number, the next time the solid state disk stores new data to be written may be affected. Thereby setting a second preset capacity.
In some embodiments, according to the existence of dirty data of each socket in the hard disk to be cleaned, releasing the used capacity of the hard disk to be cleaned includes: determining the socket without dirty data in the hard disk to be cleaned as the socket to be cleaned; releasing the to-be-cleaned socket according to the priority of the to-be-cleaned socket; the priority is used to characterize how often the data stored within the bucket is accessed.
Optionally, in the foregoing embodiment, releasing the to-be-cleaned socket according to the priority of the to-be-cleaned socket may be: and releasing the to-be-cleaned socket with the priority lower than the preset priority. Therefore, the probability that the to-be-cleaned socket with low priority is accessed is smaller, and the space utilization rate of the solid state disk can be improved under the condition that the reading speed of a user is not affected by cleaning the to-be-cleaned socket with lower priority than the preset priority.
Still alternatively, in the above embodiment, releasing the to-be-cleaned socket according to the priority of the to-be-cleaned socket may also be: and sequentially releasing the to-be-cleaned socket according to the order of the priority of the to-be-cleaned socket from low to high until the writing times of the solid state disk are larger than the second preset times.
In some embodiments, researchers can consider the response speed of upper-layer applications to data and release the capacity space of the solid state disk under the condition of setting the preset priority level based on a large amount of experimental investigation. Thereby performing the setting.
In some embodiments, the priority of a bucket may be accumulated 1 time each time data within the bucket is accessed.
In some embodiments, the storage system includes 2 solid state disks, which are solid state disk L and solid state disk M, respectively. And under the condition that the writing times of the solid state disk L and the solid state disk M are smaller than the second preset times, acquiring the usable capacity of the solid state disk L as ll. The available capacity of the obtained solid state disk M is mm. Assume that the usable capacity of the solid state disk L is ll higher than the second preset capacity, and the usable capacity of the solid state disk M is mm smaller than the second preset capacity. And determining the solid state disk M as a hard disk to be cleaned. And determining the socket without dirty data in the solid state disk M as the socket to be cleaned. And acquiring the priority of each to-be-cleaned socket, and releasing the to-be-cleaned socket with the priority lower than the preset priority.
In some embodiments, the metadata structure for each socket is as follows: struct bucket_meta { spool used; bool dirty; uint16_t priority; uint64_t replica; }. The input field represents use state information, the dirty field represents existence of dirty data, the priority field represents priority of the socket, and the duplicate field represents the socket storing the same data.
In some embodiments, it is assumed that two solid state disks with a capacity of 500G are employed as the cache disks. If two solid state disks are combined into one RAID1, the available cache space of the cache disk is only 500G. If dirty data is limited to up to 40%, that is, up to 40% of the capacity of the solid state disk is used to store the dirty data, 200GB can be used to store the dirty data, and 300GB can be used to store data that is not the dirty data in the solid state disk. If the management method of the storage system is adopted, if the dirty data is limited to be up to 40%, and the size of the dirty data is assumed to be x, then x/(x+2 (500-x))=40%, the maximum capacity for storing the dirty data is 285.7GB, 428.6GB is used for storing data which is not the dirty data, and 42.85% of space is increased compared with the RAID1 scheme.
Referring to fig. 5, the storage system includes n solid state disks and a mechanical hard disk with the n solid state disks as a buffer disk; n is an integer of 2 or more; an embodiment of the present application provides a management device of a storage system, including: the device comprises an acquisition module 7, a solid state disk writing module 8, a hard disk determining module 9, a mechanical hard disk writing module 10 and a releasing module 11. An acquisition module 7 for acquiring data to be written; the solid state disk writing module 8 is used for respectively storing data to be written in the n solid state disks; the hard disk determining module 9 is configured to determine a first target hard disk from the n solid state hard disks if a preset writing condition is satisfied; the mechanical hard disk writing module 10 is configured to send a writing instruction to the first target hard disk, and trigger the first target hard disk to write the data to be written into the mechanical hard disk; the releasing module 11 is used for releasing data to be written in the m solid state disks; m is 1 or more and n-1 or less.
By adopting the management device of the storage system, the data to be written is acquired through the acquisition module. The solid state disk writing module respectively stores data to be written in the n solid state disks. And the hard disk determining module determines a first target hard disk from the n solid state hard disks under the condition that the preset writing condition is met. The mechanical hard disk writing module sends a writing instruction to the first target hard disk, and triggers the first target hard disk to write the data to be written into the mechanical hard disk. The releasing module releases the data to be written in the m solid state disks; m is 1 or more and n-1 or less. Therefore, the data to be written is written into the plurality of solid state disks, and data loss caused under the condition that part of the solid state disks are damaged can be avoided. And under the condition that the data to be written is written into the mechanical hard disk, releasing the data to be written into part of the solid state disk. Because the data to be written is already stored in the mechanical hard disk, even if the solid state disk storing the data to be written is damaged, the data to be written can still be obtained from the mechanical hard disk, so that the reliability of the data is ensured. Meanwhile, the data to be written is released in part of the solid state disk. Therefore, the capacity in part of the solid state disk can be released, and the space utilization rate of the cache disk formed by the solid state disk can be improved under the condition that the reliability of data is maintained.
Optionally, each solid state disk is divided into a plurality of pockets respectively; the solid state disk writing module respectively stores data to be written in n solid state disks in the following manner: establishing an association relation between target sockets; the target socket is used for storing data to be written in each solid state disk; and respectively storing the data to be written in each target socket.
Optionally, the solid state disk writing module establishes the association relationship between the target sockets by the following manner: respectively selecting a target socket from the n solid state disks; for each target socket, adding first copy information in metadata of the target socket; the first copy information includes identification information of all target pockets except the target pocket.
Optionally, the metadata of each socket includes use state information, where the use state information is used to characterize whether the socket is in a usable state; after the data to be written are stored, the use state information of each target socket is a first value; the first value is used for identifying that the socket is in an unusable state; the releasing module releases data to be written in the m solid state disks by the following modes: selecting m to-be-released pockets from m solid state disks from all target pockets; modifying the use state information of each socket to be released from a first value to a second value; the second value is used to identify that the socket is in a usable state.
Optionally, the releasing module is configured to, after releasing the data to be written in the m solid state disks: deleting the first copy information of each to-be-released socket; and deleting the identification information of each to-be-released socket in the metadata of each reserved socket aiming at reserved sockets except for the to-be-released socket in each target socket.
Optionally, the management device of the storage system further includes: and writing the module. The writing-in module is used for sending reading-out instructions aiming at the same target data to the n solid state disks so as to enable each solid state disk to search the target data; under the condition that no target data is found in the n solid state disks, sending a read-out instruction of the target data to the mechanical hard disk so as to acquire the target data from the mechanical hard disk; storing the target data in k second target solid state disks in the n solid state disks; k is 1 or more and n-1 or less.
Optionally, the writing module determines k second target solid state disks by: respectively acquiring the number of the pockets in a usable state in the n solid state disks; and determining the first k solid state disks as second target solid state disks according to the sequence from high to low in number.
Optionally, the management device of the storage system further includes: and a capacity cleaning module. The capacity cleaning module is used for releasing the used capacity of the solid state disk according to the usable capacity of each solid state disk under the condition that the writing times of the n solid state disks are smaller than the second preset times.
Optionally, the capacity cleaning module releases the used capacity of the solid state disk according to the usable capacity of each solid state disk by: acquiring usable capacities of n solid state disks; determining the solid state disk with the usable capacity lower than the second preset capacity as a hard disk to be cleaned; releasing the used capacity of the hard disk to be cleaned according to the existence condition of dirty data of each socket in the hard disk to be cleaned; dirty data presence conditions are used to characterize whether dirty data is present in a bucket.
Optionally, the capacity cleaning module releases the used capacity of the hard disk to be cleaned according to the existence of dirty data of each socket in the hard disk to be cleaned by the following manner: determining the socket without dirty data in the hard disk to be cleaned as the socket to be cleaned; releasing the to-be-cleaned socket according to the priority of the to-be-cleaned socket; the priority is used to characterize how often the data stored within the bucket is accessed.
As shown in connection with fig. 6, an embodiment of the present application provides an electronic device including a processor 12 and a memory 13. Optionally, the apparatus may further comprise a communication interface 14 and a bus 15. The processor 12, the communication interface 14 and the memory 13 may communicate with each other via a bus 15. The communication interface 14 may be used for information transfer. The processor 12 may call logic instructions in the memory 13 to perform the management method of the storage system of the above-described embodiment.
Further, the logic instructions in the memory 13 described above may be implemented in the form of software functional units and may be stored in a computer readable storage medium when sold or used as a stand alone product.
The memory 13 is a computer readable storage medium, and may be used to store a software program, a computer executable program, and program instructions/modules corresponding to the methods in the embodiments of the present application. The processor 12 executes the functional applications and data processing by executing program instructions/modules stored in the memory 13, i.e., implements the management method of the storage system in the above-described embodiment.
The memory 13 may include a storage program area that may store an operating system, at least one application program required for functions, and a storage data area; the storage data area may store data created according to the use of the terminal device, etc. Further, the memory 13 may include a high-speed random access memory, and may also include a nonvolatile memory.
The embodiment of the application provides a storage medium, which stores computer executable instructions that, when called and executed by a processor, cause the processor to implement the method for managing a storage system.
Embodiments of the present application provide a computer program product comprising a computer program stored on a storage medium, the computer program comprising program instructions which, when executed by a computer, cause the computer to perform the method of managing a storage system as described above.
The computer readable storage medium may be a transitory computer readable storage medium or a non-transitory computer readable storage medium.
The technical solutions of the embodiments of the present application may be embodied in the form of a software product, where the software product is stored in a storage medium, and includes one or more instructions to cause a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in the embodiments of the present application. And the aforementioned storage medium may be a non-transitory storage medium including: a plurality of media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or a transitory storage medium.
The above description and the drawings illustrate embodiments of the present application sufficiently to enable those skilled in the art to practice them. Other embodiments may involve structural, logical, electrical, process, and other changes. The embodiments represent only possible variations. Individual components and functions are optional unless explicitly required, and the sequence of operations may vary. Portions and features of some embodiments may be included in, or substituted for, those of others. Moreover, the terminology used in the present application is for the purpose of describing embodiments only and is not intended to limit the claims. As used in the description of the embodiments and the claims, the singular forms "a," "an," and "the" (the) are intended to include the plural forms as well, unless the context clearly indicates otherwise. Without further limitation, an element defined by the phrase "comprising one …" does not exclude the presence of other like elements in a process, method or apparatus comprising such elements. In this context, each embodiment may be described with emphasis on the differences from the other embodiments, and the same similar parts between the various embodiments may be referred to each other. For the methods, products, etc. disclosed in the embodiments, if they correspond to the method sections disclosed in the embodiments, the description of the method sections may be referred to for relevance.
Those of skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. The skilled person may use different methods for each particular application to achieve the described functionality, but such implementation should not be considered to be beyond the scope of the embodiments of the present application. It will be clearly understood by those skilled in the art that, for convenience and brevity of description, specific working procedures of the above-described systems, apparatuses and units may refer to corresponding procedures in the foregoing method embodiments, which are not repeated herein.
In the embodiments disclosed herein, the disclosed methods, articles of manufacture (including but not limited to devices, apparatuses, etc.) may be practiced in other ways. For example, the apparatus embodiments described above are merely illustrative, and for example, the division of the units may be merely a logical function division, and there may be additional divisions when actually implemented, for example, multiple units or components may be combined or integrated into another system, or some features may be omitted, or not performed. In addition, the coupling or direct coupling or communication connection shown or discussed with each other may be through some interface, device or unit indirect coupling or communication connection, which may be in electrical, mechanical or other form. The units described as separate units may or may not be physically separate, and units shown 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 may be selected according to actual needs to implement the present embodiment. In addition, each functional unit in the embodiments of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit.
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). In some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. In the description corresponding to the flowcharts and block diagrams in the figures, operations or steps corresponding to different blocks may also occur in different orders than that disclosed in the description, and sometimes no specific order exists between different operations or steps. For example, two consecutive operations or steps may actually be performed substantially in parallel, they may sometimes be performed in reverse order, which may be dependent on the functions involved. Each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.

Claims (14)

1. The management method of the storage system is characterized in that the storage system comprises n solid state disks and mechanical hard disks taking the n solid state disks as cache disks; n is an integer greater than or equal to 2; the method comprises the following steps:
acquiring data to be written;
respectively storing the data to be written in n solid state disks;
under the condition that preset writing conditions are met, determining a first target hard disk from n solid state disks;
sending a writing instruction to the first target hard disk, and triggering the first target hard disk to write the data to be written into the mechanical hard disk;
releasing the data to be written in the m solid state disks; and m is more than or equal to 1 and less than or equal to n-1.
2. The method of claim 1, wherein each solid state disk is divided into a plurality of pockets; storing the data to be written in the n solid state disks respectively, wherein the steps include:
establishing an association relation between target sockets; the target socket is a socket used for storing the data to be written in each solid state disk;
and respectively storing the data to be written in each target socket.
3. The method of claim 2, wherein establishing an association between target sockets comprises:
Respectively selecting one target socket from the n solid state disks;
for each target socket, adding first copy information in metadata of the target socket; the first copy information comprises identification information of all target pockets except the target pocket.
4. A method according to claim 3, wherein the metadata of each socket includes usage status information, the usage status information being used to characterize whether the socket is in a usable state; after the data to be written are stored, the use state information of each target socket is a first value; the first value is used for identifying that the socket is in an unusable state;
releasing the data to be written in the m solid state disks comprises the following steps:
selecting m to-be-released pockets in m solid state disks from the target pockets;
modifying the use state information of each to-be-released socket from a first value to a second value; the second value is used to identify that the socket is in a usable state.
5. The method of claim 4, further comprising, after releasing the data to be written in the m solid state disks:
deleting the first copy information of each to-be-released socket;
And deleting the identification information of each to-be-released socket in the metadata of each reserved socket aiming at the reserved socket except for the to-be-released socket in each target socket.
6. The method according to any one of claims 1 to 5, wherein the preset writing conditions include at least one of:
the writing times of the n solid state disks are smaller than the first preset times;
the usable capacity of the solid state disk is smaller than the first preset capacity.
7. The method according to any one of claims 1 to 5, further comprising:
sending read-out instructions aiming at the same target data to n solid state disks so as to enable each solid state disk to search the target data;
under the condition that the target data are not found in the n solid state disks, sending a read-out instruction of the target data to the mechanical hard disk so as to acquire the target data from the mechanical hard disk;
storing the target data in k second target solid state disks in the n solid state disks; and k is more than or equal to 1 and less than or equal to n-1.
8. The method of claim 7, wherein each solid state disk is divided into a plurality of pockets; determining k second target solid state disks by the following method:
Respectively acquiring the number of the sockets in a usable state in the n solid state disks;
and determining the first k solid state disks as the second target solid state disks according to the sequence from high to low of the number.
9. The method according to any one of claims 1 to 5, further comprising:
and under the condition that the writing times of the n solid state disks are smaller than the second preset times, releasing the used capacity of the solid state disks according to the usable capacity of each solid state disk.
10. The method of claim 9, wherein each solid state disk is divided into a plurality of pockets; releasing the used capacity of the solid state disk according to the usable capacity of each solid state disk, including:
acquiring the usable capacities of n solid state disks;
determining the solid state disk with the usable capacity lower than the second preset capacity as a hard disk to be cleaned;
releasing the used capacity of the hard disk to be cleaned according to the existence condition of dirty data of each socket in the hard disk to be cleaned; the dirty data existence condition is used for representing whether dirty data exists in the socket.
11. The method of claim 10, wherein releasing the used capacity of the hard disk to be cleaned according to the presence of dirty data of each socket in the hard disk to be cleaned comprises:
Determining the socket without dirty data in the hard disk to be cleaned as the socket to be cleaned;
releasing the to-be-cleaned socket according to the priority of the to-be-cleaned socket; the priority is used for representing the frequency of data stored in the to-be-cleaned socket to be accessed.
12. The management device of the storage system is characterized in that the storage system comprises n solid state disks and mechanical hard disks taking the n solid state disks as cache disks; n is an integer greater than or equal to 2; the device comprises:
the acquisition module is used for acquiring data to be written;
the solid state disk writing module is used for respectively storing the data to be written in n solid state disks;
the hard disk determining module is used for determining a first target hard disk from the n solid state hard disks under the condition that preset writing conditions are met;
the mechanical hard disk writing module is used for sending a writing instruction to the first target hard disk and triggering the first target hard disk to write the data to be written into the mechanical hard disk;
the releasing module is used for releasing the data to be written in the m solid state disks; and m is more than or equal to 1 and less than or equal to n-1.
13. An electronic device comprising a processor and a memory, the memory storing computer-executable instructions executable by the processor, the processor executing the computer-executable instructions to implement the method of managing a storage system of any one of claims 1 to 11.
14. A storage medium storing computer-executable instructions which, when invoked and executed by a processor, cause the processor to implement a method of managing a storage system according to any one of claims 1 to 11.
CN202311587036.XA 2023-11-24 2023-11-24 Storage system management method and device, electronic equipment and storage medium Pending CN117608477A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311587036.XA CN117608477A (en) 2023-11-24 2023-11-24 Storage system management method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311587036.XA CN117608477A (en) 2023-11-24 2023-11-24 Storage system management method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN117608477A true CN117608477A (en) 2024-02-27

Family

ID=89949229

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311587036.XA Pending CN117608477A (en) 2023-11-24 2023-11-24 Storage system management method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN117608477A (en)

Similar Documents

Publication Publication Date Title
US8595451B2 (en) Managing a storage cache utilizing externally assigned cache priority tags
US11301379B2 (en) Access request processing method and apparatus, and computer device
KR101717644B1 (en) Apparatus, system, and method for caching data on a solid-state storage device
US8051249B2 (en) Method for preloading data to improve data-retrieval times
CN107391774B (en) The rubbish recovering method of log file system based on data de-duplication
US8161240B2 (en) Cache management
CN108268219B (en) Method and device for processing IO (input/output) request
CN110399310B (en) Method and device for recovering storage space
CN109800185B (en) Data caching method in data storage system
CN108733306B (en) File merging method and device
CN108604165A (en) Storage device
CN107329704B (en) Cache mirroring method and controller
KR20070060070A (en) Fat analysis for optimized sequential cluster management
CN107329692B (en) Data deduplication method and storage device
CN111209253B (en) Performance improving method and device for distributed storage device and distributed storage device
CN108628542B (en) File merging method and controller
CN113568582B (en) Data management method, device and storage equipment
CN112114753B (en) Data writing method, device and equipment
KR100703680B1 (en) Flash file system
CN113254365A (en) Method, apparatus, device, medium, and program product for managing storage space
JP2019028954A (en) Storage control apparatus, program, and deduplication method
KR101114125B1 (en) Nand Flash File System And Method For Initialization And Crash Recovery Thereof
CN113253932B (en) Read-write control method and system for distributed storage system
CN108334457B (en) IO processing method and device
US7752405B2 (en) Data recording apparatus, program product, and data recording method

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