A distributed storage disk management method, device and medium
By generating a logical slot number that uniquely corresponds to the disk in a distributed storage system, the problem of non-standard device management in existing technologies is solved, enabling effective disk management of non-standard devices and improving system compatibility and management efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- JINAN INSPUR DATA TECH CO LTD
- Filing Date
- 2023-12-22
- Publication Date
- 2026-07-21
AI Technical Summary
Existing disk management strategies are only applicable to standard devices, resulting in insufficient compatibility and versatility with non-standard devices, and making it impossible to effectively perform disk management operations.
By acquiring the disk array card information and disk connection location information of each node in the distributed storage system, a first logical slot number uniquely corresponding to each disk is generated, and this number is associated with the disk serial number and stored in the disk information table to achieve disk management for non-standard devices.
It expands the scope of disk management, improves system compatibility and management efficiency, and can effectively manage disks of non-standard devices.
Smart Images

Figure CN117724662B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of distributed storage hardware management, and in particular to a distributed storage disk management method, apparatus, and medium. Background Technology
[0002] In distributed storage systems, disk management across nodes is a key factor affecting system performance. Disk management includes operations such as disk alerts, disk location, and disk swapping. The key to implementing these operations lies in clearly defining the mapping between disks and their addresses (logical disk locations), allowing the management system to locate the target disk for management.
[0003] To ensure consistency between the disk information displayed on the device view and the actual physical machine, current disk management systems typically require a fixed disk arrangement for each device. They then calculate the offset between the physical disk locations and the displayed locations based on this arrangement, using the resulting logical location information to manage the disks. In other words, for a storage node in a distributed system, the disk arrangement is fixed, uniquely corresponding to a single offset value used to calculate the logical location information of all disks on that node, thus meeting disk management requirements.
[0004] However, the above solution also has certain drawbacks: it requires the node devices to be standard devices, meaning the disk management system can identify the node type of the node device and thus determine the offset value corresponding to the disk of that node, in order to satisfy the condition for determining the logical location information of all disks of that node. When the device model of the node cannot be obtained or the obtained device model is unrecognizable, the disk management system cannot obtain the fixed offset value from the device model, and therefore cannot calculate the logical location information of the disk, thus making it impossible to perform disk management operations such as positioning and disk replacement.
[0005] Therefore, those skilled in the art urgently need a distributed storage disk management method to address the current disk management strategies, which are only applicable to the management of standard devices and whose versatility and compatibility still need to be improved. Summary of the Invention
[0006] The purpose of this invention is to provide a distributed storage disk management method, apparatus, and medium to address the problem that current disk management strategies are only applicable to the management of standard devices, and their versatility and compatibility still need to be improved.
[0007] To address the aforementioned technical problems, this invention provides a distributed storage disk management method, comprising:
[0008] Obtain disk array card information for each node in the distributed storage system;
[0009] Obtain the disk connection location information and disk serial number of all disks under each node based on the disk array card information;
[0010] Based on the disk array card information and disk connection location information, determine the unique first disk logical slot number corresponding to each disk;
[0011] The logical slot number and serial number of the first disk corresponding to each disk are respectively stored as associated data in a preset disk information table;
[0012] Perform disk management operations based on the disk information table.
[0013] On the other hand, after obtaining the disk connection location information and disk serial number of all disks under each node based on the disk array card information, it also includes:
[0014] Get the node type information of the current node;
[0015] If the node type information of the current node is successfully obtained and the node type information is identifiable, then the current node is determined to be a standard device node; otherwise, the current node is determined to be a non-standard device node.
[0016] If the current node is a non-standard device node, proceed to the step of determining the first logical slot number of each disk based on the disk array card information and disk connection location information;
[0017] If the current node is a standard device node, then perform the following steps:
[0018] Based on the node type information, determine the slot offset value and the total number of slots for the current node;
[0019] Based on the slot offset value, the total number of slots in the node, the disk array card information, and the disk connection position information, determine the unique second disk logical slot number corresponding to all disks under the current node;
[0020] The logical slot number and disk serial number of the second disk corresponding to each disk are respectively stored as associated data in the disk information table;
[0021] Perform disk management operations based on the disk information table.
[0022] On the other hand, performing disk management operations based on the disk information table includes:
[0023] Receive and parse disk management commands to determine the disk management action and the target disk's serial number; the disk management action can be any one of disk alarm, location, or disk swapping operation;
[0024] Based on the disk serial number, determine the logical slot number corresponding to the target disk from the disk information table; wherein, the logical slot number is either the first logical slot number or the second logical slot number.
[0025] Parse the logical slot number of the target disk to locate the disk array card information and disk connection location information corresponding to the target disk;
[0026] Based on the RAID card information and disk connection location information, perform disk management actions on the target disk.
[0027] On the other hand, if the disk management action is a disk swapping operation, then after performing the disk management action on the target disk, the following steps are also included:
[0028] Obtain the new disk serial number returned after the disk swapping operation is completed;
[0029] Based on the disk array card information and disk connection location information used in this disk replacement operation, locate the disk serial number associated with the disk information table;
[0030] The disk information table is updated using the new disk serial number.
[0031] On the other hand, based on the disk array card information, the disk connection location information and disk serial number of all disks under each node are obtained, including:
[0032] Based on the disk array card information, the disk connection location information of each disk expansion card connected to the corresponding node is obtained through hardware commands;
[0033] The disk connection location information includes disk slot information, or includes both disk slot information and disk expansion card information.
[0034] On the other hand, based on the disk array card information and disk connection location information, the unique first disk logical slot number corresponding to each disk is determined as follows:
[0035] Parse the RAID card information to determine the RAID card type and RAID card number;
[0036] Generate a first-level classification number based on the disk array card type;
[0037] Generate a second-level array card number based on the disk array card number;
[0038] Parse disk connection location information to determine disk slot information, or determine disk expansion card information and physical slot information;
[0039] If disk expansion card information exists, a third-level expansion card number is generated based on the disk expansion card information; if disk expansion card information does not exist, the numbering starts from a preset initial value to generate a third-level expansion card number.
[0040] Generate a fourth-level slot number based on the disk slot information;
[0041] Based on the generated numbering at each level, determine the first logical slot number of the current disk.
[0042] On the other hand, the logical slot number of the second disk is in numeric format, and the value is an integer value within the range of 1 to the total number of slots in the node;
[0043] The first disk logical slot number must include at least one non-numeric digit.
[0044] After determining the logical slot number of the target disk from the disk information table based on the disk serial number, the process also includes:
[0045] Based on whether the disk logical slot number is in pure numeric format, determine whether the node to which the target disk belongs is a standard device or a non-standard device, and return the determination result.
[0046] To address the aforementioned technical problems, the present invention also provides a distributed storage disk management device, comprising:
[0047] The first acquisition module is used to acquire disk array card information of each node in the distributed storage system;
[0048] The second acquisition module is used to acquire the disk connection location information and disk serial number of all disks under each node based on the disk array card information;
[0049] The first determining module is used to determine the first logical slot number of each disk uniquely corresponding to each disk based on the disk array card information and disk connection position information.
[0050] The slot association module is used to store the first disk logical slot number and disk serial number corresponding to each disk as associated data in a preset disk information table;
[0051] The disk management module is used to perform disk management operations based on the disk information table.
[0052] To address the aforementioned technical problems, the present invention also provides a distributed storage disk management device, comprising:
[0053] Memory, used to store computer programs;
[0054] A processor is used to implement the steps of the distributed storage disk management method described above when executing computer programs.
[0055] To address the aforementioned technical problems, the present invention also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the distributed storage disk management method described above.
[0056] To solve the above-mentioned technical problems, the present invention also provides a
[0057] This invention provides a distributed storage disk management method. By acquiring disk array card information and disk connection location information, it determines the different actual physical locations of each disk in the distributed storage system. Based on these differences, it generates a unique logical slot number for each disk according to certain rules. Even when a node is a non-standard device and the slot offset value of the node disk cannot be obtained, it can still generate a unique logical slot number for each disk. This number is then associated with the disk serial number, facilitating user management operations via the disk serial number. This solution meets the management requirements of disk management systems for non-standard devices, broadens the applicability of disk management, improves the compatibility of disk management systems, and better meets the needs of practical disk management scenarios.
[0058] The distributed storage disk management device and computer-readable storage medium provided by this invention correspond to the above-described method and have the same effect. Attached Figure Description
[0059] To more clearly illustrate the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0060] Figure 1 This is a disk architecture diagram of a distributed storage system;
[0061] Figure 2 A flowchart of a distributed storage disk management method provided by the present invention;
[0062] Figure 3 A structural diagram of a distributed storage disk management device provided by the present invention;
[0063] Figure 4 This is a structural diagram of another distributed storage disk management device provided by the present invention. Detailed Implementation
[0064] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the protection scope of the present invention.
[0065] The core of this invention is to provide a distributed storage disk management method, device, and medium.
[0066] To enable those skilled in the art to better understand the present invention, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0067] Currently, when managing disks, the disk management system needs to fix the disk arrangement on each device to ensure consistency between the disk information displayed on the device view and the actual physical machine location. It then calculates the offset between the physical disk location information and the location information displayed on the interface based on this arrangement, and uses the logical location information after the physical disk location information is offset to manage the disk.
[0068] For example, taking 36 disks on a single node as an example, the above disk management scheme is illustrated as follows:
[0069] like Figure 1 As shown, a node device includes one disk array card and three disk expansion cards, each with 12 disks connected to it, for a total of 36 disks. To associate the disk slot number with the disk insertion location, the logical disk slot number will be fixed within the range of 1 to 36.
[0070] Since each disk's connection position on the expansion card is determined by its specific slot number, and the first disk on an expansion card may not necessarily correspond to the first slot, it's necessary to calculate the slot offset value for each disk connected to the expansion card. This slot offset value is related to the node device and is usually fixed. Based on the slot offset value, the disk slot numbers of the three expansion cards are converted into three groups of logical disk slot numbers: 1-12, 13-24, and 25-36. Administrators can then intuitively determine the correspondence between the disk information displayed on the interface and the actual physical connection positions of the disks using the disk slot numbers, facilitating subsequent operation and maintenance.
[0071] However, it's clear that while the above solution can clearly display disk location information in the management interface, it requires determining the offset value, which is strongly correlated with the node's device type. Therefore, if the node type cannot be obtained, i.e., the total number of disk slots and the offset value cannot be determined, and the logical slot number of each disk cannot be determined, it becomes impossible to perform disk management operations such as alarms, location, and disk replacement on the device.
[0072] Therefore, the above disk management scheme relies on the premise that the node devices must be standard devices. Standard devices are those whose model the disk management system can directly obtain and identify. Thus, the above disk management scheme is no longer applicable to non-standard devices, and the compatibility and versatility of the disk management system need improvement.
[0073] To address the above problems, this invention provides a distributed storage disk management method, such as... Figure 2 As shown, it includes:
[0074] S11: Obtain disk array card information for each node in the distributed storage system.
[0075] S12: Obtain the disk connection location information and disk serial number of all disks under each node based on the disk array card information.
[0076] S13: Based on the disk array card information and disk connection location information, determine the unique first disk logical slot number corresponding to each disk.
[0077] S14: Store the first disk logical slot number and disk serial number corresponding to each disk as associated data in the preset disk information table.
[0078] S15: Perform disk management operations based on the disk information table.
[0079] As for step S11, it is easy to see that step S11 is a global step for the distributed storage system, globally obtaining the disk array card information under all nodes. The disk array card information mentioned above includes at least the disk array card type and disk array card number; among them, common disk array card types include: RAID card, SAS card, and PMC card, etc.; while the disk array card number is used to distinguish different disk array cards deployed on the node device.
[0080] Step S12, based on the disk array card information obtained in step S11, further obtains the connected disk wiring location information via hardware commands. It should be noted that disk array cards typically connect to disks via disk expansion cards, forming a three-tier structure: array card—expansion card—disk. However, some types of disk array cards can be identified by their expansion card identifiers, distinguishing different expansion cards, such as RAID cards and SAS cards; other types do not have expansion card identifiers, such as PMC cards. Therefore, the disk wiring location information obtained for these two types of disk array cards is different. The disk wiring location information for RAID and SAS cards includes both disk expansion card information and disk slot information; while the disk wiring location information for PMC cards only includes disk slot information.
[0081] In summary, the disk connection location information obtained in step S12 includes at least disk slot information, and may also include disk expansion card information (whether it is included depends on the type of disk array card).
[0082] Regarding step S13, it should be noted that in this method, determining the logical slot number of the disk no longer requires the offset value and the total slot value, so node type identification is no longer necessary. Furthermore, hardware information such as RAID card information and disk connection location information can be queried for non-standard devices based on hardware instructions, making this method additionally applicable to non-standard devices. Once the RAID card information and disk connection location information are obtained, which distinguish the different physical connection locations of different disks under the same node, a unique logical slot number corresponding to each disk can be generated for disk management.
[0083] It should also be noted that the method of generating disk logical slot numbers in this invention differs from traditional methods, and the resulting disk logical slot numbers are also different. Furthermore, this method of generating disk logical slot numbers is not only applicable to non-standard devices but also to standard devices; however, the intuitiveness of demonstrating the relationship between disk information and the actual physical wiring positions of the disk is slightly less.
[0084] To distinguish the disk logical slot number provided by this method from that provided for non-standard devices, which is only applicable to standard devices, the disk logical slot number generated by this method that is applicable to non-standard devices is called the first disk logical slot number.
[0085] In addition, the disk logical slot number generated in this step is only for the purpose of uniquely identifying each disk under the node. Therefore, the present invention does not impose strict restrictions on the generation rules and format of the first disk logical slot number, and can be freely selected according to actual needs.
[0086] For example, this embodiment provides an implementation scheme for generating a first disk logical slot number, that is, step S13 specifically includes:
[0087] S131: Parse the disk array card information to determine the disk array card type and disk array card number;
[0088] S132: Generate a first-level classification number based on the disk array card type;
[0089] S133: Generate a second-level RAID card number based on the disk array card number;
[0090] S134: Parse disk connection location information to determine disk slot information, or determine disk expansion card information and physical slot information;
[0091] S135: If disk expansion card information exists, generate a third-level expansion card number based on the disk expansion card information; if disk expansion card information does not exist, start numbering from a preset initial value to generate a third-level expansion card number.
[0092] S136: Generate a fourth-level slot number based on the disk slot information;
[0093] S137: Based on the generated numbering at each level, determine the first logical slot number of the current disk.
[0094] First, based on the above scheme, it is not difficult to see that the first disk logical slot number generated in this embodiment is a multi-level structure number. In order to more clearly distinguish the different levels of numbers, the numbers at each level can be separated by separators such as " / ".
[0095] For steps S131 to S133, the first two levels of numbers can be generated based on the disk array card information.
[0096] For step S132, three common disk array card types have been given above: RAID, SAS, and PMC, and their first letters are different. Therefore, the first letter of the disk array card type can be directly used to represent the first-level classification number. For example, the disk array card type RAID corresponds to the first-level classification number R, the disk array card type SAS corresponds to the first-level classification number S, and the disk array card type PMC corresponds to the first-level classification number P. It should also be noted that using the first letter of the array card type as the first-level classification number is only one possible implementation. If the first letters of the array card types are repeated, other numbering rules need to be used.
[0097] Step S133 aims to distinguish different RAID cards. One possible generation rule is to sequentially number the RAID cards based on the RAID card number sequence obtained from the hardware command query, starting from a set initial value (e.g., "0"). Specifically, to more clearly distinguish them from other numbering levels, the RAID card number begins with a special identifier (e.g., the letter "C"). An example is as follows:
[0098] For the disk array card with the serial number 1 found in the query, its corresponding second-level array card number is: C0 (initial value is 0).
[0099] For step S135, as mentioned above, RAID cards and SAS cards have disk expansion card identifiers, so when determining the number of the third-level expansion card, the number in its expansion card identifier can be directly queried and used as the number value of the third-level expansion card. However, PMC cards do not have expansion card identifiers and can only be distinguished by the wiring order, so the numbering starts from the initial value (0).
[0100] For example, if the RAID card finds the expansion card identifier as "e65", then the corresponding generated third-level expansion card number can be: E65 (where the letter "E" is a special identifier corresponding to the expansion card, and uppercase and lowercase are used to distinguish between the found expansion card identifier and the generated third-level expansion card number).
[0101] For PMC cards, there is no expansion card identifier. If the current expansion card number is 2, then its corresponding third-level expansion card number is: E1 (initial value is 0).
[0102] Similarly, for step S136, one possible rule for generating the fourth-level slot number is: determine the fourth-level slot number based on the disk slot number (slot value) queried by the hardware instruction.
[0103] For example, if the queried slot value is 64, the corresponding fourth-level slot number is: A64 (where the letter "A" is a special identifier corresponding to the slot).
[0104] Based on the above numbering rules, it can be determined that the first logical slot number generated for each disk consists of 4 levels of encoding, separated by delimiters. For example, one possible first logical slot number is: R / C0 / E65 / A64. Here, "R" indicates that the RAID card type to which the disk belongs is RAID; "C0" indicates that the RAID card number to which the disk belongs is "0", which is the first RAID card of this node; "E65" indicates that the expansion card number to which the disk belongs is "65"; and "A64" indicates that the corresponding cable slot for this disk is "64". This achieves the generation of a unique logical slot number for each disk under a node.
[0105] Step S14 involves establishing a mapping relationship between the logical disk slot number determined in step S13 and the disk serial number (SN code). This allows users to directly determine the logical disk slot number using the SN code and locate the target disk during subsequent disk management. Specifically, this mapping relationship is stored in a table, where a set of corresponding logical disk slot numbers and disk serial numbers are stored as associated data in a pre-established disk information table. Based on this, when a user issues a management operation on a target disk using its serial number, the corresponding logical disk slot number can be quickly determined through the disk information table, allowing the user to locate the target disk and perform the appropriate management operation.
[0106] For step S15, the disk management operation can be any common disk management operation, and this embodiment does not limit it. For example, it can be disk alarm, location, disk replacement, etc. Furthermore, the specific implementation schemes of the above-mentioned common disk management operations are well known to those skilled in the art, and will not be elaborated upon here.
[0107] As can be seen from the above, the distributed storage disk management method provided by this invention improves upon the problem of current disk management strategies being inapplicable to non-standard device nodes. By using disk array card information and disk wiring location information, which can represent the differences in the actual physical wiring positions of the disks, a first logical slot number uniquely corresponding to each disk is generated. This first logical slot number, associated with the disk serial number, participates in disk management. This achieves debinding of disk management and node types, solving the problem in traditional solutions where the node type of non-standard devices cannot be identified, thus making it impossible to determine the slot offset value and the total number of slots, and therefore impossible to calculate the logical slot number. This extends the application scope of the disk management solution to nodes of non-standard devices, improving the compatibility of the disk management system. Furthermore, based on the first logical slot number determined above, the disk wiring position can be directly traced, which can improve the efficiency of disk location to a certain extent, thereby improving disk management efficiency.
[0108] It should be noted that the disk management method provided in the above embodiments is applicable not only to non-standard devices but also to standard devices. However, traditional disk management schemes also have their unique advantages, namely, a more intuitive display of the correlation between disk information and the actual location of the disk. Based on this, this embodiment also provides a possible implementation scheme, in which the above method further includes the following after step S12:
[0109] S21: Get the node type information of the current node;
[0110] S22: If the node type information of the current node is successfully obtained and the node type information is identifiable, then the current node is determined to be a standard device node; otherwise, the current node is determined to be a non-standard device node. If the current node is a non-standard device node, proceed to step S13; if the current node is a standard device node, execute the following steps:
[0111] S23: Determine the slot offset value and total slot value of the current node based on the node type information;
[0112] S24: Based on the slot offset value, the total number of slots in the node, the disk array card information, and the disk connection position information, determine the unique second disk logical slot number corresponding to all disks under the current node;
[0113] S25: Store the logical slot number and disk serial number of the second disk corresponding to each disk as associated data in the disk information table;
[0114] Then, return to step S15: Perform disk management operations based on the disk information table.
[0115] That is, before determining the logical slot number of the disk, this embodiment also determines the node type of the current node, that is, whether the current node is a standard device or a non-standard device. For a standard device node, the logical slot number of its disk is obtained based on the above steps S23 to S25, and is called the second logical slot number to distinguish it from the first logical slot number in the above embodiment. Specific generation examples are also shown in the example above where one node includes one disk array card, three disk expansion cards, and 36 disks, which will not be repeated in this embodiment.
[0116] It's important to note that the disk management system manages all disks across all nodes in a distributed storage system. However, in a distributed storage system, some nodes may use standard devices while others use non-standard devices. In this case, the disk management system can determine the logical disk slot number using either steps S13-S14 or steps S23-S25, depending on the node type. That is, there may be situations where the disk information table in a distributed storage system includes both first and second logical disk slot numbers in different forms. Furthermore, the different forms of logical disk slot numbers are all node-based; that is, all disks under a node either use the first logical disk slot number or all use the second logical disk slot number.
[0117] For non-standard devices, the first logical disk slot number is determined based on steps S13 to S14 to ensure compatibility with disk management for non-standard devices; for standard devices, the second logical disk slot number is determined based on steps S23 to S25 to provide a more intuitive representation of the actual physical wiring location of the disk; thus, the advantages of the above-mentioned steps S11 to S15 scheme and the traditional scheme are combined to achieve better disk management results.
[0118] It should be noted that, based on the above embodiments, it is easy to see that the first disk logical slot number generated in steps S13 to S14 and the second disk logical slot number in pure numeric form generated in steps S23 to S25 have obvious differences in format. In particular, the first disk logical slot number has a multi-level encoding structure based on delimiters, and also includes non-numeric encoding such as letters, which allows users to quickly and intuitively distinguish between the first and second disk logical slot numbers.
[0119] On the other hand, regarding step S15 above, which is the implementation method of managing the disk after determining the disk logical slot number, this embodiment also provides a possible implementation method, wherein step S15 above specifically includes:
[0120] S151: Receive and parse disk management instructions to determine the disk management action and the disk serial number of the target disk.
[0121] Disk management actions include any one of the following: disk alarm, location, and disk swapping.
[0122] S152: Determine the logical slot number of the target disk from the disk information table based on the disk serial number.
[0123] The disk logical slot number is either the first disk logical slot number or the second disk logical slot number.
[0124] S153: Parse the logical slot number of the target disk to locate the disk array card information and disk connection location information corresponding to the target disk.
[0125] S154: Perform disk management actions on the target disk based on the disk array card information and disk connection location information.
[0126] It should be noted that disk swapping during management operations will cause a change in the disk's serial number. In this case, the data in the disk information table needs to be updated to meet the requirements of the next management operation on that disk. Based on this requirement, this embodiment provides a possible implementation plan: if the disk management action performed is a disk swapping operation, then after step S154, the following steps are also included:
[0127] S155: Obtain the new disk serial number returned after the disk swapping operation is completed;
[0128] S156: Based on the disk array card information and disk connection location information used in this disk replacement operation, locate the disk serial number associated with the disk information table;
[0129] S157: Update the disk information table using the new disk serial number.
[0130] In other words, this embodiment will replace the old disk serial number in the disk information table with the new disk serial number returned after the disk replacement operation, thus updating the disk information table. Therefore, in subsequent disk management processes, if the user uses the new disk serial number to manage the disk, the disk management system can correctly identify and locate the target disk and complete the management operation.
[0131] On the other hand, regarding the format of the first disk logical slot number and the second disk logical slot number in the above embodiments, a more preferred implementation scheme is provided:
[0132] The logical slot number of the second disk is in numeric format, and the value is an integer value within the range of 1 to the total number of slots in the node;
[0133] The first disk logical slot number must include at least one non-numeric digit.
[0134] Therefore, the format of the disk logical slot number can intuitively show whether the disk node belongs to a standard device or a non-standard device.
[0135] Therefore, this embodiment further provides an implementation scheme, which includes the following step after step S152:
[0136] S158: Determine whether the node to which the target disk belongs is a standard device or a non-standard device based on whether the disk logical slot number is in pure numeric format, and return the determination result.
[0137] For the implementation of step S158, determining whether the disk logical slot number is in pure numeric format can also be converted to determining whether the disk logical slot number contains special identifiers or separators in non-numeric form, such as recognizing the letters R, S, P, C, E, A, etc. in the example provided in the above embodiment, as well as the separator " / ", so as to return the node type recognition result to the user.
[0138] In the above embodiments, a distributed storage disk management method has been described in detail. The present invention also provides an embodiment corresponding to a distributed storage disk management device. It should be noted that the present invention describes the device embodiment from two perspectives: one based on functional modules, and the other based on hardware.
[0139] From the perspective of functional modules, this embodiment provides a distributed storage disk management device, such as... Figure 3 As shown, it includes:
[0140] The first acquisition module 11 is used to acquire disk array card information of each node in the distributed storage system;
[0141] The second acquisition module 12 is used to acquire the disk connection location information and disk serial number of all disks under each node based on the disk array card information;
[0142] The first determining module 13 is used to determine the first logical slot number of each disk uniquely corresponding to each disk based on the disk array card information and disk connection position information.
[0143] The slot association module 14 is used to store the first disk logical slot number and disk serial number corresponding to each disk as associated data in a preset disk information table.
[0144] The disk management module 15 is used to perform disk management operations based on the disk information table.
[0145] Since the embodiments of the apparatus and the embodiments of the method correspond to each other, please refer to the description of the embodiments of the method for the embodiments of the apparatus, which will not be repeated here.
[0146] Figure 4 A structural diagram of a distributed storage disk management device provided in another embodiment of the present invention is shown below. Figure 4 As shown, a distributed storage disk management device includes: a memory 20 for storing computer programs;
[0147] The processor 21 is used to execute computer programs to implement the steps of a distributed storage disk management method as described in the above embodiments.
[0148] The distributed storage disk management device provided in this embodiment may include, but is not limited to, mobile terminals, personal computers, workstations, etc.
[0149] The processor 21 may include one or more processing cores, such as a quad-core processor or an octa-core processor. The processor 21 may be implemented using at least one of the following hardware forms: Digital Signal Processor (DSP), Field-Programmable Gate Array (FPGA), or Programmable Logic Array (PLA). The processor 21 may also include a main processor and a coprocessor. The main processor, also known as the Central Processing Unit (CPU), is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, the processor 21 may integrate a Graphics Processing Unit (GPU), which is responsible for rendering and drawing the content to be displayed on the screen. In some embodiments, the processor 21 may also include an Artificial Intelligence (AI) processor, which is used to handle computational operations related to machine learning.
[0150] The memory 20 may include one or more computer-readable storage media, which may be non-transitory. The memory 20 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices or flash memory devices. In this embodiment, the memory 20 is used to store at least the following computer program 201, which, after being loaded and executed by the processor 21, is capable of implementing the relevant steps of a distributed storage disk management method disclosed in any of the foregoing embodiments. In addition, the resources stored in the memory 20 may also include an operating system 202 and data 203, and the storage method may be temporary or permanent storage. The operating system 202 may include Windows, Unix, Linux, etc. The data 203 may include, but is not limited to, a distributed storage disk management method.
[0151] In some embodiments, a distributed storage disk management device may further include a display screen 22, an input / output interface 23, a communication interface 24, a power supply 25, and a communication bus 26.
[0152] Those skilled in the art will understand that Figure 4 The structure shown does not constitute a limitation on a distributed storage disk management device and may include more or fewer components than illustrated.
[0153] The present invention provides a distributed storage disk management device, including a memory and a processor. When the processor executes a program stored in the memory, it can implement the following method: a distributed storage disk management method.
[0154] Finally, the present invention also provides an embodiment corresponding to a computer-readable storage medium. The computer-readable storage medium stores a computer program, which, when executed by a processor, performs the steps described in the above method embodiments.
[0155] It is understood that if the methods in the above embodiments are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and executes all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0156] The above provides a detailed description of a distributed storage disk management method, apparatus, and medium provided by the present invention. The various embodiments in the specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to in the method section. It should be noted that those skilled in the art can make several improvements and modifications to the present invention without departing from the principles of the invention, and these improvements and modifications also fall within the protection scope of the claims of the present invention.
[0157] It should also be noted that, in this specification, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
Claims
1. A distributed storage disk management method, characterized in that, include: Obtain disk array card information for each node in the distributed storage system; Based on the disk array card information, obtain the disk connection location information and disk serial number of all disks under each node; Obtain the node type information of the currently stated node; If the node type information of the current node is successfully obtained and the node type information is identifiable, then the current node is determined to be a standard device node; otherwise, the current node is determined to be a non-standard device node. If the current node is a non-standard device node, then the first logical slot number uniquely corresponding to each disk is determined based on the disk array card information and the disk connection position information; The first disk logical slot number and the disk serial number corresponding to each disk are respectively stored as associated data in a preset disk information table; Perform disk management operations based on the disk information table; If the current node is a standard device node, then perform the following steps: Based on the node type information, determine the current slot offset value and the total number of slots for the node; Based on the slot offset value, the total number of slots in the node, the disk array card information, and the disk connection position information, determine the unique second disk logical slot number corresponding to all disks under the current node; The logical slot number of the second disk and the disk serial number corresponding to each disk are respectively stored as associated data in the disk information table; Perform disk management operations based on the disk information table.
2. The distributed storage disk management method according to claim 1, characterized in that, The step of performing disk management operations based on the disk information table includes: Receive and parse disk management instructions to determine the disk management action and the disk serial number of the target disk; wherein, the disk management action is any one of disk alarm, location, and disk swapping operation; Based on the disk serial number, the logical slot number corresponding to the target disk is determined from the disk information table; wherein, the logical slot number is either the first logical slot number or the second logical slot number. The logical slot number of the target disk is parsed to locate the disk array card information and disk connection position information corresponding to the target disk; Based on the disk array card information and the disk connection location information, the disk management action is performed on the target disk.
3. The distributed storage disk management method according to claim 2, characterized in that, If the disk management action is a disk swapping operation, then after performing the disk management action on the target disk, the following steps are also included: Obtain the new disk serial number returned after the disk swapping operation is completed; Based on the disk array card information and disk connection location information used in this disk replacement operation, the disk serial number associated with the disk information table is located; The disk information table is updated using the new disk serial number.
4. The distributed storage disk management method according to any one of claims 1 to 3, characterized in that, Based on the disk array card information, obtain the disk connection location information and disk serial number of all disks under each node, including: Based on the disk array card information, the disk connection position information of each disk expansion card connected to the corresponding node is obtained through hardware commands; The disk connection location information includes disk slot information, or includes: disk slot information and disk expansion card information.
5. The distributed storage disk management method according to claim 4, characterized in that, Based on the disk array card information and the disk connection location information, the unique first disk logical slot number corresponding to each disk is determined as follows: The disk array card information is parsed to determine the disk array card type and disk array card number; A first-level classification number is generated based on the disk array card type; Generate a second-level array card number based on the disk array card number; The disk connection location information is parsed to determine the disk slot information, or to determine the disk expansion card information and physical slot information; If the disk expansion card information exists, a third-level expansion card number is generated based on the disk expansion card information; if the disk expansion card information does not exist, the numbering starts from a preset initial value to generate the third-level expansion card number. A fourth-level slot number is generated based on the disk slot information; Based on the generated numbering at each level, the first logical slot number of the current disk is determined.
6. The distributed storage disk management method according to claim 2, characterized in that, The second disk logical slot number is in numeric format, and the value is an integer value within the range of 1 to the total number of slots in the node; The first disk logical slot number includes at least one non-numeric number. After determining the logical slot number of the target disk from the disk information table based on the disk serial number, the method further includes: Based on whether the disk logical slot number is in pure numeric format, determine whether the node to which the target disk belongs is a standard device or a non-standard device, and return the determination result.
7. A distributed storage disk management device, characterized in that, include: The first acquisition module is used to acquire disk array card information of each node in the distributed storage system; The second acquisition module is used to acquire the disk connection location information and disk serial number of all disks under each node according to the disk array card information; acquire the node type information of the current node; if the node type information of the current node is successfully acquired and the node type information is identifiable, then the current node is determined to be a standard device node; otherwise, the current node is determined to be a non-standard device node. The first determining module is used to determine the first logical slot number of each disk uniquely corresponding to each disk based on the disk array card information and the disk connection position information if the current node is a non-standard device node; and to determine the slot offset value and the total number of slots of the current node based on the node type information if the current node is a standard device node. Based on the slot offset value, the total number of slots in the node, the disk array card information, and the disk connection position information, determine the unique second disk logical slot number corresponding to all disks under the current node; The slot association module is used to store the first disk logical slot number and the disk serial number corresponding to each disk as associated data in a preset disk information table if the current node is a non-standard device node; and to store the second disk logical slot number and the disk serial number corresponding to each disk as associated data in the disk information table if the current node is a standard device node. The disk management module is used to perform disk management operations based on the disk information table.
8. A distributed storage disk management device, characterized in that, include: Memory, used to store computer programs; A processor, configured to implement the steps of the distributed storage disk management method as described in any one of claims 1 to 6 when executing the computer program.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the distributed storage disk management method as described in any one of claims 1 to 6.