CN116339643B - Formatting method, formatting device, formatting equipment and formatting medium for disk array - Google Patents

Formatting method, formatting device, formatting equipment and formatting medium for disk array Download PDF

Info

Publication number
CN116339643B
CN116339643B CN202310605216.XA CN202310605216A CN116339643B CN 116339643 B CN116339643 B CN 116339643B CN 202310605216 A CN202310605216 A CN 202310605216A CN 116339643 B CN116339643 B CN 116339643B
Authority
CN
China
Prior art keywords
formatting
target
data attribute
logical volume
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.)
Active
Application number
CN202310605216.XA
Other languages
Chinese (zh)
Other versions
CN116339643A (en
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.)
Suzhou Inspur Intelligent Technology Co Ltd
Original Assignee
Suzhou Inspur Intelligent Technology 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 Suzhou Inspur Intelligent Technology Co Ltd filed Critical Suzhou Inspur Intelligent Technology Co Ltd
Priority to CN202310605216.XA priority Critical patent/CN116339643B/en
Publication of CN116339643A publication Critical patent/CN116339643A/en
Application granted granted Critical
Publication of CN116339643B publication Critical patent/CN116339643B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0638Organizing or formatting or addressing of data
    • 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/0662Virtualisation aspects
    • G06F3/0665Virtualisation aspects at area level, e.g. provisioning of virtual or logical volumes
    • 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/0683Plurality of storage devices
    • G06F3/0689Disk arrays, e.g. RAID, JBOD
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The invention relates to the technical field of data storage, and discloses a formatting method, a formatting device, formatting equipment and formatting media of a disk array. And setting respective corresponding formatting rules for different data attributes, wherein the formatting rate corresponding to each formatting rule is different. After determining the target data attribute of the target logical volume, determining a target formatting rule matched with the target data attribute based on the corresponding relation between the data attribute and the formatting rule. And carrying out formatting operation on the target logical volume according to the target formatting rule. The method has the advantages that the formatting rate of the logical volume is determined through the data attribute of the logical volume, the overall performance and the data safety of the disk array are ensured, and meanwhile, the formatting efficiency of the disk array can be improved to the greatest extent.

Description

