Method, device, equipment and program product for mapping logical hard disks and physical hard disks

By identifying and recording the mapping relationship between logical hard drives and physical hard drives in the storage server, the problem of mapping confusion caused by users flexibly plugging and unplugging hard drives is solved, and the mapping relationship can be determined quickly and accurately and faults can be repaired.

CN120687037BActive Publication Date: 2025-12-30ZIGUANG HENGYUE TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510821664.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-06-19
Publication Date
2025-12-30
Estimated Expiration
2045-06-19

AI Technical Summary

Technical Problem

In scenarios where users can freely plug and unplug physical hard drives, the mapping relationship between logical hard drives and physical hard drives in storage servers becomes chaotic, making troubleshooting difficult, increasing time costs, and potentially leading to data loss or business interruption.

Method used

During the process of users plugging and unplugging physical hard drives, the storage server identifies the slot status, assigns logical hard drive serial numbers related to the hard drive identification timing, and records the hard drive serial number, identification time, and slot mapping relationship. It uses the backplane controller and RAID card controller to improve identification and allocation efficiency, updates the mapping table in a timely manner, and uses electrically erasable programmable read-only memory to stably store the mapping relationship.

Benefits of technology

It enables the rapid and accurate determination of the mapping relationship between logical hard drives and physical hard drives in scenarios where users can flexibly plug and unplug physical hard drives, improving the efficiency of fault location and repair, and ensuring the uniqueness and accuracy of the mapping relationship.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120687037B_ABST
    Figure CN120687037B_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a method, device, equipment and program product for mapping logical hard disk and physical hard disk, and relate to the technical field of computer storage. The method comprises: identifying whether a physical hard disk is inserted into each empty slot in a plurality of slots of a storage server in the process that a user plugs and unplugs the physical hard disk in the plurality of slots; if a physical hard disk is inserted into any empty slot, assigning a logical hard disk to the current physical hard disk; the hard disk serial number of the current logical hard disk is positively correlated with the identification time sequence of the current physical hard disk, and the identification time sequence of the current physical hard disk is determined according to the arrangement order of the identification time of all physical hard disks on the current storage server; and storing the hard disk serial number of the current logical hard disk, the identification time of the current physical hard disk and the slot of the current physical hard disk as a group of mapping relationship. Embodiments of the present application can quickly and accurately determine the mapping relationship between the logical hard disk and the physical hard disk in the scene that the user flexibly plugs and unplugs the physical hard disk.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer storage technology, and more specifically, to a method, apparatus, device, and program product for mapping logical hard disks and physical hard disks. Background Technology

[0002] Currently, in order to meet the storage needs of massive amounts of data, the number of physical hard drives that can be installed on storage servers is constantly increasing, so that users can flexibly plug and unplug physical hard drives on storage servers according to actual application needs.

[0003] However, in practical applications, it has been found that this flexible physical hard drive connection method poses significant challenges to the mapping between logical and physical hard drives on storage servers. Because users can freely plug and unplug physical hard drives, the mapping relationship between logical and physical hard drives in the storage server can easily become chaotic. When any logical hard drive on the storage server fails, maintenance personnel struggle to quickly and accurately determine the corresponding physical hard drive slot. This not only increases the time cost of troubleshooting but also easily leads to data loss or business interruption due to delays in fault repair.

[0004] In scenarios where users can freely plug and unplug physical hard drives, how to quickly and accurately determine the mapping relationship between logical hard drives and physical hard drives has become a major problem that urgently needs to be solved. Summary of the Invention

[0005] The purpose of this application is to provide a method, apparatus, device, and program product for mapping logical hard drives and physical hard drives, so as to achieve the technical effect of quickly and accurately determining the mapping relationship between logical hard drives and physical hard drives in scenarios where users flexibly plug and unplug physical hard drives.

[0006] In a first aspect, embodiments of this application provide a method for mapping logical hard disks and physical hard disks, applied to a storage server, the storage server including multiple slots; the method includes:

[0007] During the process of the user randomly inserting and removing physical hard drives in the multiple slots, it is identified whether a physical hard drive is inserted in each empty slot among the multiple slots.

[0008] If a physical hard drive is found to be inserted into any empty slot among the plurality of slots, a logical hard drive is allocated to the current physical hard drive; wherein, the hard drive serial number of the current logical hard drive is positively correlated with the identification time sequence of the current physical hard drive, and the identification time sequence of the current physical hard drive is determined according to the order of the identification times of all physical hard drives on the current storage server;

[0009] The hard drive serial number of the current logical hard drive, the identification time of the current physical hard drive, and the insertion slot of the current physical hard drive are stored as a mapping relationship.

[0010] In the above implementation process, the storage server identifies whether a physical hard drive is inserted in each empty slot during the user's arbitrarily plugging and unplugging of physical hard drives in multiple slots. When a physical hard drive is found in any empty slot, a logical hard drive with a hard drive serial number positively correlated with the identification time of the current physical hard drive is assigned to it. The hard drive serial number of the current logical hard drive, the identification time of the current physical hard drive, and the slot where the current physical hard drive is plugged in are stored as a mapping relationship. On the one hand, logical hard drives can be assigned to the first inserted physical hard drive first, ensuring that the logical hard drives assigned to the first and the last inserted physical hard drives are not out of order. On the other hand, the identification time of the physical hard drive can be introduced to associate the hard drive serial number of the logical hard drive with the slot where the physical hard drive is plugged in, solving the problem of chaotic mapping relationship between logical hard drives and physical hard drives in the scenario where users arbitrarily plug and unplug physical hard drives. This ensures that the mapping relationship between logical hard drives and physical hard drives is unique and accurate, thereby enabling the rapid and accurate determination of the mapping relationship between logical hard drives and physical hard drives in the scenario where users arbitrarily plug and unplug physical hard drives.

