CN116991328A - Volume formatting control method, device, system, equipment and medium of disk array - Google Patents

Volume formatting control method, device, system, equipment and medium of disk array Download PDF

Info

Publication number
CN116991328A
CN116991328A CN202311237705.0A CN202311237705A CN116991328A CN 116991328 A CN116991328 A CN 116991328A CN 202311237705 A CN202311237705 A CN 202311237705A CN 116991328 A CN116991328 A CN 116991328A
Authority
CN
China
Prior art keywords
formatting
volume
state
nonvolatile memory
memory chip
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.)
Granted
Application number
CN202311237705.0A
Other languages
Chinese (zh)
Other versions
CN116991328B (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 Metabrain Intelligent Technology Co Ltd
Original Assignee
Suzhou Metabrain 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 Metabrain Intelligent Technology Co Ltd filed Critical Suzhou Metabrain Intelligent Technology Co Ltd
Priority to CN202311237705.0A priority Critical patent/CN116991328B/en
Publication of CN116991328A publication Critical patent/CN116991328A/en
Application granted granted Critical
Publication of CN116991328B publication Critical patent/CN116991328B/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/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
    • 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/0646Horizontal data movement in storage systems, i.e. moving data in between storage devices or systems
    • G06F3/0652Erasing, e.g. deleting, data cleaning, moving of data to a wastebasket

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Signal Processing For Digital Recording And Reproducing (AREA)

Abstract

The invention relates to the technical field of storage systems, and discloses a volume formatting control method, a device, a system, equipment and a medium of a disk array, wherein the method comprises the following steps: when a volume formatting operation request of the disk array is received, determining starting data based on the volume formatting operation request; storing the starting data to a nonvolatile memory chip; the starting state timer inquires the nonvolatile memory chip to acquire the current formatting state of the target volume in the starting data; and calling the bottom chip firmware to format the target volume based on the formatting parameters based on the current formatting state of the target volume, and updating the formatting state in the nonvolatile memory chip based on the formatting state fed back by the bottom chip firmware in the formatting process. By using the nonvolatile memory chip to store the volume formatting state, the formatting process is controlled for different states, the logic behavior is equivalent to the state machine processing, and the logic completeness, the structural definition and the management efficiency are improved.

Description

Volume formatting control method, device, system, equipment and medium of disk array
Technical Field
The present invention relates to the field of storage systems, and in particular, to a method, an apparatus, a system, a device, and a medium for controlling volume formatting of a disk array.
Background
In the field of storage systems, the development of redundant arrays of independent disks (Redundant Array of Independent Disks, abbreviated as RAID) technology has promoted the development of the whole industry. Users achieve greater capacity storage, higher performance, and adequate security and fault tolerance by grouping multiple hard disks into RAID arrays. The entire RAID group may be considered a large logical disk, providing volume mapping for the host system, and mounted for use in the operating system. After the disk array card, namely the RAID card, generates the volume, the operation of volume formatting is provided, so that the volume can be thoroughly initialized, the residual data can be deleted, and the subsequent safe use can be realized.
General processing flow for volume formatting: the user issues a formatting operation command of the volume; a volume management module (volume module for short) analyzes and processes the issued command; the volume module calls the function of the bottom chip firmware to execute specific formatting actions in a remote procedure call (Remote Procedure Call, called RPC for short); the chip firmware asynchronously informs and returns the final formatting processing result. In the above procedure, the volume module needs to store the formatting status, and each change of the formatting status needs to be triggered by an external single point, for example: after the chip firmware finishes the volume formatting, a formatting completion result is returned, and the volume formatting processing mode causes incomplete whole formatting state transition logic, unclear structure and low management efficiency.
Disclosure of Invention
In view of this, the present invention provides a method, apparatus, system, device and medium for controlling volume formatting of a disk array, so as to solve the problems of incomplete logic, unclear structure and low management efficiency of the whole formatting state transition caused by the existing volume formatting processing mode.
In a first aspect, the present invention provides a method for controlling volume formatting of a disk array, applied to a disk array card, where the disk array card includes: a non-volatile memory chip and underlying chip firmware, the method comprising:
when a volume formatting operation request of a disk array is received, determining starting data based on the volume formatting operation request, wherein the starting data comprises formatting parameters required by formatting a target volume in the disk array and formatting states of the target volume;
storing the start data to the nonvolatile memory chip;
a starting state timer inquires the nonvolatile memory chip to acquire the current formatting state of the target volume in the starting data;
and calling the bottom chip firmware to format the target volume based on the formatting parameters based on the current formatting state of the target volume, and updating the formatting state of the starting data in the nonvolatile memory chip based on the formatting state fed back by the bottom chip firmware in the formatting process.
Therefore, the volume formatting state and the formatting parameters are stored by utilizing the nonvolatile memory chip, the formatting state is queried at regular time through the state timer, the whole formatting process is controlled for different states, the logic behavior is equivalent to the state machine processing, and the volume formatting control mode can improve the logic completeness and the structural definition and improve the management efficiency.
In an alternative embodiment, the method further comprises:
invoking a query progress interface of the bottom chip firmware in a formatting process to acquire current formatting parameters of the target volume;
and updating the formatting parameters of the starting data in the nonvolatile memory chip based on the current formatting parameters when the current formatting state is the in-process formatting state.
The real-time formatting parameters corresponding to the volume formatting process are obtained by calling the query progress interface of the bottom chip firmware in the whole formatting process, the real-time formatting parameters are updated in the nonvolatile memory chip, the formatting parameters corresponding to the current actual formatting process are ensured to be stored in the nonvolatile memory chip, the data loss can be avoided by storing the formatting parameter data in the nonvolatile memory chip, and an accurate data basis is provided for recovering the formatting process after restarting.
In an alternative embodiment, the formatting parameters include: the method comprises the steps of identifying a volume of a target volume, shifting a logical block address, a formatted completion length and formatted completion times, wherein the logical block address shifting is the shifting of a logical block address of a part of the volume which is already formatted by the target volume and a starting logical block address, and updating the formatting parameters of starting data in the nonvolatile memory chip based on the current formatting parameters, and comprises the following steps:
determining starting data corresponding to the volume identifier in the nonvolatile memory chip based on the volume identifier in the current formatting parameter;
and updating the logical block address offset, the formatted completion length and the formatted completion times in the starting data corresponding to the volume identifier in the nonvolatile memory chip into the corresponding current logical block address offset, the current formatted completion length and the current formatted completion times in the current formatting parameters.
The method and the system are convenient for accurately positioning the formatting state of the target volume by updating the logical block address offset, the formatted completion length and the formatted completion times required in the volume formatting process, and are convenient for the target volume formatting process to recover after the system is restarted.
In an alternative embodiment, the method further comprises:
and deleting the starting data in the nonvolatile memory chip and stopping the state timer when the current formatting state is any one of a complete formatting state, a formatting failure state and a formatting stopping state.
When the timer inquires that the formatting state of the volume is the formatting completion state, the formatting failure state and the formatting stop state, the timer indicates that the formatting of the volume is completed or terminated, the occupation of invalid data to the nonvolatile memory chip is avoided by deleting the starting data in the nonvolatile memory chip, and the process of the disk array card is released by stopping the state timer.
In an optional embodiment, when the current formatting status is any one of a complete formatting status, a formatting failure status, and a formatting stop status, the method further includes:
and feeding back a formatting result of the target volume to a user based on the current formatting state so that the user can perform corresponding processing based on the formatting result.
Therefore, the result that the formatting is completed or terminated is fed back to the user, so that the user can conveniently perform corresponding processing based on the formatted result, and the use experience of the user is improved.
In an alternative embodiment, the method further comprises:
and when the current formatting state is a pause state, maintaining starting data in the nonvolatile memory chip unchanged until a formatting restoration instruction is received, and restoring the process of formatting the target volume by the bottom chip firmware based on the starting data in the nonvolatile memory chip.
Thus, when the volume formatting is in a pause state, the starting data in the nonvolatile memory chip is maintained unchanged, so that the formatting process is resumed by using the starting data in the nonvolatile memory chip after the formatting is resumed.
In an alternative embodiment, the updating the formatting status of the startup data in the nonvolatile memory chip based on the formatting status fed back by the firmware of the bottom chip during the formatting process includes:
when receiving the identification corresponding to the ongoing formatting from the formatting status fed back by the firmware of the bottom chip, updating the formatting status of the starting data in the nonvolatile memory chip to the ongoing formatting status;
when receiving the identification corresponding to the completion of the formatting, the formatting state of the starting data in the nonvolatile memory chip is updated to the completion of the formatting state;
And when receiving the identification that the formatting state fed back by the bottom chip firmware corresponds to the formatting error, updating the formatting state of the starting data in the nonvolatile memory chip into a formatting failure state.
The formatting status stored in the nonvolatile memory chip is updated by using the formatting process identifier fed back by the bottom chip firmware, so that the completeness of the whole formatting process is improved, and the management efficiency is improved.
In an alternative embodiment, the method further comprises:
and when receiving a pause instruction or a formatting stop instruction, interrupting the process of formatting the target volume by the bottom chip firmware.
When receiving a pause instruction or a stop instruction issued by a user, the method and the device perform interrupt control on the volume formatting process so as to realize accurate control on the whole volume formatting process by the user.
In an alternative embodiment, upon receiving a pause instruction or a format stop instruction, the method further comprises:
updating the formatting status of the start data in the nonvolatile memory chip based on the pause instruction or formatting stop instruction.
Therefore, the formatting state stored in the nonvolatile memory chip is updated based on the user-to-volume formatting control instruction, so that the completeness of the whole formatting process is improved, and the management efficiency is improved.
In an alternative embodiment, the updating the formatting status of the startup data in the nonvolatile memory chip based on the pause instruction or the formatting stop instruction includes:
updating the formatting state of the starting data in the nonvolatile memory chip into a pause state based on the pause instruction;
and updating the formatting status of the starting data in the nonvolatile memory chip into a formatting stop status based on the formatting stop instruction.
The formatting status stored in the nonvolatile memory chip is updated based on the pause instruction and the formatting stop instruction of the user for volume formatting, so that the completeness of the whole formatting process is improved, and the management efficiency is improved.
In an alternative embodiment, the method further comprises:
after restarting the disk array card, judging whether starting data exist in the nonvolatile memory chip;
And when the starting data exists in the nonvolatile memory chip, reconstructing a formatting flow based on the starting data so as to continuously complete formatting of the target volume corresponding to the starting data.
By utilizing the nonvolatile characteristic of the flash memory, the volume formatting parameter data held in the nonvolatile memory chip can be continuously performed at the breakpoint after the system is restarted, so that the operation of a user is not lost, the user is not required to repeatedly issue a formatting command, the time for formatting from the beginning is greatly reduced, and the management efficiency is further improved particularly in a high-capacity scene.
In an alternative embodiment, the reconstructing the formatting process based on the start data includes:
initializing the formatting state of the target volume corresponding to the starting data, and returning to a step of inquiring the nonvolatile memory chip by a starting state timer to acquire the current formatting state of the target volume in the starting data so as to continuously complete the formatting of the target volume.
Thus, the formatting process is continuously executed from the breakpoint to the whole volume by initializing the formatting state of the target volume.
In an alternative embodiment, before determining the startup data based on the volume formatting operation request, the method further comprises:
carrying out validity check on command parameters carried by the volume formatting operation request;
after the validity check is passed, startup data is determined based on the volume formatting operation request.
Therefore, by means of carrying out validity check on command parameters carried by the volume formatting operation request, the success rate of volume formatting is improved, the phenomenon that stored data is lost due to illegal formatting of the volume is avoided, and the security of volume formatting is ensured.
In an alternative embodiment, the command parameters include: the identification of the disk array card, the identification of the volume and the formatting parameters, wherein the validity check of the command parameters carried by the volume formatting operation request comprises the following steps:
respectively judging whether the identification, the volume identification and the formatting parameters of the disk array card are in the corresponding legal numerical ranges or not;
when the identification of the disk array card, the volume identification and the formatting parameters are all in the corresponding legal numerical value range, determining that the validity check is passed;
and when any one of the identification, the volume identification and the formatting parameters of the disk array card is not in the corresponding legal numerical range, determining that the validity check is not passed.
Therefore, whether the validity check is passed or not is determined by judging whether the identification of the disk array card, the identification of the volume and the formatting parameters are in the corresponding legal numerical range, so that the normal execution of the volume formatting operation request is ensured, the problem of volume formatting failure caused by the error of the user setting parameters is avoided, the safety of volume formatting is ensured, the illegal formatting of the volume is avoided, and the user experience is improved.
In an alternative embodiment, when the validity check fails, the method further includes:
rejecting the volume formatting operation request.
When the validity check fails, the method reminds the user that the volume formatting operation request has a problem by rejecting the volume formatting operation request so as to modify the volume formatting operation request and avoid illegal formatting operation on the volume.
In an alternative embodiment, the disk array card is an NVMe-supporting device, and the user issues a volume formatting operation request, a pause instruction, a formatting stop instruction, and a resume formatting instruction to the disk array card through an NVMe protocol.
Therefore, the command issuing between the user and the disk array card is realized by utilizing the NVMe protocol, the response speed of the command is improved, and the transmission delay is reduced.
In a second aspect, the present invention provides a volume formatting control device for a disk array, applied to a disk array card, where the disk array card includes: a non-volatile memory chip and underlying chip firmware, the apparatus comprising:
the first processing module is used for determining starting data based on a volume formatting operation request of the disk array when the volume formatting operation request of the disk array is received, wherein the starting data comprises formatting parameters required by formatting a target volume in the disk array and formatting states of the target volume;
the second processing module is used for storing the starting data to the nonvolatile memory chip;
the third processing module is used for inquiring the nonvolatile memory chip by a starting state timer so as to acquire the current formatting state of the target volume in the starting data;
and the fourth processing module is used for calling the bottom chip firmware to format the target volume based on the current formatting state of the target volume, and updating the formatting state of the starting data in the nonvolatile memory chip based on the formatting state fed back by the bottom chip firmware in the formatting process.
In a third aspect, the present invention provides a storage system comprising: disk arrays, and disk array cards, wherein,
the disk array card includes: a nonvolatile memory chip and underlying chip firmware;
the disk array card formats the volume of the disk array by performing the volume formatting control of the disk array of the first aspect or any optional implementation thereof.
In a fourth aspect, the present invention provides an electronic device, comprising: the storage device and the processor are in communication connection, computer instructions are stored in the storage device, and the processor executes the computer instructions, so that the volume formatting control method of the disk array in the first aspect or any optional implementation manner of the first aspect is executed.
In a fifth aspect, the present invention provides a computer readable storage medium having stored thereon computer instructions for causing a computer to perform the volume formatting control method of a disk array of the first aspect or any of its alternative embodiments.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings that are needed in the description of the embodiments or the prior art will be briefly described, and it is obvious that the drawings in the description below are some embodiments of the present invention, and other drawings can be obtained according to the drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic diagram of a memory system according to an embodiment of the present invention;
FIG. 2 is a flow chart of a method for controlling volume formatting of a disk array according to an embodiment of the present invention;
FIG. 3 is a flow chart of another method for controlling volume formatting of a disk array according to an embodiment of the present invention;
FIG. 4 is a flow chart of a method for controlling volume formatting of a disk array according to an embodiment of the present invention;
FIG. 5 is a schematic diagram of a volume formatting system according to an embodiment of the present invention;
FIG. 6A is a process diagram of a disk array card in a ready state and an in-progress format state according to an embodiment of the invention;
FIG. 6B is a process diagram of a disk array card in a complete format state according to an embodiment of the present invention;
FIG. 6C is a process diagram of a disk array card in a different remaining formatting state in accordance with an embodiment of the present invention;
FIG. 7 is a state machine transition diagram of a disk array card performing state machine control according to an embodiment of the present invention;
FIG. 8 is a block diagram of a volume formatting control device of a disk array according to an embodiment of the present invention;
fig. 9 is a schematic diagram of a hardware structure of an electronic device according to an embodiment of the present invention.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is apparent that the described embodiments are some embodiments of the present invention, but not all embodiments of the present invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
First, some terms of art used in the embodiments of the present invention will be explained:
RAID: (Redundant Array of Independent Disks) redundant array of independent disks. RAID is a technique for combining multiple independent hard disks (physical hard disks) in different ways to form a hard disk group (logical hard disk), also known as a disk array, to provide higher storage performance and to provide data backup than a single hard disk. The user looks like a hard disk, which can be partitioned, formatted, etc. by the user. RAID card: and the disk array card is used for carrying out volume formatting control on the disk array through hardware.
VOLUME: i.e., volumes, are objects managed internally by the storage system. RAID cards mask the complexity of the storage device mapping to the physical or logical disks of the host, and by making the managed disks into volumes that are flexibly presented to the operating system in logical volumes, users can create file systems on the volumes for use by the system. The VOLUME module, i.e., the process executing on the RAID card.
FlashDB: is an ultra-lightweight embedded database and is focused on providing a data storage scheme of an embedded product. Unlike traditional file system based databases, the Flash DB combines the characteristics of Flash, has stronger performance and reliability, and prolongs the service life of Flash as far as possible on the premise of ensuring extremely low resource occupation.
Formatting: the special reference herein is to secure formatting of the volume, that is, by randomly writing data multiple times, the data on the volume is completely deleted and cannot be recovered, to the extent of secure use, and is generally divided into 1 write, 3 writes and 9 writes.
RPC: (Remote Procedure Call), remote procedure call, which means that network communication is needed, can be understood as calling a method on a remote machine, and here refers to communication between different cores, and through RPC, the method of other cores can be called as the method of the core.
FSM: (fine-state machine), finite state machine. Is a mathematical computational model representing finite states and transitions and actions between these states, and is used herein to represent the relationships between formatting states.
LBA: (Logical Block Address), logical block addresses. The mechanism by which a block of data resides on a computer memory device is described, typically as an address of the data block. The volume is here made up of logical blocks pointed to by a number of contiguous or non-contiguous LBAs.
NVMe: (Non-Volatile Memory Express), i.e., nonvolatile memory flash channel. It is a communication protocol and interface standard for interfacing a computer system to a flash memory storage device, such as a solid state disk.
The invention provides a scheme for storing the formatting status and key information through a nonvolatile memory chip such as a flash DB, and using a timer to store and inquire the formatting status and information at regular time to perform state machine (FSM) processing, so as to achieve the purposes of effectively controlling the volume formatting flow and restarting the system to continue formatting. The flash DB carried on the flash memory stores the state and process data of the volume formatting, so that the state machine control is performed on the formatting flow of the whole volume, the management efficiency is improved, the non-volatile characteristic of the flash memory is utilized, the formatting progress is not lost after the system is restarted, the formatting is continued from the breakpoint, the time for restarting the formatting after the system is restarted is saved, and the effect is particularly obvious particularly in a high-capacity scene.
In this embodiment, there is provided a storage system, as shown in fig. 1, including: disk array 101 and disk array card 102, wherein disk array card 102 comprises: a nonvolatile memory chip 1021 and underlying chip firmware 1022; the disk array card 102 formats the volume of the disk array 101 by executing a volume formatting control method. The specific steps of the method for performing volume formatting control by the disk array card 102 are described in the following method embodiments, and are not described in detail herein.
In the embodiment of the present invention, the nonvolatile memory chip 1021 is exemplified by FlashDB, and in practical application, the nonvolatile memory chip 1021 may be a data storage structure such as an SD card that does not lose stored data due to power-off, restart, and other problems, and the present invention is not limited thereto.
According to the storage system provided by the embodiment of the invention, the volume formatting state and the formatting parameters are stored by utilizing the nonvolatile storage chip, the formatting state is queried at regular time through the state timer, the whole formatting process is controlled for different states, the logic behavior is equivalent to the state machine processing, and the volume formatting control mode can improve the logic completeness and the structural definition and improve the management efficiency.
In accordance with an embodiment of the present invention, there is provided a volume formatting control method embodiment for a disk array, it being noted that the steps shown in the flowchart of the figures may be performed in a computer system, such as a set of computer executable instructions, and that, although a logical sequence is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than what is shown or described herein.
In this embodiment, a method for controlling volume formatting of a disk array is provided, which is applied to a disk array card as shown in fig. 1, and fig. 2 is a flowchart of a method for controlling volume formatting of a disk array according to an embodiment of the present invention, as shown in fig. 2, where the flowchart includes the following steps:
in step S201, when a volume formatting operation request of the disk array is received, startup data is determined based on the volume formatting operation request.
The starting data comprises formatting parameters required by formatting the target volume in the disk array and formatting states of the target volume. Specifically, when the initial state of the formatting status is the READY status, the initial state is abbreviated as READY status, and when the formatting status of the target volume is the READY status, it is indicated that the target volume can start the formatting operation, and the formatting status further includes following the volume formatting: the status of the FORMATTING is hereinafter referred to as FORMATTING, the status of the completion of the FORMATTING is hereinafter referred to as complete_failed, and the like. The formatting parameters include: volume identification of the target volume, logical block address offset, formatted completion length, number of formatted completions, etc.
Illustratively, the startup data may be in the format of (vol_id, curr_lba, final_len, fmt_count, fmt_status), where vol_id is the identification simply volume ID, curr_lba is the logical block address offset described above simply the current lba offset, final_len is the volume formatted length, fmt_count is the number of formatted completions, fmt_status is the formatting status,
step S202, storing the startup data to the nonvolatile memory chip.
By storing the startup data in the FlashDB, the format status and the formatting parameters of the format process can be stored by utilizing the nonvolatile characteristics of the FlashDB, and the loss of formatting progress data can be avoided.
In step S203, the startup status timer queries the nonvolatile memory chip to obtain the current formatting status of the target volume in the startup data.
By starting a timer task, the FlashDB is queried at regular time to acquire the real-time format state of the volume, and by way of example, the state timer is set to 5s, the format state in the FlashDB is queried every 5s, so that corresponding volume formatting control is performed according to the queried state.
Step S204, based on the current formatting state of the target volume, calling the bottom chip firmware to format the target volume based on the formatting parameters, and updating the formatting state of the starting data in the nonvolatile memory chip based on the formatting state fed back by the bottom chip firmware in the formatting process.
When the current FORMATTING state of the target volume is queried to be the READY state, the FORMATTING process of the volume is started, specifically, the FORMATTING interface of the bottom chip firmware can be called in an asynchronous RPC mode to start FORMATTING, the FORMATTING state is changed from the READY state to the FORMATTING state which is the FORMATTING state, and the FORMATTING state is written into the flash DB to update the FORMATTING state.
Therefore, the volume formatting state and the formatting parameters are stored by utilizing the nonvolatile memory chip, the formatting state is queried at regular time through the state timer, the whole formatting process is controlled for different states, the logic behavior is equivalent to the state machine processing, and the volume formatting control mode can improve the logic completeness and the structural definition and improve the management efficiency.
In this embodiment, a method for controlling volume formatting of a disk array is further provided, which is applied to a disk array card as shown in fig. 1, and fig. 3 is a flowchart of a method for controlling volume formatting of a disk array according to an embodiment of the present invention, as shown in fig. 3, where the flowchart includes the following steps:
in step S301, when a volume formatting operation request of the disk array is received, startup data is determined based on the volume formatting operation request, where the startup data includes formatting parameters required for formatting a target volume in the disk array and a formatting status of the target volume. Details are related to the step S201 shown in fig. 2, and will not be described here again.
In step S302, the startup data is stored in the nonvolatile memory chip. Details are related to the step S202 shown in fig. 2, and will not be described herein.
In step S303, the start status timer queries the nonvolatile memory chip to obtain the current formatting status of the target volume in the start data. Details are related to the step S203 shown in fig. 2, and will not be described here again.
Step S304, based on the current formatting state of the target volume, calling the bottom chip firmware to format the target volume based on the formatting parameters, and updating the formatting state of the starting data in the nonvolatile memory chip based on the formatting state fed back by the bottom chip firmware in the formatting process.
Specifically, in the step S304, based on the formatting status fed back by the firmware of the bottom chip, the method updates the formatting status of the startup data in the nonvolatile memory chip, specifically includes:
and step a1, when the formatting state fed back by the firmware of the bottom chip is the identifier corresponding to the ongoing formatting, updating the formatting state of the starting data in the nonvolatile memory chip into the ongoing formatting state.
And a step a2, when the formatting state fed back by the firmware of the bottom chip is the identification corresponding to the completion of formatting, updating the formatting state of the starting data in the nonvolatile memory chip into the completion of formatting state.
And a step a3, when receiving the identification that the formatting status fed back by the firmware of the bottom chip is corresponding to the formatting error, updating the formatting status of the starting data in the nonvolatile memory chip into a formatting failure status.
Specifically, the bottom chip firmware will inform the disk array card of the formatting execution result in the process of formatting the volume, the process of the disk array card can acquire the actual formatting status by analyzing the informing content, different formatting status can be represented by setting different identifiers, for example, the numbers 1, 2 and 3 respectively indicate that the formatting is being performed, the formatting is COMPLETED and the formatting fails, when the informing content fed back by the bottom chip firmware is "2", the disk array card indicates that the formatting of the target volume is COMPLETED, and the corresponding formatting status is updated to the complete status.
The formatting status stored in the nonvolatile memory chip is updated by using the formatting process identifier fed back by the bottom chip firmware, so that the completeness of the whole formatting process is improved, and the management efficiency is improved.
In some alternative embodiments, the above method further comprises:
and b1, interrupting the process of formatting the target volume by the bottom chip firmware when receiving a pause instruction or a formatting stop instruction.
Specifically, the pause instruction and the formatting stop instruction are control instructions issued by the user according to the formatting requirements by the RAID card, and specifically, instruction communication between the user and the RAID card can be realized through an NVMe protocol. For example, when the formatting of the current volume requires too long, the user wants to pause the formatting process or cancel the formatting, and then the interruption of the formatting process can be implemented by issuing a corresponding control instruction to the RAID card.
When receiving a pause instruction or a stop instruction issued by a user, the method and the device perform interrupt control on the volume formatting process so as to realize accurate control on the whole volume formatting process by the user.
And b2, when receiving the pause instruction or the formatting stop instruction, updating the formatting state of the starting data in the nonvolatile memory chip based on the pause instruction or the formatting stop instruction.
Therefore, the formatting state stored in the nonvolatile memory chip is updated based on the user-to-volume formatting control instruction, so that the completeness of the whole formatting process is improved, and the management efficiency is improved.
Specifically, based on the pause instruction, updating the formatting state of the startup data in the nonvolatile memory chip to a pause state; based on the formatting stop instruction, the formatting state of the startup data in the nonvolatile memory chip is updated to the formatting stop state.
Illustratively, during the volume FORMATTING process, if a PAUSE instruction is received, the FORMATTING status is changed from FORMATTING to PAUSE status, hereinafter referred to as PAUSE status, and if a FORMATTING STOP instruction is received, also referred to as terminate instruction, the FORMATTING status is changed from FORMATTING to FORMATTING STOP status, hereinafter referred to as complete_stop status.
The formatting status stored in the nonvolatile memory chip is updated based on the pause instruction and the formatting stop instruction of the user for volume formatting, so that the completeness of the whole formatting process is improved, and the management efficiency is improved.
Step S305, calling the query progress interface of the bottom chip firmware in the formatting process to acquire the current formatting parameters of the target volume.
Step S306, when the current formatting status is in the ongoing formatting status, updating the formatting parameters of the startup data in the nonvolatile memory chip based on the current formatting parameters.
Specifically, during the process of volume formatting, the corresponding formatting parameters are also changing continuously, such as: current lba offset, volume formatted length, number of completed times, etc. In the formatting process, a corresponding timer task can be set, for example, the state timer is adopted, a query progress interface of the bottom chip firmware is called every 5s, the current formatting parameters are queried, and the formatting parameters are updated in the flashDB, so that the formatting parameters stored in the flashDB correspond to the actual formatting progress of the volume, and the loss of the formatting progress is avoided.
The real-time formatting parameters corresponding to the volume formatting process are obtained by calling the query progress interface of the bottom chip firmware in the whole formatting process, the real-time formatting parameters are updated in the nonvolatile memory chip, the formatting parameters corresponding to the current actual formatting process are ensured to be stored in the nonvolatile memory chip, the data loss can be avoided by storing the formatting parameter data in the nonvolatile memory chip, and an accurate data basis is provided for recovering the formatting process after restarting.
Specifically, the above formatting parameters include: the step S306 includes:
And c1, determining starting data corresponding to the volume identifier in the nonvolatile memory chip based on the volume identifier in the current formatting parameter.
Specifically, because the volume identifier is the unique identifier of the volume in the disk array, the association between the volume and the starting data is established through the volume identifier, so that the RAID card can simultaneously and respectively perform format control on a plurality of volumes, and the management efficiency of formatting the disk array volume is further improved.
And c2, updating the logical block address offset, the formatted completion length and the formatted completion times in the start data corresponding to the volume identifier in the nonvolatile memory chip into the corresponding current logical block address offset, the current formatted completion length and the current formatted completion times in the current formatting parameters.
The method and the system are convenient for accurately positioning the formatting state of the target volume by updating the logical block address offset, the formatted completion length and the formatted completion times required in the volume formatting process, and are convenient for the target volume formatting process to recover after the system is restarted.
In step S307, when the current formatting status is any one of the complete formatting status, the formatting failure status, and the formatting stop status, the startup data in the nonvolatile memory chip is deleted, and the status timer is stopped.
When the timer inquires that the formatting state of the volume is the formatting completion state, the formatting failure state and the formatting stop state, the timer indicates that the formatting of the volume is completed or terminated, the occupation of invalid data to the nonvolatile memory chip is avoided by deleting the starting data in the nonvolatile memory chip, and the process of the disk array card is released by stopping the state timer.
Step S308, when the current formatting status is any one of the completed formatting status, the formatting failure status and the formatting stopping status, the formatting result of the target volume is fed back to the user based on the current formatting status, so that the user performs corresponding processing based on the formatting result.
The method includes that when the current formatting state is the completion formatting state, a formatting result of a target volume is fed back to a user as the formatting completion, the user can conveniently store data of the formatted volume, and when the formatting failure and other problems occur, a volume formatting operation request is reset according to formatting requirements to reformat the target volume, or corresponding operation and maintenance inspection and the like are performed on the target volume.
Therefore, the result that the formatting is completed or terminated is fed back to the user, so that the user can conveniently perform corresponding processing based on the formatted result, and the use experience of the user is improved.
Step S309, when the current formatting status is a pause status, maintaining the startup data in the nonvolatile memory chip unchanged until receiving a command for resuming the formatting, and resuming the process of the bottom chip firmware for formatting the target volume based on the startup data in the nonvolatile memory chip.
Specifically, the format recovery instruction is a control instruction issued by a user to the RAID card, and when the RAID card receives the format recovery instruction, the formatting process is continued from the formatting interruption position by using the formatting progress data stored in the FlashDB, so that reformatting is prevented from being restarted, and formatting time is saved.
Thus, when the volume formatting is in a pause state, the starting data in the nonvolatile memory chip is maintained unchanged, so that the formatting process is resumed by using the starting data in the nonvolatile memory chip after the formatting is resumed.
In some alternative embodiments, the disk array card is an NVMe-enabled device, and the user issues a volume formatting operation request, a pause instruction, a formatting stop instruction, and a resume formatting instruction to the disk array card through an NVMe protocol.
Therefore, the command issuing between the user and the disk array card is realized by utilizing the NVMe protocol, the response speed of the command is improved, and the transmission delay is reduced.
In this embodiment, a method for controlling volume formatting of a disk array is further provided, which is applied to the disk array card shown in fig. 1, and fig. 4 is a flowchart of a method for controlling volume formatting of a disk array according to an embodiment of the present invention, as shown in fig. 4, where the flowchart includes the following steps:
step S401, when receiving a volume formatting operation request of a disk array, performing validity check on command parameters carried by the volume formatting operation request.
Specifically, the command parameters include: the step S401 specifically includes:
and e1, respectively judging whether the identification of the disk array card, the volume identification and the formatting parameters are in the corresponding legal numerical range.
And e2, determining that the validity check passes when the identification of the disk array card, the volume identification and the formatting parameters are all in the corresponding legal numerical range.
And e3, when any one of the identification of the disk array card, the volume identification and the formatting parameter is not in the corresponding legal numerical range, determining that the validity check is not passed.
Specifically, in practical application, the storage system may have a plurality of disk array cards, the corresponding volume identifier on each disk array is limited, the corresponding logical block address of the volume is also in a certain address range, for example, if the identifier of the corresponding disk array card in the volume formatting operation request is inconsistent with the identifier of the disk array card actually receiving the request, it may be that a user command issues an error, or a malicious formatting attack occurs, etc., in addition, if in the formatting parameter, if the logical block address required to be formatted set by the user is inconsistent with the actual logical block address of the volume, the formatting cannot be performed normally, which eventually leads to a problem of format failure, and the above problem can be avoided through validity verification.
Therefore, whether the validity check is passed or not is determined by judging whether the identification of the disk array card, the identification of the volume and the formatting parameters are in the corresponding legal numerical range, so that the normal execution of the volume formatting operation request is ensured, the problem of volume formatting failure caused by the error of the user setting parameters is avoided, the safety of volume formatting is ensured, the illegal formatting of the volume is avoided, and the user experience is improved.
In step S402, after the validity check is passed, startup data is determined based on the volume formatting operation request.
Therefore, by means of carrying out validity check on command parameters carried by the volume formatting operation request, the success rate of volume formatting is improved, the phenomenon that stored data is lost due to illegal formatting of the volume is avoided, and the security of volume formatting is ensured.
Step S403, storing the startup data to the nonvolatile memory chip. Details are related to the step S302 shown in fig. 3, and will not be described herein.
In step S404, the startup status timer queries the nonvolatile memory chip to obtain the current formatting status of the target volume in the startup data. Details are related to step S303 shown in fig. 3, and will not be described here again.
Step S405, based on the current formatting status of the target volume, the bottom chip firmware is called to format the target volume based on the formatting parameters, and based on the formatting status fed back by the bottom chip firmware in the formatting process, the formatting status of the startup data in the nonvolatile memory chip is updated. Details are related to the step S304 shown in fig. 3, and will not be described here again.
Step S406, after restarting the disk array card, judging whether the starting data exists in the nonvolatile memory chip.
Specifically, since the startup data corresponding to the volume is stored in the FlashDB during the process of formatting the volume until the formatting process is finished, whether an interrupted formatting process exists before restarting the disk array card, for example, the disk array card interrupts the formatting process for a certain volume due to power failure or system reset, can be determined by determining whether the startup data exists in the FlashDB.
In step S407, when the startup data exists in the nonvolatile memory chip, the formatting process is rebuilt based on the startup data, so as to complete formatting of the target volume corresponding to the startup data.
Specifically, since the startup data stored in the FlashDB is data corresponding to the actual formatting progress of the volume, the process of recovering the formatting from the formatting breakpoint can be implemented using the startup data stored in the FlashDB.
By utilizing the nonvolatile characteristic of the flash memory, the volume formatting parameter data held in the flash DB can be continuously performed at the breakpoint after the system is restarted, so that the operation of a user is not lost, the user is not required to repeatedly issue a formatting command, the time for formatting from the beginning is greatly reduced, and the management efficiency is further improved particularly in a high-capacity scene.
Specifically, step S406 above corresponds to the formatting status of the target volume by initializing the startup data, and returns to step S404 to continue to complete the formatting of the target volume.
Thus, the formatting process is continuously executed from the breakpoint to the whole volume by initializing the formatting state of the target volume.
In step S408, when the validity check fails, the volume formatting operation request is rejected.
Specifically, the execution of the volume formatting operation request can be refused by feeding back to the user a mode that the volume formatting operation request is illegal or incorrect, and reminding the user to modify the volume formatting operation request, and then the correct control instruction is issued again.
When the validity check fails, the method reminds the user that the volume formatting operation request has a problem by rejecting the volume formatting operation request so as to modify the volume formatting operation request and avoid illegal formatting operation on the volume.
The specific working process of the volume formatting control method of the disk array provided by the embodiment of the invention will be described in detail below with reference to specific application examples.
The volume formatting control method of the disk array provided by the embodiment of the invention is used for constructing a volume formatting system shown in figure 5, wherein the system is composed of a RAID array and a RAID card, and the RAID card comprises: the method comprises the following steps of a VOLUME module, namely a process on a RAID card, a flash DB and a bottom firmware chip, wherein the VOLUME module inquires the formatting state in the flash DB by starting a state TIMER TIMER after receiving a formatting instruction issued by a user, and calls the bottom firmware chip to perform formatting control on a VOLUME in a RAID array by using RPC according to a state inquiry result, and the specific process of performing VOLUME formatting on the disk array by the system is as follows:
1. a user needs to perform formatting operation on a certain volume, and issues a formatting instruction of the volume to the RAID card in an NVMe protocol mode; the VOLUME module on the RAID card firstly analyzes the operation instruction obtained from the host, recognizes the operation type as a VOLUME formatting instruction, and further performs parameter validity check on the carried command parameters.
2. Firstly, the VOLUME module calls a write interface of the flash DB to store to a piece of starting data, a data format (vol_id, curr_lba, fmt_status) is stored in the flash DB, wherein the vol_id is a VOLUME ID, the unique identifier of the VOLUME, curr_lba is a current lba offset, finish_len is a VOLUME formatted length, fmt_count is the number of times completed, fmt_status is a formatted state, and the initialized formatted state is a READY state when the system is started, namely a READY state.
3. After storing the startup data in the FlashDB, as shown in fig. 6A, a status TIMER is started at the same time, and the formatting status in the FlashDB is queried every 5s, and corresponding processing is performed according to the status therein.
4. As shown in fig. 6A, when the timer queries that the status in the FlashDB is ready, the FORMATTING interface of the underlying chip firmware is called in an asynchronous RPC manner to start FORMATTING, the FORMATTING status is updated to be the ongoing FORMATTING status, i.e. FORMATTING, and the FORMATTING status is written into the FlashDB to enter the ongoing FORMATTING status.
5. As shown in fig. 6A, the timer queries that the state in the FlashDB is the in-process formatting state, which indicates that the volume is being formatted, and saves data such as curr_lba, finished_len, fmt_count, etc. to the FlashDB as a data node for recovering the formatting after restarting.
6. As shown in fig. 6B, when the firmware formatting of the bottom chip is COMPLETED, the VOLUME module is notified, and the VOLUME module writes the COMPLETED formatting status, i.e., complete, into the FlashDB; if the underlying chip firmware fails error during formatting, temporarily PAUSEs the psuse, or the user issues a formatting STOP, the VOLUME module will update the status in the FlashDB to a formatting failure status, i.e., complete_failed, a PAUSE status, i.e., PAUSE, and a formatting STOP status, i.e., complete_stop, respectively.
7. As shown in fig. 6C, when the timer queries the format completion state, the format failure state and the format stop state, which indicate that the formatting is completed or passively stopped, the VOLUME module will delete the data in the FlashDB and stop the timer to report the result; when the state is the pause state, the VOLUME module keeps the data of the formatted data node unchanged, waits for recovery, calls the chip firmware formatting interface to continue formatting from the logical block address offset after being allowed to start, and updates the formatting state of the FlashDB to the ongoing formatting state.
8. After the system is restarted, because the FlashDB is located on the flash memory, the flash memory is a non-volatile memory, the formatted data of the VOLUME is not lost, and the VOLUME module can continue to format from the interrupt, because the FlashDB already stores curr_lba, finished_len, fmt_count in the in-process formatting state, with which the formatting process can be rebuilt. For example, the progress calculation returned to the user, the recovered progress value is the same as that before the system is restarted, and the formatting interrupt is not perceived:
progress = 1/loop*(fmt_count + (finished_len/len_total))
where len_total is the total length of lba of the roll; loop is the round of volume security formatting, which is typically performed 1, 3, and 9 times, respectively, according to the degree of security to be achieved. The state machine transition process of the whole disk array card for performing state machine control is shown in fig. 7, in the volume formatting process, when the volume formatting starts, the formatting state is changed from the ready state to the in-progress formatting state, if the formatting is completed, the formatting state is changed from the in-progress formatting state to the completed formatting state, if the formatting fails, the formatting state is changed from the in-progress formatting state to the formatting failure state, if a pause instruction or a termination instruction of a user is received in the formatting process, the formatting state is changed from the in-progress formatting state to the pause state, and the like, and when a restoration instruction of the user is received, the formatting state is changed from the pause state to the ready state again, and if a termination instruction of the user is received in the formatting process, the formatting state is changed from the in-progress formatting state to the formatting stop state.
The VOLUME module reads the formatted data in the FlashDB in the initialization process after restarting, starts formatting from curr_lba of the VOLUME, sets the formatting state as READY, starts a timer, and continues to finish the rest formatting times.
The method has the advantages that the formatting state of the flash DB storage volume on the flash memory is utilized, the formatting state is queried at regular time through a timer, the whole formatting process is controlled for different states, the logic behavior is equivalent to the state machine processing, the logic completeness and the structural definition can be improved, and the management efficiency is improved; meanwhile, by utilizing the nonvolatile characteristic of the flash memory, the volume formatting can be continued at the breakpoint after the system is restarted by the stored formatting data, so that the operation of a user is not lost, the user is not required to repeatedly issue the formatting command, and the formatting time from the beginning is greatly reduced especially in a high-capacity scene.
The embodiment also provides a volume formatting control device of a disk array, which is used for implementing the foregoing embodiments and preferred embodiments, and is not described in detail. As used below, the term "module" may be a combination of software and/or hardware that implements a predetermined function. While the means described in the following embodiments are preferably implemented in software, implementation in hardware, or a combination of software and hardware, is also possible and contemplated.
The embodiment provides a volume formatting control device of a disk array, as shown in fig. 8, including:
the first processing module 801 is configured to determine, when a volume formatting operation request of the disk array is received, startup data based on the volume formatting operation request, where the startup data includes formatting parameters required for formatting a target volume in the disk array and a formatting state of the target volume;
a second processing module 802, configured to store the startup data to the FlashDB;
a third processing module 803, configured to query the FlashDB by using a start status timer to obtain a current formatting status of the target volume in the start data;
the fourth processing module 804 is configured to invoke the bottom chip firmware to format the target volume based on the current formatting status of the target volume, and update the formatting status of the startup data in the FlashDB based on the formatting status fed back by the bottom chip firmware in the formatting process.
In some alternative embodiments, the apparatus further comprises:
the fourth processing module is used for calling a query progress interface of the bottom chip firmware in the formatting process so as to acquire the current formatting parameters of the target volume;
And a fifth processing module, configured to update the formatting parameter of the startup data in the FlashDB based on the current formatting parameter when the current formatting status is in the ongoing formatting status.
In some alternative embodiments, the formatting parameters include: the fifth processing module specifically includes:
the first processing unit is used for determining starting data corresponding to the volume identifier in the FlashDB based on the volume identifier in the current formatting parameter;
and the second processing unit is used for updating the logical block address offset, the formatted completion length and the formatted completion times in the startup data corresponding to the volume identifier in the flash DB into the corresponding current logical block address offset, the current formatted completion length and the current formatted completion times in the current formatting parameters.
In some alternative embodiments, the apparatus further comprises:
and the sixth processing module is used for deleting the starting data in the FlashDB and stopping the state timer when the current formatting state is any one of the completed formatting state, the formatting failure state and the formatting stopping state.
In some alternative embodiments, the apparatus further comprises:
and the seventh processing module is used for feeding back the formatting result of the target volume to the user based on the current formatting state when the current formatting state is any one of the completed formatting state, the formatting failure state and the formatting stopping state, so that the user can perform corresponding processing based on the formatting result.
In some alternative embodiments, the apparatus further comprises:
and the eighth processing module is used for maintaining the starting data in the FlashDB unchanged when the current formatting state is the pause state until a formatting restoration instruction is received, and restoring the process of formatting the target volume by the bottom chip firmware based on the starting data in the FlashDB.
In some alternative embodiments, the fourth processing module 804 specifically includes:
the third processing unit is used for updating the formatting state of the starting data in the FlashDB into the ongoing formatting state when the formatting state fed back by the bottom chip firmware is the identifier corresponding to the ongoing formatting;
the fourth processing unit is used for updating the formatting state of the starting data in the flashDB into a complete formatting state when the formatting state fed back by the bottom chip firmware is received as a mark corresponding to the complete formatting;
And the fifth processing unit is used for updating the formatting status of the starting data in the FlashDB into a formatting failure status when receiving the identification corresponding to the formatting error as the formatting status fed back by the bottom chip firmware.
In some alternative embodiments, the apparatus further comprises:
and the ninth processing module is used for interrupting the process of formatting the target volume by the bottom chip firmware when receiving a pause instruction or a formatting stop instruction.
In some alternative embodiments, the apparatus further comprises:
and the tenth processing module is used for updating the formatting state of the starting data in the FlashDB based on the pause instruction or the formatting stop instruction when the pause instruction or the formatting stop instruction is received.
In some alternative embodiments, the tenth processing module specifically includes:
a sixth processing unit, configured to update a formatting status of the startup data in the FlashDB to a suspension status based on the suspension instruction;
and a seventh processing unit, configured to update the formatting status of the start data in the FlashDB to a formatting stop status based on the formatting stop instruction.
In some alternative embodiments, the apparatus further comprises:
and the eleventh processing module is used for judging whether startup data exists in the flash DB after the disk array card is restarted.
And the twelfth processing module is used for rebuilding the formatting flow based on the starting data when the starting data exists in the flashDB so as to continuously complete the formatting of the target volume corresponding to the starting data.
In some alternative embodiments, the twelfth processing module specifically includes:
and the eighth processing unit is used for initializing the formatting state of the target volume corresponding to the starting data, returning to the step of inquiring the flashDB by the starting state timer to acquire the current formatting state of the target volume in the starting data so as to continuously complete the formatting of the target volume.
In some alternative embodiments, the first processing module 801 further comprises:
a ninth processing unit, configured to perform validity check on a command parameter carried by the volume formatting operation request;
and a tenth processing unit, configured to determine the startup data based on the volume formatting operation request after the validity check passes.
In some alternative embodiments, the command parameters include: the ninth processing unit specifically includes:
the first processing subunit is used for respectively judging whether the identification, the volume identification and the formatting parameters of the disk array card are in the corresponding legal numerical value range;
The second processing subunit is used for determining that the validity check passes when the identification of the disk array card, the volume identification and the formatting parameter are all in the corresponding legal numerical value range;
and the third processing subunit is used for determining that the validity check is not passed when any one of the identification, the volume identification and the formatting parameters of the disk array card is not in the corresponding legal numerical range.
In some alternative embodiments, the apparatus further comprises:
and the thirteenth processing module is used for rejecting the volume formatting operation request when the validity check fails.
In some alternative embodiments, the disk array card is an NVMe-enabled device, and the user issues a volume formatting operation request, a pause instruction, and a formatting stop instruction to the disk array card through an NVMe protocol.
The volume formatting control of the disk array in this embodiment is presented in the form of functional units, where the units refer to ASIC circuits, processors and memory executing one or more software or fixed programs, and/or other devices that can provide the above functions.
Further functional descriptions of the above respective modules and units are the same as those of the above corresponding embodiments, and are not repeated here.
The embodiment of the invention also provides an electronic device, which is provided with the volume formatting control device of the disk array shown in the figure 8.
Referring to fig. 9, fig. 9 is a schematic structural diagram of an electronic device according to an alternative embodiment of the present invention, as shown in fig. 9, the electronic device includes: one or more processors 10, memory 20, and interfaces for connecting the various components, including high-speed interfaces and low-speed interfaces. The various components are communicatively coupled to each other using different buses and may be mounted on a common motherboard or in other manners as desired. The processor may process instructions executing within the computer device, including instructions stored in or on memory to display graphical information of the GUI on an external input/output device, such as a display device coupled to the interface. In some alternative embodiments, multiple processors and/or multiple buses may be used, if desired, along with multiple memories and multiple memories. Also, multiple computer devices may be connected, each providing a portion of the necessary operations (e.g., as a server array, a set of blade servers, or a multiprocessor system). One processor 10 is illustrated in fig. 9.
The processor 10 may be a central processor, a network processor, or a combination thereof. The processor 10 may further include a hardware chip, among others. The hardware chip may be an application specific integrated circuit, a programmable logic device, or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general-purpose array logic, or any combination thereof.
Wherein the memory 20 stores instructions executable by the at least one processor 10 to cause the at least one processor 10 to perform a method for implementing the embodiments described above.
The memory 20 may include a storage program area that may store an operating system, at least one application program required for functions, and a storage data area; the storage data area may store data created from the use of the computer device of the presentation of a sort of applet landing page, and the like. In addition, the memory 20 may include high-speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid-state storage device. In some alternative embodiments, memory 20 may optionally include memory located remotely from processor 10, which may be connected to the computer device via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
Memory 20 may include volatile memory, such as random access memory; the memory may also include non-volatile memory, such as flash memory, hard disk, or solid state disk; the memory 20 may also comprise a combination of the above types of memories.
The electronic device further comprises a communication interface 30 for the baseboard management controller to communicate with other devices or communication networks.
The embodiments of the present invention also provide a computer readable storage medium, and the method according to the embodiments of the present invention described above may be implemented in hardware, firmware, or as a computer code which may be recorded on a storage medium, or as original stored in a remote storage medium or a non-transitory machine readable storage medium downloaded through a network and to be stored in a local storage medium, so that the method described herein may be stored on such software process on a storage medium using a general purpose computer, a special purpose processor, or programmable or special purpose hardware. The storage medium can be a magnetic disk, an optical disk, a read-only memory, a random access memory, a flash memory, a hard disk, a solid state disk or the like; further, the storage medium may also comprise a combination of memories of the kind described above. It will be appreciated that a computer, processor, microprocessor controller or programmable hardware includes a storage element that can store or receive software or computer code that, when accessed and executed by the computer, processor or hardware, implements the methods illustrated by the above embodiments.
Although embodiments of the present invention have been described in connection with the accompanying drawings, various modifications and variations may be made by those skilled in the art without departing from the spirit and scope of the invention, and such modifications and variations fall within the scope of the invention as defined by the appended claims.

Claims (20)

1. A volume formatting control method of a disk array is applied to a disk array card, and the disk array card comprises the following steps: a non-volatile memory chip and an underlying chip firmware, the method comprising:
when a volume formatting operation request of a disk array is received, determining starting data based on the volume formatting operation request, wherein the starting data comprises formatting parameters required by formatting a target volume in the disk array and formatting states of the target volume;
storing the start data to the nonvolatile memory chip;
a starting state timer inquires the nonvolatile memory chip to acquire the current formatting state of the target volume in the starting data;
and calling the bottom chip firmware to format the target volume based on the formatting parameters based on the current formatting state of the target volume, and updating the formatting state of the starting data in the nonvolatile memory chip based on the formatting state fed back by the bottom chip firmware in the formatting process.
2. The method according to claim 1, wherein the method further comprises:
invoking a query progress interface of the bottom chip firmware in a formatting process to acquire current formatting parameters of the target volume;
and updating the formatting parameters of the starting data in the nonvolatile memory chip based on the current formatting parameters when the current formatting state is the in-process formatting state.
3. The method of claim 2, wherein formatting parameters include: the method comprises the steps of identifying a volume of a target volume, shifting a logical block address, a formatted completion length and formatted completion times, wherein the logical block address shifting is the shifting of a logical block address of a part of the volume which is already formatted by the target volume and a starting logical block address, and updating the formatting parameters of starting data in the nonvolatile memory chip based on the current formatting parameters, and comprises the following steps:
determining starting data corresponding to the volume identifier in the nonvolatile memory chip based on the volume identifier in the current formatting parameter;
and updating the logical block address offset, the formatted completion length and the formatted completion times in the starting data corresponding to the volume identifier in the nonvolatile memory chip into the corresponding current logical block address offset, the current formatted completion length and the current formatted completion times in the current formatting parameters.
4. The method according to claim 1, wherein the method further comprises:
and deleting the starting data in the nonvolatile memory chip and stopping the state timer when the current formatting state is any one of a complete formatting state, a formatting failure state and a formatting stopping state.
5. The method of claim 4, wherein when the current formatting status is any one of a complete formatting status, a formatting failure status, a formatting stopped status, the method further comprises:
and feeding back a formatting result of the target volume to a user based on the current formatting state so that the user can perform corresponding processing based on the formatting result.
6. The method according to claim 1, wherein the method further comprises:
and when the current formatting state is a pause state, maintaining starting data in the nonvolatile memory chip unchanged until a formatting restoration instruction is received, and restoring the process of formatting the target volume by the bottom chip firmware based on the starting data in the nonvolatile memory chip.
7. The method of any of claims 1-6, wherein updating the formatting status of the boot data in the non-volatile memory chip during formatting based on the formatting status fed back by the underlying chip firmware comprises:
when receiving the identification corresponding to the ongoing formatting from the formatting status fed back by the firmware of the bottom chip, updating the formatting status of the starting data in the nonvolatile memory chip to the ongoing formatting status;
when receiving the identification corresponding to the completion of the formatting, the formatting state of the starting data in the nonvolatile memory chip is updated to the completion of the formatting state;
and when receiving the identification that the formatting state fed back by the bottom chip firmware corresponds to the formatting error, updating the formatting state of the starting data in the nonvolatile memory chip into a formatting failure state.
8. The method according to claim 1, wherein the method further comprises:
and when receiving a pause instruction or a formatting stop instruction, interrupting the process of formatting the target volume by the bottom chip firmware.
9. The method of claim 8, wherein upon receiving a pause instruction or a format stop instruction, the method further comprises:
updating the formatting status of the start data in the nonvolatile memory chip based on the pause instruction or formatting stop instruction.
10. The method of claim 9, wherein updating the formatting status of the startup data in the nonvolatile memory chip based on the pause instruction or formatting stop instruction comprises:
updating the formatting state of the starting data in the nonvolatile memory chip into a pause state based on the pause instruction;
and updating the formatting status of the starting data in the nonvolatile memory chip into a formatting stop status based on the formatting stop instruction.
11. The method according to claim 2, wherein the method further comprises:
after restarting the disk array card, judging whether starting data exist in the nonvolatile memory chip;
and when the starting data exists in the nonvolatile memory chip, reconstructing a formatting flow based on the starting data so as to continuously complete formatting of the target volume corresponding to the starting data.
12. The method of claim 11, wherein the reconstructing a formatting process based on the startup data comprises:
initializing the formatting state of the target volume corresponding to the starting data, and returning to a step of inquiring the nonvolatile memory chip by a starting state timer to acquire the current formatting state of the target volume in the starting data so as to continuously complete the formatting of the target volume.
13. The method of claim 1, wherein prior to determining startup data based on the volume formatting operation request, the method further comprises:
carrying out validity check on command parameters carried by the volume formatting operation request;
after the validity check is passed, startup data is determined based on the volume formatting operation request.
14. The method of claim 13, wherein the command parameters include: the identification of the disk array card, the identification of the volume and the formatting parameters, wherein the validity check of the command parameters carried by the volume formatting operation request comprises the following steps:
respectively judging whether the identification, the volume identification and the formatting parameters of the disk array card are in the corresponding legal numerical ranges or not;
When the identification of the disk array card, the volume identification and the formatting parameters are all in the corresponding legal numerical value range, determining that the validity check is passed;
and when any one of the identification, the volume identification and the formatting parameters of the disk array card is not in the corresponding legal numerical range, determining that the validity check is not passed.
15. The method of claim 14, wherein when the validity check fails, the method further comprises:
rejecting the volume formatting operation request.
16. The method of any one of claims 8-15, wherein the disk array card is an NVMe enabled device, and a user issues a volume formatting operation request, a pause instruction, a formatting stop instruction, and a resume formatting instruction to the disk array card via an NVMe protocol.
17. A volume formatting control device of a disk array is applied to a disk array card, and the disk array card comprises: a non-volatile memory chip and an underlying chip firmware, the apparatus comprising:
the first processing module is used for determining starting data based on a volume formatting operation request of the disk array when the volume formatting operation request of the disk array is received, wherein the starting data comprises formatting parameters required by formatting a target volume in the disk array and formatting states of the target volume;
The second processing module is used for storing the starting data to the nonvolatile memory chip;
the third processing module is used for inquiring the nonvolatile memory chip by a starting state timer so as to acquire the current formatting state of the target volume in the starting data;
and the fourth processing module is used for calling the bottom chip firmware to format the target volume based on the current formatting state of the target volume, and updating the formatting state of the starting data in the nonvolatile memory chip based on the formatting state fed back by the bottom chip firmware in the formatting process.
18. A storage system, comprising: disk arrays, and disk array cards, wherein,
the disk array card includes: a nonvolatile memory chip and underlying chip firmware;
the disk array card formats a volume of disk arrays by performing the method of any one of claims 1-16.
19. An electronic device, comprising:
a memory and a processor in communication with each other, the memory having stored therein computer instructions which, upon execution, cause the processor to perform the method of any of claims 1 to 16.
20. A computer readable storage medium having stored thereon computer instructions for causing a computer to perform the method of any one of claims 1 to 16.
CN202311237705.0A 2023-09-25 2023-09-25 Volume formatting control method, device, system, equipment and medium of disk array Active CN116991328B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311237705.0A CN116991328B (en) 2023-09-25 2023-09-25 Volume formatting control method, device, system, equipment and medium of disk array

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311237705.0A CN116991328B (en) 2023-09-25 2023-09-25 Volume formatting control method, device, system, equipment and medium of disk array

Publications (2)

Publication Number Publication Date
CN116991328A true CN116991328A (en) 2023-11-03
CN116991328B CN116991328B (en) 2024-01-16

Family

ID=88525050

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311237705.0A Active CN116991328B (en) 2023-09-25 2023-09-25 Volume formatting control method, device, system, equipment and medium of disk array

Country Status (1)

Country Link
CN (1) CN116991328B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117311646A (en) * 2023-11-29 2023-12-29 苏州元脑智能科技有限公司 Solid state disk configuration management method and device, computer equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2009084071A1 (en) * 2007-12-27 2009-07-09 Fujitsu Limited Raid control device and raid system
CN102736864A (en) * 2012-06-19 2012-10-17 杭州海康威视数字技术股份有限公司 Method and device for formatting hard disk
CN115543217A (en) * 2022-11-29 2022-12-30 苏州浪潮智能科技有限公司 Data organization method, device, server and medium for independent redundant disk array
CN116339643A (en) * 2023-05-26 2023-06-27 苏州浪潮智能科技有限公司 Formatting method, formatting device, formatting equipment and formatting medium for disk array

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2009084071A1 (en) * 2007-12-27 2009-07-09 Fujitsu Limited Raid control device and raid system
CN102736864A (en) * 2012-06-19 2012-10-17 杭州海康威视数字技术股份有限公司 Method and device for formatting hard disk
CN115543217A (en) * 2022-11-29 2022-12-30 苏州浪潮智能科技有限公司 Data organization method, device, server and medium for independent redundant disk array
CN116339643A (en) * 2023-05-26 2023-06-27 苏州浪潮智能科技有限公司 Formatting method, formatting device, formatting equipment and formatting medium for disk array

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117311646A (en) * 2023-11-29 2023-12-29 苏州元脑智能科技有限公司 Solid state disk configuration management method and device, computer equipment and storage medium
CN117311646B (en) * 2023-11-29 2024-02-23 苏州元脑智能科技有限公司 Solid state disk configuration management method and device, computer equipment and storage medium

Also Published As

Publication number Publication date
CN116991328B (en) 2024-01-16

Similar Documents

Publication Publication Date Title
US10817386B2 (en) Virtual machine recovery method and virtual machine management device
CN103842968B (en) A kind of moving method of internal storage data, computing machine and device
CN116991328B (en) Volume formatting control method, device, system, equipment and medium of disk array
US10860447B2 (en) Database cluster architecture based on dual port solid state disk
KR20170040734A (en) Electronic system with update control mechanism and method of operation thereof
US10733066B2 (en) Persistent reservation commands in a distributed storage system
US10496608B2 (en) Synchronizing changes in a file system which are initiated by a storage device and a host device
JP2007323507A (en) Storage system and data processing method using the same
CN111049913B (en) Data file transmission method and device, storage medium and electronic equipment
CN111475335B (en) Method, system, terminal and storage medium for quickly recovering database
CN115562593A (en) Abnormal RAID member disk processing method, device and medium
CN112968970B (en) Configuration information backup method and device and network equipment
CN111930707B (en) Method and system for correcting drive letter of windows cloud migration
CN114328024A (en) PCIe function level reset implementation method and device, computer equipment and storage medium
CN104572350B (en) A kind of metadata processing method and device
CN116113931A (en) Freeing a data storage track while maintaining logical corruption protection
CN112860376A (en) Snapshot chain making method and device, electronic equipment and storage medium
CN112463032A (en) Performance optimization method, system and device for deduplication module of storage system
CN109271347B (en) Starting method, device and equipment for storage unit of distributed file system
JP2003114768A (en) Method of controlling external memory
CN117149071A (en) Volume migration method, device, computer equipment and storage medium
CN107862095B (en) Data processing method and device
CN107678838B (en) Method and device for tracking operation of virtual machine and virtual machine management platform
CN110941445A (en) Method for upgrading single chip microcomputer of double-chip system instrument
CN115827591A (en) Heterogeneous system migration data consistency verification method, device, terminal and medium

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