Formatting method, formatting device, formatting equipment and formatting medium for disk array
Technical Field
The present invention relates to the field of data storage technologies, and in particular, to a method, an apparatus, a device, and a medium for formatting a disk array.
Background
With the vigorous development of industrial internet and artificial intelligence technology, enterprises have increasingly stringent requirements on the security and storage performance of stored data. Taking Three-dimensional (3D) printers as an example, each 3D printer generates up to tens of Terabytes (TBs) of data per day. Further, by way of example, the data of the subscriber information produced by each bank is also huge. How to store these data, how to improve the security of data storage, and how to improve the read-write performance of data storage have become significant challenges for enterprise development.
With the rapid development of chip technology in recent years, each large storage company uses a hard redundant array of independent disks (Redundant Array of Independent Disks, RAID) storage server to replace a soft RAID storage server, and the most important component unit in the hard RAID storage server is a RAID card. A RAID card is a chip that implements the organization of disks connected to a storage server into a plurality of RAID arrays according to RAID levels.
When operating the RAID card, a host user creates a plurality of RAID arrays and then creates a plurality of logical volumes. After the host user performs the operation of deleting the logical volume, in order to thoroughly wipe out the data in the logical volume to ensure absolute data security, the volume formatting operation is usually performed on the logical volume again, so that the frequency of the deletion operation and the formatting operation of the logical volume is higher. The formatting operation of the volume is to completely destroy the content in the logical volume, and the currently commonly adopted means is to write 1 to the disk area corresponding to the RAID array, then write random number and finally write 0, thereby completing the formatting operation. But such writing of three passes of data can severely impact the formatting efficiency of the logical volumes in the RAID array.
It can be seen that how to improve the formatting efficiency of the disk array is a problem that needs to be solved by those skilled in the art.
Disclosure of Invention
The embodiment of the invention aims to provide a method, a device, equipment and a medium for formatting a disk array, which can improve the formatting efficiency of the disk array.
In order to solve the above technical problems, an embodiment of the present invention provides a method for formatting a disk array, including:
under the condition that a formatting instruction of a target logical volume is acquired, determining a target data attribute of the target logical volume according to the access times recorded in a target data attribute node corresponding to the target logical volume;
determining a target formatting rule matched with the target data attribute based on the corresponding relation between the data attribute and the formatting rule; wherein, the formatting rates corresponding to different formatting rules are different;
and carrying out formatting operation on the target logical volume according to the target formatting rule.
In one aspect, the determining, according to the number of accesses recorded in the target data attribute node corresponding to the target logical volume, the target data attribute of the target logical volume includes:
reading the access times recorded in the target data attribute node corresponding to the target logical volume;
And determining the target data attribute of the target logical volume according to the multiple relation between the access times of the target logical volume and the number of stripes contained in the target logical volume.
In one aspect, the determining, according to the multiple relationship between the access times of the target logical volume and the stripe number included in the target logical volume, the target data attribute of the target logical volume includes:
calculating the ratio of the access times of the target logical volume to the number of stripes contained in the target logical volume;
inquiring the corresponding relation between the set ratio range and the data attribute, and determining the target data attribute matched with the ratio.
In one aspect, the data attributes include N types of data attributes; wherein N is a positive integer greater than or equal to 2;
the ratio range corresponding to each data attribute is positively correlated with the formatting rate of the formatting rule to which it is matched.
In one aspect, the data attributes include first thermal data, second thermal data, and third thermal data;
correspondingly, the corresponding relation between the ratio range set by the query and the data attribute, and determining the target data attribute matched by the ratio comprises:
judging the target data attribute as first thermal data under the condition that the ratio is greater than or equal to a first threshold value;
Determining that the target data attribute is second thermal data if the ratio is greater than or equal to a second threshold and less than a first threshold; wherein the first threshold is greater than the second threshold;
and under the condition that the ratio is smaller than a second threshold value, judging the target data attribute as third thermal data.
In one aspect, the determining, based on the correspondence between the data attribute and the formatting rule, the target formatting rule that matches the target data attribute includes:
under the condition that the target data attribute is first hot data, selecting a formatting operation mode corresponding to a first formatting rate as a target formatting rule;
selecting a formatting operation mode corresponding to a second formatting rate as a target formatting rule under the condition that the target data attribute is second hot data;
selecting a formatting operation mode corresponding to a third formatting rate as a target formatting rule under the condition that the target data attribute is third hot data; wherein the first formatting rate is higher than the second formatting rate, which is higher than the third formatting rate.
In one aspect, the formatting the target logical volume according to the target formatting rule includes:
under the condition that the target formatting rule is a formatting operation mode corresponding to the first formatting rate, performing write-once operation on the target logical volume to complete formatting of the target logical volume; wherein the single write operation is zero write operation, one write operation or random number write operation;
under the condition that the target formatting rule is a formatting operation mode corresponding to the second formatting rate, performing twice write operation on the target logical volume in sequence to complete formatting of the target logical volume; wherein the double write operation is a random number write operation and a zero write operation; or write one operation and write zero operation;
under the condition that the target formatting rule is a formatting operation mode corresponding to a third formatting rate, performing write operation on the target logical volume for three times to complete formatting of the target logical volume; wherein the three write operations are a random number write operation, a one write operation and a zero write operation; and the write zero operation is the third write operation.
In one aspect, for a process of establishing a correspondence between the data attribute and a formatting rule, the method includes:
Determining the type of the data attribute of the target logical volume and the ratio range matched by the data attribute of each type based on the variation range of the access times of the target logical volume in the historical time period;
selecting a formatting rule with positive correlation between the formatting rate and each ratio range from the established formatting rule base according to the ratio range matched by each type of data attribute;
and establishing the corresponding relation of the type of the data attribute of the target logical volume and the matched formatting rule.
In one aspect, the formatting rule base sequentially comprises a write zero operation, a write one operation, a write random number operation, a write one operation and a write zero operation, a write random number operation and a write one operation, a write random number operation, a write one operation and a write zero operation in descending order of the formatting rate.
In one aspect, the method further comprises:
under the condition that a formatting instruction of a target logical volume is acquired, acquiring a data access time interval of the target logical volume;
and determining the target data attribute of the target logical volume according to the data access time interval and the access times recorded in the target data attribute node corresponding to the target logical volume.
In one aspect, the determining, according to the data access time interval and the access times recorded in the target data attribute node corresponding to the target logical volume, the target data attribute of the target logical volume includes:
reading the access times recorded in the target data attribute node corresponding to the target logical volume;
calculating the ratio of the access times of the target logical volume to the number of stripes contained in the target logical volume;
and inquiring a preset ratio range, a preset data access time interval range and a preset corresponding relation between data attributes, and determining the ratio and the target data attribute matched with the data access time interval.
In one aspect, before determining the target data attribute of the target logical volume according to the access times recorded in the target data attribute node corresponding to the target logical volume, the method further includes:
and under the condition that the logical volume creation command is acquired, the data attribute nodes matched with the number of the logical volumes to be created are taken out from the global idle data attribute node linked list.
In one aspect, after the data attribute nodes matching the number of logical volumes to be created are fetched from the global idle data attribute node linked list, the method further includes:
Periodically inquiring the current access times recorded in the data attribute node according to the established timer;
and updating the data attribute of the logical volume according to the current access times.
In one aspect, the global idle data attribute node linked list comprises a plurality of data attribute nodes; each data attribute node comprises an attribute data field and an access times field;
correspondingly, after the data attribute nodes matched with the number of the logical volumes to be created are taken out from the global idle data attribute node linked list, the method further comprises the steps of:
based on pointers recorded in attribute data fields in each data attribute node, reading the stripe access times recorded in a metadata table pointed by the pointers;
and writing the accumulated sum value of all the stripe access times in the metadata table into an access times field of the metadata table.
In one aspect, each data attribute node further comprises a front pointer to a preceding data attribute node and a back pointer to a subsequent data attribute node.
In one aspect, the retrieving, from the global idle data attribute node linked list, the data attribute node matching the number of logical volumes to be created includes:
And intercepting the data attribute nodes matched with the number of the logic volumes to be created from the head of the global idle data attribute node linked list, so that the extracted data attribute nodes are deleted from the global idle data attribute node linked list.
In one aspect, the retrieving, from the global idle data attribute node linked list, the data attribute node matching the number of logical volumes to be created includes:
and starting to read the data attribute nodes matched with the number of the logic volumes to be created from the position of the global idle data attribute node linked list, which is not marked with the read identifier, and setting the read identifier for the read data attribute nodes.
In one aspect, for a process of obtaining a formatting instruction for the target logical volume, the method includes:
and obtaining a formatting instruction of the target logical volume received by the command line interface.
In one aspect, for a process of obtaining a formatting instruction for the target logical volume, the method includes:
and obtaining a formatting instruction of the target logical volume received by the graphical interface.
The embodiment of the invention also provides a formatting device of the disk array, which comprises an attribute determining unit, a rule determining unit and a formatting unit;
the attribute determining unit is used for determining the target data attribute of the target logical volume according to the access times recorded in the target data attribute node corresponding to the target logical volume under the condition that the formatting instruction of the target logical volume is acquired;
The rule determining unit is used for determining a target formatting rule matched with the target data attribute based on the corresponding relation between the data attribute and the formatting rule; wherein, the formatting rates corresponding to different formatting rules are different;
and the formatting unit is used for carrying out formatting operation on the target logical volume according to the target formatting rule.
In one aspect, the attribute determining unit is configured to read the number of accesses recorded in the target data attribute node corresponding to the target logical volume; and determining the target data attribute of the target logical volume according to the multiple relation between the access times of the target logical volume and the number of stripes contained in the target logical volume.
In one aspect, the attribute determining unit includes a computing subunit and a querying subunit;
the calculating subunit is used for calculating the ratio of the access times of the target logical volume to the number of stripes contained in the target logical volume;
and the inquiring subunit is used for inquiring the corresponding relation between the set ratio range and the data attribute and determining the target data attribute matched with the ratio.
In one aspect, the data attributes include N types of data attributes; wherein N is a positive integer greater than or equal to 2;
The ratio range corresponding to each data attribute is positively correlated with the formatting rate of the formatting rule to which it is matched.
In one aspect, the data attributes include first thermal data, second thermal data, and third thermal data;
correspondingly, the query subunit is configured to determine that the target data attribute is first thermal data when the ratio is greater than or equal to a first threshold;
determining that the target data attribute is second thermal data if the ratio is greater than or equal to a second threshold and less than a first threshold; wherein the first threshold is greater than the second threshold;
and under the condition that the ratio is smaller than a second threshold value, judging the target data attribute as third thermal data.
In one aspect, the rule determining unit includes a first selecting subunit, a second selecting subunit, and a third selecting subunit;
the first selecting subunit is configured to select, when the target data attribute is the first hot data, a formatting operation mode corresponding to the first formatting rate as a target formatting rule;
the second selecting subunit is configured to select, when the target data attribute is second hot data, a formatting operation mode corresponding to a second formatting rate as a target formatting rule;
The third selecting subunit is configured to select, when the target data attribute is third hot data, a formatting operation mode corresponding to a third formatting rate as a target formatting rule; wherein the first formatting rate is higher than the second formatting rate, which is higher than the third formatting rate.
In one aspect, the formatting unit includes a write once subunit, a write twice subunit, and a write three subunit;
the write-once subunit is configured to perform write-once operation on the target logical volume to complete formatting of the target logical volume when the target formatting rule is a formatting operation manner corresponding to the first formatting rate; wherein the single write operation is zero write operation, one write operation or random number write operation;
the double-write subunit is configured to sequentially perform double-write operation on the target logical volume to complete formatting of the target logical volume when the target formatting rule is a formatting operation mode corresponding to the second formatting rate; wherein the double write operation is a random number write operation and a zero write operation; or write one operation and write zero operation;
The write-once subunit is configured to perform write-once operation on the target logical volume to complete formatting of the target logical volume when the target formatting rule is a formatting operation mode corresponding to a third formatting rate; wherein the three write operations are a random number write operation, a one write operation and a zero write operation; and the write zero operation is the third write operation.
In one aspect, for the process of establishing the correspondence between the data attribute and the formatting rule, the apparatus includes a range determining unit, a selecting unit, and an establishing unit;
the range determining unit is used for determining the type of the data attribute of the target logical volume and the ratio range matched by the data attribute of each type based on the variation range of the access times of the target logical volume in the historical time period;
the selecting unit is used for selecting a formatting rule with positive correlation between the formatting rate and each ratio range from the established formatting rule base according to the ratio range matched by each type of data attribute;
the establishing unit is used for establishing the corresponding relation between the type of the data attribute of the target logical volume and the matched formatting rule.
In one aspect, the formatting rule base sequentially comprises a write zero operation, a write one operation, a write random number operation, a write one operation and a write zero operation, a write random number operation and a write one operation, a write random number operation, a write one operation and a write zero operation in descending order of the formatting rate.
In one aspect, the device further comprises an acquisition unit;
the obtaining unit is used for obtaining the data access time interval of the target logical volume under the condition that the formatting instruction of the target logical volume is obtained;
and the attribute determining unit is used for determining the target data attribute of the target logical volume according to the data access time interval and the access times recorded in the target data attribute node corresponding to the target logical volume.
In one aspect, the attribute determining unit is configured to read the number of accesses recorded in the target data attribute node corresponding to the target logical volume;
calculating the ratio of the access times of the target logical volume to the number of stripes contained in the target logical volume;
and inquiring a preset ratio range, a preset data access time interval range and a preset corresponding relation between data attributes, and determining the ratio and the target data attribute matched with the data access time interval.
In one aspect, the device further comprises a fetching unit;
and the extraction unit is used for extracting the data attribute nodes matched with the number of the logical volumes to be created from the global idle data attribute node linked list under the condition that the logical volume creation command is acquired.
In one aspect, the system further comprises a query unit and an update unit;
the query unit is used for periodically querying the current access times recorded in the data attribute nodes according to the established timer after the data attribute nodes matched with the number of the logic volumes to be created are taken out from the global idle data attribute node linked list;
and the updating unit is used for updating the data attribute of the logic volume according to the current access times.
In one aspect, the global idle data attribute node linked list comprises a plurality of data attribute nodes; each data attribute node comprises an attribute data field and an access times field;
the device also comprises a reading unit and a writing unit;
the reading unit is used for reading the stripe access times recorded in the metadata table pointed by the pointers based on the pointers recorded by the attribute data fields in each data attribute node after the data attribute nodes matched with the number of the logical volumes to be created are taken out from the global idle data attribute node linked list;
And the writing unit is used for writing the accumulated sum value of all the stripe access times in the metadata table into the access times field of the metadata table.
In one aspect, each data attribute node further comprises a front pointer to a preceding data attribute node and a back pointer to a subsequent data attribute node.
In one aspect, the extracting unit is configured to intercept, from a head of a global idle data attribute node linked list, data attribute nodes that match the number of logical volumes to be created, so that the extracted data attribute nodes are deleted from the global idle data attribute node linked list.
In one aspect, the fetching unit is configured to start reading, from a location in the global idle data attribute node linked list where the read identifier is not marked, a data attribute node that matches the number of logical volumes to be created, and set the read identifier for the read data attribute node.
In one aspect, the apparatus includes an instruction fetch unit for fetching formatting instructions for the target logical volume;
the instruction acquisition unit is used for acquiring the formatting instruction of the target logical volume received by the command line interface.
In one aspect, the apparatus includes an instruction fetch unit for fetching formatting instructions for the target logical volume;
The instruction acquisition unit is used for acquiring the formatting instruction of the target logical volume received by the graphical interface.
The embodiment of the invention also provides electronic equipment, which comprises:
a memory for storing a computer program;
and a processor for executing the computer program to implement the steps of the method for formatting a disk array as described above.
The embodiment of the invention also provides a computer readable storage medium, wherein the computer readable storage medium stores a computer program, and the computer program realizes the steps of the formatting method of the disk array when being executed by a processor.
According to the technical scheme, under the condition that the formatting instructions of the target logical volume are acquired, the target data attribute of the target logical volume is determined according to the access times recorded in the target data attribute node corresponding to the target logical volume. The access times can reflect the access heat of the target logical volume, and the higher the access heat is, the higher the frequency of the target logical volume being used is, and in this case, the security of the data on the target logical volume can be ensured by only executing simple formatting operation on the target logical volume. In the invention, the corresponding formatting rules can be set for different data attributes, and the formatting rate corresponding to each formatting rule is different. After determining the target data attribute of the target logical volume, determining the target formatting rule matched with the target data attribute based on the corresponding relation between the data attribute and the formatting rule. And carrying out formatting operation on the target logical volume according to the target formatting rule. The method has the advantages that the formatting rate of the logical volume is determined through the data attribute of the logical volume, the overall performance and the data safety of the disk array are ensured, and the formatting efficiency of the disk array can be improved to the greatest extent.
Drawings
For a clearer description of embodiments of the present invention, the drawings that are required to be used in the embodiments will be briefly described, it being apparent that the drawings in the following description are only some embodiments of the present invention, and other drawings may be obtained according to the drawings without inventive effort for those skilled in the art.
FIG. 1 is a flowchart of a method for formatting a disk array according to an embodiment of the present invention;
FIG. 2 is a flowchart of a method for formatting a target logical volume according to an embodiment of the present invention;
FIG. 3 is a frame diagram of a data attribute node according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of a data attribute node of a required number intercepted from a global idle data attribute node linked list according to an embodiment of the present invention;
FIG. 5 is a schematic diagram of a formatting device for a disk array according to an embodiment of the present invention;
fig. 6 is a block diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by a person of ordinary skill in the art without making any inventive effort are within the scope of the present invention.
The terms "comprising" and "having" in the description of the invention and the claims and in the above-mentioned figures, as well as any variations thereof that relate to "comprising" and "having", are intended to cover a non-exclusive inclusion. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those steps or elements but may include other steps or elements not expressly listed.
In order to better understand the aspects of the present invention, the present invention will be described in further detail with reference to the accompanying drawings and detailed description.
Next, a method for formatting a disk array according to an embodiment of the present invention will be described in detail. Fig. 1 is a flowchart of a method for formatting a disk array according to an embodiment of the present invention, where the method includes:
s101: and under the condition that the formatting instruction of the target logical volume is acquired, determining the target data attribute of the target logical volume according to the access times recorded in the target data attribute node corresponding to the target logical volume.
The number of logical volumes is often large, and the logical volumes required to perform the formatting operation may be all logical volumes or some logical volumes. For convenience of distinction, in the embodiment of the present invention, a logical volume performing a formatting operation may be referred to as a target logical volume, a data attribute node corresponding to the target logical volume may be referred to as a target data attribute node, and a data attribute of the target logical volume may be referred to as a target data attribute.
In the embodiment of the invention, when the logical volumes are created, corresponding data attribute nodes are set for each created logical volume. I.e., each logical volume has its corresponding data attribute node. In the embodiment of the invention, parameters for reflecting the data attribute of the logical volume can be recorded in the data attribute node.
In particular implementations, different data attributes may be partitioned based on the hotness of data accesses on a logical volume. The higher the access heat, the higher the frequency of the logic volume being used, and in this case, only a simple formatting operation is needed to be executed on the logic volume, so that the formatting efficiency of the logic volume can be effectively improved while the data security on the logic volume is ensured. The granularity of the division can be flexibly adjusted based on actual requirements.
The number of accesses may reflect the access heat of the data on the logical volume, and thus the parameter recorded in the data attribute node reflecting the data attribute of the logical volume may be the number of accesses of the logical volume.
Each logical volume comprises a plurality of strips, each strip has the corresponding access times, and the access times of all the strips under one logical volume are summed to obtain the corresponding access times of the logical volume.
Considering that the number of stripes contained in different logical volumes is different, when determining the target data attribute of the target logical volume, the access times recorded in the target data attribute node corresponding to the target logical volume can be read first; and then determining the target data attribute of the target logical volume according to the multiple relation between the access times of the target logical volume and the number of stripes contained in the target logical volume.
The multiple relationship between the number of accesses to the target logical volume and the number of stripes contained in the target logical volume may be represented by a ratio of the number of accesses to the target logical volume to the number of stripes contained in the target logical volume.
In a specific implementation, the corresponding relation between different ratio ranges and data attributes can be preset, and the larger the ratio range is, the higher the access heat of the logical volume is indicated, and the higher the access heat of the corresponding data attribute for characterization is.
The data attributes corresponding to the different ratio ranges can be named sequentially according to the access heat. Assuming that 3 ratio ranges are preset, each corresponding to one data attribute, the data attributes may be sequentially referred to as first thermal data, second thermal data, and third thermal data in order of heat from high to low. The data attributes may also be named in other ways, such as in order of heat from high to low, and may be referred to as hot data, warm data, and cold data in that order. In the embodiment of the invention, the naming mode of the data attribute is not limited.
After the ratio of the access times of the target logical volume to the number of stripes contained in the target logical volume is calculated, the corresponding relation between the set ratio range and the data attribute can be queried, so that the target data attribute with the matched ratio is determined.
S102: and determining a target formatting rule matched with the target data attribute based on the corresponding relation between the data attribute and the formatting rule.
Each data attribute has its matching formatting rule. The formatting rates corresponding to different formatting rules are different.
In an embodiment of the present invention, the data attributes may include N types of data attributes; wherein N is a positive integer greater than or equal to 2; the ratio range corresponding to each data attribute is positively correlated with the formatting rate of the formatting rule to which it is matched.
By way of example, assuming a total of 3 ratio ranges, the set formatting rule may include 3 formatting operations. The ratio ranges are arranged in order from large to small, and the ratio range 1, the ratio range 2 and the ratio range 3 are sequentially arranged. And arranging a formatting operation mode a, a formatting operation mode b and a formatting operation mode c in sequence according to the sequence of the formatting rate from high to low, wherein the ratio range 1 corresponds to the formatting operation mode a, the ratio range 2 corresponds to the formatting operation mode b and the ratio range 3 corresponds to the formatting operation mode c.
S103: and carrying out formatting operation on the target logical volume according to the target formatting rule.
The target formatting rule records a formatting operation mode, and after the target formatting rule matched with the target data attribute is determined, the target logical volume can be formatted according to the target formatting rule.
According to the technical scheme, under the condition that the formatting instructions of the target logical volume are acquired, the target data attribute of the target logical volume is determined according to the access times recorded in the target data attribute node corresponding to the target logical volume. The access times can reflect the access heat of the target logical volume, and the higher the access heat is, the higher the frequency of the target logical volume being used is, and in this case, the security of the data on the target logical volume can be ensured by only executing simple formatting operation on the target logical volume. In the invention, the corresponding formatting rules can be set for different data attributes, and the formatting rate corresponding to each formatting rule is different. After determining the target data attribute of the target logical volume, determining the target formatting rule matched with the target data attribute based on the corresponding relation between the data attribute and the formatting rule. And carrying out formatting operation on the target logical volume according to the target formatting rule. The method has the advantages that the formatting rate of the logical volume is determined through the data attribute of the logical volume, the overall performance and the data safety of the disk array are ensured, and the formatting efficiency of the disk array can be improved to the greatest extent.
In the embodiment of the invention, the data attribute can be divided based on the actual requirement. Taking the division of three data attributes as an example, these 3 data attributes may be referred to as first thermal data, second thermal data, and third thermal data, respectively.
In a specific implementation, two thresholds may be set, thereby constructing three ratio ranges, each corresponding to a data attribute. The two thresholds may be a first threshold and a second threshold, wherein the value of the first threshold is greater than the second threshold.
In the case where the ratio is greater than or equal to the first threshold, it may be determined that the target data attribute is the first thermal data. In the case where the ratio is greater than or equal to the second threshold value and less than the first threshold value, the target data attribute may be determined to be the second thermal data. In the case where the ratio is smaller than the second threshold, it may be determined that the target data attribute is the third thermal data.
The data attributes of different types have corresponding formatting rules, and in the embodiment of the invention, each data attribute and the matched formatting rule can be recorded in a corresponding relation mode.
Taking the above three data attributes as an example, each data attribute has a corresponding formatting rule, so in the embodiment of the present invention, three formatting operation modes with different formatting rates may be set.
And under the condition that the target data attribute is the first hot data, selecting a formatting operation mode corresponding to the first formatting rate as a target formatting rule. And under the condition that the target data attribute is the second hot data, selecting a formatting operation mode corresponding to the second formatting rate as a target formatting rule. Under the condition that the target data attribute is third hot data, selecting a formatting operation mode corresponding to a third formatting rate as a target formatting rule; wherein the first formatting rate is higher than the second formatting rate, and the second formatting rate is higher than the third formatting rate.
In practical application, the more times the logical volume performs the formatting writing operation, the lower the corresponding formatting efficiency. Accordingly, the fewer times a logical volume performs a formatting write operation, the higher its corresponding formatting efficiency. Therefore, in the embodiment of the invention, the formatting operation modes of the three different formatting rates can be a single writing operation, a double writing operation and a triple writing operation respectively.
Under the condition that the target formatting rule is a formatting operation mode corresponding to the first formatting rate, write-once operation can be performed on the target logical volume so as to complete the formatting of the target logical volume; the write-once operation may be a write-zero operation, a write-one operation, or a write-random number operation.
And under the condition that the target formatting rule is a formatting operation mode corresponding to the second formatting rate, performing double write operation on the target logical volume in sequence to complete the formatting of the target logical volume.
The double write operation means that the formatted write operation is performed twice on the logical volume. In the double write operation, the write zero operation is generally used as the second formatted write operation, so the double write operation can be a random number write operation and a zero write operation; or a write one operation and a write zero operation.
Taking write one operation and write zero operation of the target logical volume as examples, formatting the target logical volume includes performing write one operation on the target logical volume first and then performing write zero operation on the target logical volume.
Under the condition that the target formatting rule is a formatting operation mode corresponding to the third formatting rate, writing operation can be performed on the target logical volume for three times so as to complete formatting of the target logical volume; wherein, the three times of writing operation can be random number writing operation, one writing operation and zero writing operation; and the write zero operation is the third write operation.
Fig. 2 is a flowchart of a method for formatting a target logical volume according to an embodiment of the present invention, where the method includes:
S201: under the condition that the ratio is greater than or equal to a first threshold value, judging the attribute of the target data as first thermal data; selecting a formatting operation mode corresponding to the first formatting rate as a target formatting rule; and performing write-once operation on the target logical volume according to a formatting operation mode corresponding to the first formatting rate so as to complete the formatting of the target logical volume.
Taking the first threshold value as 5 as an example, assuming that the ratio of the number of accesses of the target logical volume to the number of stripes contained in the target logical volume is 6, the ratio is greater than the first threshold value, it may be determined that the data attribute of the target logical volume is first hot data.
The data attribute is first hot data, which indicates that the access heat of the target logical volume is high, and at this time, the formatting operation can be performed on the target logical volume according to the formatting operation mode corresponding to the first formatting rate. The formatting operation corresponding to the first formatting rate may be a write-once operation.
The write-once operation may include a write-zero operation, a write-random number operation, or a write-one operation. The write zero operation may be preferentially selected as a write-once operation in view of the highest execution efficiency of the write zero operation.
S202: determining the target data attribute as second thermal data when the ratio is greater than or equal to a second threshold and less than the first threshold; selecting a formatting operation mode corresponding to the second formatting rate as a target formatting rule; and sequentially performing double write operation on the target logical volume according to the formatting operation mode corresponding to the second formatting rate so as to complete the formatting of the target logical volume.
Taking the first threshold value as 5 and the second threshold value as 2 as an example, assuming that the ratio of the number of accesses of the target logical volume to the number of stripes contained in the target logical volume is 3, the ratio is greater than the second threshold value and less than the first threshold value, it can be determined that the data attribute of the target logical volume is the second thermal data.
The data attribute is second hot data, which indicates that the access heat of the target logical volume is general, and at this time, the formatting operation can be performed on the target logical volume according to the formatting operation mode corresponding to the second formatting rate. The formatting operation corresponding to the second formatting rate may be a double write operation.
In view of the fact that the formatting effect of performing two different write operations is better than that of performing the same write operation twice repeatedly, the two write operations generally end with a write zero operation, so in the embodiment of the present invention, the two write operations generally use two different write operations, and the two write operations may include a write random number operation and a write zero operation, or a write one operation and a write zero operation.
S203: under the condition that the ratio is smaller than a second threshold value, judging the attribute of the target data as third thermal data; selecting a formatting operation mode corresponding to the third formatting rate as a target formatting rule; and performing write operation on the target logical volume for three times according to the formatting operation mode corresponding to the third formatting rate so as to complete the formatting of the target logical volume.
Taking the first threshold value as 5 and the second threshold value as 2 as an example, assuming that the ratio of the number of accesses of the target logical volume to the number of stripes contained in the target logical volume is 1.5, the ratio is smaller than the second threshold value, the data attribute of the target logical volume can be determined to be the third thermal data.
The data attribute is third hot data, which indicates that the access heat of the target logical volume is low, and at this time, the formatting operation can be performed on the target logical volume according to the formatting operation mode corresponding to the third formatting rate. The formatting operation corresponding to the third formatting rate may be three write operations.
In view of the fact that the formatting effect of performing multiple different write operations is better than that of performing multiple identical write operations, in the embodiment of the present invention, three write operations generally use three different write operations, for example, three write operations may be a write random number operation, a write one operation, and a write zero operation. To achieve better formatting, three write operations typically use write zeros as the third write operation.
In the embodiment of the invention, the matched formatting rate is selected based on the data attribute of the logic volume in the disk array, so that the formatting operation is executed according to the formatting operation mode corresponding to the formatting rate. Compared with the traditional mode that the formatting is completed by executing three write operations, in the embodiment of the invention, for the logical volume with high heat, the single write operation is executed, so that the time spent by two write operations is saved, and the formatting efficiency of the logical volume is improved. For a logical volume with common heat, the double write operation is executed, so that the time spent by one write operation is saved, and the formatting efficiency of the logical volume can be improved.
It should be noted that the above description is an introduction developed by taking three data attributes as examples. In the embodiment of the present invention, the division granularity for the data attribute is not limited to the above three types. Each data attribute corresponds to a formatting rule, considering that the execution efficiency of a write-zero operation is higher than the execution efficiency of a write-one operation, which is higher than the execution efficiency of a write-random number. Various formatting rules may be set in accordance with formatting efficiency.
In practical application, a format rule base can be established, and format rules corresponding to a plurality of different format rates are recorded in the format rule base. The formatting rule base sequentially comprises a zero writing operation, a one writing operation, a random number writing operation, a one writing operation and a zero writing operation, a random number writing operation and a one writing operation, a random number writing operation, a one writing operation and a zero writing operation according to the descending order of the formatting rate. 7 formatting rules can be contained in the formatting rule base, so 7 or less than 7 formatting rules can be divided when the ratio range is divided, 7 data attributes can be set correspondingly by taking 7 dividing the ratio range as an example, and the 7 data attributes are matched with the 7 formatting rules.
In the embodiment of the invention, the types of the data attributes can be preset, and the types of the data attributes and the matching ratio range thereof can be dynamically adjusted based on the change of the access heat of the logic volume in the disk array in the historical time period.
In a specific implementation, the type of the data attribute of the target logical volume and the ratio range matched by each type of the data attribute can be determined based on the variation range of the access times of the target logical volume in the historical time period. And selecting a formatting rule with positive correlation between the formatting rate and each ratio range from the established formatting rule base according to the ratio range matched by each type of data attribute. And establishing the corresponding relation of the type of the data attribute of the target logical volume and the matched formatting rule.
The value of the historical time period can be set based on actual requirements, and is not limited herein.
The number of stripes contained in the target logical volume is a fixed value, so that the larger the variation range of the access times of the target logical volume in the historical time period is, the larger the access heat variation of the target logical volume is, and the variety of the data attribute and the matched ratio range can be dynamically adjusted for better improving the formatting efficiency of the target logical volume. When the variation range is large, the types of the data attributes can be divided more finely; the range of variation is small, the kinds of data attributes can be divided into coarser ones.
In the embodiment of the invention, besides evaluating the access heat of the logic volume according to the access times, the factor of the data access time interval can be further considered on the basis.
Taking two logical volumes with the same access times as an example, assuming that the two logical volumes contain the same number of stripes, when the access times of the two logical volumes are the same, the shorter the access time interval of the logical volumes is, the higher the access heat of the logical volumes is.
Therefore, in the case of acquiring the formatting instruction of the target logical volume, the data access time interval of the target logical volume can be acquired in addition to the access number of the target logical volume. And determining the target data attribute of the target logical volume according to the data access time interval and the access times recorded in the target data attribute node corresponding to the target logical volume.
The target logical volume often involves multiple accesses, and the data access time interval may be averaged over the time interval between every two adjacent accesses.
In a specific implementation, the access times recorded in the target data attribute node corresponding to the target logical volume can be read; calculating the ratio of the access times of the target logical volume to the number of stripes contained in the target logical volume; and inquiring the preset ratio range, the preset data access time interval range and the preset corresponding relation between the data attributes, and determining the ratio and the target data attribute matched with the data access time interval.
In the embodiment of the invention, the corresponding relation among the ratio range, the data access time interval range and the data attribute can be established at the same time. After the ratio of the logical volumes and the data access time interval are determined, the data attribute of the logical volumes can be determined based on the corresponding relationship.
In addition, a correspondence relationship between the ratio range and the data attribute, and a correspondence relationship between the data access time interval range and the data attribute may be established. A data attribute of the match can be determined based on the ratio of the logical volumes, a data attribute of the match can be determined based on the data access time interval of the logical volumes, and a final data attribute of the logical volumes can be determined based on the two data attributes. For example, the data attributes are divided into 4 types according to the access hotness, the data attribute determined based on the ratio is the second hot data, the data attribute determined based on the data access time interval is the fourth hot data, and the final data attribute of the logical volume may be the third hot data. Of course, the data attribute with the highest heat degree in the two data attributes can be taken as the final data attribute of the logical volume, or the data attribute with the lowest heat degree can be taken as the final data attribute of the logical volume. The specific manner of use is not limited herein.
It should be noted that, before the formatting operation of the disk array is performed, it is selected which way to determine the data attribute of the logical volume. In the embodiment of the invention, the implementation mode of determining the data attribute according to the access times can be taken as a default mode. When the user needs to change to the implementation mode for determining the data attribute according to the access times and the data access time intervals, the user can switch the implementation mode for determining the data attribute into the mode for determining the data attribute according to the access times and the data access time intervals by inputting a change command.
In the embodiment of the invention, a global idle data attribute node linked list can be pre-established in a RAID card storage system. And recording a plurality of data attribute nodes corresponding to the logical volumes in the global idle data attribute node linked list.
After the RAID card is powered on, a user may input a command to create a logical volume through a command line interface or a graphical interface, and may create one or more logical volumes. Accordingly, the user may also input the formatting instructions for the target logical volume through a command line interface or a graphical interface. The process of obtaining the formatting instruction for the target logical volume may be obtaining the formatting instruction of the target logical volume received by the command line interface. Or may be a formatting instruction for obtaining the target logical volume received by the graphical interface.
Under the condition that a RAID card controller in the RAID card storage system acquires a logic volume creation command, the RAID card controller can take out the data attribute nodes matched with the number of the logic volumes to be created from the global idle data attribute node linked list.
Because the data access times of the logical volumes belong to parameters which dynamically change, the data attributes of the logical volumes can dynamically change, and in order to ensure the correctness of the data attributes of the logical volumes, a timer can be established after the data attribute nodes which are matched with the number of the logical volumes to be created are taken out from the global idle data attribute node linked list. Periodically inquiring the current access times recorded in the data attribute node according to the established timer; and updating the data attribute of the logical volume according to the current access times.
The cycle time of the timer may default to 20ms or may be specified by the user via a command line or graphical interface.
In an embodiment of the present invention, the global idle data attribute node linked list may include a plurality of data attribute nodes. To facilitate the recording of the number of accesses to the logical volume by the data attribute nodes, each data attribute node may include an attribute data field and a number of accesses field.
In a specific implementation, based on pointers recorded in attribute data fields in each data attribute node, the number of stripe accesses recorded in a metadata table pointed by the pointers can be read; and writing the accumulated sum value of all the stripe access times in the metadata table into the access times field of the metadata table. Therefore, the number of the access times field record is the access times of the logical volume.
In the embodiment of the invention, in order to realize the positioning of the storage position of the data attribute node, the memory space occupied by the data attribute node is saved. The data attribute node may employ a bi-directional list to characterize the storage location of the data attribute node. In a particular implementation, a front pointer to a previous data attribute node and a back pointer to a subsequent data attribute node may be set for each data attribute node.
Fig. 3 is a frame diagram of a data attribute node according to an embodiment of the present invention, where the data attribute node may include four parts, namely an attribute data field, an access number field, a front pointer field, and a back pointer field. The attribute data field points to an unsigned four-byte metadata table, the number of accesses to the stripe managed by the unsigned four-byte metadata record, the number of accesses to the logical volume can be obtained by accumulating all the unsigned four-byte metadata in the unsigned four-byte metadata table, and the number of accesses can be written into the number of accesses field. The front pointer field is a front pointer to the previous data attribute node. The backpointer field is a backpointer that points to a subsequent data attribute node. In order to distinguish between the different data attribute nodes, their corresponding IDs may be set for each data attribute node.
In the embodiment of the invention, the global idle data attribute node linked list comprises a plurality of data attribute nodes. The frames of each data attribute node are identical, except that the data stored in each field under each data attribute node is different.
In practical applications, there may be two ways to extract the data attribute nodes matching the number of logical volumes to be created from the global idle data attribute node linked list, and one possible way may be to intercept the data attribute nodes matching the number of logical volumes to be created from the head of the global idle data attribute node linked list, so that the extracted data attribute nodes are deleted from the global idle data attribute node linked list.
Another possible way may be to read the data attribute nodes matching the number of logical volumes to be created starting from a position in the global free data attribute node linked list where the read identifier is not marked, and set the read identifier for the read data attribute nodes.
The read identity is used to indicate that the data attribute node has been assigned to the corresponding logical volume. In the embodiment of the invention, the form of the read identifier is not limited.
Fig. 4 is a schematic diagram of intercepting a required number of data attribute nodes from a global idle data attribute node linked list, taking the global idle data attribute node linked list including N data attribute nodes as an example, and assuming that a user creates three logical volumes, three data attribute nodes may be sequentially extracted from the head of the global idle data attribute node linked list, which are respectively a data attribute node 0, a data attribute node 1 and a data attribute node 2, where one data attribute node corresponds to one logical volume. After the three data attribute nodes are taken out, N-3 data attribute nodes remain in the global idle data attribute node linked list.
The embodiment of the invention adds a global idle data attribute node linked list in a RAID card storage system, the global idle data attribute node linked list detects the use condition of all logic volumes in the RAID card by a user, and the formatting rule is determined according to the data attribute of logic block equipment (corresponding to the logic volumes in the RAID card one by one) created by the user in the RAID array, so that the formatting rate is flexibly adjusted. Under the condition of not increasing hardware, the formatting efficiency of the RAID card is improved, the data security and the I/O performance of the RAID card are further improved, and the competitiveness in the RAID card market is improved. The technical scheme provided by the embodiment of the invention can be applied to the hard RAID storage server and is also applicable to the soft RAID storage server. The method can be applied to the storage field, and is also applicable to the fields of cloud computing, artificial intelligence and the like.
Fig. 5 is a schematic structural diagram of a formatting device for a disk array according to an embodiment of the present invention, including an attribute determining unit 51, a rule determining unit 52, and a formatting unit 53;
the attribute determining unit 51 is configured to determine, when a formatting instruction of the target logical volume is acquired, a target data attribute of the target logical volume according to the number of accesses recorded in a target data attribute node corresponding to the target logical volume;
A rule determining unit 52, configured to determine a target formatting rule that matches the target data attribute based on a correspondence between the data attribute and the formatting rule; wherein, the formatting rates corresponding to different formatting rules are different;
and a formatting unit 53, configured to perform a formatting operation on the target logical volume according to the target formatting rule.
On the one hand, the attribute determining unit is used for reading the access times recorded in the target data attribute node corresponding to the target logical volume; and determining the target data attribute of the target logical volume according to the multiple relation between the access times of the target logical volume and the number of stripes contained in the target logical volume.
In one aspect, the attribute determining unit includes a computing subunit and a querying subunit;
a calculating subunit, configured to calculate a ratio of the number of accesses of the target logical volume to the number of stripes included in the target logical volume;
and the inquiring subunit is used for inquiring the corresponding relation between the set ratio range and the data attribute and determining the target data attribute with the matched ratio.
In one aspect, the data attributes include N types of data attributes; wherein N is a positive integer greater than or equal to 2;
the ratio range corresponding to each data attribute is positively correlated with the formatting rate of the formatting rule to which it is matched.
In one aspect, the data attributes include first thermal data, second thermal data, and third thermal data;
correspondingly, the query subunit is configured to determine that the target data attribute is the first thermal data when the ratio is greater than or equal to the first threshold;
determining the target data attribute as second thermal data when the ratio is greater than or equal to a second threshold and less than the first threshold; wherein the first threshold is greater than the second threshold;
and if the ratio is smaller than the second threshold value, judging the attribute of the target data as third thermal data.
In one aspect, the rule determining unit includes a first selecting subunit, a second selecting subunit, and a third selecting subunit;
the first selecting subunit is used for selecting a formatting operation mode corresponding to the first formatting rate as a target formatting rule under the condition that the target data attribute is first hot data;
the second selecting subunit is configured to select, as the target formatting rule, a formatting operation mode corresponding to the second formatting rate when the target data attribute is the second hot data;
the third selecting subunit is used for selecting a formatting operation mode corresponding to the third formatting rate as a target formatting rule under the condition that the target data attribute is third hot data; wherein the first formatting rate is higher than the second formatting rate, and the second formatting rate is higher than the third formatting rate.
In one aspect, the formatting unit includes a write once subunit, a write twice subunit, and a write three subunit;
a write-once subunit, configured to perform write-once operation on the target logical volume to complete formatting of the target logical volume when the target formatting rule is a formatting operation mode corresponding to the first formatting rate; wherein the single write operation is zero write operation, one write operation or random number write operation;
the double-write subunit is used for sequentially carrying out double-write operation on the target logical volume under the condition that the target formatting rule is a formatting operation mode corresponding to the second formatting rate so as to complete the formatting of the target logical volume; the double write operation is a random number write operation and a zero write operation; or write one operation and write zero operation;
the write-once subunit is configured to perform write-once operation on the target logical volume to complete the formatting of the target logical volume when the target formatting rule is a formatting operation mode corresponding to the third formatting rate; wherein the three times of writing operation are random number writing operation, one writing operation and zero writing operation; and the write zero operation is the third write operation.
On the one hand, the device comprises a range determining unit, a selecting unit and a building unit aiming at the building process of the corresponding relation between the data attribute and the formatting rule;
The range determining unit is used for determining the type of the data attribute of the target logical volume and the ratio range matched by the data attribute of each type based on the variation range of the access times of the target logical volume in the historical time period;
the selecting unit is used for selecting a formatting rule with positive correlation between the formatting rate and each ratio range from the established formatting rule base according to the ratio range matched by each type of data attribute;
the establishing unit is used for establishing the corresponding relation between the type of the data attribute of the target logical volume and the matched formatting rule.
In one aspect, the formatting rule base sequentially comprises a write zero operation, a write one operation, a write random number operation, a write one operation and a write zero operation, a write random number operation and a write one operation, a write random number operation, a write one operation and a write zero operation in descending order of the formatting rate.
In one aspect, the device further comprises an acquisition unit;
the acquisition unit is used for acquiring the data access time interval of the target logical volume under the condition that the formatting instruction of the target logical volume is acquired;
and the attribute determining unit is used for determining the target data attribute of the target logical volume according to the data access time interval and the access times recorded in the target data attribute node corresponding to the target logical volume.
On the one hand, the attribute determining unit is used for reading the access times recorded in the target data attribute node corresponding to the target logical volume;
calculating the ratio of the access times of the target logical volume to the number of stripes contained in the target logical volume;
and inquiring the preset ratio range, the preset data access time interval range and the preset corresponding relation between the data attributes, and determining the ratio and the target data attribute matched with the data access time interval.
In one aspect, the device further comprises a fetching unit;
and the extraction unit is used for extracting the data attribute nodes matched with the number of the logical volumes to be created from the global idle data attribute node linked list under the condition that the logical volume creation command is acquired.
In one aspect, the system further comprises a query unit and an update unit;
the query unit is used for periodically querying the current access times recorded in the data attribute nodes according to the established timer after the data attribute nodes matched with the number of the logic volumes to be created are taken out from the global idle data attribute node linked list;
and the updating unit is used for updating the data attribute of the logic volume according to the current access times.
In one aspect, the global idle data attribute node linked list comprises a plurality of data attribute nodes; each data attribute node comprises an attribute data field and an access times field;
The device also comprises a reading unit and a writing unit;
the reading unit is used for reading the stripe access times recorded in the metadata table pointed by the pointer based on the pointer recorded by the attribute data field in each data attribute node after the data attribute node matched with the number of the logic volumes to be created is taken out from the global idle data attribute node linked list;
and the writing unit is used for writing the accumulated sum value of all the stripe access times in the metadata table into the access times field of the metadata table.
In one aspect, each data attribute node further comprises a front pointer to a preceding data attribute node and a back pointer to a subsequent data attribute node.
In one aspect, the extracting unit is configured to intercept, from a head of the global idle data attribute node linked list, data attribute nodes that match the number of logical volumes to be created, so that the extracted data attribute nodes are deleted from the global idle data attribute node linked list.
In one aspect, the fetching unit is configured to start reading, from a location in the global idle data attribute node linked list where the read identifier is not marked, a data attribute node that matches the number of logical volumes to be created, and set the read identifier for the read data attribute node.
In one aspect, the apparatus includes an instruction fetch unit for fetching a formatted instruction for a target logical volume;
the command acquisition unit is used for acquiring the formatting command of the target logical volume received by the command line interface.
In one aspect, the apparatus includes an instruction fetch unit for fetching a formatted instruction for a target logical volume;
the instruction acquisition unit is used for acquiring the formatting instruction of the target logical volume received by the graphical interface.
The description of the features of the embodiment corresponding to fig. 5 may be referred to the related description of the embodiment corresponding to fig. 1 to 4, and will not be repeated here.
According to the technical scheme, under the condition that the formatting instructions of the target logical volume are acquired, the target data attribute of the target logical volume is determined according to the access times recorded in the target data attribute node corresponding to the target logical volume. The access times can reflect the access heat of the target logical volume, and the higher the access heat is, the higher the frequency of the target logical volume being used is, and in this case, the security of the data on the target logical volume can be ensured by only executing simple formatting operation on the target logical volume. In the invention, the corresponding formatting rules can be set for different data attributes, and the formatting rate corresponding to each formatting rule is different. After determining the target data attribute of the target logical volume, determining the target formatting rule matched with the target data attribute based on the corresponding relation between the data attribute and the formatting rule. And carrying out formatting operation on the target logical volume according to the target formatting rule. The method has the advantages that the formatting rate of the logical volume is determined through the data attribute of the logical volume, the overall performance and the data safety of the disk array are ensured, and the formatting efficiency of the disk array can be improved to the greatest extent.
Fig. 6 is a block diagram of an electronic device according to an embodiment of the present invention, as shown in fig. 6, where the electronic device includes: a memory 60 for storing a computer program;
a processor 61 for implementing the steps of the method for formatting a disk array according to the above embodiment when executing a computer program.
The electronic device provided in this embodiment may include, but is not limited to, a smart phone, a tablet computer, a notebook computer, a desktop computer, or the like.
Processor 61 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 61 may be implemented in at least one hardware form of DSP (Digital Signal Processing ), FPGA (Field-Programmable Gate Array, field programmable gate array), PLA (Programmable Logic Array ). The processor 61 may also include a main processor, which is a processor for processing data in an awake state, also called a CPU (Central Processing Unit ), and a coprocessor; a coprocessor is a low-power processor for processing data in a standby state. In some embodiments, the processor 61 may integrate a GPU (Graphics Processing Unit, image processor) for rendering and drawing of content required to be displayed by the display screen. In some embodiments, the processor 61 may also include an AI (Artificial Intelligence ) processor for processing computing operations related to machine learning.
Memory 60 may include one or more computer-readable storage media, which may be non-transitory. Memory 60 may also include high-speed random access memory, as well as non-volatile memory, such as one or more magnetic disk storage devices, flash memory storage devices. In this embodiment, the memory 60 is at least used for storing a computer program 601, where the computer program, when loaded and executed by the processor 61, can implement the relevant steps of the method for formatting a disk array disclosed in any of the foregoing embodiments. In addition, the resources stored in the memory 60 may further include an operating system 602, data 603, and the like, where the storage manner may be transient storage or permanent storage. The operating system 602 may include Windows, unix, linux, among other things. The data 603 may include, but is not limited to, correspondence of data attributes to formatting rules, and the like.
In some embodiments, the electronic device may further include a display 62, an input-output interface 63, a communication interface 64, a power supply 65, and a communication bus 66.
Those skilled in the art will appreciate that the structure shown in fig. 6 is not limiting of the electronic device and may include more or fewer components than shown.
It will be appreciated that the method of formatting a disk array in the above embodiments may be stored on a computer readable storage medium if implemented in the form of software functional units and sold or used as a stand alone product. Based on this understanding, the technical solution of the present invention may be embodied essentially or in part or in whole or in part in the form of a software product stored in a storage medium for performing all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random-access Memory (Random Access Memory, RAM), an electrically erasable programmable ROM, registers, a hard disk, a removable disk, a CD-ROM, a magnetic disk, or an optical disk, etc. various media capable of storing program codes.
Based on this, the embodiment of the present invention further provides a computer readable storage medium, where a computer program is stored, where the computer program when executed by a processor implements the steps of the method for formatting a disk array as described above.
The method, the device, the equipment and the computer readable storage medium for formatting the disk array provided by the embodiment of the invention are described in detail. In the description, each embodiment is described in a progressive manner, and each embodiment is mainly described by the differences from other embodiments, so that the same similar parts among the embodiments are mutually referred. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant points refer to the description of the method section.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative elements and steps are described above generally in terms of functionality in order to clearly illustrate the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
The method, apparatus, device and computer readable storage medium for formatting a disk array provided by the present invention are described above in detail. The principles and embodiments of the present invention have been described herein with reference to specific examples, the description of which is intended only to facilitate an understanding of the method of the present invention and its core ideas. It should be noted that it will be apparent to those skilled in the art that various modifications and adaptations of the invention can be made without departing from the principles of the invention and these modifications and adaptations are intended to be within the scope of the invention as defined in the following claims.