[0011] Furthermore, the storage server includes a backplane controller and a disk array RAID card controller;

[0012] The step of identifying whether a physical hard drive is inserted in each of the plurality of slots (empty slots) includes:

[0013] The backplane controller identifies whether a physical hard drive is inserted into each empty slot;

[0014] The process of allocating logical hard drives to the current physical hard drive includes:

[0015] The current logical hard drive is allocated to the current physical hard drive through the RAID card controller.

[0016] In the above implementation process, by using the backplane controller in the storage server to identify whether each empty slot in multiple slots has a physical hard drive inserted, and by using the RAID card controller in the storage server to allocate the current logical hard drive to the current physical hard drive, the identification efficiency of physical hard drives and the allocation efficiency of logical hard drives can be improved. This allows for a faster and more accurate determination of the mapping relationship between logical hard drives and physical hard drives in scenarios where users can flexibly plug and unplug physical hard drives.

[0017] Furthermore, the method also includes:

[0018] When the backplane controller detects the current physical hard drive, it records the first mapping relationship between the current physical hard drive's slot and the current physical hard drive's detection time in a first mapping table.

[0019] After allocating the current logical hard drive to the current physical hard drive through the RAID card controller, the second mapping relationship between the identification time of the current physical hard drive and the hard drive serial number of the current logical hard drive is recorded in the second mapping table.

[0020] In the above implementation process, by using the backplane controller in the storage server to directly record and maintain the first mapping relationship between the physical hard drive slot determined in the physical hard drive identification stage and the physical hard drive identification time in the first mapping table, and by using the RAID card controller in the storage server to directly record and maintain the second mapping relationship between the physical hard drive identification time determined in the logical hard drive allocation stage and the logical hard drive serial number in the second mapping table, the mapping efficiency between logical hard drives and physical hard drives can be further improved.

[0021] Furthermore, the method also includes:

[0022] The backplane controller identifies whether a physical hard drive has been removed from each of the multiple slots that are not empty. If a physical hard drive is removed from any of the multiple slots that are not empty, the first mapping relationship corresponding to the removed physical hard drive is deleted from the first mapping table.

[0023] When the backplane controller recognizes the removed physical hard drive, the RAID card controller deletes the second mapping relationship corresponding to the removed physical hard drive from the second mapping table.

[0024] In the above implementation process, by using the backplane controller in the storage server to identify whether a physical hard drive has been removed from each non-empty slot in multiple slots, and when a physical hard drive is identified as being removed from any non-empty slot, the first mapping relationship corresponding to the removed physical hard drive is deleted from the first mapping table, and the second mapping relationship corresponding to the removed physical hard drive is synchronously deleted from the second mapping table by using the RAID card controller in the storage server. This enables timely updates to the mapping relationship between logical hard drives and physical hard drives, and better enables the rapid and accurate determination of the mapping relationship between logical hard drives and physical hard drives in scenarios where users flexibly plug and unplug physical hard drives.

[0025] Furthermore, the storage server includes a memory, which includes an electrically erasable programmable read-only memory;

[0026] The step of storing the hard drive serial number of the current logical hard drive, the identification time of the current physical hard drive, and the insertion slot of the current physical hard drive as a mapping relationship includes:

[0027] The hard drive serial number of the current logical hard drive, the identification time of the current physical hard drive, and the insertion slot of the current physical hard drive are stored as a mapping relationship in the memory.

[0028] In the above implementation process, by storing the current logical hard disk serial number, the current physical hard disk identification time, and the current physical hard disk slot as a mapping relationship in the storage server's electrically erasable programmable read-only memory or other memory, the mapping relationship between the logical hard disk and the physical hard disk can be effectively prevented from being damaged or deleted, thus ensuring the stable storage of the mapping relationship between the logical hard disk and the physical hard disk.

[0029] Furthermore, the method also includes:

[0030] If a failure is detected in any of the logical hard drives on the storage server, the identification time of the target physical hard drive corresponding to the hard drive serial number of the failed logical hard drive is determined.

[0031] Determine the insertion slot of the target physical hard drive corresponding to the recognition time of the target physical hard drive.

[0032] In the above implementation process, when the storage server detects a failure of any logical hard drive among all logical hard drives on the storage server, it determines the identification time of the target physical hard drive corresponding to the hard drive serial number of the failed logical hard drive, and then determines the insertion slot of the target physical hard drive corresponding to the identification time of the target physical hard drive. In scenarios where users can flexibly insert physical hard drives, the insertion slot of the target physical hard drive corresponding to the failed logical hard drive can be quickly and accurately located based on the mapping relationship of all groups in the storage.

[0033] Furthermore, the method also includes:

[0034] Send a fault message to the user terminal indicating the faulty logical hard drive; wherein the fault message includes the connection slot of the target physical hard drive.

[0035] In the above implementation process, when the storage server detects a failure in any logical hard drive among all logical hard drives on the storage server, it sends a fault prompt message to the user terminal, including the connection slot of the target physical hard drive corresponding to the faulty logical hard drive. This allows the user to quickly locate the connection slot of the target physical hard drive for fault repair, which helps to improve the efficiency of fault repair for the target physical hard drive.

[0036] Secondly, embodiments of this application provide an apparatus for mapping logical hard disks and physical hard disks, applied to a storage server, the storage server including multiple slots; the apparatus includes:

[0037] The physical hard drive identification module is used to identify whether a physical hard drive is inserted in each empty slot among the multiple slots;

[0038] The logical hard disk allocation module is used to allocate a logical hard disk to the current physical hard disk when a physical hard disk inserted into any empty slot among the plurality of slots is detected; wherein, the hard disk serial number of the current logical hard disk is positively correlated with the identification time sequence of the current physical hard disk, and the identification time sequence of the current physical hard disk is determined according to the order of the identification times of all physical hard disks on the current storage server;

