A method for locating a storage device port by identifying data content

By identifying the data content and locating the storage device port, it solves the problems of installation errors and cumbersome maintenance in multi-storage device systems, enables random insertion and removal of hard disks and simplifies maintenance, and improves the reliability and efficiency of the system.

CN113157325BActive Publication Date: 2024-09-13SHENZHEN JIFANG IND CONTROL CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202110344388.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-03-30
Publication Date
2024-09-13
Estimated Expiration
2041-03-30

AI Technical Summary

Technical Problem

In a multi-storage device system, installation errors of storage devices often cause the system to fail to operate normally, making subsequent maintenance and management cumbersome and increasing working hours.

Method used

The method of locating storage device ports by identifying data content uses the Block IO protocol to traverse the device, obtain Device Path Node data, analyze the Node data of the parent device and combine it with the hardware circuit design to locate the physical port location, simplifying the installation and maintenance process.

Benefits of technology

It realizes the easy insertion and removal of hard disks, reduces the probability of errors, simplifies post-maintenance management, and improves the reliability and efficiency of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113157325B
    Figure CN113157325B
Patent Text Reader

Abstract

The present invention discloses a method for locating a storage device port by identifying data content, which is characterized by comprising the following steps: step 1, traversing all devices containing a Block IO protocol; step 2, using the Block IO protocol of each device to capture partition data information; step 3, comparing and identifying partition data; step 4, using the Device Path protocol of a device with successful data comparison to obtain Device Path Node data of the device; step 5, using the Device Path Node data to trace back and find out the parent device; step 6, obtaining the Device Path Node data of the parent device; step 7, analyzing the Node data of the parent device, combining with the hardware circuit design, and locating the physical port position.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a method for locating a storage device port by identifying data content. Background Art

[0002] In a multi-storage device system, there are often primary boot storage devices, secondary boot storage devices, and expansion storage devices. During the assembly process of the entire system, various storage devices have designated installation ports. Installation errors will cause the entire system to not operate normally. For example, if the primary boot storage device is installed incorrectly, the system cannot be loaded. Installation and debugging require designated port rules, and subsequent maintenance and management are very cumbersome, which greatly increases working time. Summary of the invention

[0003] The present invention aims at the above-mentioned deficiencies in the prior art and provides a method for locating a storage device port by identifying data content. By using this technology, hard disks can be plugged in and out at will, and installation is convenient, error-prone, and subsequent maintenance is also more convenient.

[0004] To achieve the above object, the present invention provides the following technical solutions:

[0005] A method for locating a storage device port by identifying data content comprises the following steps:

[0006] Step 1: Traverse all devices containing Block IO protocol;

[0007] Step 2: Get the Device Path Node data of the device and find the parent device;

[0008] Step 3: Get the Device Path Node data of the parent device;

[0009] Step 4: Analyze the Node data of the parent device and locate the physical port location based on the hardware circuit design.

[0010] Preferably: Step 2 specifically includes: using the Block IO protocol of each device to capture the data information of the partition; comparing and identifying the partition data; and using the Device Path protocol of the device whose data comparison succeeds to obtain the Device Path Node data of the device.

[0011] Preferably, in step 2, the parent device is found by backtracking the Device Path Node data.

[0012] Preferably, when the comparison data does not match, the partition data of the next device is read for comparison.

[0013] Preferably: in the step 4, the device name information and the serial number identification code are obtained using the parent device Information protocol.

[0014] Preferably: the ReadBlocks function in the Block IO protocol of the device is used to capture data information.

[0015] Preferably: in step three, the Device Path Node data is obtained using the Device Path protocol of the parent device.

[0016] Compared with the prior art, the present invention has the following beneficial effects:

[0017] 1. The present invention utilizes the rich interface resources and protocols provided by the UEFI specification to obtain storage device data information, capacity space information, device name serial number, physical path information, setting mark data, etc., and locates the port position of a specific storage device in a multi-storage device system by analyzing the obtained information data, thereby managing the storage device. In a multi-storage device system, the port position of a storage device containing specific data content is identified, and the storage device is managed; the identification information, serial number, device name, etc. of the storage devices on different ports are determined, and data is provided for asset management.

[0018] 2. After the present invention applies the technology, during the startup phase of the UEF I firmware, the physical path can be used to locate which port is the primary boot device according to the data on the storage device, so that the UEF I firmware can load the system from the storage device of this port. This makes the structural design much simpler, and there is no need to design fixed ports for the master and slave devices, and no specified port rules are required for installation and debugging, which is also conducive to later maintenance and management.

[0019] 3. The present invention can utilize this technology in common multi-hard disk device systems, and the hard disk slots can be plugged in and out at will, which is easy to install, not prone to errors, and more convenient for later maintenance. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] Figure 1 It is a schematic diagram of the process of the present invention. DETAILED DESCRIPTION

[0021] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0022] like Figure 1As shown, a method for locating a storage device port by identifying data content is characterized by comprising the following steps:

[0023] Step 1: Traverse all devices containing Block IO protocol;

[0024] Step 2: Use the ReadBlocks function in the Block IO protocol of each device to capture the partition data information;

[0025] Step 3: Compare and identify the partition data; if the compared data does not match, continue to read the partition data of the next device for comparison;