Claims (21)

1. A method for formatting a disk array, comprising:
under the condition that a formatting instruction of a target logical volume is acquired, determining a target data attribute of the target logical volume according to the access times recorded in a target data attribute node corresponding to the target logical volume;
determining a target formatting rule matched with the target data attribute based on the corresponding relation between the data attribute and the formatting rule; wherein, the formatting rates corresponding to different formatting rules are different;
and carrying out formatting operation on the target logical volume according to the target formatting rule.
2. The method for formatting a disk array according to claim 1, wherein determining the target data attribute of the target logical volume according to the number of accesses recorded in the target data attribute node corresponding to the target logical volume comprises:
reading the access times recorded in the target data attribute node corresponding to the target logical volume;
and determining the target data attribute of the target logical volume according to the multiple relation between the access times of the target logical volume and the number of stripes contained in the target logical volume.
3. The method for formatting a disk array according to claim 2, wherein determining the target data attribute of the target logical volume according to a multiple relationship between the number of accesses of the target logical volume and the number of stripes included in the target logical volume includes:
calculating the ratio of the access times of the target logical volume to the number of stripes contained in the target logical volume;
inquiring the corresponding relation between the set ratio range and the data attribute, and determining the target data attribute matched with the ratio.
4. A method of formatting a disk array according to claim 3 wherein the data attributes comprise N types of data attributes; wherein N is a positive integer greater than or equal to 2;
The ratio range corresponding to each data attribute is positively correlated with the formatting rate of the formatting rule to which it is matched.
5. The method of claim 4, wherein the data attributes comprise first thermal data, second thermal data, and third thermal data;
correspondingly, the corresponding relation between the ratio range set by the query and the data attribute, and determining the target data attribute matched by the ratio comprises:
judging the target data attribute as first thermal data under the condition that the ratio is greater than or equal to a first threshold value;
determining that the target data attribute is second thermal data if the ratio is greater than or equal to a second threshold and less than a first threshold; wherein the first threshold is greater than the second threshold;
and under the condition that the ratio is smaller than a second threshold value, judging the target data attribute as third thermal data.
6. The method for formatting a disk array according to claim 5, wherein determining, based on the correspondence between the data attribute and the formatting rule, a target formatting rule for matching the target data attribute comprises:
under the condition that the target data attribute is first hot data, selecting a formatting operation mode corresponding to a first formatting rate as a target formatting rule;
Selecting a formatting operation mode corresponding to a second formatting rate as a target formatting rule under the condition that the target data attribute is second hot data;
selecting a formatting operation mode corresponding to a third formatting rate as a target formatting rule under the condition that the target data attribute is third hot data; wherein the first formatting rate is higher than the second formatting rate, which is higher than the third formatting rate.
7. The method of claim 6, wherein the formatting the target logical volume according to the target formatting rule comprises:
under the condition that the target formatting rule is a formatting operation mode corresponding to the first formatting rate, performing write-once operation on the target logical volume to complete formatting of the target logical volume; wherein the single write operation is zero write operation, one write operation or random number write operation;
under the condition that the target formatting rule is a formatting operation mode corresponding to the second formatting rate, performing twice write operation on the target logical volume in sequence to complete formatting of the target logical volume; wherein the double write operation is a random number write operation and a zero write operation; or write one operation and write zero operation;
Under the condition that the target formatting rule is a formatting operation mode corresponding to a third formatting rate, performing write operation on the target logical volume for three times to complete formatting of the target logical volume; wherein the three write operations are a random number write operation, a one write operation and a zero write operation; and the write zero operation is the third write operation.
8. The method for formatting a disk array according to claim 4, wherein for the process of establishing the correspondence between the data attribute and the formatting rule, the method comprises:
determining the type of the data attribute of the target logical volume and the ratio range matched by the data attribute of each type based on the variation range of the access times of the target logical volume in the historical time period;
selecting a formatting rule with positive correlation between the formatting rate and each ratio range from the established formatting rule base according to the ratio range matched by each type of data attribute;
and establishing the corresponding relation of the type of the data attribute of the target logical volume and the matched formatting rule.
9. The method of claim 8, wherein the formatting rule base sequentially comprises a write zero operation, a write one operation, a write random number operation, a write one operation and a write zero operation, a write random number operation and a write one operation, a write random number operation, a write one operation and a write zero operation in descending order of formatting rate.
10. The method of formatting a disk array according to any one of claims 1 to 9, further comprising:
under the condition that a formatting instruction of a target logical volume is acquired, acquiring a data access time interval of the target logical volume;
and determining the target data attribute of the target logical volume according to the data access time interval and the access times recorded in the target data attribute node corresponding to the target logical volume.
11. The method for formatting a disk array according to claim 10, wherein determining the target data attribute of the target logical volume according to the data access time interval and the number of accesses recorded in the target data attribute node corresponding to the target logical volume includes:
reading the access times recorded in the target data attribute node corresponding to the target logical volume;
calculating the ratio of the access times of the target logical volume to the number of stripes contained in the target logical volume;
and inquiring a preset ratio range, a preset data access time interval range and a preset corresponding relation between data attributes, and determining the ratio and the target data attribute matched with the data access time interval.
12. The method for formatting a disk array according to claim 1, further comprising, before determining the target data attribute of the target logical volume according to the number of accesses recorded in the target data attribute node corresponding to the target logical volume:
and under the condition that the logical volume creation command is acquired, the data attribute nodes matched with the number of the logical volumes to be created are taken out from the global idle data attribute node linked list.
13. The method for formatting a disk array according to claim 12, further comprising, after said retrieving data attribute nodes matching the number of logical volumes to be created from the global free data attribute node linked list:
periodically inquiring the current access times recorded in the data attribute node according to the established timer;
and updating the data attribute of the logical volume according to the current access times.
14. The method of claim 12, wherein the global free data attribute node linked list comprises a plurality of data attribute nodes; each data attribute node comprises an attribute data field and an access times field;
Correspondingly, after the data attribute nodes matched with the number of the logical volumes to be created are taken out from the global idle data attribute node linked list, the method further comprises the steps of:
based on pointers recorded in attribute data fields in each data attribute node, reading the stripe access times recorded in a metadata table pointed by the pointers;
and writing the accumulated sum value of all the stripe access times in the metadata table into an access times field of the metadata table.
15. The method of claim 14, wherein each data attribute node further comprises a front pointer to a previous data attribute node and a back pointer to a subsequent data attribute node.
16. The method for formatting a disk array according to claim 12, wherein said retrieving data attribute nodes from the global free data attribute node linked list that match the number of logical volumes to be created comprises:
and intercepting the data attribute nodes matched with the number of the logic volumes to be created from the head of the global idle data attribute node linked list, so that the extracted data attribute nodes are deleted from the global idle data attribute node linked list.
17. The method for formatting a disk array according to claim 12, wherein said retrieving data attribute nodes from the global free data attribute node linked list that match the number of logical volumes to be created comprises:
and starting to read the data attribute nodes matched with the number of the logic volumes to be created from the position of the global idle data attribute node linked list, which is not marked with the read identifier, and setting the read identifier for the read data attribute nodes.
18. The method of claim 1, wherein the method comprises, for the target logical volume, a process of obtaining formatting instructions for the target logical volume, the method comprising:
and obtaining a formatting instruction of the target logical volume received by the command line interface or obtaining a formatting instruction of the target logical volume received by the graphical interface.
19. A formatting device of a disk array is characterized by comprising an attribute determining unit, a rule determining unit and a formatting unit;
the attribute determining unit is used for determining the target data attribute of the target logical volume according to the access times recorded in the target data attribute node corresponding to the target logical volume under the condition that the formatting instruction of the target logical volume is acquired;
The rule determining unit is used for determining a target formatting rule matched with the target data attribute based on the corresponding relation between the data attribute and the formatting rule; wherein, the formatting rates corresponding to different formatting rules are different;
and the formatting unit is used for carrying out formatting operation on the target logical volume according to the target formatting rule.
20. An electronic device, comprising:
a memory for storing a computer program;
a processor for executing the computer program to perform the steps of the method of formatting a disk array as claimed in any one of claims 1 to 18.
21. A computer readable storage medium, characterized in that the computer readable storage medium has stored thereon a computer program which, when executed by a processor, implements the steps of the method for formatting a disk array according to any of claims 1 to 18.
CN202310605216.XA 2023-05-26 2023-05-26 Formatting method, formatting device, formatting equipment and formatting medium for disk array Active CN116339643B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310605216.XA CN116339643B (en) 2023-05-26 2023-05-26 Formatting method, formatting device, formatting equipment and formatting medium for disk array

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310605216.XA CN116339643B (en) 2023-05-26 2023-05-26 Formatting method, formatting device, formatting equipment and formatting medium for disk array