[0039] The mapping relationship storage module is used to store the hard disk serial number of the current logical hard disk, the identification time of the current physical hard disk, and the insertion slot of the current physical hard disk as a set of mapping relationships.

[0040] Thirdly, embodiments of this application provide an electronic device, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor; the processor executes the computer program to implement the method described above.

[0041] Fourthly, embodiments of this application provide a computer program product, the computer program product including instructions, which, when executed by a computer, cause the computer to perform the method described above.

[0042] Fifthly, embodiments of this application provide a computer-readable storage medium, the computer-readable storage medium including a stored computer program; wherein, when the computer program is executed, it controls the device where the computer-readable storage medium is located to perform the method described above. Attached Figure Description

[0043] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments of this application will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0044] Figure 1 A flowchart illustrating a method for mapping logical hard disks and physical hard disks, provided in the first embodiment of this application;

[0045] Figure 2A schematic diagram of a device for mapping logical hard disks and physical hard disks provided in the second embodiment of this application;

[0046] Figure 3 This is a schematic diagram of the structure of an electronic device provided in the third embodiment of this application. Detailed Implementation

[0047] The technical solutions in the embodiments of this application will now be described with reference to the accompanying drawings.

[0048] It should be noted that in the description of this application, the terms "first," "second," etc., are used only for distinguishing descriptions and should not be construed as indicating or implying relative importance. Furthermore, the step numbers in the text are only for the convenience of explaining the embodiments of this application and are not intended to limit the order in which the steps are executed. The methods provided in the embodiments of this application can be executed by relevant terminal devices, and the following description uses the processor within a storage server as the execution entity.

[0049] In related technologies, in order to meet the storage needs of massive amounts of data, the number of physical hard drives that can be mounted on storage servers is constantly increasing, so that users can flexibly plug and unplug physical hard drives in multiple slots of the storage server according to actual application needs. For example, a user can first insert the first physical hard drive into the empty slot 2 of the storage server, and then insert the second physical hard drive into the empty slot 6 of the storage server.

[0050] After a storage server detects an empty slot with a physical hard drive inserted, it allocates a logical hard drive to that physical drive in the operating system. However, in practical applications, this flexible physical hard drive insertion method has proven to be extremely difficult for the storage server in mapping logical and physical hard drives. Because users can freely insert and remove physical hard drives, the mapping relationship between logical and physical hard drives in the storage server can easily become chaotic. When any logical hard drive on the storage server fails and reports an error, maintenance personnel find it difficult to quickly and accurately determine the corresponding physical hard drive slot. This not only increases the time cost of troubleshooting but also easily leads to data loss or business interruption due to delays in fault repair.

[0051] In scenarios where users can freely plug and unplug physical hard drives, how to quickly and accurately determine the mapping relationship between logical hard drives and physical hard drives has become a major problem that urgently needs to be solved.

[0052] To address this, this application proposes a method for mapping logical hard drives and physical hard drives. The storage server identifies whether a physical hard drive is inserted in any empty slot during the process of a user arbitrarily plugging and unplugging physical hard drives in multiple slots. If a physical hard drive is detected in any empty slot, a logical hard drive with a hard drive serial number positively correlated with the identification time of the current physical hard drive is assigned to it. The hard drive serial number of the current logical hard drive, the identification time of the current physical hard drive, and the insertion slot of the current physical hard drive are stored as a mapping relationship. This ensures that logical hard drives are assigned to earlier inserted physical hard drives first, preventing disordered allocation between them. Furthermore, the identification time of the physical hard drive is used to associate the hard drive serial number of the logical hard drive with the insertion slot of the physical hard drive, solving the problem of chaotic mapping between logical and physical hard drives in scenarios where users arbitrarily plug and unplug physical hard drives. This ensures that the mapping relationship between logical and physical hard drives is unique and accurate, thereby enabling rapid and accurate determination of the mapping relationship between logical and physical hard drives in scenarios where users arbitrarily plug and unplug physical hard drives.

[0053] Please refer to Figure 1 , Figure 1 This is a flowchart illustrating a method for mapping logical hard disks and physical hard disks according to a first embodiment of this application. The first embodiment of this application provides a method for mapping logical hard disks and physical hard disks, applied to a storage server, which includes multiple slots; the method includes steps S101-S103:

[0054] S101. During the process of the user randomly plugging and unplugging physical hard drives in multiple slots, identify whether a physical hard drive is inserted in each empty slot among the multiple slots.

[0055] S102. When a physical hard drive inserted into any empty slot among multiple slots is detected, a logical hard drive is allocated to the current physical hard drive; wherein, the hard drive serial number of the current logical hard drive is positively correlated with the identification time of the current physical hard drive, and the identification time of the current physical hard drive is determined according to the order of the identification times of all physical hard drives on the current storage server.

[0056] S103. Store the current logical hard disk's serial number, the current physical hard disk's identification time, and the current physical hard disk's insertion slot as a mapping relationship.

[0057] As an example, users can flexibly plug and unplug physical hard drives into multiple slots of the storage server according to their actual application needs.

[0058] The processor inside the storage server can identify in real time whether a physical hard drive is inserted in each empty slot as the user plugs and unplugs physical hard drives into multiple slots.

[0059] When the processor in the storage server recognizes a physical hard drive inserted into any empty slot among multiple slots, it sorts the recognition times of all physical hard drives on the current storage server in ascending order of recognition time to determine the recognition time sequence of the currently inserted physical hard drive. Based on the recognition time sequence of the current physical hard drive, it determines the currently allocated logical hard drive, i.e., the hard drive serial number of the current logical hard drive, and assigns the current logical hard drive to the current physical hard drive. The hard drive serial number of the current logical hard drive is positively correlated with the recognition time sequence of the current physical hard drive.