[0026] Step 4: Use the Device Path protocol of the device whose data comparison succeeds to obtain the Device PathNode data of the device;

[0027] Step 5: Use Device Path Node data to trace back and find the parent device;

[0028] Step 6: Use the Device Path protocol of the parent device to obtain the Device Path Node data; use the I nformat ion protocol of the parent device to obtain the device name information and serial number identification code;

[0029] Step 7: Analyze the Node data of the parent device and locate the physical port location based on the hardware circuit design.

[0030] In this embodiment, a hard disk storage device is taken as an example to analyze the data storage structure of the storage device.

[0031] The hard disk can be divided into multiple partitions, each of which stores different data files.

[0032] From the UEFI Block IO protocol, we know that each partition has its own Block IO protocol. The Block IO protocol abstracts the block storage device to facilitate the reading and writing of data from the block device.

[0033] The Block IO protocol contains the following functions:

[0034] typedef struct_EFI_BLOCK_IO_PROTOCOL{

[0035] UINT64 Revision;

[0036] EFI_BLOCK_IO_MEDIA*Media;

[0037] EFI_BLOCK_RESET Reset;

[0038] EFI_BLOCK_READ ReadBlocks;

[0039] EFI_BLOCK_WRITE WriteBlocks;

[0040] EFI_BLOCK_FLUSH FlushBlocks;

[0041] }EFI_BLOCK_IO_PROTOCOL;

[0042] For example, a hard disk has four partitions, namely, four Child Devices. Each Child Device is a partition and has its own Block IO protocol. We can use the Block IO protocol to read the data stored on the partition, for example, read the first 256 bytes of data on the first partition.

[0043] We can identify the properties of the hard disk that owns the partition through the partition data information.

[0044] According to the UEFI specification, we know that any Device contains the Device Path protocol / / **********************************************************

[0045] / / EFI_DEVICE_PATH_PROTOCOL

[0046] / / ***********************************************************

[0047] typedef struct_EFI_DEVICE_PATH_PROTOCOL{

[0048] UINT8 Type;

[0049] UINT8 SubType;

[0050] UINT8 Length[2];

[0051] }EFI_DEVI CE_PATH_PROTOCOL;

[0052] Dev Path abstracts the physical path of the device. By analyzing Dev Path, you can get the physical connection path information of the device. The hard disk partition also belongs to a Dev and must contain the Dev Path protocol. Analyze the Child Dev (partition) Path Node data and trace back to the Parent Dev (parent device), which is the hard disk body.

[0053] By using the parent device-child device relationship and tracing back to the parent device, we further analyze the Device Path protocol of the parent device and extract the connection information between the hard disk and the host based on the Device Path node data. Combined with the hardware circuit design, the actual physical location of the hard disk on the machine can be located from the entire system.

[0054] From the UEF IPI specification, we know that storage devices have their own I nformat ion related protocols.

[0055] For example, the hard disk has DiskInfo Protocol, which can obtain the name, serial number and other information of the hard disk;

[0056] USB storage devices have USB IO protocol, which can obtain the name, serial number and other information of USB storage devices.

[0057] After locating the storage device body above, we can call the storage device's information-related protocol to obtain more information about the storage device. Taking Disk Information Protocol as an example, typedef struct _EF I_DISK_INFO_PROTOCOL {

[0058] EFI_GUID Interface;

[0059] EF I_DISK_INFO_INQU IRY Inquiry;

[0060] EFI_DISK_INFO_IDENTIFY Identify;

[0061] EFI_DISK_INFO_SENSE_DATA SenseData;

[0062] EF I_DISK_INFO_WHICH_IDE WhichIde;

[0063] }EF I_DISK_INFO_PROTOCOL;

[0064] We use the I ndentify function in the protocol to obtain the device name and serial number. In this way, we can not only locate the port position of the storage device, but also obtain the name and serial number information of the hard disk, which is also helpful for the control and asset management of the storage device.

[0065] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.

Claims

1. A method for locating a storage device port by identifying data content, Features: The following steps are involved: Step 1: Traverse all devices containing Block IO protocol; Step 2: Get the Device Path Node data of the device and find the parent device; Step 3: Get the Device Path Node data of the parent device; Step 4: Analyze the Device Path Node data of the parent device and locate the physical port location based on the hardware circuit design. Step 2 specifically includes: using the Block IO protocol of each device to capture the partition data information; comparing and identifying the partition data; using the Device Path protocol of the device whose data comparison succeeds to obtain the Device Path Node data of the device; In the step 2, the parent device is found by backtracking the Device Path Node data. When the comparison data does not match, continue to read the partition data of the next device for comparison; In step 4, the parent device Information protocol is used to obtain the device name information and serial number identification code; Use the ReadBlocks function in the device's Block IO protocol to capture data information; In step three, the Device Path protocol of the parent device is used to obtain the Device Path Node data.

Citation Information

Patent Citations

  • Method and television for recognizing USB (universal serial bus) devices plugged in television

    CN103546704A

  • Method for achieving EXT file system based on UEFI firmware

    CN106909351A

  • Solid state disk resource allocation method and device and storage medium

    CN112035061A