Memory disk detection method and apparatus, terminal device, and storage medium
Patent Information
- Application Number
- MYPI2022007270
- Authority / Receiving Office
- MY · MY
- Patent Type
- Patents
- Current Assignee / Owner
- Priority Date
- 2020-06-22
- Filing Date
- 2021-06-07
- Publication Date
- 2026-08-28
- Estimated Expiration
- 2041-06-07
AI Technical Summary
It is difficult to identify the physical location of the storage disk in a computer system, especially when the system structure changes.
Make the current status of the target storage disk different from other storage disks by controlling the preset location parameters of the storage disk, read the current status of the storage disk, and determine the mapping between the preset location parameters of the target storage disk and the target location parameters based on this. Relationships, including physical locations or logical indexes.
It realizes the identification of the accurate physical location and logical index of the storage disk, improves the configuration flexibility and identification accuracy of the computer storage system, and avoids identification errors when the connection relationship changes.
Abstract
Description
Storage disk testing methods, devices, terminal equipment and storage media
[0001] Cross-references to related applications
[0002] This application is based on and claims priority to Chinese Patent Application No. 202010575854.8, filed on June 22, 2020, the entire contents of which are incorporated herein by reference. Technical Field
[0003] The embodiments of this application relate to, but are not limited to, the field of computer technology. Specifically, they relate to, but are not limited to, a storage disk detection method, apparatus, terminal device, and storage medium. Background Technology
[0004] The hardware design of a computer system is related to the upgrade and replacement of the CPU (central processing unit) and its application direction. A typical design approach is to design a motherboard for a specific type of computer system using a particular generation of CPU. Depending on the application, the storage system can be configured with different models and quantities of RAID (Redundant Arrays of Independent Disks) cards / HBA (Host Bus Adapter) cards, different numbers of hard drives, and different types and quantities of backplanes to meet various specific needs. Because there are numerous specific requirements, storage system configurations are highly flexible. This makes it difficult for a single computer management software to identify the physical location of hard drives in the computer system, especially after changes in connections or firmware upgrades to RAID / HBA cards, which can easily lead to identification errors.
[0005] Summary of the Invention
[0006] The storage disk detection method, apparatus, terminal device, and storage medium provided in this application mainly solve the technical problem of difficulty in identifying the physical location of the storage disk, especially the inability to accurately identify it when the system structure changes.
[0007] This application provides a storage disk detection method, including: controlling the current state of a target storage disk corresponding to a preset location parameter in each storage disk to be different from the current state of other storage disks; reading the current state of each storage disk; and determining the mapping relationship between the preset location parameter and the target location parameter of the target storage disk based on the current state of each storage disk; wherein the target location parameter includes a physical location or a logical index.
[0008] This application embodiment also provides a storage disk detection device, including: a status control module, a status reading module, and a parameter identification module; the status control module is used to control the current status of a target storage disk corresponding to a preset location parameter, which is different from the current status of other storage disks; the status reading module is used to read the current status of each storage disk; the parameter identification module is used to determine the mapping relationship between the preset location parameter and the target location parameter of the target storage disk based on the current status of each storage disk; wherein, the target location parameter includes a physical location or a logical index.
[0009] This application embodiment also provides a terminal device, the terminal including a processor, a memory, and a communication bus; the communication bus is used to realize the connection and communication between the processor and the memory; the processor is used to execute one or more computer programs stored in the memory to implement the steps of the above-described storage disk detection method.
[0010] This application also provides a computer storage medium, which stores one or more programs that can be executed by one or more processors to implement the steps of the storage disk detection method described above. Attached Figure Description
[0011] Figure 1 is a schematic diagram of the computer system composition of various embodiments of this application;
[0012] Figure 2 is a flowchart of the storage disk detection method provided in Embodiment 1 of this application;
[0013] Figure 3 is a flowchart of the storage disk detection method provided in Embodiment 2 of this application;
[0014] Figure 4 is a schematic diagram of the computer system composition provided in Embodiment 2 of this application;
[0015] Figure 5 is a flowchart of the storage disk detection method provided in Embodiment 3 of this application;
[0016] Figure 6 is a schematic diagram of the computer system composition provided in Embodiment 3 of this application;
[0017] Figure 7 is a schematic diagram of the composition of the storage disk detection device provided in Embodiment 4 of this application;
[0018] Figure 8 is a schematic diagram of the terminal device composition provided in Embodiment 5 of this application. Detailed Implementation
[0019] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be further described in detail below with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are merely illustrative of this application and are not intended to limit this application.
[0020] Please refer to Figure 1, which illustrates a storage system design for a computer system. The CPU and RAID card / HBA card are connected via PCIe (Peripheral Component Interconnect Express). The RAID card / HBA card is connected to its backplane via a cable (e.g., SAS (Serial Attached SCSI) cable). The hard drive is inserted into a slot on the backplane. In different computer systems, the model and number of PCIe RAID card / HBA cards may vary; the hard drive backplane design may differ; and the wiring between the RAID card / HBA card and the hard drive backplane may differ.
[0021] Based on the above computer system architecture, various embodiments of this application are proposed.
[0022] Example 1:
[0023] This embodiment provides a storage disk detection method. Please refer to Figure 2. The method includes:
[0024] S201. Control the current state of the target storage disk corresponding to the preset position parameter in each storage disk to be different from the current state of other storage disks;
[0025] S202, Read the current status of each storage disk;
[0026] S203. Based on the current state of each storage disk, determine the mapping relationship between the preset location parameters of the target storage disk and the target location parameters; wherein, the target location parameters include physical location or logical index.
[0027] In this embodiment, the storage disk refers to a memory used to store data. The storage disk is the primary storage medium in a computer, capable of storing large amounts of binary data and retaining it even after power loss. Early computers used floppy disks, while today commonly use hard disks and SSDs (Solid State Disk or Solid State Drive). In the embodiments of this application, the storage disk can be a floppy disk, a hard disk, or an SSD.
[0028] In step S201, controlling the current state of the target storage disk corresponding to the preset location parameters, so that it is different from the current state of other storage disks, means that the preset location parameters are known, and the current state of each storage disk is controlled according to the preset location parameters. The type of preset location parameters can include the logical index of the storage disk or the physical location of the storage disk. The current state is used to identify the differences between storage disks, and these differences are substantial physical differences. Controlling the current state of the target storage disk to be different from the current state of other storage disks is a control method that distinguishes the current state of a specified storage disk from the current state of other storage disks, thereby enabling subsequent identification of that storage disk.
[0029] In some embodiments, before controlling the current state of the target storage disk corresponding to the preset position parameter in each storage disk to be different from the current state of other storage disks, the process may further include:
[0030] Read the list of all in-place storage disks and record the logical index list of all storage disks. An in-place storage disk indicates that it is in the normal power-on and operating process. After recording the logical index list of all in-place storage disks, subsequent control status operations can be performed based on the storage disk's logical index list, and the mapping relationship between the corresponding preset position parameters and target position parameters can be determined based on the storage disk's status.
[0031] In step S202, the current state of each storage disk is read. The current state of each storage disk is the different current state obtained by controlling the storage disks in step S201. This current state is differentiated based on the storage disk; for a given storage disk, its state differs from other storage disks, while the states of other storage disks can be the same.
[0032] In step S203, based on the current state of each storage disk, the mapping relationship between the preset location parameters and the target location parameters of the target storage disk is determined; wherein, the target location parameters include physical location or logical index. Since the current state of the target storage disk can be set according to the logical index or physical location in step S201, which is different from the current state of other storage disks, the logical index or physical location of the target storage disk is determined; and the target location parameters, similar to the preset location parameters, can also include physical location or logical index; in other words, the storage disk detection method in this embodiment is equivalent to knowing one of the logical index and physical location, determining the other corresponding to the storage disk, thereby determining the mapping relationship between the logical index and physical location of the storage disk. The unknown physical location or logical index of the target storage disk can be determined according to the state of each storage disk obtained in step S202, so the mapping relationship from logical index to physical location of the storage disk can be established. For the storage disks in this computer system, by traversing the above operations for each storage disk, the mapping relationship from logical index to physical location of all storage disks can be established, which is equivalent to completing the detection of the storage disk locations in the computer system.
[0033] In some embodiments, controlling the current state of the target storage disk corresponding to a preset location parameter in each storage disk, which differs from the current state of other storage disks, may include:
[0034] The current state of the storage disks is controlled by the RAID storage disk array card / HBA host bus adapter card. RAID is a technology that combines multiple independent hard drives (physical hard drives) in different ways to form a hard drive group (logical hard drive), thereby providing higher storage performance and data redundancy than a single hard drive. A RAID card is a board used to implement RAID functionality, and it is typically composed of a series of components such as an I / O (Input / Output) processor, a SCSI (Small Computer System Interface) controller, a SCSI connector, and cache.
[0035] HBA (Host Bus Adapter) is the physical connection between the server's internal I / O channels and the storage system's I / O channels. An HBA is a circuit board and / or integrated circuit adapter that provides input / output (I / O) processing and physical connectivity between the server and storage devices. Because HBAs reduce the burden on the main processor for data storage and retrieval tasks, they can improve server performance. An HBA and its associated storage disk system are sometimes referred to together as a storage disk channel. The host bus adapter card contains a small central processing unit (CPU), some memory as a data cache, and connectors for Fibre Channel and the bus. This small CPU is responsible for converting between PCI (Peripheral Component Interconnect) and Fibre Channel protocols. It also has other functions, such as initializing server ports connected to the Fibre Channel network, supporting upper-layer protocols such as TCP / IP (Transmission Control Protocol / Internet Protocol), SCSI, and 8B / 10B encoding / decoding. Controlling storage disks through the RAID card / HBA card is a fundamental function of the RAID card / HBA card.
[0036] In some embodiments, the current state of the target storage disk corresponding to the preset position parameter in each storage disk is controlled. Unlike the current state of other storage disks, the current state of the storage disk includes at least one of the following: the indicator light status of the storage disk and the power status of the storage disk. The indicator light status refers to controlling the on / off state of the indicator lights on each storage disk, while the power status refers to whether the power to each storage disk is on or off.
[0037] In some embodiments, when the current state of a storage disk includes the status of an indicator light, the corresponding preset position parameter includes a logical index; and controlling the current state of the target storage disk corresponding to the preset position parameter, which differs from the current state of other storage disks, may include:
[0038] Control the on / off state of the indicator light of the target storage disk corresponding to the control logic index, so that the on / off state of the indicator light of the target storage disk is different from the on / off state of other storage disks;
[0039] The target location parameters include physical location; based on the current state of each storage disk, the mapping relationship between the preset location parameters of the target storage disk and the target location parameters is determined, including:
[0040] Based on the on / off state of the indicator lights, the physical location of the target storage disk is determined, and the mapping relationship between the physical location and the logical index is established. The on / off state of the indicator lights on each storage disk indicates whether the indicator light is lit or off; these two states (on / off) allow for differentiation of the indicator light status of each storage disk. In some cases, controlling the current state of the target storage disk corresponding to a preset location parameter to be different from the current state of other storage disks may include:
[0041] The indicator light on the target storage drive is on, while the indicator lights on other storage drives are off; or,
[0042] The indicator light on the target storage disk is off, while the indicator lights on other storage disks are on. In other words, either only the indicator light on the target storage disk is on, or only the indicator light on the target storage disk is off. Regardless of the state, the target storage disk can be distinguished from other storage disks, and its physical location can be determined. Since the storage disks are controlled by logical indices, meaning the logical index of the target storage disk is known, the mapping relationship between the logical index and physical location of each storage disk can be established one by one.
[0043] In some embodiments, when the current state of the storage disk includes the power state, the corresponding preset location parameter includes the physical location; and controlling the current state of the target storage disk corresponding to the preset location parameter, which differs from the current state of other storage disks, may include:
[0044] Power off the storage disk corresponding to one of the physical locations, while keeping the other storage disks powered on. Accordingly, in some embodiments, the target location parameter includes a logical index; and determining the mapping relationship between the preset location parameter of the target storage disk and the target location parameter based on the current state of each storage disk may include:
[0045] Based on the first index list and the second index list, determine the logical index of the storage disk whose power is turned off;
[0046] The second index list is obtained by reading all currently in-place storage disks and recording the records.
[0047] The first index list is obtained by reading all in-situ storage disks and recording their current states before controlling the current states of the target storage disk corresponding to the preset position parameters. When detecting storage disks by power-on / off, the first index list is obtained by traversing and reading all in-situ storage disks before controlling the state of the storage disks. Then, after powering down the target storage disk with the specified logical index, the in-situ storage disks are read again, and the current second index list is recorded. This second index list is different from the first index list in that the logical index of the powered-down storage disk does not exist in the current index list. This allows us to simultaneously determine the logical index of the powered-down storage disk and, based on the power-down state, the physical location of the powered-down storage disk, which is known. This allows us to establish a mapping relationship between logical indexes and physical locations.
[0048] This embodiment provides a storage disk detection method. It controls the current state of a target storage disk corresponding to a preset location parameter, ensuring this state is different from the current state of other storage disks. The method reads the current state of each storage disk and, based on the current state of each disk, determines the mapping relationship between the preset location parameter and the target location parameter of the target storage disk. The target location parameter includes either a physical location or a logical index. By directly identifying the current storage disk state, the physical location and logical index of the storage disk corresponding to the logical index are determined. This enables real-time adjustment and change of the mapping relationship between the physical location and logical index of the storage disk, improving the accuracy of identification and enhancing the flexibility of computer storage system configuration.
[0049] Example 2
[0050] As shown in Figure 3, this embodiment provides a storage disk detection method, which includes:
[0051] S301. Read the list of all in-place storage disks through the RAID card / HBA card and record their logical index list. The logical index list can be [A, B, C, D], where A, B, C, and D represent logical indices. Please refer to Figure 4. Hard disk indicator light detection logic can be designed on the hardware backplane. This detection logic can be an FPGA (Field Programmable Gate Array), MCU (Microcontroller Unit), etc. In this way, the indicator light of each hard disk can be read from the hard disk indicator light detection logic. The computer system CPU or BMC (Baseboard Management Controller) can access the hard disk indicator light detection logic to read the status of each hard disk indicator light and the physical location information of the hard disk.
[0052] S302. Control the RAID card / HBA card according to the logical index list of the storage disks, turn on the indicator light of the storage disk corresponding to logical index X, and turn off the indicator lights of all other storage disks.
[0053] The S303 and RAID / HBA cards send the LED lighting command to the FPGA or MCU. The FPGA or MCU controls the indicator light (usually an LED) and saves the LED status to the LED status query logic.
[0054] S304. Read the status of the storage disk indicator lights through the LED status query logic of the FPGA or MCU, and identify the index i of the LED status query logic of the lit indicator light.
[0055] S305. Read the physical location of the storage disk in the FPGA or MCU according to index i;
[0056] Repeat the above steps to establish a mapping from the logical index [A, B, C, D] in the RAID card / HBA card to the physical location [a, b, c, d] of all storage disks, thus completing the identification of the physical location of all storage disks.
[0057] Example 3
[0058] As shown in Figure 5, this embodiment provides a storage disk detection method, which includes:
[0059] S501: Read all in-place storage disk information through the RAID card / HBA card and record their logical index list, such as [A, B, C, D]; Please refer to Figure 6. A storage disk power control unit can be designed on the storage disk backplane. The computer management software can control the storage disk power switch on the storage disk backplane through the storage disk power control unit.
[0060] S502, Send a command to the power control unit to turn off the power to storage disk x;
[0061] S503, The power control unit turns off the power to storage disk x;
[0062] S504, The signal link between the storage disk x and the RAID card / HBA is lost, and the RAID card / HBA updates the internal storage disk information in place;
[0063] S505: Read all the storage disks in place again through the RAID card / HBA card and record their current index list, such as [B, C, D];
[0064] S506. Analyze the changes in the logical index in the index list in steps S601 and S605, and find that the logical index of the power-off storage disk is A. Establish the mapping between A and the physical location x of the storage disk in S604.
[0065] Repeat the S501-S506 loop until all storage disks have been identified. Establish a mapping from the logical index [A, B, C, D] in the RAID card / HBA card to the physical location [a, b, c, d] of all storage disks, and complete the identification of the physical location of all storage disks.
[0066] Example 4
[0067] This embodiment provides a storage disk detection device. Please refer to Figure 7. The storage disk detection device includes:
[0068] The status control module 71 is used to control the current status of the target storage disk corresponding to the preset position parameters in each storage disk, which is different from the current status of other storage disks.
[0069] Status reading module 72 is used to read the current status of each storage disk;
[0070] The parameter identification module 73 is used to determine the mapping relationship between the preset location parameters of the target storage disk and the target location parameters based on the current status of each storage disk; wherein, the target location parameters include physical location or logical index.
[0071] In this embodiment, the storage disk refers to a memory used to store data. A storage disk is the primary storage medium in a computer, capable of storing large amounts of binary data and retaining it even after power loss. Early computers used floppy disks as storage disks, while today hard disks and SSDs are commonly used. In the embodiments of this application, the storage disk can be a floppy disk, a hard disk, or an SSD.
[0072] Controlling the current state of a target storage disk corresponding to preset location parameters, differentiating it from the current state of other storage disks, means that the preset location parameters are known, and the current state of each storage disk is controlled based on these parameters. The type of preset location parameters can include the logical index of the storage disk or its physical location. The current state is used to identify the differences between storage disks; these differences are substantial physical differences. Controlling the current state of a target storage disk to be different from the current states of other storage disks allows for the differentiation of the current state of a specific storage disk from those of other storage disks, thus enabling subsequent identification of that storage disk.
[0073] In some embodiments, before controlling the current state of the target storage disk corresponding to the preset position parameter in each storage disk to be different from the current state of other storage disks, the process may further include:
[0074] Read the list of all in-place storage disks and record the logical index list of all storage disks. An in-place storage disk indicates that it is in the normal power-on and operating process. After recording the logical index list of all in-place storage disks, subsequent control status operations can be performed based on the storage disk's logical index list, and the mapping relationship between the corresponding preset position parameters and target position parameters can be determined based on the storage disk's status.
[0075] The current state of each storage disk refers to the different current states obtained by controlling the storage disk. This current state is differentiated based on the storage disk; for a given storage disk, its state is different from that of other storage disks, while the states of other storage disks can be the same.
[0076] The current state of the target storage disk can be set according to its logical index or physical location. Since the current state of the target storage disk differs from that of other storage disks, its logical index or physical location is determined. The target location parameter, similar to the preset location parameter, can also include either a physical location or a logical index. In other words, the storage disk detection method in this embodiment is equivalent to knowing one of the logical index and physical location, and determining the other corresponding to the storage disk, thereby establishing the mapping relationship between the logical index and physical location of the storage disk. The unknown physical location or logical index of the target storage disk can be determined based on the state of each storage disk obtained by the state reading module 72, thus establishing the mapping relationship from logical index to physical location for that storage disk. For the storage disks in this computer system, by traversing the above operations for each storage disk, the mapping relationship from logical index to physical location for all storage disks can be established, which is equivalent to completing the detection of the storage disk locations in the computer system.
[0077] In some embodiments, controlling the current state of each storage disk may include:
[0078] The current status of the storage disk is controlled by controlling the RAID storage disk array card / HBA host bus adapter card.
[0079] In some embodiments, the current state of the target storage disk corresponding to the preset position parameter in each storage disk is controlled. Unlike the current state of other storage disks, the current state of the storage disk includes at least one of the following: the indicator light status of the storage disk and the power status of the storage disk. The indicator light status refers to controlling the on / off state of the indicator lights on each storage disk, while the power status refers to whether the power to each storage disk is on or off.
[0080] In some embodiments, when the current state of a storage disk includes the status of an indicator light, the corresponding preset position parameter includes a logical index; and controlling the current state of the target storage disk corresponding to the preset position parameter, which differs from the current state of other storage disks, may include:
[0081] Control the on / off state of the indicator light of the target storage disk corresponding to the control logic index, so that the on / off state of the indicator light of the target storage disk is different from the on / off state of other storage disks;
[0082] The target location parameters include physical location; based on the current state of each storage disk, the mapping relationship between the preset location parameters of the target storage disk and the target location parameters is determined, including:
[0083] Based on the on / off state of the indicator lights, the physical location of the target storage disk is determined, and the mapping relationship between the physical location and the logical index is established. The on / off state of the indicator lights on each storage disk indicates whether the indicator light is lit or off; these two states (on / off) allow for differentiation of the indicator light status of each storage disk. In some cases, controlling the current state of the target storage disk corresponding to a preset location parameter to be different from the current state of other storage disks may include:
[0084] The indicator light on the target storage drive is on, while the indicator lights on other storage drives are off; or,
[0085] The indicator light on the target storage disk is off, while the indicator lights on other storage disks are on. In other words, either only the indicator light on the target storage disk is on, or only the indicator light on the target storage disk is off. Regardless of the state, the target storage disk can be distinguished from other storage disks, and its physical location can be determined. Since the storage disks are controlled by logical indices, meaning the logical index of the target storage disk is known, the mapping relationship between the logical index and physical location of each storage disk can be established one by one.
[0086] In some embodiments, when the current state of the storage disk includes the power state, the corresponding preset location parameter includes the physical location; and controlling the current state of the target storage disk corresponding to the preset location parameter, which differs from the current state of other storage disks, may include:
[0087] Power off the storage disk corresponding to one of the physical locations, while keeping the other storage disks powered on. Accordingly, in some embodiments, the target location parameter includes a logical index; and determining the mapping relationship between the preset location parameter of the target storage disk and the target location parameter based on the current state of each storage disk may include:
[0088] Based on the first index list and the second index list, determine the logical index of the storage disk whose power is turned off;
[0089] The second index list is obtained by reading all currently in-place storage disks and recording the records.
[0090] The first index list is obtained by reading all in-situ storage disks and recording their current states before controlling the current states of the target storage disk corresponding to the preset position parameters. When detecting storage disks by power-on / off, the first index list is obtained by traversing and reading all in-situ storage disks before controlling the state of the storage disks. Then, after powering down the target storage disk with the specified logical index, the in-situ storage disks are read again, and the current second index list is recorded. This second index list is different from the first index list in that the logical index of the powered-down storage disk does not exist in the current index list. This allows us to simultaneously determine the logical index of the powered-down storage disk and, based on the power-down state, the physical location of the powered-down storage disk, which is known. This allows us to establish a mapping relationship between logical indexes and physical locations.
[0091] This embodiment provides a storage disk detection device that controls the current state of a target storage disk corresponding to a preset location parameter, ensuring it differs from the current states of other storage disks. It reads the current state of each storage disk and, based on the current state of each disk, determines the mapping relationship between the preset location parameter and the target location parameter of the target storage disk. The target location parameter includes either a physical location or a logical index. By directly identifying the current storage disk state, the device determines the physical location and logical index of the storage disk corresponding to the logical index, enabling real-time adjustment and change of the mapping relationship between the physical location and logical index of the storage disk. This improves the accuracy of identification and enhances the flexibility of computer storage system configuration.
[0092] Those skilled in the art will understand that all or some of the steps, systems, or devices disclosed above, and their functional modules / units, can be implemented as software (using computer program code executable by a computing device), firmware, hardware, or suitable combinations thereof. In hardware implementations, the division between functional modules / units mentioned above does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed collaboratively by several physical components. Some or all physical components can be implemented as software executed by a processor, such as a central processing unit, digital signal processor, or microprocessor, or as hardware, or as integrated circuits, such as application-specific integrated circuits (ASICs).
[0093] The functional modules / units in all or some of the devices described above include storage logic—a non-transitory machine-readable storage medium—that can be used to perform at least a portion of the functions of, for example, a storage module, a fetch module, a trigger module, and a delete module. The logic may include instructions, data, and / or code that, if executed by a machine, can cause the machine to perform the methods, processes, and / or operations described herein. The machine may include, for example, any suitable processing platform, computing platform, computing device, processing device, computing system, processing system, computer, processor, etc., and may be implemented using any suitable combination of hardware, software, firmware, etc. The logic may include or can be implemented as: software, software modules, applications, programs, subroutines, instructions, instruction sets, computational code, words, values, symbols, etc. These instructions may include any suitable type of code, such as source code, compiled code, interpreted code, executable code, static code, dynamic code, etc. These instructions may be implemented according to a predetermined computer language, method, or syntax to instruct the processor to perform a certain function. These instructions can be implemented using any suitable high-level, low-level, object-oriented, visual, compiled, and / or interpreted programming language, such as C, C++, Java, BASIC, Matlab, Pascal, Visual BASIC, assembly language, machine code, etc.
[0094] Example 5
[0095] This embodiment provides a terminal device, as shown in Figure 8. The terminal device includes a processor 81, a memory 82, and a communication bus 83.
[0096] Communication bus 83 is used to realize the connection and communication between processor 81 and memory 82;
[0097] The processor 81 is used to execute one or more computer programs stored in the memory 82 to implement the steps of the storage disk detection method described in the above embodiments, which will not be repeated here.
[0098] This embodiment also provides a computer-readable storage medium, which includes volatile or non-volatile, removable or non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, computer program modules or other data). Computer-readable storage media include, but are not limited to, RAM (Random Access Memory), ROM (Read-Only Memory), EEPROM (Electrically Erasable Programmable Read-Only Memory), flash memory or other memory technologies, CD-ROM (Compact Disc Read-Only Memory), DVD or other optical disc storage, magnetic cartridges, magnetic tapes, storage discs or other magnetic storage terminals, or any other medium that can be used to store desired information and is accessible by a computer.
[0099] The computer-readable storage medium in this embodiment can be used to store one or more computer programs, which can be executed by a processor to implement at least one step of the storage disk detection method in the above embodiments.
[0100] This embodiment also provides a computer program (or computer software) that can be distributed on a computer-readable medium and executed by a computing terminal to implement at least one step of the storage disk detection method in the above embodiments.
[0101] This embodiment also provides a computer program product, including a computer-readable terminal on which the computer program as shown above is stored. In this embodiment, the computer-readable terminal may include the computer-readable storage medium as shown above.
[0102] According to the storage disk detection method, apparatus, terminal device, storage medium, computer program, and computer program product provided in the embodiments of this application, the current state of the target storage disk corresponding to the preset position parameters in each storage disk is controlled to be different from the current state of other storage disks; the current state of each storage disk is read; based on the current state of each storage disk, the mapping relationship between the preset position parameters and the target position parameters of the target storage disk is determined; wherein, the target position parameters include physical location or logical index. Thus, by directly identifying the current state of the storage disk, the logical index and physical location corresponding to the target storage disk are determined, realizing the real-time adjustment and change of the mapping relationship between the physical location and the logical index of the target storage disk. This avoids the situation where, in computer systems with different configurations, differences in the connection between the storage disk and the hard disk backplane lead to variations in the real-time adjustment of the mapping relationship between the physical location and the logical index of the storage disk are caused by complex system management software, reducing the complexity of the system management software and avoiding identification errors caused by changes in the connection relationship.
[0103] Therefore, those skilled in the art should understand that all or some of the steps, terminals, and functional modules / units in the methods disclosed above can be implemented as software (which can be implemented using computer program code executable by a computing terminal), firmware, hardware, and suitable combinations thereof. In hardware implementations, the division between functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed collaboratively by several physical components. Some or all physical components may be implemented as software executed by a processor, such as a central processing unit, digital signal processor, or microprocessor, or as hardware, or as integrated circuits, such as application-specific integrated circuits (ASICs).
[0104] Furthermore, as is known to those skilled in the art, communication media typically contain computer-readable instructions, data structures, computer program modules, or other data in modulated data signals such as carrier waves or other transmission mechanisms, and may include any information delivery medium. Therefore, this application is not limited to any particular combination of hardware and software.
[0105] The above description, in conjunction with specific implementation methods, provides a further detailed explanation of the embodiments of this application. It should not be construed that the specific implementation of this application is limited to these descriptions. For those skilled in the art, various simple deductions or substitutions can be made without departing from the concept of this application, and all such modifications and substitutions should be considered within the scope of protection of this application.
Claims
1. A storage disk detection method, wherein, The method comprises: controlling the current state of a target storage disk corresponding to a preset position parameter to be different from the current state of other storage disks; reading the current state of each storage disk; determining a mapping relationship between the preset position parameter and a target position parameter of the target storage disk based on the current state of each storage disk; the target position parameter comprises a physical position or a logical index.
2. The storage disk detection method of claim 1, wherein, Before the step of controlling the current state of a target storage disk corresponding to a preset position parameter to be different from the current state of other storage disks, the method further comprises: reading a list of all in-situ storage disks and recording a list of logical indexes of all storage disks.
3. The storage disk detection method of claim 1 or 2, wherein, The current state of the storage disk comprises at least one of the following: an indicator light state of the storage disk; and a power state of the storage disk.
4. The storage disk detecting method of claim 3, wherein, When the current state of the storage disk comprises the indicator light state, the preset position parameter comprises the logical index; and the step of controlling the current state of a target storage disk corresponding to a preset position parameter to be different from the current state of other storage disks comprises: controlling the on-off state of the indicator light of the target storage disk corresponding to the logical index, so that the on-off state of the indicator light of the target storage disk is different from the on-off state of the indicator light of other storage disks. The target position parameter comprises a physical position; and the step of determining a mapping relationship between the preset position parameter and the target position parameter of the target storage disk based on the current state of each storage disk comprises: determining the physical position of the target storage disk according to the on-off state of the indicator light, and determining a mapping relationship between the physical position and the logical index.
5. The storage disk detecting method of claim 4, wherein, The step of controlling the current state of a target storage disk corresponding to a preset position parameter to be different from the current state of other storage disks comprises: the indicator light of the target storage disk is on, and the indicator light of other storage disks is off; or the indicator light of the target storage disk is off, and the indicator light of other storage disks is on.
6. The storage disk detecting method of claim 3, wherein, When the current state of the storage disk comprises the power state, the preset position parameter comprises the physical position; and the step of controlling the current state of a target storage disk corresponding to a preset position parameter to be different from the current state of other storage disks comprises: turning off the power of a storage disk corresponding to one physical position, and keeping the power of other storage disks turned on.
7. The storage disk detecting method of claim 6, wherein, The target position parameter comprises a logical index; and the step of determining a mapping relationship between the preset position parameter and the target position parameter of the target storage disk based on the current state of each storage disk comprises: determining the logical index of the storage disk with the turned-off power according to a first index list and a second index list; the second index list is obtained by reading all in-situ storage disks; and the first index list is obtained by reading all in-situ storage disks before the step of controlling the current state of a target storage disk corresponding to a preset position parameter to be different from the current state of other storage disks.
8. The storage disk detection method according to any one of claims 1 to 7, wherein, The preset position parameter comprises a logical index or a physical position; and the mapping relationship between the preset position parameter and the target position parameter of the target storage disk is determined based on the current state of each storage disk, which comprises determining a mapping relationship between a logical index and a physical position of the target storage disk based on the current state of each storage disk. 9.A storage disk detection apparatus, comprising: a state control module configured to control a current state of a target storage disk corresponding to a preset position parameter in each storage disk, which is different from a current state of other storage disks; a state reading module configured to read the current state of each storage disk; a parameter identification module configured to determine a mapping relationship between the preset position parameter and a target position parameter of the target storage disk based on the current state of each storage disk; wherein the target position parameter comprises a physical position or a logical index.
10. The storage disk detecting method of claim 9, wherein, The preset position parameter comprises a logical index or a physical position; and the mapping relationship between the preset position parameter and the target position parameter of the target storage disk is determined based on the current state of each storage disk, which comprises determining a mapping relationship between a logical index and a physical position of the target storage disk based on the current state of each storage disk. 11.A terminal device, comprising a processor, a memory and a communication bus; The communication bus is configured to realize connection communication between the processor and the memory; The processor is configured to execute one or more computer programs stored in the memory to realize steps of the storage disk detection method according to any one of claims 1-8.
12. A computer readable storage medium, wherein, The computer readable storage medium stores one or more computer programs, which can be executed by one or more processors to realize steps of the storage disk detection method according to any one of claims 1-8. The computer readable storage medium stores one or more computer programs, which can be executed by one or more processors to realize steps of the storage disk detection method according to any one of claims 1-8.