[0060] It should be noted that all physical hard drives on the current storage server include both currently installed physical hard drives and previously inserted physical hard drives.

[0061] If the processor in the storage server does not recognize any physical hard drives inserted in the empty slots of the multiple slots, it continues to identify whether any physical hard drives are inserted in the empty slots of the multiple slots.

[0062] After allocating a logical hard drive to the current physical hard drive, the processor in the storage server can determine the hard drive serial number of the current logical hard drive, the identification time of the current physical hard drive, and the connection slot of the current physical hard drive. The hard drive serial number of the current logical hard drive, the identification time of the current physical hard drive, and the connection slot of the current physical hard drive are stored as a mapping relationship.

[0063] For example, suppose a storage server has eight slots: slot 1, slot 2, slot 3, slot 4, slot 5, slot 6, slot 7, and slot 8. All eight slots are empty. A user performs the following operations according to their application needs: inserting the first physical hard drive into slot 1 at 9:00; inserting the second physical hard drive into slot 5 at 9:30; inserting the third physical hard drive into slot 6 at 10:00; and inserting the fourth physical hard drive into slot 2 at 10:30. In this scenario, the processor within the storage server will execute the following steps sequentially: upon recognizing the first physical hard drive inserted into slot 1... In the first case, the identification time of the first physical hard drive can be determined to be 9:00, and its insertion slot is slot 1. Since there is only one physical hard drive on the current storage server, its identification timing is 1. Based on the principle that the logical hard drive allocation order corresponds to the actual physical hard drive insertion order, a first logical hard drive is assigned to the first physical hard drive, with a drive number of 0. The drive number, identification time, and insertion slot of the first logical hard drive are stored as a mapping relationship, with the first mapping relationship being "0—9:00—slot 1". When the second physical hard drive inserted in slot 5 is identified, the identification time of the second physical hard drive can be determined to be 9:30, and its insertion slot is slot 5. Since there are two physical hard drives on the current storage server, the identification timing of the second physical hard drive is 2. Based on the principle that the logical hard drive allocation order corresponds to the actual physical hard drive insertion order, a second logical hard drive is assigned to the second physical hard drive. The second logical hard drive has a hard drive serial number of 1. The hard drive serial number of the second logical hard drive, the identification time of the second physical hard drive, and the insertion slot of the second physical hard drive are stored as a mapping relationship. The second set of mapping relationships is "1-9:30-slot 5". Following this operation, four sets of mapping relationships are finally stored. The first set of mapping relationships is "0-9:00-slot 1", the second set of mapping relationships is "1-9:30-slot 5", the third set of mapping relationships is "2-10:00-slot 6", and the fourth set of mapping relationships is "3-10:30-slot 2".

[0064] By having the storage server determine the logical hard drive serial number assigned to a physical hard drive each time a physical hard drive is inserted into a slot, based on the principle that the logical hard drive allocation order corresponds to the actual physical hard drive insertion order, the logical hard drive serial number is positively correlated with the physical hard drive identification time. This ensures that logical hard drives are assigned to earlier inserted physical hard drives first, guaranteeing that the logical hard drives assigned to earlier and later inserted physical hard drives are not out of order. Furthermore, by incorporating the physical hard drive identification time and associating the logical hard drive serial number with the physical hard drive's insertion slot, this approach can solve the problem of directly mapping logical hard drives in scenarios where users flexibly insert and remove physical hard drives. The problem of inconsistent mapping between hard drive serial numbers and physical hard drive slots is addressed. For example, in the above case, if the storage server uses a direct mapping method, the four final stored mapping relationships are "0—slot 1", "1—slot 5", "2—slot 6", and "3—slot 2". When a user removes the first physical hard drive from slot 1 at 11:00 and inserts the fifth physical hard drive, the storage server will store a mapping relationship "4—slot 1", which is inconsistent with the "0—slot 1" mapping relationship. This ensures that the mapping relationship between the logical hard drive serial number and the physical hard drive slot is unique and accurate.

[0065] This application embodiment achieves this by having a storage server identify whether a physical hard drive is inserted in any empty slot during the process of a user arbitrarily plugging and unplugging physical hard drives in multiple slots. If a physical hard drive is detected in any empty slot, a logical hard drive with a hard drive serial number positively correlated with the identification time of the current physical hard drive is assigned to it. The hard drive serial number of the current logical hard drive, the identification time of the current physical hard drive, and the slot where the current physical hard drive is plugged in are stored as a mapping relationship. This ensures that logical hard drives are assigned to earlier-inserted physical hard drives first, preventing disordered allocation between them. Furthermore, the identification time of the physical hard drive is used to associate the hard drive serial number of the logical hard drive with the slot where the physical hard drive is plugged in, solving the problem of chaotic mapping between logical and physical hard drives in scenarios where users arbitrarily plug and unplug physical hard drives. This ensures that the mapping between logical and physical hard drives is unique and accurate, thus enabling rapid and accurate determination of the mapping relationship between logical and physical hard drives in scenarios where users arbitrarily plug and unplug physical hard drives.

[0066] In an optional embodiment, the storage server includes a backplane controller and a disk array RAID card controller; identifying whether each empty slot in the multiple slots has a physical hard drive inserted includes: identifying whether each empty slot has a physical hard drive inserted via the backplane controller; allocating a logical hard drive to the current physical hard drive includes: allocating a current logical hard drive to the current physical hard drive via the RAID card controller.

[0067] As an example, considering the limited processing power of the processor in the storage server in practical applications, in scenarios where the number of physical hard drives that can be installed on the storage server is large, in order to improve the identification efficiency of physical hard drives and the allocation efficiency of logical hard drives, the backplane controller in the storage server can be used to identify whether a physical hard drive is inserted in each empty slot among multiple slots, and the RAID card controller can be pre-configured on the storage server to allocate the current logical hard drive to the current physical hard drive.