Publications (2)

Publication Number Publication Date
CN116339643A CN116339643A (en) 2023-06-27
CN116339643B true CN116339643B (en) 2023-08-04

Family

ID=86884416

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310605216.XA Active CN116339643B (en) 2023-05-26 2023-05-26 Formatting method, formatting device, formatting equipment and formatting medium for disk array

Country Status (1)

Country Link
CN (1) CN116339643B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116991328B (en) * 2023-09-25 2024-01-16 苏州元脑智能科技有限公司 Volume formatting control method, device, system, equipment and medium of disk array

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101840308A (en) * 2009-10-28 2010-09-22 创新科存储技术有限公司 Hierarchical memory system and logical volume management method thereof
CN106155588A (en) * 2016-06-30 2016-11-23 联想(北京)有限公司 Information processing method and solid state hard disc
CN110427157A (en) * 2019-07-19 2019-11-08 苏州浪潮智能科技有限公司 A kind of formatting method and relevant apparatus
CN111176560A (en) * 2019-12-17 2020-05-19 腾讯科技(深圳)有限公司 Cache management method and device, computer equipment and storage medium
CN114995771A (en) * 2022-08-02 2022-09-02 苏州浪潮智能科技有限公司 Formatting scheduling method, device, equipment and medium for redundant array of independent disks
CN115495421A (en) * 2022-09-23 2022-12-20 苏州浪潮智能科技有限公司 Data formatting method, device, electronic equipment and medium

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008117195A (en) * 2006-11-06 2008-05-22 Hitachi Ltd Semiconductor storage device
JP5224706B2 (en) * 2007-03-23 2013-07-03 キヤノン株式会社 Storage device and storage device control method
US20180096358A1 (en) * 2016-09-30 2018-04-05 Wipro Limited Methods and Systems for Managing User Experience Design

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101840308A (en) * 2009-10-28 2010-09-22 创新科存储技术有限公司 Hierarchical memory system and logical volume management method thereof
CN106155588A (en) * 2016-06-30 2016-11-23 联想(北京)有限公司 Information processing method and solid state hard disc
CN110427157A (en) * 2019-07-19 2019-11-08 苏州浪潮智能科技有限公司 A kind of formatting method and relevant apparatus
CN111176560A (en) * 2019-12-17 2020-05-19 腾讯科技(深圳)有限公司 Cache management method and device, computer equipment and storage medium
CN114995771A (en) * 2022-08-02 2022-09-02 苏州浪潮智能科技有限公司 Formatting scheduling method, device, equipment and medium for redundant array of independent disks
CN115495421A (en) * 2022-09-23 2022-12-20 苏州浪潮智能科技有限公司 Data formatting method, device, electronic equipment and medium

