[go: up one dir, main page]

CN115951845B - Disk management method, device, equipment and storage medium - Google Patents

Disk management method, device, equipment and storage medium Download PDF

Info

Publication number
CN115951845B
CN115951845B CN202310239629.0A CN202310239629A CN115951845B CN 115951845 B CN115951845 B CN 115951845B CN 202310239629 A CN202310239629 A CN 202310239629A CN 115951845 B CN115951845 B CN 115951845B
Authority
CN
China
Prior art keywords
threshold
disk
disks
pointer
array card
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
CN202310239629.0A
Other languages
Chinese (zh)
Other versions
CN115951845A (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 CN202310239629.0A priority Critical patent/CN115951845B/en
Publication of CN115951845A publication Critical patent/CN115951845A/en
Application granted granted Critical
Publication of CN115951845B publication Critical patent/CN115951845B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • 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

Landscapes

  • Signal Processing For Digital Recording And Reproducing (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application discloses a disk management method, a device, equipment and a storage medium, and relates to the technical field of storage. The method comprises the following steps: acquiring a threshold domain, and defining a threshold for a disk array card according to the size of the threshold domain; taking bits contained in the threshold as bitmaps of the disks, and sequentially executing a hooking operation on the corresponding disks in the current threshold by moving a threshold pointer in the threshold; and moving the threshold after all the disks corresponding to the current threshold are hung, and sequentially executing hanging operation on the disks corresponding to the moved threshold by using the threshold finger until all the disks in the disk array card are hung. And the threshold pointer are utilized to manage the down-hanging operation of all the disks in the disk array card through a threshold moving algorithm, only resources with the threshold domain and the threshold pointer are occupied, the occupancy rate of memory resources is effectively reduced, and the speed of executing the down-hanging disk task of the disk array card is accelerated.

Description

一种磁盘管理方法、装置、设备及存储介质Disk management method, device, equipment and storage medium

技术领域technical field

本发明涉及存储技术领域,特别涉及一种磁盘管理方法、装置、设备及存储介质。The invention relates to the field of storage technology, in particular to a disk management method, device, equipment and storage medium.

背景技术Background technique

随着工业互联网的迅猛发展,越来越多的数据需要安全、可靠的存储在数据中心,因此存储技术在现在的工业互联网时代显得尤为重要。随着需要存储的数据量越来越大,单台存储服务器上运行的数据也日益增多,当单台存储服务器在容量和安全性上不足以支撑系统业务时,就需要将多个存储服务器以某种特定方式组合起来,对外作为一个存储系统来使用,才可满足实际需要。存储系统的最小管理单元是RAID阵列(即RedundantArrayofIndependentDisks,磁盘阵列,该阵列是由很多块独立的磁盘组合成一个容量巨大的磁盘组,利用个别磁盘提供数据所产生加成效果提升整个磁盘系统效能,利用这项技术,将数据切割成许多区段,分别存放在各个磁盘上),存储系统中各个存储服务器都以RAID阵列来管理磁盘,因此RAID技术是存储领域中的重要技术,目前包括RAID级别0、1、5、6、10、50、60,它们使用条带、镜像和校验来保证数据可靠性,并通过阵列中多个磁盘驱动并发处理I/O(Input/Output,输入/输出)以提高RAID阵列的I/O性能。With the rapid development of the industrial Internet, more and more data needs to be stored safely and reliably in the data center, so storage technology is particularly important in the current era of the industrial Internet. With the increasing amount of data to be stored, the data running on a single storage server is also increasing. When the capacity and security of a single storage server are not enough to support the system business, it is necessary to combine multiple storage servers with Only when they are combined in a specific way and used externally as a storage system can they meet actual needs. The smallest management unit of the storage system is the RAID array (that is, RedundantArrayofIndependentDisks, disk array, which is composed of many independent disks to form a large-capacity disk group, using individual disks to provide data. The bonus effect improves the performance of the entire disk system. Using this technology, the data is cut into many sections and stored on each disk respectively), and each storage server in the storage system uses a RAID array to manage the disks, so RAID technology is an important technology in the storage field, currently including RAID levels 0, 1, 5, 6, 10, 50, 60, they use striping, mirroring, and parity to ensure data reliability, and concurrently process I/O (Input/Output, input/output) through multiple disk drives in the array ) to improve the I/O performance of the RAID array.

过去存储服务器中都使用软RAID存储技术,存储中的一些算法、数据管理以及一些功能都交给软件管理和实现,整个过程没有硬件参与,由于没有硬件分担RAID阵列几何空间管理等等复杂功能,因此过去存储服务器的存储性能较低。而近些年随着半导体芯片的高速发展,硬RAID存储技术(RAID卡,磁盘阵列卡)也应运而生,RAID卡是为了提高存储中心的I/O性能和数据安全性而在软RAID存储技术基础上提出的硬RAID存储技术,顾名思义硬RAID存储技术就是将软RAID存储技术中的一些算法、数据管理以及一些功能都交给硬件管理和实现,以达到提高存储系统的I/O性能和数据安全性。物理连接层面来讲,RAID卡就是实现将存储服务器连接的磁盘按照RAID级别组织成多个RAID阵列的功能板卡,技术人员将一个或多个RAID卡通过存储服务器预留的PCIe插槽插到存储服务器上供用户使用。In the past, soft RAID storage technology was used in storage servers. Some algorithms, data management, and some functions in storage were managed and implemented by software. The whole process was not involved in hardware. Since there was no hardware to share complex functions such as RAID array geometric space management, Therefore, the storage performance of the storage server was low in the past. In recent years, with the rapid development of semiconductor chips, hard RAID storage technology (RAID card, disk array card) has emerged at the historic moment. RAID card is to improve the I/O performance and data security of storage center The hard RAID storage technology proposed on the basis of technology, as the name implies, the hard RAID storage technology is to hand over some algorithms, data management and some functions in the soft RAID storage technology to hardware management and implementation, so as to improve the I/O performance and data security. In terms of physical connection, a RAID card is a functional board that organizes the disks connected to the storage server into multiple RAID arrays according to the RAID level. The technician inserts one or more RAID cards into the stored on the server for user use.

大型存储中心的存储容量是巨大的,单个磁盘的容量是非常有限的,因此目前部署在大型存储服务器的RAID卡需要下挂几十万个磁盘。RAID卡管理下挂几十万个磁盘的过程会消耗大量时间,导致用户体验下降,并且在前台紧急I/O任务情况下存在RAID卡管理下挂磁盘出错的风险。目前业界技术在RAID卡下挂磁盘的管理采用Bit位组织方式,这是一个由比特位(Bit)组成的一维线性表,其中每个Bit代表一个磁盘。这种Bit位组织方式在大型大容量RAID阵列中存在不足,Bit位组织方式会占用大量内存资源,会导致大型存储中心中每个RAID卡在管理下挂磁盘时需要很长时间,当用户增加RAID卡时,会消耗更多时间。当用户需要RAID卡管理1PB容量的存储空间,假如一个磁盘有16G容量,因此RAID卡需要管理1PB/16G个磁盘即管理65536个磁盘,根据一个磁盘对应一位则需要65536位,换算为(65536/8)个8192个字节,由此得出需要8192个字节的内存空间来存放Bit位,8192个字节占用大量内存资源空间,导致RAID卡管理下挂的磁盘过程变慢,影响用户在RAID卡执行的业务,致使用户使用RAID卡的体验下降。即Bit位组织方式消耗大量的内存资源,不仅导致RAID卡启动时管理下挂磁盘耗时增加而且会降低用户使用RAID卡的体验感,并且在前台紧急I/O任务情况下存在RAID卡管理下挂磁盘出错的风险。The storage capacity of a large storage center is huge, but the capacity of a single disk is very limited. Therefore, the RAID card currently deployed on a large storage server needs to have hundreds of thousands of disks attached to it. The process of attaching hundreds of thousands of disks under the management of the RAID card will consume a lot of time, resulting in a decline in user experience, and there is a risk of errors when the disks attached to the RAID card are managed in the case of an emergency I/O task in the foreground. At present, the technology in the industry adopts the Bit organization method for the management of the disks attached to the RAID card. This is a one-dimensional linear table composed of bits, where each Bit represents a disk. This bit organization method is insufficient in large-capacity RAID arrays. The bit organization method will occupy a large amount of memory resources, and it will take a long time for each RAID card in a large storage center to be connected to a disk under management. When users increase When using a RAID card, it will consume more time. When the user needs a RAID card to manage 1PB of storage space, if a disk has a capacity of 16G, the RAID card needs to manage 1PB/16G disks, that is, 65536 disks. According to the corresponding bit of a disk, 65536 bits are required, which is converted to (65536 /8) 8192 bytes, thus it can be concluded that 8192 bytes of memory space are needed to store Bit bits, and 8192 bytes occupy a large amount of memory resource space, which will slow down the disk process under RAID card management and affect users The services performed on the RAID card degrade the user experience of using the RAID card. That is, the bit organization method consumes a large amount of memory resources, which not only increases the time-consuming management of the attached disks when the RAID card is started, but also reduces the user experience of using the RAID card, and in the case of emergency I/O tasks in the foreground, there is a problem with the RAID card management. Risk of disk failure.

发明内容Contents of the invention

有鉴于此,本发明的目的在于提供一种磁盘管理方法、装置、设备及介质,能够有效降低内存资源占用率,加快磁盘阵列卡执行下挂磁盘任务的速度。其具体方案如下:In view of this, the purpose of the present invention is to provide a disk management method, device, equipment and medium, which can effectively reduce the memory resource occupancy rate and speed up the disk array card to perform the task of attaching the disk. The specific plan is as follows:

第一方面,本申请公开了一种磁盘管理方法,包括:In a first aspect, the present application discloses a disk management method, including:

获取门限域,根据所述门限域的大小定义针对磁盘阵列卡的门限;Acquire a threshold domain, and define a threshold for a disk array card according to the size of the threshold domain;

将所述门限包含的比特位作为磁盘的位图,通过在所述门限内移动门限指针对当前门限内对应的磁盘依次执行下挂操作;Using the bits contained in the threshold as the bitmap of the disk, performing the hanging operation on the corresponding disks in the current threshold in sequence by moving the threshold pointer in the threshold;

在当前门限内对应的所有磁盘均下挂完成后移动所述门限,并利用门限指针对移动后门限内对应的磁盘依次执行下挂操作,直至所述磁盘阵列卡中所有磁盘下挂完成。After all the disks corresponding to the current threshold are connected, the threshold is moved, and the corresponding disks in the moved threshold are used to perform the connection operation in sequence by using the threshold pointer until all the disks in the disk array card are connected.

可选的,所述在当前门限内对应的所有磁盘均下挂完成后,移动所述门限,并利用门限指针对移动后门限内对应的磁盘依次进行下挂操作,直至所述磁盘阵列卡中所有磁盘下挂完成的过程中,包括:Optionally, after all the disks corresponding to the current threshold are installed, move the threshold, and use the threshold pointer to perform the installation operation on the disks corresponding to the moved threshold in sequence until the disk array card During the process of attaching all disks, including:

确定所述门限的移动次数以及所述门限指针的偏移量;determining the number of moves of the threshold and the offset of the threshold pointer;

根据所述门限占用的比特位的数量、所述移动次数、所述偏移量以及所述磁盘阵列卡内磁盘的总数量,判断所述磁盘阵列卡中所有磁盘是否均下挂完成。According to the number of bits occupied by the threshold, the number of times of movement, the offset and the total number of disks in the disk array card, it is judged whether all the disks in the disk array card have been connected.

可选的,所述根据所述门限占用的比特位的数量、所述移动次数、所述偏移量以及所述磁盘阵列卡内磁盘的总数量,判断所述磁盘阵列卡中所有磁盘是否均下挂完成之前,还包括:Optionally, according to the number of bits occupied by the threshold, the number of times of movement, the offset, and the total number of disks in the disk array card, it is judged whether all the disks in the disk array card are Before the hanging is completed, it also includes:

根据磁盘阵列卡的容量确定所述磁盘阵列卡内磁盘的总数量。The total number of disks in the disk array card is determined according to the capacity of the disk array card.

可选的,所述根据所述门限占用的比特位的数量、所述移动次数、所述偏移量以及所述磁盘阵列卡内磁盘的总数量,判断所述磁盘阵列卡中所有磁盘是否均下挂完成,包括:Optionally, according to the number of bits occupied by the threshold, the number of times of movement, the offset, and the total number of disks in the disk array card, it is judged whether all the disks in the disk array card are The hanging is completed, including:

根据所述门限占用的比特位的数量、所述移动次数和所述偏移量,确定所述磁盘阵列卡中已执行下挂操作的磁盘数量;According to the number of bits occupied by the threshold, the number of times of movement, and the offset, determine the number of disks in the disk array card that have performed the downlink operation;

若所述磁盘阵列卡中已执行下挂操作的磁盘数量等于所述磁盘阵列卡内磁盘的总数量,则判定所述磁盘阵列卡中所有磁盘均下挂完成。If the number of disks in the disk array card that have performed the downlink operation is equal to the total number of disks in the disk array card, it is determined that all the disks in the disk array card have been downlinked.

可选的,所述通过在所述门限内移动门限指针对当前门限内对应的磁盘依次执行下挂操作,包括:Optionally, performing the hanging operation on the corresponding disks within the current threshold in sequence by moving the threshold pointer within the threshold includes:

根据当前所述门限指针指向的比特位中的符号,判断当前所述门限指针指向的磁盘是否下挂完毕;所述门限中的比特位用于表征对应的磁盘是否被下挂。According to the sign in the bit pointed by the current threshold pointer, it is judged whether the disk pointed to by the threshold pointer is currently installed; the bit in the threshold is used to indicate whether the corresponding disk is installed.

可选的,所述判断当前所述门限指针指向的磁盘是否下挂完毕之后,还包括:Optionally, after the judging whether the disk currently pointed to by the threshold pointer has been downloaded, it also includes:

若是当前所述门限指针指向的磁盘未下挂完毕,则对当前所述门限指针指向的磁盘执行下挂操作。If the disk currently pointed to by the threshold pointer has not been mounted yet, perform a mount operation on the disk currently pointed to by the threshold pointer.

可选的,所述判断当前所述门限指针指向的磁盘是否下挂完毕之后,还包括:Optionally, after the judging whether the disk currently pointed to by the threshold pointer has been downloaded, it also includes:

若当前所述门限指针指向的磁盘已下挂完毕,移动所述门限指针指向下一个比特位。If the disk currently pointed by the threshold pointer has been mounted, move the threshold pointer to point to the next bit.

可选的,所述通过在所述门限内移动门限指针对当前门限内对应的磁盘依次执行下挂操作的过程中,还包括:Optionally, the process of sequentially performing the hanging operation on the corresponding disks within the current threshold by moving the threshold pointer within the threshold further includes:

根据所述门限指针在门限内的偏移量与所述门限占用的比特位数量之间的大小关系,判断当前门限内对应的所有磁盘是否均下挂完成。According to the size relationship between the offset of the threshold pointer within the threshold and the number of bits occupied by the threshold, it is judged whether all the disks corresponding to the current threshold have been installed.

可选的,所述在当前门限内对应的所有磁盘均下挂完成后移动所述门限,包括:Optionally, moving the threshold after all the corresponding disks within the current threshold are downlinked includes:

若当前门限内对应的所有磁盘均下挂完成,则移动所述门限以使所述门限对应的比特位都清零。If all the corresponding disks within the current threshold have been mounted, the threshold is moved so that the bits corresponding to the threshold are all cleared.

可选的,所述判断当前门限内对应的所有磁盘是否均下挂完成之后,还包括:Optionally, after the judging whether all the disks corresponding to the current threshold have been hung up, it also includes:

若当前门限内对应的所有磁盘存在没有下挂完成的磁盘,则继续执行所述通过在所述门限内移动门限指针对当前门限内对应的磁盘依次执行下挂操作的步骤。If all the corresponding disks within the current threshold have unmounted disks, continue to execute the step of sequentially performing the demounting operation on the corresponding disks within the current threshold by moving the threshold pointer within the threshold.

可选的,所述获取门限域,包括:Optionally, the acquiring threshold domain includes:

从内存申请目标字节大小的第一无符号数据;Apply for the first unsigned data of the target byte size from the memory;

将所述第一无符号数据展开得到对应的目标数量比特位,基于所述目标数量比特位得到门限域。Expanding the first unsigned data to obtain a corresponding target number of bits, and obtaining a threshold field based on the target number of bits.

可选的,所述将所述第一无符号数据展开得到对应的目标数量比特位,基于所述目标数量比特位得到门限域,包括:Optionally, said expanding the first unsigned data to obtain the corresponding target number of bits, and obtaining a threshold field based on the target number of bits includes:

通过所述磁盘阵列卡内固件层的磁盘管理硬件模块,执行所述将所述第一无符号数据展开得到对应的目标数量比特位,基于所述目标数量比特位得到门限域的操作。Through the disk management hardware module of the firmware layer in the disk array card, the operation of expanding the first unsigned data to obtain the corresponding target quantity bits and obtaining the threshold field based on the target quantity bits is performed.

可选的,所述将所述门限包含的比特位作为磁盘的位图,利用门限指针对当前门限内对应的磁盘依次进行下挂操作之前,还包括:Optionally, before using the bits contained in the threshold as the bitmap of the disk, and using the threshold pointer to sequentially perform the downloading operation on the corresponding disks within the current threshold, the method also includes:

从内存申请目标字节大小的第二无符号数据,并将所述第二无符号数据作为门限指针。Applying for second unsigned data of the target byte size from memory, and using the second unsigned data as a threshold pointer.

可选的,所述将所述第二无符号数据作为门限指针,包括:Optionally, using the second unsigned data as a threshold pointer includes:

通过所述磁盘阵列卡内固件层的磁盘管理硬件模块,执行所述将所述第二无符号数据作为门限指针的操作。The operation of using the second unsigned data as a threshold pointer is performed by the disk management hardware module of the firmware layer in the disk array card.

可选的,所述根据所述门限域的大小定义针对磁盘阵列卡的门限,包括:Optionally, the defining the threshold for the disk array card according to the size of the threshold domain includes:

根据所述门限域的大小,通过宏定义方式定义针对磁盘阵列卡的门限;According to the size of the threshold domain, define the threshold for the disk array card through macro definition;

相应的,所述种磁盘管理方法,还包括:Correspondingly, the disk management method also includes:

通过修改所述宏定义中的字符串修改所述门限。Modify the threshold by modifying the character string in the macro definition.

可选的,所述通过在所述门限内移动门限指针对当前门限内对应的磁盘依次执行下挂操作,包括:Optionally, performing the hanging operation on the corresponding disks within the current threshold in sequence by moving the threshold pointer within the threshold includes:

确定所述磁盘阵列卡中起始下挂磁盘的逻辑设备号;Determining the logical device number of the initial downlink disk in the disk array card;

将所述门限指针调整至门限内的第一个比特位,根据所述逻辑设备号从所述起始下挂磁盘处执行下挂操作。Adjusting the threshold pointer to the first bit in the threshold, and performing a download operation from the initial download disk according to the logical device number.

可选的,所述确定所述磁盘阵列卡中起始下挂磁盘的逻辑设备号,包括:Optionally, the determining the logical device number of the initial attached disk in the disk array card includes:

若获取到用户发送的目标逻辑设备号,将所述目标逻辑设备号作为所述磁盘阵列卡中起始下挂磁盘的逻辑设备号;If the target logical device number sent by the user is obtained, the target logical device number is used as the logical device number of the initial downlink disk in the disk array card;

若未获取到用户发送的目标逻辑设备号,则将首个逻辑设备号作为所述磁盘阵列卡中起始下挂磁盘的逻辑设备号。If the target logical device number sent by the user is not obtained, the first logical device number is used as the logical device number of the first connected disk in the disk array card.

第二方面,本申请公开了一种磁盘管理装置,包括:In a second aspect, the present application discloses a disk management device, including:

门限确定模块,用于获取门限域,根据所述门限域的大小定义针对磁盘阵列卡的门限;A threshold determination module, configured to obtain a threshold domain, and define a threshold for a disk array card according to the size of the threshold domain;

下挂模块,用于将所述门限包含的比特位作为磁盘的位图,通过在所述门限内移动门限指针对当前门限内对应的磁盘依次执行下挂操作;The hanging module is used to use the bits contained in the threshold as the bitmap of the disk, and perform the hanging operation sequentially on the corresponding disks in the current threshold by moving the threshold pointer within the threshold;

门限移动模块,用于在当前门限内对应的所有磁盘均下挂完成后移动所述门限,并利用门限指针对移动后门限内对应的磁盘依次执行下挂操作,直至所述磁盘阵列卡中所有磁盘下挂完成。The threshold moving module is used to move the threshold after all the disks corresponding to the current threshold are mounted, and use the threshold pointer to perform the mounting operation on the disks corresponding to the moved threshold in sequence until all disks in the disk array card Disk installation is complete.

第三方面,本申请公开了一种电子设备,包括:In a third aspect, the present application discloses an electronic device, comprising:

存储器,用于保存计算机程序;memory for storing computer programs;

处理器,用于执行所述计算机程序,以实现前述的磁盘管理方法。A processor, configured to execute the computer program to implement the aforementioned disk management method.

第四方面,本申请公开了一种计算机可读存储介质,用于存储计算机程序;其中计算机程序被处理器执行时实现前述的磁盘管理方法。In a fourth aspect, the present application discloses a computer-readable storage medium for storing a computer program; wherein when the computer program is executed by a processor, the aforementioned disk management method is implemented.

本申请中,获取门限域,根据所述门限域的大小定义针对磁盘阵列卡的门限;将所述门限包含的比特位作为磁盘的位图,通过在所述门限内移动门限指针对当前门限内对应的磁盘依次执行下挂操作;在当前门限内对应的所有磁盘均下挂完成后移动所述门限,并利用门限指针对移动后门限内对应的磁盘依次执行下挂操作,直至所述磁盘阵列卡中所有磁盘下挂完成。可见,利用门限和门限指针通过门限移动算法管理磁盘阵列卡中所有磁盘的下挂操作,只需占用门限域和门限指针大小的资源,有效降低内存资源占用率,并且加快磁盘阵列卡执行下挂磁盘任务的速度。In the present application, the threshold field is obtained, and the threshold for the disk array card is defined according to the size of the threshold field; the bits contained in the threshold are used as the bitmap of the disk, and the threshold pointer is moved within the threshold to the current threshold. The corresponding disks are attached in sequence; after all the corresponding disks within the current threshold are attached, the threshold is moved, and the threshold pointer is used to perform the installation operation on the corresponding disks within the moved threshold in turn until the disk array All the disks in the card have been attached. It can be seen that using the threshold and the threshold pointer to manage the mounting operation of all the disks in the disk array card through the threshold moving algorithm only needs to occupy resources of the size of the threshold field and the threshold pointer, effectively reducing the memory resource occupation rate, and speeding up the disk array card to perform the mounting operation. The speed of disk tasks.

附图说明Description of drawings

为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据提供的附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only It is an embodiment of the present invention, and those skilled in the art can also obtain other drawings according to the provided drawings without creative work.

图1为本申请提供的一种磁盘管理方法流程图;Fig. 1 is a flow chart of a disk management method provided by the present application;

图2为本申请提供的一种具体的存储系统中RAID卡结构图;Fig. 2 is a structural diagram of a RAID card in a specific storage system provided by the present application;

图3为本申请提供的一种具体的磁盘管理方法流程图;FIG. 3 is a flow chart of a specific disk management method provided by the present application;

图4为本申请提供的一种具体的磁盘管理方法流程图;FIG. 4 is a flow chart of a specific disk management method provided by the present application;

图5为本申请提供的一种磁盘管理装置结构示意图;FIG. 5 is a schematic structural diagram of a disk management device provided by the present application;

图6为本申请提供的一种电子设备结构图。FIG. 6 is a structural diagram of an electronic device provided by the present application.

具体实施方式Detailed ways

为使本发明实施例的目的、技术方案和优点更加清楚,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments It is only some embodiments of the present invention, but not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts belong to the protection scope of the present invention.

现有技术中,在RAID卡下挂磁盘的管理采用Bit位组织方式,这种Bit位组织方式在大型大容量RAID阵列中存在不足,Bit位组织方式会占用大量内存资源,会导致大型存储中心中每个RAID卡在管理下挂磁盘时需要很长时间,当用户增加RAID卡时,会消耗更多时间。为克服上述技术问题,本申请提出一种磁盘管理方法,能够有效降低内存资源占用率,加快磁盘阵列卡执行下挂磁盘任务的速度。In the prior art, the management of the disks attached to the RAID card adopts the Bit organization method. This Bit organization method is insufficient in large-scale and large-capacity RAID arrays. The Bit organization method will occupy a large amount of memory resources, which will lead to large storage centers. It takes a long time to attach disks to each RAID card under management. When the user adds a RAID card, it will consume more time. In order to overcome the above-mentioned technical problems, the present application proposes a disk management method, which can effectively reduce the memory resource occupancy rate and speed up the disk array card's execution of the attached disk task.

本申请实施例公开了一种磁盘管理方法,参见图1所示,该方法可以包括以下步骤:The embodiment of the present application discloses a disk management method, as shown in FIG. 1, the method may include the following steps:

步骤S11:获取门限域,根据所述门限域的大小定义针对磁盘阵列卡的门限。Step S11: Obtain a threshold domain, and define a threshold for a disk array card according to the size of the threshold domain.

本实施例中,首先获取门限域,然后根据门限域的大小定义针对磁盘阵列卡的门限,上述门限域具体可以为基于预留的目标字节大小的无符号数据生成的。具体的,上述获取门限域,可以包括:从内存申请目标字节大小的第一无符号数据;将所述第一无符号数据展开得到对应的目标数量比特位,基于所述目标数量比特位得到门限域。例如,将第一个无符号四字节数据展开成32个Bit位,用这32个Bit位形成单次能管理32个磁盘的门限阈。In this embodiment, the threshold field is obtained first, and then the threshold for the disk array card is defined according to the size of the threshold field. The above threshold field may specifically be generated based on unsigned data with a reserved target byte size. Specifically, the above-mentioned acquisition threshold field may include: applying for the first unsigned data of the target byte size from the memory; expanding the first unsigned data to obtain the corresponding target number of bits, and obtaining the corresponding target number of bits based on the target number of bits threshold domain. For example, expand the first unsigned four-byte data into 32 Bits, and use these 32 Bits to form a threshold that can manage 32 disks at a time.

本实施例中,所述将所述第一无符号数据展开得到对应的目标数量比特位,基于所述目标数量比特位得到门限域,可以包括:通过所述磁盘阵列卡内固件层的磁盘管理硬件模块,执行所述将所述第一无符号数据展开得到对应的目标数量比特位,基于所述目标数量比特位得到门限域的操作。In this embodiment, said expanding the first unsigned data to obtain the corresponding target number bits, and obtaining the threshold field based on the target number bits may include: through the disk management of the firmware layer in the disk array card The hardware module executes the operation of expanding the first unsigned data to obtain a corresponding target number of bits, and obtaining a threshold field based on the target number of bits.

可以理解的是,例如图2所示为存储系统中RAID卡的结构图,110指示的磁盘管理硬件模块,RAID卡中固件层包括驱动程序、RAID卡内核、文件系统、管理监控系统、磁盘管理硬件模块等等,RAID卡内核和文件系统可以提供对文件和逻辑单元号访问的功能,以及对这些功能的管,RAID卡中固件层的驱动程序和处理器执行一些程序指令,用于处理主机I/O请求。如图2所示,130指示的磁盘组1构成1号RAID阵列,磁盘组2构成2号RAID阵列,以此类推,磁盘组N构成N号RAID阵列。1号RAID阵列、2号RAID阵列......N号RAID阵列一起构成RAID组。140指示的RAID卡控制器负责RAID卡中的软件处理功能,由RAID卡控制器专门实现软件功能,硬件模块执行一些算法、数据管理以及其他一些功能,以此实现软硬分离,硬件和软件各自独立、平行工作,通过软硬分离系统架构设计提高RAID卡管理下挂磁盘的性能。本实施例中,客户端用户输入RAID卡需要下挂的所有磁盘,直到RAID卡完成下挂所有磁盘后返回给用户。例如,磁盘管理硬件模块将第一个无符号四字节数据展开成32个Bit位,用32个Bit位形成管理32个磁盘的门限阈,磁盘管理硬件模块将第二个无符号四字节数据作为门限指针使用。It can be understood that, for example, FIG. 2 shows a structural diagram of a RAID card in a storage system, the disk management hardware module indicated by 110, and the firmware layer in the RAID card includes a driver program, a RAID card kernel, a file system, a management monitoring system, and a disk management system. Hardware modules, etc., the RAID card kernel and file system can provide functions for accessing files and logical unit numbers, as well as the management of these functions. The driver and processor of the firmware layer in the RAID card execute some program instructions for processing the host computer. I/O requests. As shown in FIG. 2 , disk group 1 indicated by 130 constitutes RAID array No. 1, disk group 2 constitutes RAID array No. 2, and so on, disk group N constitutes RAID array No. N. The RAID array No. 1, the RAID array No. 2...the RAID array N together form a RAID group. The RAID card controller indicated by 140 is responsible for the software processing function in the RAID card. The RAID card controller is dedicated to realize the software function, and the hardware module executes some algorithms, data management and other functions, so as to realize the separation of software and hardware. The hardware and software are separate Work independently and in parallel, and improve the performance of the disks under RAID card management through the system architecture design of the separation of software and hardware. In this embodiment, the client user inputs all the disks that need to be attached to the RAID card, and returns to the user after the RAID card completes attaching all the disks. For example, the disk management hardware module expands the first unsigned four-byte data into 32 Bits, and uses 32 Bits to form the threshold for managing 32 disks, and the disk management hardware module converts the second unsigned four-byte The data is used as a threshold pointer.

采用软硬分离的设计思路,硬件和软件各自独立、平行工作,并在硬件中新增磁盘管理硬件模块,RAID卡控制器负责软件功能,通过软硬分离系统架构设计提高RAID卡执行下挂磁盘任务过程中数据安全性和I/O性能。Adopting the design idea of separation of software and hardware, hardware and software work independently and in parallel, and a new disk management hardware module is added to the hardware. The RAID card controller is responsible for software functions. Through the system architecture design of the separation of software and hardware, the RAID card executes the attached disk. Data security and I/O performance during tasks.

本实施例中,所述根据所述门限域的大小定义针对磁盘阵列卡的门限,可以包括:根据所述门限域的大小,通过宏定义方式定义针对磁盘阵列卡的门限;相应的,所述种磁盘管理方法,还可以包括:通过修改所述宏定义中的字符串修改所述门限。宏定义又称为宏代换、宏替换,简称“宏”,格式为“#define标识符字符串”,其中的标识符就是所谓的符号常量,也称为“宏名”,使用宏定义后便于统一修改,如若底层编码中包含多处门限值,需要修改门限时直接修改一次定义中的字符串即可。In this embodiment, the defining the threshold for the disk array card according to the size of the threshold domain may include: defining the threshold for the disk array card through a macro definition according to the size of the threshold domain; correspondingly, the A disk management method may further include: modifying the threshold by modifying a character string in the macro definition. Macro definition is also called macro substitution, macro replacement, referred to as "macro", the format is "#define identifier string", the identifier is the so-called symbol constant, also called "macro name", after using the macro definition It is convenient for unified modification. If the underlying code contains multiple threshold values, you can directly modify the string in the definition once when you need to modify the threshold.

步骤S12:将所述门限包含的比特位作为磁盘的位图,通过在所述门限内移动门限指针对当前门限内对应的磁盘依次执行下挂操作。Step S12: Use the bits included in the threshold as a bitmap of the disk, and sequentially perform the attaching operation on the corresponding disks within the current threshold by moving the threshold pointer within the threshold.

本实施例中,将上述门限包含的比特位作为磁盘的位图,通过在所述门限内移动门限指针对当前门限内对应的磁盘依次执行下挂操作,上述门限指针的大小与门限相同,具体也可以为基于预留的目标字节大小的无符号数据生成的。具体的,所述将所述门限包含的比特位作为磁盘的位图,利用门限指针对当前门限内对应的磁盘依次进行下挂操作之前,还可以包括:从内存申请目标字节大小的第二无符号数据,并将所述第二无符号数据作为门限指针。如一个无符号四字节数据展开成32个Bit位,用32个Bit位形成管理32个磁盘的门限阈,另一个无符号四字节数据是门限指针。In this embodiment, the bits included in the above-mentioned threshold are used as the bitmap of the disk, and by moving the threshold pointer within the threshold, the corresponding disks in the current threshold are sequentially connected to the disk. The size of the above-mentioned threshold pointer is the same as the threshold, specifically Can also be generated for unsigned data based on the reserved target byte size. Specifically, before using the bits contained in the threshold as the bitmap of the disk, and using the threshold pointer to sequentially perform the hanging operation on the corresponding disks within the current threshold, it may also include: applying for the second byte of the target byte size from the memory unsigned data, and use the second unsigned data as a threshold pointer. For example, an unsigned four-byte data is expanded into 32 Bits, and 32 Bits are used to form a threshold for managing 32 disks, and another unsigned four-byte data is a threshold pointer.

本实施例中,所述将所述第二无符号数据作为门限指针,可以包括:通过所述磁盘阵列卡内固件层的磁盘管理硬件模块,执行所述将所述第二无符号数据作为门限指针的操作。即磁盘管理硬件模块将第二个无符号数据作为门限指针使用,由此通过两个无符号数据跟踪RAID卡中所有下挂的磁盘。即在RAID卡中新增磁盘管理硬件模块,该模块维护用到的两个目标字节大小的无符号数据,In this embodiment, using the second unsigned data as a threshold pointer may include: performing the using the second unsigned data as a threshold through a disk management hardware module of the firmware layer in the disk array card. Pointer operations. That is, the disk management hardware module uses the second unsigned data as a threshold pointer, thereby tracking all the disks attached to the RAID card through the two unsigned data. That is, a new disk management hardware module is added to the RAID card, and this module maintains unsigned data of two target byte sizes,

以32个Bit位为例,32个Bit位是管理门限阈内需要执行下挂任务的32个磁盘的位图,门限指针DoorPointer是指向需要执行下挂任务的磁盘。用PK_Bit_DOOR作为宏定义的门限大小,默认为32,因为此时采用32个Bit位的门限阈;当然也可以使用无符号八字节数据,这样就是将无符号八字节数据展开后64个Bit位的门限阈,那么相应的PK_Bit_DOOR宏定义的门限大小为64。如下所示为32个Bit位门限:Taking 32 Bits as an example, the 32 Bits are bitmaps of 32 disks that need to perform download tasks within the management threshold, and the threshold pointer DoorPointer points to the disks that need to perform download tasks. Use PK_Bit_DOOR as the threshold size defined by the macro, and the default is 32, because the threshold threshold of 32 Bits is used at this time; of course, unsigned eight-byte data can also be used, so that 64 Bits after expanding the unsigned eight-byte data Bit threshold, then the threshold size defined by the corresponding PK_Bit_DOOR macro is 64. The 32-bit threshold is shown below:

Figure SMS_1
Figure SMS_1
;

本实施例中,所述通过在所述门限内移动门限指针对当前门限内对应的磁盘依次执行下挂操作之后,还可以包括:修改下挂磁盘对应的比特位的内容。即每下挂一个磁盘后,将该磁盘对应在门限中的比特位上的内容进行修改,如采用0表征未下挂1表征下挂,或用1表征未下挂0表征下挂。In this embodiment, after the step of moving the threshold pointer within the threshold and sequentially performing the attaching operations on the disks corresponding to the current threshold, it may further include: modifying the contents of the bits corresponding to the attached disks. That is, after each disk is installed, modify the content of the disk corresponding to the bit in the threshold, for example, use 0 to indicate that it is not installed, and 1 to indicate that it is installed, or use 1 to indicate that it is not installed and 0 to indicate that it is installed.

本实施例中,所述通过在所述门限内移动门限指针对当前门限内对应的磁盘依次执行下挂操作,可以包括:根据当前所述门限指针指向的比特位中的符号,判断当前所述门限指针指向的磁盘是否下挂完毕;所述门限中的比特位用于表征对应的磁盘是否被下挂。即在执行磁盘下挂前,根据当前门限指针指向的比特位中的符号判断对应的磁盘是否已经执行了下挂操作,再根据判断结果执行相应的操作。In this embodiment, the sequentially performing the downloading operation on the corresponding disks within the current threshold by moving the threshold pointer within the threshold may include: judging the current Whether the disk pointed by the threshold pointer has been mounted; the bits in the threshold are used to indicate whether the corresponding disk has been mounted. That is, before the disk is mounted, it is judged according to the symbol in the bit pointed by the current threshold pointer whether the corresponding disk has performed the mount operation, and then the corresponding operation is performed according to the judgment result.

本实施例中,所述判断当前所述门限指针指向的磁盘是否下挂完毕之后,还可以包括:若是当前所述门限指针指向的磁盘未下挂完毕,则对当前所述门限指针指向的磁盘执行下挂操作。本实施例中,所述判断当前所述门限指针指向的磁盘是否下挂完毕之后,还可以包括:若当前所述门限指针指向的磁盘已下挂完毕,移动所述门限指针指向下一个比特位。即若当前门限指针指向的磁盘未执行下挂,则对该磁盘进行下挂,若已经下挂则移动门限指针指向下一个比特位,以便对下一个磁盘进行下挂。In this embodiment, after the judging whether the disk currently pointed to by the threshold pointer has been downloaded, it may further include: if the disk currently pointed to by the threshold pointer has not been downloaded, then the disk currently pointed to by the threshold pointer Perform the hanging operation. In this embodiment, after the judging whether the disk currently pointed to by the threshold pointer has been mounted, it may further include: if the disk currently pointed to by the threshold pointer has been mounted, moving the threshold pointer to point to the next bit . That is, if the disk pointed to by the current threshold pointer has not been mounted, then the disk is mounted. If it has been mounted, the threshold pointer is moved to point to the next bit, so that the next disk can be mounted.

本实施例中,所述通过在所述门限内移动门限指针对当前门限内对应的磁盘依次执行下挂操作的过程中,还可以包括:根据所述门限指针在门限内的偏移量与所述门限占用的比特位数量之间的大小关系,判断当前门限内对应的所有磁盘是否均下挂完成。本实施例中,所述在当前门限内对应的所有磁盘均下挂完成后移动所述门限,可以包括:若当前门限内对应的所有磁盘均下挂完成,则移动所述门限以使所述门限对应的比特位都清零。本实施例中,所述判断当前门限内对应的所有磁盘是否均下挂完成之后,还可以包括:若当前门限内对应的所有磁盘存在没有下挂完成的磁盘,则继续执行所述通过在所述门限内移动门限指针对当前门限内对应的磁盘依次执行下挂操作的步骤。In this embodiment, the process of sequentially performing the attaching operation on the corresponding disks within the current threshold by moving the threshold pointer within the threshold may further include: according to the offset of the threshold pointer within the threshold and the The size relationship between the number of bits occupied by the above-mentioned thresholds is used to judge whether all the disks corresponding to the current thresholds have been downloaded. In this embodiment, moving the threshold after all the disks corresponding to the current threshold have been downloaded may include: if all the disks corresponding to the current threshold have been downloaded, moving the threshold so that the The bits corresponding to the threshold are all cleared. In this embodiment, after the judging whether all the disks corresponding to the current threshold have been downloaded, it may also include: if there are disks that have not been downloaded in all the disks corresponding to the current threshold, then continue to execute the above-mentioned process. The step of moving the threshold pointer within the threshold and performing the demounting operation sequentially on the corresponding disks within the current threshold.

即针对大量的待下挂磁盘,本实施例中通过门限每次框选一部分,依次对磁盘进行下挂,因此需要判断当前门限内对应的磁盘是否全部下挂,若是则清零门限以执行下一部分磁盘的下挂。具体通过查看门限指针在门限内的偏移量与门限占用的比特位数量之间的大小关系,判断门限指针是否遍历当前门限的所有比特位。也就是说,RAID卡一次下挂PK_Bit_DOOR宏定义门限内的所有磁盘,当该门限的所有磁盘下挂完成后,移动该门限,然后对移动后门限内的所有磁盘执行下挂任务,以此循环,直至RAID卡将用户指定需要下挂的磁盘都下挂完毕为止。That is, for a large number of disks to be downloaded, in this embodiment, a part of the disk is selected each time through the threshold, and the disks are mounted sequentially. Therefore, it is necessary to determine whether all the corresponding disks within the current threshold are mounted, and if so, clear the threshold to execute the download. A part of the disk is hung under. Specifically, by checking the size relationship between the offset of the threshold pointer within the threshold and the number of bits occupied by the threshold, it is judged whether the threshold pointer traverses all the bits of the current threshold. That is to say, the RAID card mounts all the disks within the threshold defined by the PK_Bit_DOOR macro at one time, and when all the disks within the threshold are mounted, the threshold is moved, and then all the disks within the threshold after the movement are mounted, and the cycle is repeated. , until the RAID card has installed all the disks specified by the user to be installed.

步骤S13:在当前门限内对应的所有磁盘均下挂完成后移动所述门限,并利用门限指针对移动后门限内对应的磁盘依次执行下挂操作,直至所述磁盘阵列卡中所有磁盘下挂完成。Step S13: After all the corresponding disks within the current threshold have been installed, move the threshold, and use the threshold pointer to perform the installation operation on the corresponding disks within the moved threshold in sequence until all the disks in the disk array card are installed Finish.

即通过移动门限并在每次门限移动后通过移动门限指针对遍历所有磁盘,实现对磁盘阵列卡中所有磁盘的下挂操作。That is, by moving the threshold and traversing all the disks by moving the threshold pointer after each threshold movement, the downlink operation of all the disks in the disk array card is realized.

本实施例中,所述在当前门限内对应的所有磁盘均下挂完成后,移动所述门限,并利用门限指针对移动后门限内对应的磁盘依次进行下挂操作,直至所述磁盘阵列卡中所有磁盘下挂完成的过程中,包括以下步骤:In this embodiment, after all the disks corresponding to the current threshold are installed, the threshold is moved, and the disks corresponding to the moved threshold are sequentially installed using the threshold pointer until the disk array card The process of attaching all the disks in , includes the following steps:

S131:确定所述门限的移动次数以及所述门限指针的偏移量;S131: Determine the movement times of the threshold and the offset of the threshold pointer;

S132:根据所述门限占用的比特位的数量、所述移动次数、所述偏移量以及所述磁盘阵列卡内磁盘的总数量,判断所述磁盘阵列卡中所有磁盘是否均下挂完成。S132: According to the number of bits occupied by the threshold, the number of times of movement, the offset, and the total number of disks in the disk array card, determine whether all the disks in the disk array card have been attached.

本实施例中,所述根据所述门限占用的比特位的数量、所述移动次数、所述偏移量以及所述磁盘阵列卡内磁盘的总数量,判断所述磁盘阵列卡中所有磁盘是否均下挂完成之前,还可以包括:根据磁盘阵列卡的容量确定所述磁盘阵列卡内磁盘的总数量。具体的磁盘阵列卡所需的总容量与单个磁盘容量的比值作为磁盘阵列卡内磁盘的总数量。In this embodiment, according to the number of bits occupied by the threshold, the number of moves, the offset, and the total number of disks in the disk array card, it is judged whether Before the completion of all downloading, it may further include: determining the total number of disks in the disk array card according to the capacity of the disk array card. The ratio of the total capacity required by the specific disk array card to the capacity of a single disk is taken as the total number of disks in the disk array card.

本实施例中,所述根据所述门限占用的比特位的数量、所述移动次数、所述偏移量以及所述磁盘阵列卡内磁盘的总数量,判断所述磁盘阵列卡中所有磁盘是否均下挂完成,可以包括:根据所述门限占用的比特位的数量、所述移动次数和所述偏移量,确定所述磁盘阵列卡中已执行下挂操作的磁盘数量;若所述磁盘阵列卡中已执行下挂操作的磁盘数量等于所述磁盘阵列卡内磁盘的总数量,则判定所述磁盘阵列卡中所有磁盘均下挂完成。即根据门限占用的比特位的数量与门限移动次数的乘积,结合在当前门限内门限指针的偏移量,得到磁盘阵列卡中已执行下挂操作的磁盘数量,当磁盘阵列卡中已执行下挂操作的磁盘数量等于磁盘阵列卡内磁盘的总数量,则可以判定磁盘阵列卡中所有磁盘均下挂完成。In this embodiment, according to the number of bits occupied by the threshold, the number of moves, the offset, and the total number of disks in the disk array card, it is judged whether All downloading is completed, which may include: determining the number of disks in the disk array card that have performed the downloading operation according to the number of bits occupied by the threshold, the number of times of movement, and the offset; if the disk If the number of disks in the array card for which the downlink operation has been performed is equal to the total number of disks in the disk array card, it is determined that all the disks in the disk array card have been downlinked. That is, according to the product of the number of bits occupied by the threshold and the number of threshold moves, combined with the offset of the threshold pointer within the current threshold, the number of disks that have been attached to the disk array card has been executed. If the number of disks to be attached is equal to the total number of disks in the disk array card, it can be determined that all disks in the disk array card have been attached.

由上可见,本实施例中获取门限域,根据所述门限域的大小定义针对磁盘阵列卡的门限;将所述门限包含的比特位作为磁盘的位图,通过在所述门限内移动门限指针对当前门限内对应的磁盘依次执行下挂操作;在当前门限内对应的所有磁盘均下挂完成后移动所述门限,并利用门限指针对移动后门限内对应的磁盘依次执行下挂操作,直至所述磁盘阵列卡中所有磁盘下挂完成。可见,利用门限和门限指针通过门限移动算法管理磁盘阵列卡中所有磁盘的下挂操作,只需占用门限域和门限指针大小的资源,有效降低内存资源占用率,并且加快磁盘阵列卡执行下挂磁盘任务的速度。As can be seen from the above, in this embodiment, the threshold field is obtained, and the threshold for the disk array card is defined according to the size of the threshold field; the bits contained in the threshold are used as the bitmap of the disk, and the threshold index is moved by moving the threshold in the threshold. Carry out the mount operation in turn for the corresponding disks within the current threshold; move the threshold after all the disks corresponding to the current threshold have been mounted, and use the threshold pointer to perform mount operations on the corresponding disks within the moved threshold in sequence until All the disks in the disk array card are attached. It can be seen that using the threshold and the threshold pointer to manage the mounting operation of all the disks in the disk array card through the threshold moving algorithm only needs to occupy resources of the size of the threshold field and the threshold pointer, effectively reducing the memory resource occupation rate, and speeding up the disk array card to perform the mounting operation. The speed of disk tasks.

本申请实施例公开了一种具体的磁盘管理方法,参见图3所示,该方法可以包括以下步骤:The embodiment of the present application discloses a specific disk management method, as shown in Figure 3, the method may include the following steps:

步骤S21:获取门限域,根据所述门限域的大小定义针对磁盘阵列卡的门限。Step S21: Obtain a threshold domain, and define a threshold for a disk array card according to the size of the threshold domain.

步骤S22:将所述门限包含的比特位作为磁盘的位图,确定所述磁盘阵列卡中起始下挂磁盘的逻辑设备号。Step S22: Using the bits contained in the threshold as the bitmap of the disk, determine the logical device number of the first connected disk in the disk array card.

即首先明确出起始下挂磁盘的逻辑设备号,即RAID卡需要下挂的第一个磁盘。That is, firstly, specify the logical device number of the first attached disk, that is, the first disk to be attached to the RAID card.

本实施例中,所述确定所述磁盘阵列卡中起始下挂磁盘的逻辑设备号,可以包括:若获取到用户发送的目标逻辑设备号,将所述目标逻辑设备号作为所述磁盘阵列卡中起始下挂磁盘的逻辑设备号;若未获取到用户发送的目标逻辑设备号,则将首个逻辑设备号作为所述磁盘阵列卡中起始下挂磁盘的逻辑设备号。即若用户没有特定从哪个磁盘开始则可以从逻辑设备号为零的磁盘开始下挂,若用户设定了起始下挂磁盘的逻辑设备号,则可认为之前的磁盘已经下挂,因此从该磁盘开始下挂即可。In this embodiment, the determination of the logical device number of the first attached disk in the disk array card may include: if the target logical device number sent by the user is obtained, using the target logical device number as the disk array The logical device number of the first connected disk in the card; if the target logical device number sent by the user is not obtained, the first logical device number is used as the logical device number of the first connected disk in the disk array card. That is, if the user does not specify which disk to start from, the disk can be mounted from the disk whose logical device number is zero. The disk can be hung up.

步骤S23:将所述门限指针调整至门限内的第一个比特位,根据所述逻辑设备号从所述起始下挂磁盘处执行下挂操作。Step S23: Adjust the threshold pointer to the first bit in the threshold, and perform a download operation from the initial download disk according to the logical device number.

即起始下挂磁盘对应为首个磁盘中第一个比特位,从此处开始执行下挂。That is, the initial attached disk corresponds to the first bit in the first disk, and the attached disk is executed from here.

步骤S24:在当前门限内对应的所有磁盘均下挂完成后移动所述门限,并利用门限指针对移动后门限内对应的磁盘依次执行下挂操作,直至所述磁盘阵列卡中所有磁盘下挂完成。Step S24: After all the disks corresponding to the current threshold are installed, move the threshold, and use the threshold pointer to sequentially perform the installation operation on the corresponding disks within the moved threshold until all the disks in the disk array card are installed Finish.

其中,关于上述步骤S21、S24的具体过程可以参考前述实施例公开的相应内容,在此不再进行赘述。Wherein, for the specific process of the above steps S21 and S24, reference may be made to the corresponding content disclosed in the foregoing embodiments, and details are not repeated here.

由上可见,本实施例中将所述门限包含的比特位作为磁盘的位图,确定所述磁盘阵列卡中起始下挂磁盘的逻辑设备号;将所述门限指针调整至门限内的第一个比特位,根据所述逻辑设备号从所述起始下挂磁盘处执行下挂操作,由此通过逻辑设备号明确下挂的起始位置。As can be seen from the above, in the present embodiment, the bits contained in the threshold are used as the bitmap of the disk to determine the logical device number of the initial hanging disk in the disk array card; the threshold pointer is adjusted to the first threshold in the threshold. One bit, according to the logical device number, perform the downloading operation from the initial downloading disk, thereby specifying the starting position of the downloading through the logical device number.

例如图4所示为一种具体的磁盘管理方法,主要步骤如下:For example, Figure 4 shows a specific disk management method, the main steps are as follows:

第一步:从内存中申请两个无符号四字节数据,并将RAID卡需要下挂的第一个磁盘的ldn号(logicdevicenumber,用来表征磁盘的逻辑设备号)保存在内存中。Step 1: Apply for two unsigned four-byte data from the memory, and save the ldn number (logicdevicenumber, used to represent the logical device number of the disk) of the first disk to be connected to the RAID card in the memory.

第二步:从RAID卡需要下挂的第一个磁盘处设置第一个门限,例如定义执行磁盘下挂任务的第一个门限为PK_Bit_DOOR宏定义门限。定义PK_Bit_DOOR为32。Step 2: Set the first threshold from the first disk that needs to be attached to the RAID card, for example, define the first threshold for executing the task of attaching the disk as the PK_Bit_DOOR macro definition threshold. Define PK_Bit_DOOR as 32.

第三步:输入RAID卡执行第一个下挂任务磁盘的ldn号,并根据RAID卡容量求解RAID卡需要下挂的磁盘数量。Step 3: Enter the ldn number of the disk to which the RAID card executes the first task to be attached, and calculate the number of disks to be attached to the RAID card according to the capacity of the RAID card.

第四步:设置DoorPointer门限指针指向门限内的第一个Bit位,并判断DoorPointer门限指针指向的Bit位是否为1,为1则跳过该Bit位然后将门限指针移动到下一个Bit位,为0则执行该Bit位标识的磁盘的下挂任务,执行完毕后移动到下一个Bit位。Step 4: Set the DoorPointer threshold pointer to point to the first Bit in the threshold, and judge whether the Bit pointed to by the DoorPointer threshold pointer is 1. If it is 1, skip this Bit and move the threshold pointer to the next Bit. If it is 0, execute the attached task of the disk identified by the bit, and move to the next bit after the execution is completed.

第五步:DoorPointer门限指针每移动一位,都需判断门限偏移量,即判断门限偏移量是否等于PK_Bit_DOOR值,等于则对门限进行一个32位的移动,同时将DoorPointer门限指针移动到门限头部(门限头部指门限内的第一个Bit位)。对第四步和第五步进一步解释为:磁盘管理硬件模块将第一个无符号四字节数据初始化为0,这样该数据展开成32个Bit位后每个Bit位都为0,因此第一个门限内的所有磁盘都需要执行下挂任务,当第一个门限内的32个Bit位都变为0后即32块磁盘都执行完下挂任务后,对门限进行一个32位的移动是将第一个无符号四字节数据赋值为零,然后将DoorPointer门限指针指向该门限内的第一个Bit位开始执行第五步中所述内容。Step 5: Every time the DoorPointer threshold pointer moves one bit, it is necessary to judge the threshold offset, that is, to judge whether the threshold offset is equal to the PK_Bit_DOOR value, and if it is equal, move the threshold by 32 bits, and move the DoorPointer threshold pointer to the threshold Header (threshold header refers to the first Bit in the threshold). The fourth and fifth steps are further explained as follows: the disk management hardware module initializes the first unsigned four-byte data to 0, so that after the data is expanded into 32 bits, each bit is 0, so the first All disks within a threshold need to execute the downloading task. When the 32 bits in the first threshold become 0, that is, after all 32 disks have completed the downloading task, the threshold is moved by 32 bits. It is to assign the first unsigned four-byte data to zero, and then point the DoorPointer threshold pointer to the first Bit in the threshold to start executing the content described in the fifth step.

第六步:根据第三步求得的磁盘数和门限移动的次数以及DoorPointer门限指针的偏移,判断RAID卡下挂磁盘任务是否执行完毕。Step 6: According to the number of disks obtained in step 3, the number of threshold moves, and the offset of the DoorPointer threshold pointer, determine whether the task of attaching the disks to the RAID card has been completed.

综上所述,采用编程语言进行算法实现,设计将门限与位图相结合,利用门限和门限指针的快速高效特点,占用的内存资源情况是两个无符号四字节数据,大幅度降低内存资源占用率,同时在不增加硬件的情况下,能够提升RAID卡执行下挂磁盘任务的效率,增加公司在RAID卡市场的核心竞争力;在不增加硬件,能够保证数据安全、提升RAID卡执行下挂磁盘任务的效率、减小RAID卡启动时下挂磁盘的时间长度而且提高用户使用RAID卡的体验感,同时在前台紧急I/O任务情况下降低RAID卡管理下挂磁盘出错的风险。To sum up, the programming language is used for algorithm implementation, the design combines threshold and bitmap, and utilizes the fast and efficient characteristics of threshold and threshold pointer. The memory resources occupied are two unsigned four-byte data, which greatly reduces memory Resource occupancy rate, at the same time, without increasing the hardware, it can improve the efficiency of the RAID card to perform the task of attaching the disk, and increase the company's core competitiveness in the RAID card market; without increasing the hardware, it can ensure data security and improve the performance of the RAID card The efficiency of the task of attaching the disk, reducing the length of time for attaching the disk when the RAID card is started, and improving the user experience of using the RAID card, and at the same time reducing the risk of errors in the disk under the RAID card management in the case of emergency I/O tasks in the foreground.

相应的,本申请实施例还公开了一种磁盘管理装置,参见图5所示,该装置包括:Correspondingly, the embodiment of the present application also discloses a disk management device, as shown in Figure 5, the device includes:

门限确定模块11,用于获取门限域,根据所述门限域的大小定义针对磁盘阵列卡的门限;Threshold determination module 11 is used to obtain the threshold domain, and define the threshold for the disk array card according to the size of the threshold domain;

下挂模块12,用于将所述门限包含的比特位作为磁盘的位图,通过在所述门限内移动门限指针对当前门限内对应的磁盘依次执行下挂操作;The hanging module 12 is used to use the bits contained in the threshold as the bitmap of the disk, and perform the hanging operation sequentially on the corresponding disks in the current threshold by moving the threshold pointer in the threshold;

门限移动模块13,用于在当前门限内对应的所有磁盘均下挂完成后移动所述门限,并利用门限指针对移动后门限内对应的磁盘依次执行下挂操作,直至所述磁盘阵列卡中所有磁盘下挂完成。The threshold moving module 13 is used to move the threshold after all the disks corresponding to the current threshold have been hung up, and use the threshold pointer to perform the hanging operation on the corresponding disks in the moved threshold in turn until the disk array card All disks are attached.

由上可见,本实施例中获取门限域,根据所述门限域的大小定义针对磁盘阵列卡的门限;将所述门限包含的比特位作为磁盘的位图,通过在所述门限内移动门限指针对当前门限内对应的磁盘依次执行下挂操作;在当前门限内对应的所有磁盘均下挂完成后移动所述门限,并利用门限指针对移动后门限内对应的磁盘依次执行下挂操作,直至所述磁盘阵列卡中所有磁盘下挂完成。可见,利用门限和门限指针通过门限移动算法管理磁盘阵列卡中所有磁盘的下挂操作,只需占用门限域和门限指针大小的资源,有效降低内存资源占用率,并且加快磁盘阵列卡执行下挂磁盘任务的速度。As can be seen from the above, in this embodiment, the threshold field is obtained, and the threshold for the disk array card is defined according to the size of the threshold field; the bits contained in the threshold are used as the bitmap of the disk, and the threshold index is moved by moving the threshold in the threshold. Carry out the mount operation in turn for the corresponding disks within the current threshold; move the threshold after all the disks corresponding to the current threshold have been mounted, and use the threshold pointer to perform mount operations on the corresponding disks within the moved threshold in sequence until All the disks in the disk array card are attached. It can be seen that using the threshold and the threshold pointer to manage the mounting operation of all the disks in the disk array card through the threshold moving algorithm only needs to occupy resources of the size of the threshold field and the threshold pointer, effectively reducing the memory resource occupation rate, and speeding up the disk array card to perform the mounting operation. The speed of disk tasks.

在一些具体实施例中,所述门限移动模块13具体可以包括:In some specific embodiments, the threshold moving module 13 may specifically include:

偏移量确定单元,用于确定所述门限的移动次数以及所述门限指针的偏移量;an offset determining unit, configured to determine the number of times of movement of the threshold and the offset of the threshold pointer;

下挂完成判断单元,用于根据所述门限占用的比特位的数量、所述移动次数、所述偏移量以及所述磁盘阵列卡内磁盘的总数量,判断所述磁盘阵列卡中所有磁盘是否均下挂完成。The download completion judging unit is used to judge all disks in the disk array card according to the number of bits occupied by the threshold, the number of times of movement, the offset and the total number of disks in the disk array card Whether all downloads are completed.

在一些具体实施例中,所述磁盘管理装置具体可以包括:In some specific embodiments, the disk management device may specifically include:

磁盘总数确定单元,用于根据磁盘阵列卡的容量确定所述磁盘阵列卡内磁盘的总数量。The total number of disks determining unit is configured to determine the total number of disks in the disk array card according to the capacity of the disk array card.

在一些具体实施例中,所述下挂完成判断单元具体可以包括:In some specific embodiments, the download completion judging unit may specifically include:

已下挂磁盘数量确定单元,用于根据所述门限占用的比特位的数量、所述移动次数和所述偏移量,确定所述磁盘阵列卡中已执行下挂操作的磁盘数量;The unit for determining the number of attached disks is configured to determine the number of disks in the disk array card that have performed the attached operation according to the number of bits occupied by the threshold, the number of times of movement, and the offset;

下挂完成判定单元,用于若所述磁盘阵列卡中已执行下挂操作的磁盘数量等于所述磁盘阵列卡内磁盘的总数量,则判定所述磁盘阵列卡中所有磁盘均下挂完成。The download completion judging unit is configured to determine that all the disks in the disk array card have been downloaded if the number of disks in the disk array card that have performed the download operation is equal to the total number of disks in the disk array card.

在一些具体实施例中,所述下挂模块12具体可以包括:In some specific embodiments, the hanging module 12 may specifically include:

磁盘下挂判断单元,用于根据当前所述门限指针指向的比特位中的符号,判断当前所述门限指针指向的磁盘是否下挂完毕;所述门限中的比特位用于表征对应的磁盘是否被下挂。The disk hanging judging unit is used for judging whether the disk pointed to by the current threshold pointer has been hung up according to the symbol in the bit pointed by the current threshold pointer; the bit in the threshold is used to represent whether the corresponding disk is Be hung up.

在一些具体实施例中,所述下挂模块12具体可以包括:In some specific embodiments, the hanging module 12 may specifically include:

下挂单元,用于在判断当前所述门限指针指向的磁盘是否下挂完毕之后,若是当前所述门限指针指向的磁盘未下挂完毕,则对当前所述门限指针指向的磁盘执行下挂操作。The hanging unit is used to perform the hanging operation on the disk pointed to by the threshold pointer after judging whether the disk pointed to by the threshold pointer has been hung up, if the disk pointed to by the threshold pointer has not been hung up .

在一些具体实施例中,所述下挂模块12具体可以包括:In some specific embodiments, the hanging module 12 may specifically include:

指针移动单元,用于在判断当前所述门限指针指向的磁盘是否下挂完毕之后,若当前所述门限指针指向的磁盘已下挂完毕,移动所述门限指针指向下一个比特位。The pointer moving unit is configured to move the threshold pointer to point to the next bit if the disk currently pointed to by the threshold pointer has been downloaded after judging whether the disk pointed to by the threshold pointer is completed.

在一些具体实施例中,所述下挂模块12具体可以包括:In some specific embodiments, the hanging module 12 may specifically include:

门限内磁盘下挂完成判断单元,用于根据所述门限指针在门限内的偏移量与所述门限占用的比特位数量之间的大小关系,判断当前门限内对应的所有磁盘是否均下挂完成。The disk download completion judging unit within the threshold is used to judge whether all the corresponding disks within the current threshold are connected according to the size relationship between the offset of the threshold pointer within the threshold and the number of bits occupied by the threshold Finish.

在一些具体实施例中,所述门限移动模块13具体可以包括:In some specific embodiments, the threshold moving module 13 may specifically include:

移动单元,用于若当前门限内对应的所有磁盘均下挂完成,则移动所述门限以使所述门限对应的比特位都清零。The moving unit is configured to move the threshold so that all the bits corresponding to the threshold are cleared to zero if all corresponding disks within the current threshold have been installed.

在一些具体实施例中,所述下挂模块12具体可以包括:In some specific embodiments, the hanging module 12 may specifically include:

下挂单元,用于在判断当前门限内对应的所有磁盘是否均下挂完成之后,若当前门限内对应的所有磁盘存在没有下挂完成的磁盘,则继续执行所述通过在所述门限内移动门限指针对当前门限内对应的磁盘依次执行下挂操作的步骤。The hanging unit is used to continue to perform the process of moving within the threshold if all the disks corresponding to the current threshold have disks that have not been hung up after judging whether all the disks corresponding to the current threshold have been hung. The threshold points to the steps of performing the demounting operation on the corresponding disks within the current threshold in sequence.

在一些具体实施例中,所述门限确定模块11具体可以包括:In some specific embodiments, the threshold determination module 11 may specifically include:

第一无符号数据获取单元,用于从内存申请目标字节大小的第一无符号数据;The first unsigned data acquisition unit is used to apply for the first unsigned data of the target byte size from the memory;

门限域确定单元,用于将所述第一无符号数据展开得到对应的目标数量比特位,基于所述目标数量比特位得到门限域。A threshold field determining unit, configured to expand the first unsigned data to obtain a corresponding target number of bits, and obtain a threshold field based on the target number of bits.

在一些具体实施例中,所述门限域确定单元还用于通过所述磁盘阵列卡内固件层的磁盘管理硬件模块,执行所述将所述第一无符号数据展开得到对应的目标数量比特位,基于所述目标数量比特位得到门限域的操作。In some specific embodiments, the threshold domain determination unit is further configured to perform the expansion of the first unsigned data to obtain the corresponding target number of bits through the disk management hardware module of the firmware layer in the disk array card. , obtaining the operation of the threshold field based on the target number of bits.

在一些具体实施例中,所述门限确定模块11具体可以包括:In some specific embodiments, the threshold determination module 11 may specifically include:

第二无符号数据获取单元,用于从内存申请目标字节大小的第二无符号数据,并将所述第二无符号数据作为门限指针。The second unsigned data acquisition unit is configured to apply for second unsigned data of a target byte size from memory, and use the second unsigned data as a threshold pointer.

在一些具体实施例中,所述第二无符号数据获取单元还用于通过所述磁盘阵列卡内固件层的磁盘管理硬件模块,执行所述将所述第二无符号数据作为门限指针的操作。In some specific embodiments, the second unsigned data acquisition unit is further configured to perform the operation of using the second unsigned data as a threshold pointer through the disk management hardware module of the firmware layer in the disk array card .

在一些具体实施例中,所述门限确定模块11具体可以包括:In some specific embodiments, the threshold determination module 11 may specifically include:

门限定义单元,用于根据所述门限域的大小,通过宏定义方式定义针对磁盘阵列卡的门限;A threshold definition unit, configured to define the threshold for the disk array card through macro definition according to the size of the threshold domain;

在一些具体实施例中,所述磁盘管理装置,还包括:In some specific embodiments, the disk management device further includes:

门限修改单元,用于通过修改所述宏定义中的字符串修改所述门限。a threshold modifying unit, configured to modify the threshold by modifying the character string in the macro definition.

在一些具体实施例中,所述下挂模块12具体可以包括:In some specific embodiments, the hanging module 12 may specifically include:

逻辑设备号确定单元,用于确定所述磁盘阵列卡中起始下挂磁盘的逻辑设备号;a logical device number determining unit, configured to determine the logical device number of the initial downlink disk in the disk array card;

指针位置调整单元,用于将所述门限指针调整至门限内的第一个比特位,根据所述逻辑设备号从所述起始下挂磁盘处执行下挂操作。A pointer position adjustment unit, configured to adjust the threshold pointer to the first bit within the threshold, and perform a download operation from the initial download disk according to the logical device number.

在一些具体实施例中,所述逻辑设备号确定单元具体可以包括:In some specific embodiments, the logical device number determining unit may specifically include:

第一逻辑设备号确定单元,用于若获取到用户发送的目标逻辑设备号,将所述目标逻辑设备号作为所述磁盘阵列卡中起始下挂磁盘的逻辑设备号;The first logical device number determining unit is configured to use the target logical device number as the logical device number of the initial downlink disk in the disk array card if the target logical device number sent by the user is obtained;

第二逻辑设备号确定单元,用于若未获取到用户发送的目标逻辑设备号,则将首个逻辑设备号作为所述磁盘阵列卡中起始下挂磁盘的逻辑设备号。The second logical device number determination unit is configured to use the first logical device number as the logical device number of the first attached disk in the disk array card if the target logical device number sent by the user is not obtained.

进一步的,本申请实施例还公开了一种电子设备,参见图6所示,图中的内容不能被认为是对本申请的使用范围的任何限制。Further, the embodiment of the present application also discloses an electronic device, as shown in FIG. 6 , and the content in the figure should not be regarded as any limitation on the application scope of the present application.

图6为本申请实施例提供的一种电子设备20的结构示意图。该电子设备20,具体可以包括:至少一个处理器21、至少一个存储器22、电源23、通信接口24、输入输出接口25和通信总线26。其中,所述存储器22用于存储计算机程序,所述计算机程序由所述处理器21加载并执行,以实现前述任一实施例公开的磁盘管理方法中的相关步骤。FIG. 6 is a schematic structural diagram of an electronic device 20 provided by an embodiment of the present application. The electronic device 20 may specifically include: at least one processor 21 , at least one memory 22 , a power supply 23 , a communication interface 24 , an input/output interface 25 and a communication bus 26 . Wherein, the memory 22 is used to store a computer program, and the computer program is loaded and executed by the processor 21 to implement relevant steps in the disk management method disclosed in any of the foregoing embodiments.

本实施例中,电源23用于为电子设备20上的各硬件设备提供工作电压;通信接口24能够为电子设备20创建与外界设备之间的数据传输通道,其所遵循的通信协议是能够适用于本申请技术方案的任意通信协议,在此不对其进行具体限定;输入输出接口25,用于获取外界输入数据或向外界输出数据,其具体的接口类型可以根据具体应用需要进行选取,在此不进行具体限定。In this embodiment, the power supply 23 is used to provide working voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and external devices, and the communication protocol it follows is applicable Any communication protocol in the technical solution of the present application is not specifically limited here; the input and output interface 25 is used to obtain external input data or output data to the external, and its specific interface type can be selected according to specific application needs, here Not specifically limited.

另外,存储器22作为资源存储的载体,可以是只读存储器、随机存储器、磁盘或者光盘等,其上所存储的资源包括操作系统221、计算机程序222及包括门限在内的数据223等,存储方式可以是短暂存储或者永久存储。In addition, the memory 22, as a resource storage carrier, can be a read-only memory, random access memory, magnetic disk or optical disk, etc., and the resources stored thereon include the operating system 221, computer programs 222, and data 223 including thresholds, etc., and the storage method Can be temporary storage or permanent storage.

其中,操作系统221用于管理与控制电子设备20上的各硬件设备以及计算机程序222,以实现处理器21对存储器22中海量数据223的运算与处理,其可以是WindowsServer、Netware、Unix、Linux等。计算机程序222除了包括能够用于完成前述任一实施例公开的由电子设备20执行的磁盘管理方法的计算机程序之外,还可以进一步包括能够用于完成其他特定工作的计算机程序。Wherein, the operating system 221 is used to manage and control each hardware device and computer program 222 on the electronic device 20, so as to realize the calculation and processing of the massive data 223 in the memory 22 by the processor 21, which can be WindowsServer, Netware, Unix, Linux wait. In addition to computer programs 222 that can be used to complete the disk management method performed by the electronic device 20 disclosed in any of the foregoing embodiments, the computer programs 222 can further include computer programs that can be used to complete other specific tasks.

进一步的,本申请实施例还公开了一种计算机存储介质,所述计算机存储介质中存储有计算机可执行指令,所述计算机可执行指令被处理器加载并执行时,实现前述任一实施例公开的磁盘管理方法步骤。Further, the embodiment of the present application also discloses a computer storage medium, the computer storage medium stores computer-executable instructions, and when the computer-executable instructions are loaded and executed by a processor, the implementation of any one of the foregoing embodiments is disclosed. Disk Management method steps.

本说明书中各个实施例采用递进的方式描述,每个实施例重点说明的都是与其它实施例的不同之处,各个实施例之间相同或相似部分互相参见即可。对于实施例公开的装置而言,由于其与实施例公开的方法相对应,所以描述的比较简单,相关之处参见方法部分说明即可。Each embodiment in this specification is described in a progressive manner, each embodiment focuses on the difference from other embodiments, and the same or similar parts of each embodiment can be referred to each other. As for the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and for relevant details, please refer to the description of the method part.

结合本文中所公开的实施例描述的方法或算法的步骤可以直接用硬件、处理器执行的软件模块,或者二者的结合来实施。软件模块可以置于随机存储器(RAM)、内存、只读存储器(ROM)、电可编程ROM、电可擦除可编程ROM、寄存器、硬盘、可移动磁盘、CD-ROM、或技术领域内所公知的任意其它形式的存储介质中。The steps of the methods or algorithms described in connection with the embodiments disclosed herein may be directly implemented by hardware, software modules executed by a processor, or a combination of both. Software modules can be placed in random access memory (RAM), internal memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other Any other known storage medium.

最后,还需要说明的是,在本文中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。Finally, it should also be noted that in this text, relational terms such as first and second etc. are only used to distinguish one entity or operation from another, and do not necessarily require or imply that these entities or operations, any such actual relationship or order exists. Furthermore, the term "comprises", "comprises" or any other variation thereof is intended to cover a non-exclusive inclusion such that a process, method, article, or apparatus comprising a set of elements includes not only those elements, but also includes elements not expressly listed. other elements of or also include elements inherent in such a process, method, article, or device. Without further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article or apparatus comprising said element.

以上对本发明所提供的一种磁盘管理方法、装置、设备及介质进行了详细介绍,本文中应用了具体个例对本发明的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本发明的方法及其核心思想;同时,对于本领域的一般技术人员,依据本发明的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本发明的限制。A disk management method, device, equipment, and medium provided by the present invention have been introduced in detail above. In this paper, specific examples are used to illustrate the principle and implementation of the present invention. The descriptions of the above embodiments are only used to help understanding The method of the present invention and its core idea; at the same time, for those of ordinary skill in the art, according to the idea of the present invention, there will be changes in the specific implementation and scope of application. In summary, the content of this specification should not be construed as a limitation of the invention.

Claims (18)

1. A method of disk management, comprising:
acquiring a threshold domain, and defining a threshold for a disk array card according to the size of the threshold domain;
taking bits contained in the threshold as bitmaps of the disks, and sequentially executing a hooking operation on the corresponding disks in the current threshold by moving a threshold pointer in the threshold;
moving the threshold after all the disks corresponding to the current threshold are hung, and sequentially executing hanging operation on the disks corresponding to the moved threshold by using the threshold finger until all the disks in the disk array card are hung;
wherein the acquisition threshold field includes:
applying for first unsigned data of a target byte size from memory;
expanding the first unsigned data to obtain corresponding target number bits, and obtaining a threshold domain based on the target number bits;
the method for processing the disk in the current threshold includes the steps of:
applying for second unsigned data with target byte size from the memory, and taking the second unsigned data as a threshold pointer.
2. The disk management method according to claim 1, wherein after the hooking of all the disks corresponding to the current threshold is completed, moving the threshold, and sequentially performing hooking operations on the disks corresponding to the moved threshold by using the threshold index until all the disks in the disk array card are hooked, the method comprises:
determining the number of times of movement of the threshold and the offset of the threshold pointer;
and judging whether all the disks in the disk array card are hung down or not according to the number of bits occupied by the threshold, the moving times, the offset and the total number of the disks in the disk array card.
3. The disk management method according to claim 2, wherein before determining whether all disks in the disk array card are hung down according to the number of bits occupied by the threshold, the number of movements, the offset, and the total number of disks in the disk array card, further comprising:
and determining the total number of the magnetic disks in the magnetic disk array card according to the capacity of the magnetic disk array card.
4. The disk management method according to claim 2, wherein the determining whether all disks in the disk array card are hung down according to the number of bits occupied by the threshold, the number of movements, the offset, and the total number of disks in the disk array card includes:
Determining the number of the magnetic disks which have executed the hanging operation in the magnetic disk array card according to the number of the bit occupied by the threshold, the moving times and the offset;
and if the number of the disks which have executed the hooking operation in the disk array card is equal to the total number of the disks in the disk array card, judging that all the disks in the disk array card are hooked.
5. The disk management method according to claim 1, wherein the sequentially performing the hooking operation on the corresponding disk in the current threshold by moving the threshold pointer in the threshold comprises:
judging whether the disk pointed by the threshold pointer is hung down or not according to the symbol in the bit pointed by the threshold pointer; the bits in the threshold are used to characterize whether the corresponding disk is down-hung.
6. The method for managing magnetic disk according to claim 5, wherein after said determining whether the magnetic disk pointed by the threshold pointer is hung up, further comprising:
and if the disk pointed by the current threshold pointer is not hung, executing hanging operation on the disk pointed by the current threshold pointer.
7. The method for managing magnetic disk according to claim 5, wherein after said determining whether the magnetic disk pointed by the threshold pointer is hung up, further comprising:
And if the disk pointed by the threshold pointer is hung down, moving the threshold pointer to point to the next bit.
8. The disk management method according to claim 1, wherein in the process of sequentially performing the hooking operation on the corresponding disk in the current threshold by moving the threshold pointer in the threshold, the method further comprises:
and judging whether all corresponding disks in the current threshold are hung down or not according to the size relation between the offset of the threshold pointer in the threshold and the bit number occupied by the threshold.
9. The disk management method according to claim 8, wherein moving the threshold after all disks corresponding to the current threshold have been hung up comprises:
and if all the disks corresponding to the current threshold are hung down, moving the threshold to clear the bit corresponding to the threshold.
10. The method for managing magnetic disks according to claim 8, wherein after determining whether all magnetic disks corresponding to the current threshold are hung up, further comprising:
if all the disks corresponding to the current threshold have the disks which are not hung, continuing to execute the step of sequentially executing the hanging operation on the disks corresponding to the current threshold by moving the threshold pointer in the threshold.
11. The disk management method according to claim 1, wherein the expanding the first unsigned data to obtain a corresponding target number of bits, and obtaining a threshold field based on the target number of bits, comprises:
and executing the operation of expanding the first unsigned data to obtain the corresponding target number of bits and obtaining a threshold domain based on the target number of bits through a disk management hardware module of a firmware layer in the disk array card.
12. The disk management method according to claim 1, wherein said taking the second unsigned data as a threshold pointer comprises:
and executing the operation of taking the second unsigned data as a threshold pointer through a disk management hardware module of a firmware layer in the disk array card.
13. The disk management method according to claim 1, wherein the defining a threshold for a disk array card according to the size of the threshold field includes:
defining a threshold for the disk array card in a macro definition mode according to the size of the threshold domain;
correspondingly, the disk management method further comprises the following steps:
the threshold is modified by modifying the string in the macro definition.
14. The disk management method according to any one of claims 1 to 13, wherein the sequentially performing the hooking operation on the corresponding disk in the current threshold by moving the threshold pointer in the threshold includes:
determining a logic device number of an initial down-hung disk in the disk array card;
and adjusting the threshold pointer to the first bit in the threshold, and executing the hooking operation from the initial hooking disk according to the logic device number.
15. The disk management method according to claim 14, wherein determining the logical device number of the disk array card from which the disk is to be mounted comprises:
if the target logic device number sent by the user is obtained, the target logic device number is used as the logic device number of the initial down-hung disk in the disk array card;
and if the target logic device number sent by the user is not obtained, taking the first logic device number as the logic device number of the initial down-hung disk in the disk array card.
16. A disk management apparatus, comprising:
the threshold determining module is used for acquiring a threshold domain and defining a threshold for the disk array card according to the size of the threshold domain;
The lower hanging module is used for taking bits contained in the threshold as a bitmap of the disk, and sequentially executing lower hanging operation on the corresponding disk in the current threshold by moving a threshold pointer in the threshold;
the threshold moving module is used for moving the threshold after all the disks corresponding to the current threshold are hung, and sequentially executing hanging operation on the disks corresponding to the moved threshold by using the threshold finger until all the disks in the disk array card are hung;
the threshold determining module is used for applying for first unsigned data with the size of the target byte from the memory; expanding the first unsigned data to obtain corresponding target number bits, and obtaining a threshold domain based on the target number bits;
the disk management device is configured to apply for second unsigned data with a target byte size from the memory before sequentially performing a hooking operation on a corresponding disk in a current threshold by using a threshold pointer, and take the second unsigned data as the threshold pointer.
17. An electronic device, comprising:
a memory for storing a computer program;
a processor for executing the computer program to implement the disk management method of any one of claims 1 to 15.
18. A computer-readable storage medium storing a computer program; wherein the computer program when executed by a processor implements the disk management method of any of claims 1 to 15.
CN202310239629.0A 2023-03-14 2023-03-14 Disk management method, device, equipment and storage medium Active CN115951845B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310239629.0A CN115951845B (en) 2023-03-14 2023-03-14 Disk management method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310239629.0A CN115951845B (en) 2023-03-14 2023-03-14 Disk management method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN115951845A CN115951845A (en) 2023-04-11
CN115951845B true CN115951845B (en) 2023-05-30

Family

ID=85891379

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310239629.0A Active CN115951845B (en) 2023-03-14 2023-03-14 Disk management method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115951845B (en)

Families Citing this family (1)

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

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8725782B2 (en) * 2011-04-25 2014-05-13 Microsoft Corporation Virtual disk storage techniques
WO2012109875A1 (en) * 2011-08-02 2012-08-23 华为技术有限公司 Method and module for setting performance threshold
CN105824572B (en) * 2015-01-05 2019-06-04 中兴通讯股份有限公司 Disk storage space management method, device and storage device
CN111858188A (en) * 2019-04-29 2020-10-30 伊姆西Ip控股有限责任公司 Method, apparatus and computer program product for storage management
US11249644B2 (en) * 2019-09-18 2022-02-15 International Business Machines Corporation Magnetic tape integration with distributed disk file systems
CN114116527B (en) * 2021-12-01 2024-12-03 中船重工(武汉)凌久电子有限责任公司 NVMe SSD storage method and system based on programmable fusion chip
CN115639970B (en) * 2022-12-05 2023-03-31 苏州浪潮智能科技有限公司 Storage virtualization method, system, device and equipment based on disk array card

Also Published As

Publication number Publication date
CN115951845A (en) 2023-04-11

Similar Documents

Publication Publication Date Title
US10846137B2 (en) Dynamic adjustment of application resources in a distributed computing system
US10831399B2 (en) Method and system for enabling agentless backup and restore operations on a container orchestration platform
US10831387B1 (en) Snapshot reservations in a distributed storage system
JP6026738B2 (en) System and method for improving scalability of a deduplication storage system
JP5309043B2 (en) Storage system and method for duplicate data deletion in storage system
US10956335B2 (en) Non-volatile cache access using RDMA
US10817380B2 (en) Implementing affinity and anti-affinity constraints in a bundled application
US8245013B2 (en) Mapped offsets preset ahead of process migration
US20170308473A1 (en) Dynamic Block-Level Indexing for Cache with Overflow
JP2010541107A (en) Solid state drive optimizer
CN111880967A (en) File backup method, device, medium and electronic equipment in cloud scene
US20210209057A1 (en) File system quota versioning
US20210034273A1 (en) Method and system for policy class based data migration
US10963182B2 (en) System and method for on-demand recovery points
US20140082275A1 (en) Server, host and method for reading base image through storage area network
CN115951845B (en) Disk management method, device, equipment and storage medium
US10552318B2 (en) Working set adjustment in a managed environment
US11474850B2 (en) Method and system for efficient virtual machine operation while recovering data
CN109582649A (en) A kind of metadata storing method, device, equipment and readable storage medium storing program for executing
US11977559B2 (en) Providing instant and distributed access to a source blob via copy-on-read blobs and link blobs
CN118689741A (en) Information management method, device, medium and program product
US11132138B2 (en) Converting large extent storage pools into small extent storage pools in place
CN117909139A (en) Method and device for protecting virtual machine on CloudOS platform and server
CN118210618A (en) Storage resource management method, device, electronic device and storage medium
US11983147B2 (en) Deduplicating data integrity checks across systems

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