[0068] It's important to note that the backplane controller plays a crucial role in storage servers, primarily responsible for managing the connection, power supply, data transfer, and status monitoring of multiple physical hard drives. A RAID (Redundant Array of Independent Disks) card controller is a specially designed hardware device used to manage and optimize data storage, redundancy, and performance among multiple physical hard drives. By implementing different levels of RAID technology, RAID card controllers provide storage servers with enhanced data protection, higher read / write speeds, and better fault tolerance, allowing users to create one or more physical hard drives as a single logical drive.

[0069] The processor in the storage server uses the backplane controller to identify whether a physical hard drive is inserted in each empty slot. It can rely on the backplane controller's ability to manage multiple physical hard drives on the hard drive backplane to quickly and accurately identify whether a physical hard drive is inserted in each empty slot.

[0070] The processor in the storage server uses the RAID card controller to allocate the current logical hard drive to the current physical hard drive. It can rely on the RAID card controller's ability to apply RAID technology to quickly and accurately allocate the current logical hard drive to the current physical hard drive.

[0071] This application embodiment utilizes the backplane controller within the storage server to identify whether a physical hard drive is inserted in each empty slot among multiple slots, and utilizes the RAID card controller within the storage server to allocate the current logical hard drive to the current physical hard drive. This improves the identification efficiency of physical hard drives and the allocation efficiency of logical hard drives, and better enables the rapid and accurate determination of the mapping relationship between logical hard drives and physical hard drives in scenarios where users flexibly plug and unplug physical hard drives.

[0072] In an optional embodiment, the method further includes steps S104-S105:

[0073] S104. When the backplane controller detects the current physical hard drive, it records the first mapping relationship between the current physical hard drive's slot and the current physical hard drive's detection time in the first mapping table.

[0074] S105. After allocating the current logical hard drive to the current physical hard drive through the RAID card controller, the second mapping relationship between the identification time of the current physical hard drive and the hard drive serial number of the current logical hard drive is recorded in the second mapping table.

[0075] As an example, considering the limited processing power of the processor in the storage server in practical applications, and in scenarios where the number of physical hard drives that can be installed on the storage server is large, in order to improve the mapping efficiency between logical hard drives and physical hard drives, a mapping table can be pre-configured on the backplane controller as a first mapping table. The backplane controller can directly record and maintain the mapping relationship between the physical hard drive's insertion slot and the physical hard drive's identification time determined during the physical hard drive identification stage. Similarly, a mapping table can be pre-configured on the RAID card controller as a second mapping table. The RAID card controller can directly record and maintain the mapping relationship between the physical hard drive's identification time and the logical hard drive's serial number determined during the logical hard drive allocation stage. This allows the processor to quickly use the physical hard drive's identification time to associate the logical hard drive's serial number with the physical hard drive's insertion slot.

[0076] The backplane controller in the storage server identifies whether a physical hard drive is inserted in each empty slot among multiple slots. When a physical hard drive inserted in any empty slot is identified, i.e., the current physical hard drive, the insertion slot of the current physical hard drive and the identification time of the current physical hard drive are determined, and the first mapping relationship between the insertion slot of the current physical hard drive and the identification time of the current physical hard drive is recorded in the first mapping table.

[0077] The RAID card controller in the storage server allocates the current logical hard drive to the current physical hard drive. After allocating the current logical hard drive to the current physical hard drive, it determines the hard drive serial number of the current logical hard drive and records the second mapping relationship between the identification time of the current physical hard drive and the hard drive serial number of the current logical hard drive in the second mapping table.

[0078] This application embodiment utilizes the backplane controller within the storage server to directly record and maintain the first mapping relationship between the physical hard drive's insertion slot and the physical hard drive's identification time, determined during the physical hard drive identification stage, in a first mapping table. It also utilizes the RAID card controller within the storage server to directly record and maintain the second mapping relationship between the physical hard drive's identification time and the logical hard drive's serial number, determined during the logical hard drive allocation stage, in a second mapping table. This further improves the mapping efficiency between logical and physical hard drives.

[0079] In an optional embodiment, the method further includes steps S106-S107:

[0080] S106. Using the backplane controller, identify whether a physical hard drive has been removed from each of the multiple slots that are not empty. If a physical hard drive is removed from any of the multiple slots that are not empty, delete the first mapping relationship corresponding to the removed physical hard drive from the first mapping table.

[0081] S107. Using the RAID card controller, when the backplane controller recognizes the removed physical hard drive, delete the second mapping relationship corresponding to the removed physical hard drive from the second mapping table.

[0082] As an example, considering that users can flexibly plug and unplug physical hard drives, and users can also unplug physical hard drives from any non-empty slot in multiple slots at any time, in order to update the mapping relationship between logical hard drives and physical hard drives in a timely manner, the backplane controller can be used to identify whether a physical hard drive has been unplugged from each non-empty slot in multiple slots, delete the first mapping relationship corresponding to the currently unplugged physical hard drive from the first mapping table, and use the RAID card controller to synchronously delete the second mapping relationship corresponding to the currently unplugged physical hard drive from the second mapping table.

[0083] The backplane controller identifies in real time whether a physical hard drive has been removed from any of the non-empty slots. If a physical hard drive is detected in any non-empty slot, the first mapping relationship corresponding to the removed physical hard drive is deleted from the first mapping table. If no physical hard drives are detected in any of the non-empty slots, the controller continues to identify whether a physical hard drive has been removed from any of the non-empty slots.

[0084] When the RAID card controller determines that the backplane controller has recognized the removed physical hard drive, it synchronously deletes the second mapping relationship corresponding to the removed physical hard drive from the second mapping table.