Also Published As

Publication number Publication date
CN116339643A (en) 2023-06-27

Similar Documents

Publication Publication Date Title
JP4733461B2 (en) Computer system, management computer, and logical storage area management method
CN103019887B (en) Data back up method and device
CN116339643B (en) Formatting method, formatting device, formatting equipment and formatting medium for disk array
CN104620230A (en) Method of managing memory
CN109960612B (en) Method, device and server for determining data storage ratio
CN109871181A (en) A kind of Object Access method and device
CN107506466A (en) A kind of small documents storage method and system
US10698608B2 (en) Method, apparatus and computer storage medium for data input and output
CN108304142A (en) A kind of data managing method and device
CN109783321A (en) Monitoring data management method, device, terminal device
CN110032474B (en) Method, system and related components for determining snapshot occupied capacity
CN116755625A (en) Data processing method, device, equipment and readable storage medium
CN111913913A (en) Access request processing method and device
CN104572737A (en) Data storage aiding method and system
CN114995770A (en) Data processing method, device, equipment, system and readable storage medium
CN111399774B (en) Data processing method and device based on snapshot under distributed storage system
CN107846327A (en) A kind of processing method and processing device of network management performance data
CN114924911A (en) Method, device, equipment and storage medium for backing up effective data of Windows operating system
CN110795034B (en) Data migration method, device and equipment of storage system and readable storage medium
CN114756523A (en) Distributed storage method, device and medium
CN108959499A (en) Distributed file system performance analysis method, device, equipment and storage medium
CN116450053B (en) Data storage method, device, system, electronic equipment and storage medium
CN112506811B (en) Data block dynamic allocation method and device based on cold and hot data division in solid state disk
CN112402955B (en) Game log recording method and system
WO2022110196A1 (en) Data processing method, apparatus, and 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
GR01 Patent grant
GR01 Patent grant