[0085] This application embodiment utilizes the backplane controller within the storage server to identify whether a physical hard drive has been removed from each of the multiple slots that are not empty. When a physical hard drive is identified as being removed from any non-empty slot, the first mapping relationship corresponding to the removed physical hard drive is deleted from the first mapping table. The second mapping relationship corresponding to the removed physical hard drive is simultaneously deleted from the second mapping table using the RAID card controller within the storage server. This enables timely updates to the mapping relationship between logical hard drives and physical hard drives, and better achieves rapid and accurate determination of the mapping relationship between logical hard drives and physical hard drives in scenarios where users flexibly plug and unplug physical hard drives.

[0086] In an optional embodiment, the storage server includes a memory, which includes an electrically erasable programmable read-only memory; the step of storing the hard disk serial number of the current logical hard disk, the identification time of the current physical hard disk, and the insertion slot of the current physical hard disk as a set of mapping relationships includes: storing the hard disk serial number of the current logical hard disk, the identification time of the current physical hard disk, and the insertion slot of the current physical hard disk as a set of mapping relationships in the memory.

[0087] As an example, the processor in the storage server can periodically retrieve a first mapping table from the backplane controller to determine a first mapping relationship between the current physical hard drive's slot and the current physical hard drive's identification time, and retrieve a second mapping table from the RAID card controller to determine a second mapping relationship between the current physical hard drive's identification time and the current logical hard drive's serial number.

[0088] After determining the first mapping relationship between the current physical hard drive's slot and its identification time, and the second mapping relationship between the current physical hard drive's identification time and its serial number, the processor can use the current physical hard drive's identification time to associate the current logical hard drive's serial number with its slot, obtaining the mapping relationship of "current logical hard drive serial number - current physical hard drive identification time - current physical hard drive slot". This mapping relationship is then stored in the memory within the storage server, such as electrically erasable programmable read-only memory (EEPROM, E2PROM).

[0089] It is understandable that electrically erasable programmable read-only memory is a non-volatile memory that allows data to be written, read, and erased by applying an electric field, and can stably store data.

[0090] This application embodiment stores the current logical hard disk's serial number, the current physical hard disk's identification time, and the current physical hard disk's insertion slot as a mapping relationship in an electrically erasable programmable read-only memory or other memory within the storage server. This effectively prevents the mapping relationship between the logical hard disk and the physical hard disk from being damaged or deleted, ensuring stable storage of the mapping relationship between the logical hard disk and the physical hard disk.

[0091] In an optional embodiment, the method further includes steps S108-S109:

[0092] S108. If a failure is detected in any logical hard drive among all logical hard drives on the storage server, determine the identification time of the target physical hard drive corresponding to the hard drive serial number of the failed logical hard drive.

[0093] S109. Determine the slot of the target physical hard drive corresponding to the recognition time of the target physical hard drive.

[0094] As an example, the processor in the storage server detects in real time whether each logical hard drive in all logical hard drives on the storage server has failed. If any logical hard drive fails, the processor determines the hard drive serial number of the failed logical hard drive and queries the hard drive serial number of the failed logical hard drive from all previously stored group mapping relationships. The processor then determines the identification time of the target physical hard drive corresponding to the hard drive serial number of the failed logical hard drive, and then determines the insertion slot of the target physical hard drive corresponding to the identification time of the target physical hard drive.

[0095] This application embodiment determines the identification time of the target physical hard drive corresponding to the hard drive serial number of the faulty logical hard drive when the storage server detects a fault in any logical hard drive among all logical hard drives on the storage server. Then, it determines the insertion slot of the target physical hard drive corresponding to the identification time of the target physical hard drive. In scenarios where users can flexibly insert physical hard drives, the insertion slot of the target physical hard drive corresponding to the faulty logical hard drive can be quickly and accurately located based on the mapping relationship of all groups in the storage.

[0096] In an optional embodiment, the method further includes step S110:

[0097] S110. Send a fault message to the user terminal indicating the faulty logical hard drive; wherein the fault message includes the connection slot of the target physical hard drive.

[0098] As an example, after the processor in the storage server determines the slot of the target physical hard drive corresponding to the faulty logical hard drive, it generates a fault message including the slot of the target physical hard drive and sends this fault message to the user terminal, so that the user can quickly locate the slot of the target physical hard drive and remove the target physical hard drive from the slot to repair the fault.

[0099] This application embodiment enables the storage server to send fault information, including the connection slot of the target physical hard drive corresponding to the faulty logical hard drive, to the user terminal when it detects a fault in any logical hard drive among all logical hard drives on the storage server. This allows the user to quickly locate the connection slot of the target physical hard drive for fault repair, thereby improving the efficiency of fault repair for the target physical hard drive.

[0100] Please refer to Figure 2 , Figure 2This is a schematic diagram of a device for mapping logical hard drives and physical hard drives according to a second embodiment of this application. The second embodiment of this application provides a device for mapping logical hard drives and physical hard drives, applied to a storage server, which includes multiple slots. The device includes: a physical hard drive identification module 201, used to identify whether a physical hard drive is inserted into any empty slot during the process of a user arbitrarily inserting and removing physical hard drives in the multiple slots; a logical hard drive allocation module 202, used to allocate a logical hard drive to the current physical hard drive when a physical hard drive is identified inserted into any empty slot; wherein the hard drive serial number of the current logical hard drive is positively correlated with the identification time sequence of the current physical hard drive, and the identification time sequence of the current physical hard drive is determined according to the order of the identification times of all physical hard drives on the current storage server; and a mapping relationship storage module 203, used to store the hard drive serial number of the current logical hard drive, the identification time of the current physical hard drive, and the insertion slot of the current physical hard drive as a set of mapping relationships.

[0101] In an optional embodiment, the storage server includes a backplane controller and a disk array RAID card controller; identifying whether each empty slot in the multiple slots has a physical hard drive inserted includes: identifying whether each empty slot has a physical hard drive inserted via the backplane controller; allocating a logical hard drive to the current physical hard drive includes: allocating a current logical hard drive to the current physical hard drive via the RAID card controller.

[0102] In an optional embodiment, the physical hard disk identification module 201 is further configured to, through the backplane controller, record the first mapping relationship between the current physical hard disk's slot and the current physical hard disk's identification time in a first mapping table when the current physical hard disk is identified; the logical hard disk allocation module 202 is further configured to, through the RAID card controller, record the second mapping relationship between the current physical hard disk's identification time and the current logical hard disk's hard disk serial number in a second mapping table after allocating the current logical hard disk to the current physical hard disk.

[0103] In an optional embodiment, the physical hard drive identification module 201 is further configured to identify, via the backplane controller, whether a physical hard drive has been removed from each non-empty slot in the multiple slots, and, if a physical hard drive is identified as being removed from any non-empty slot in the multiple slots, delete the first mapping relationship corresponding to the removed physical hard drive from the first mapping table; the logical hard drive allocation module 202 is further configured to, via the RAID card controller, delete the second mapping relationship corresponding to the removed physical hard drive from the second mapping table if the backplane controller identifies the removed physical hard drive.

[0104] In an optional embodiment, the storage server includes a memory, which includes an electrically erasable programmable read-only memory; the step of storing the hard disk serial number of the current logical hard disk, the identification time of the current physical hard disk, and the insertion slot of the current physical hard disk as a set of mapping relationships includes: storing the hard disk serial number of the current logical hard disk, the identification time of the current physical hard disk, and the insertion slot of the current physical hard disk as a set of mapping relationships in the memory.

[0105] In an optional embodiment, the device further includes: a logical hard disk maintenance module, configured to: determine the identification time of the target physical hard disk corresponding to the hard disk serial number of the faulty logical hard disk when a fault is detected in any logical hard disk among all logical hard disks on the storage server; and determine the insertion slot of the target physical hard disk corresponding to the identification time of the target physical hard disk.

[0106] In an optional embodiment, the logical hard disk maintenance module is further configured to send fault prompt information of the faulty logical hard disk to the user terminal; wherein, the fault prompt information includes the plug slot of the target physical hard disk.

[0107] The specific implementation process of the functions and roles of each module in the above device can be found in the implementation process of the corresponding steps in the above method, and will not be repeated here.

[0108] Please refer to Figure 3 , Figure 3 This is a schematic diagram of the structure of an electronic device provided in the third embodiment of this application. The third embodiment of this application provides an electronic device 30, including a processor 301, a memory 302, and a computer program stored in the memory 302 and configured to be executed by the processor 301; when the processor 301 executes the computer program, it implements the method described in the first embodiment of this application and can achieve the same beneficial effects.

[0109] When the processor 301 reads a computer program from the memory 302 via the bus 303 and executes the computer program, it can implement any of the methods described in the first embodiment of this application.

[0110] Processor 301 can process digital signals and may include various computing architectures. For example, it may be a complex instruction set computer architecture, a reduced instruction set computer architecture, or an architecture that implements multiple instruction set combinations. In some examples, processor 301 may be a microprocessor.

[0111] The memory 302 can be used to store instructions executed by the processor 301 or data related to the execution of instructions. These instructions and / or data may include code for implementing some or all of the functions of one or more modules described in the embodiments of this application. The processor 301 of this disclosure embodiment can be used to execute instructions in the memory 302 to implement the method described in the first embodiment of this application. The memory 302 includes dynamic random access memory, static random access memory, flash memory, optical memory, or other memories well known to those skilled in the art.

[0112] The fourth embodiment of this application provides a computer program product, which includes instructions that, when executed by a computer, cause the computer to perform the method described in the first embodiment of this application and achieve the same beneficial effects.

[0113] The methods described in the first embodiment of this application can be implemented, in whole or in part, by software, hardware, firmware, or any combination thereof. When implemented in software, they can be implemented, in whole or in part, in the form of a computer program product. A computer program product includes one or more computer programs or instructions. When the computer program or instructions are loaded and executed on a computer, the processes or functions described in the various embodiments of this application are performed, in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, a network device, a user equipment, a core network device, an OAM (Open Application Model), or other programmable devices.

[0114] Computer programs or instructions can be stored in or transferred from one computer-readable storage medium to another. For example, a computer program or instructions can be transferred from one website, computer, server, or data center to another via wired or wireless means. A computer-readable storage medium can be any usable medium that a computer can access, or a data storage device such as a server or data center that integrates one or more usable media. Usable media can be magnetic media, such as floppy disks, hard disks, and magnetic tapes; optical media, such as digital video discs; or semiconductor media, such as solid-state drives. The computer-readable storage medium can be volatile or non-volatile, or may include both types.

[0115] The fifth embodiment of this application provides a computer-readable storage medium, which includes a stored computer program; wherein, when the computer program is running, it controls the device where the computer-readable storage medium is located to perform the method described in the first embodiment of this application, and can achieve the same beneficial effects.

[0116] In summary, this application provides a method, apparatus, device, and program product for mapping logical hard drives and physical hard drives. The method for mapping logical hard drives and physical hard drives is applied to a storage server; the method includes: identifying whether a physical hard drive is inserted into any empty slot among the multiple slots during the process of a user arbitrarily inserting and removing physical hard drives in multiple slots; when a physical hard drive is identified as being inserted into any empty slot among the multiple slots, a logical hard drive is allocated to the current physical hard drive; wherein, the hard drive serial number of the current logical hard drive is positively correlated with the identification time sequence of the current physical hard drive, and the identification time sequence of the current physical hard drive is determined according to the order of the identification times of all physical hard drives on the current storage server; and storing the hard drive serial number of the current logical hard drive, the identification time of the current physical hard drive, and the slot where the current physical hard drive is inserted as a mapping relationship. This application embodiment achieves this by having a storage server identify whether a physical hard drive is inserted in any empty slot during the process of a user arbitrarily plugging and unplugging physical hard drives in multiple slots. If a physical hard drive is detected in any empty slot, a logical hard drive with a hard drive serial number positively correlated with the identification time of the current physical hard drive is assigned to it. The hard drive serial number of the current logical hard drive, the identification time of the current physical hard drive, and the slot where the current physical hard drive is plugged in are stored as a mapping relationship. This ensures that logical hard drives are assigned to earlier-inserted physical hard drives first, preventing disordered allocation between them. Furthermore, the identification time of the physical hard drive is used to associate the hard drive serial number of the logical hard drive with the slot where the physical hard drive is plugged in, solving the problem of chaotic mapping between logical and physical hard drives in scenarios where users arbitrarily plug and unplug physical hard drives. This ensures that the mapping between logical and physical hard drives is unique and accurate, thus enabling rapid and accurate determination of the mapping relationship between logical and physical hard drives in scenarios where users arbitrarily plug and unplug physical hard drives.

[0117] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can also be implemented in other ways. The apparatus embodiments described above are merely illustrative; for example, the flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than those marked in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram and / or flowchart, and combinations of blocks in block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.

[0118] In addition, the functional modules in the various embodiments of this application can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.

[0119] If the aforementioned functions are implemented as software functional modules 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 this application, in essence, or the part that contributes to the prior art, or a portion 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 includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. 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.

[0120] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A method of mapping logical hard disks to physical hard disks, characterized by, The application is applied to a storage server, the storage server comprises a plurality of slots; the method comprises: In the process that a user inserts or removes a physical hard disk in the plurality of slots, identifying whether a physical hard disk is inserted into each empty slot in the plurality of slots; In the case that a physical hard disk is inserted into any empty slot in the plurality of slots, assigning a logical hard disk to the current physical hard disk; wherein the hard disk serial number of the current logical hard disk is positively correlated with the identification time sequence of the current physical hard disk, and the identification time sequence of the current physical hard disk is determined according to the arrangement order of the identification time of all physical hard disks on the current storage server; Storing the hard disk serial number of the current logical hard disk, the identification time of the current physical hard disk and the slot of the current physical hard disk as a group of mapping relationships.

2. The method of claim 1, wherein, The storage server comprises a backplane controller and a RAID card controller; The identification of whether a physical hard disk is inserted into each empty slot in the plurality of slots comprises: Identifying, by the backplane controller, whether a physical hard disk is inserted into each empty slot; The assignment of a logical hard disk to the current physical hard disk comprises: Assigning, by the RAID card controller, the current logical hard disk to the current physical hard disk.

3. The method of claim 2, wherein, The method further comprises: In the case that the current physical hard disk is identified, recording, by the backplane controller, the first mapping relationship between the slot of the current physical hard disk and the identification time of the current physical hard disk in a first mapping table; After the current logical hard disk is assigned to the current physical hard disk, recording, by the RAID card controller, the second mapping relationship between the identification time of the current physical hard disk and the hard disk serial number of the current logical hard disk in a second mapping table.

4. The method of claim 3, wherein, The method further comprises: Identifying, by the backplane controller, whether a physical hard disk is removed from each non-empty slot in the plurality of slots, and in the case that a physical hard disk is removed from any non-empty slot in the plurality of slots, deleting the first mapping relationship corresponding to the removed physical hard disk from the first mapping table; In the case that the removed physical hard disk is identified by the backplane controller, deleting the second mapping relationship corresponding to the removed physical hard disk from the second mapping table.

5. The method of claim 1, wherein, The storage server comprises a storage memory, and the storage memory comprises an electrically erasable programmable read-only memory; The storage of the hard disk serial number of the current logical hard disk, the identification time of the current physical hard disk and the slot of the current physical hard disk as a group of mapping relationships comprises: Storing the hard disk serial number of the current logical hard disk, the identification time of the current physical hard disk and the slot of the current physical hard disk as a group of mapping relationships in the storage memory.

6. The method according to any one of claims 1 to 5, characterized in that, The method further comprises: In the case that any logical hard disk in all logical hard disks on the storage server is detected to be faulty, determining the identification time of the target physical hard disk corresponding to the hard disk serial number of the faulty logical hard disk; Determining the slot of the target physical hard disk corresponding to the identification time of the target physical hard disk.

7. The method of claim 6, wherein, The method further comprises: The method comprises the following steps: sending a failure prompt information of the failed logical hard disk to a user terminal; wherein the failure prompt information comprises a slot position of the target physical hard disk.

8. An apparatus for mapping logical hard disks to physical hard disks, the apparatus comprising: The device is applied to a storage server, and the storage server comprises a plurality of slots. A physical hard disk identification module is configured to identify whether a physical hard disk is inserted into each empty slot among the plurality of slots. A logical hard disk allocation module is configured to allocate a logical hard disk for a current physical hard disk in a case that the physical hard disk is inserted into any empty slot among the plurality of slots; wherein a hard disk serial number of the current logical hard disk is positively correlated with an identification time sequence of the current physical hard disk, and the identification time sequence of the current physical hard disk is determined according to an arrangement order of identification times of all physical hard disks on the current storage server. A mapping relationship storage module is configured to store the hard disk serial number of the current logical hard disk, the identification time of the current physical hard disk, and the slot position of the current physical hard disk as a group of mapping relationships.

9. An electronic device, comprising: The computer program product comprises instructions which, when executed by a computer, cause the computer to implement the method according to any one of claims 1 to 7.

10. A computer program product, characterised in that, The computer program product comprises instructions which, when executed by a computer, cause the computer to implement the method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Method and device for allocating logical DOS drives

    CN101876885A

  • Method, device and equipment for determining physical slot relationship between logic hard disk and hard disk

    CN116414601A