Universal port fixing method suitable for multiple types of solid state disks
Through LocationInfo and DeviceParent in the device tree information of the solid state drive as binary information, the problem of the hard disk's portability on different test platforms is solved, and the general positioning of multiple types of solid state drives is realized, and the unity of the test platform is improved. and adaptability reduces dependence on solid-state drive manufacturers and improves testing efficiency and accuracy of results.
Patent Information
- Application Number
- CN202411063706.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-05
- Publication Date
- 2024-11-26
AI Technical Summary
The existing solid-state drive test devices are customized with high cost and cannot be generalized. The connection method between the solid-state drive products and the test devices during testing is fixed, which limits the convenience and flexibility of the test and affects the accuracy of the test results and Repeatability, especially on different physical position information on different test platforms, leads to difficulty in fixing the mouth.
The LocationInfo and DeviceParent in the device tree information of the solid state drive are used as binary information to locate the physical location after the physical port is inserted, and the physical location mapping of multiple types of solid state drives on different test platforms is realized, which solves the difficulty of fixing the port The problem.
Achieves the universal fixed port of multiple types of solid-state drives on different test platforms, improving the uniformity and adaptability of the test platform, reducing dependence on solid-state drive manufacturers, standardizing the connection method, and improving testing efficiency and results. accuracy.
Smart Images

Figure CN119028419A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of solid state hard disks, and in particular to a universal port positioning method applicable to multiple types of solid state hard disks. Background Art
[0002] Solid State Drives, also known as SSD storage devices, are hard disks made of solid-state electronic storage chip arrays, consisting of a control unit and a storage unit (FLASH chip, DRAM chip). The SSD interface specifications and definitions, functions and usage methods are exactly the same as those of traditional hard disks, and the product appearance and size are also completely consistent with traditional hard disks, but the I / O performance is greatly improved compared to traditional hard disks. It is widely used in military, automotive, industrial control, video surveillance, network monitoring, network terminals, electricity, medical, aviation, navigation equipment and other fields. The operating temperature range of its chips is very wide, including commercial products (0-70°C) and industrial products (-40-85°C). Although the cost is relatively high, it is gradually becoming popular in the DIY market. Because the SSD technology is different from the traditional hard disk technology, many emerging memory manufacturers have emerged. Manufacturers only need to purchase NAND memory and match it with appropriate control chips to manufacture SSDs. The new generation of SSDs generally use SATA-3 interface, M.2 interface, MSATA interface, PCI-E interface, SAS interface, CFast interface and SFF-8639 interface. However, when the SSD is powered off for a long time and placed in a high temperature environment, it will face the risk of data loss. Therefore, using SSDs to back up data is not a good choice. With the rapid development of the Internet, people's demand for data storage is also increasing. Now many storage manufacturers have launched their own portable SSDs, and there are also mobile SSDs that support Type-C interfaces and SSDs that support fingerprint recognition.
[0003] As a new generation of storage devices, solid-state drives have been widely used in the field of information technology due to their high performance and low power consumption. In the R&D and production process of solid-state drives, the necessity of conducting various tests and inspections on their key performance indicators is a consensus among relevant companies in the industry. Existing solid-state drive tests usually use specific test devices, which require special tests and mold designs for different main controls and different models of solid-state drives, and have the following problems and disadvantages:
[0004] 1. The test device has a high degree of customization. The test mold needs to be redesigned for different SSD models, which requires large investment, long cycle, high cost, and cannot be universalized;
[0005] 2. During the test, the connection method between the solid-state drive product and the test device is fixed and cannot be flexibly adjusted, which limits the convenience and flexibility of the solid-state drive test.
[0006] 3. The SSD test fixture and its connection method are not standardized, which may affect the accuracy and repeatability of the test results.
[0007] 4. The port setting method in the SSD test depends on the port setting method in the card activation software provided by the SSD manufacturer. It is relatively closed and is not conducive to the implementation of integrated testing.
[0008] 5. The number of SATA interfaces and PCIE channels on different test platforms are different. The location information of the same SSD on these test platforms may vary greatly.
[0009] Specifically, the port positioning in SSD testing refers to mapping the physical location information of each port of the SSD through a positioning method in the test platform. The difference in physical location information of the same SSD on different test platforms will make it difficult to position the port during testing. The difference in physical location information of SSDs of different types and interfaces on the test platform will make it even more difficult to position the port during testing. Summary of the invention
[0010] In order to solve the problems in the prior art, the present invention provides a universal port positioning method applicable to multiple types of solid-state hard drives. By selecting LocationInfo and DeviceParent in the device tree information of the solid-state hard drive as a binary information method, the physical position that will be formed after a physical port is inserted into the solid-state hard drive is located. This enables multiple types of solid-state hard drives to easily map the physical location information of each port on different test platforms, thereby solving the problem in the prior art that the difference in physical location information of the solid-state hard drives on different test platforms will lead to difficulty in port positioning during testing.
[0011] A universal positioning method applicable to multiple types of solid state hard disks of the present invention comprises the following steps:
[0012] Step 1: Start to determine the mouth;
[0013] Step 2: Start the test platform, set the test platform parameters and import path;
[0014] Step 3: Determine whether the solid-state drive type of the port to be determined is SATA type;
[0015] Step 4: When the type of the SSD of the port to be determined is SATA, insert the SSD of the port to be determined into all ports of the test platform in turn, and obtain the device tree information of the SSD each time it is inserted;
[0016] Step 5: Get the LocationInfo value, LocationPaths value, and DeviceParent value in the device tree information of the solid state drive;
[0017] Step 6: Determine whether the LocationPaths value of the solid state drive matches the LocationInfo value;
[0018] Step 7: When the LocationPaths value of the solid state drive matches the LocationInfo value, the LocationInfo value of the solid state drive and the DeviceParent value are saved as a tuple of information;
[0019] Step 8: Determine whether the number of ports of the solid-state hard disk that has been plugged into the test platform has reached the maximum value of the test platform;
[0020] Step 9: When the number of ports of the SSD to be assigned ports that have been plugged into the test platform reaches the maximum value of the test platform, a SSD assignment information file is generated;
[0021] Step 10: Finishing.
[0022] The present invention is further improved. In the step 3, the type of the solid state hard disk of the port to be determined includes SATA type and PCIE type. When the type of the solid state hard disk of the port to be determined is not SATA type, the test platform is shut down and the solid state hard disk of the port to be determined is inserted, and then the test platform is turned on to obtain the device tree information of the solid state hard disk.
[0023] The present invention is further improved. In step 7, when the LocationPaths value of the solid state drive does not match the LocationInfo value, it is prompted that the acquisition of the device tree information of the solid state drive is abnormal and needs to be re-operated.
[0024] The present invention is further improved. In step 8, when the number of ports of the solid state hard disk to be determined that has been plugged into the test platform does not reach the maximum value of the test platform, step 3 is executed.
[0025] The present invention is further improved, in step 4, when the solid state hard disks of the ports to be determined are inserted into all the ports of the test platform in sequence, only one solid state hard disk of the port to be determined is inserted each time.
[0026] The present invention is further improved. In step 4, the SetiupDiGetDeviceResitryProperty method of the operating system is called to obtain the device tree information of the solid state drive, including the InstallState value, HardwareIDs value, LocationPaths value, LocationInfo value, InstanceID value and DeviceParent value of the solid state drive.
[0027] The present invention is further improved, in step 5, calling the Get-device command to obtain the LocationInfo value, LocationPaths value and DeviceParent value in the device tree information of the solid state drive.
[0028] The present invention is further improved. In step 6, LocationPaths represents the location path of the solid state drive, which refers to the path or position of the solid state drive in the system hierarchy; LocationInfo represents the location information of the solid state drive, including the physical location information of the solid state drive.
[0029] The beneficial effects of the present invention are as follows: the present invention provides a universal port positioning method applicable to multiple types of solid-state hard disks, which locates the physical position formed after a physical port is inserted into a solid-state hard disk by selecting LocationInfo and DeviceParent in the solid-state hard disk device tree information as a binary information method, so that multiple types of solid-state hard disks can easily map the solid-state hard disk physical location information of each port on different test platforms; the test platform is unified and can be adapted to different master controls and different types of solid-state hard disks, whether it is USB type, PCIE type, or SATA type, to achieve a universal effect, and is independent of the manufacturer of the solid-state hard disk; the connection method of the test platform is standardized, which does not affect the accuracy of the test results at the hardware level, greatly improves the efficiency of mass production testing of solid-state hard disks, and solves the problem in the prior art that the difference in physical location information of solid-state hard disks on different test platforms will lead to difficulty in port positioning during testing. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] Figure 1 The present invention is a flowchart of a universal port positioning method applicable to multiple types of solid state drives. DETAILED DESCRIPTION
[0031] The present invention is further described in detail below with reference to the accompanying drawings and embodiments.
[0032] See also Figure 1 A universal positioning method applicable to multiple types of solid state hard disks of the present invention comprises the following steps:
[0033] Step 1: Start to determine the mouth.
[0034] Step 2: Start the test platform, set the test platform parameters and import path. In this embodiment, the test platform parameters and import path are set to facilitate the subsequent acquisition of the device tree information of the solid state drive.
[0035] Step 3: Determine whether the SSD type of the port to be determined is SATA type; wherein, the SSD type of the port to be determined includes SATA type and PCIE type. When the SSD type of the port to be determined is not SATA type, shut down the test platform and insert the SSD of the port to be determined, and then restart the test platform to obtain the device tree information of the SSD, because SATA type SSD supports hot plugging, while PCIE type SSD does not support hot plugging. Plugging in and out the PCIE type SSD in a powered state will cause an abnormality.
[0036] Step 4: When the type of the solid-state hard disk of the port to be determined is SATA type, the solid-state hard disk of the port to be determined is inserted into all ports of the test platform in turn, and the device tree information of the solid-state hard disk is obtained each time; when the solid-state hard disk of the port to be determined is inserted into all ports of the test platform in turn, only one solid-state hard disk of the port to be determined is inserted each time; in this embodiment, the SetiupDiGetDeviceResitryProperty method of the operating system is called to obtain the device tree information of the solid-state hard disk, including the InstallState value, HardwareIDs value, LocationPaths value, LocationInfo value, InstanceID value and DeviceParent value of the solid-state hard disk.
[0037] Step 5: Obtain the LocationInfo value, LocationPaths value, and DeviceParent value in the device tree information of the solid state drive; in this embodiment, the Get-device command is called to obtain the LocationInfo value, LocationPaths value, and DeviceParent value in the device tree information of the solid state drive.
[0038] Step 6: Determine whether the LocationPaths value of the solid-state drive matches the LocationInfo value; where LocationPaths represents the location path of the solid-state drive, which refers to the path or location of the solid-state drive in the system hierarchy; LocationInfo represents the location information of the solid-state drive, including the physical location information of the solid-state drive. Under normal circumstances, the LocationPaths value of the solid-state drive matches the LocationInfo value. In this embodiment, whether the device tree information of the solid-state drive is obtained abnormally is determined by determining whether the LocationPaths value of the solid-state drive matches the LocationInfo value.
[0039] Step 7: When the LocationPaths value of the SSD matches the LocationInfo value, the LocationInfo value and DeviceParent value of the SSD are saved as a tuple of information; when the LocationPaths value of the SSD does not match the LocationInfo value, it is prompted that the device tree information of the SSD is abnormally obtained and needs to be re-operated.
[0040] Step 8: Determine whether the number of ports of the solid-state hard disk that has been plugged into the port to be determined on the test platform has reached the maximum value of the test platform; when the number of ports of the solid-state hard disk that has been plugged into the port to be determined on the test platform has not reached the maximum value of the test platform, execute step 3.
[0041] Step 9: When the number of ports of the SSD to be assigned ports that have been plugged into the test platform reaches the maximum value of the test platform, a SSD assignment information file is generated;
[0042] Step 10: Finishing.
[0043] In this embodiment, first, we insert the SSDs of the ports to be determined into the test platform in sequence (only a single SSD of the port to be determined is inserted at a time). At this time, if the SSD of the port to be determined is a valid SSD, the operating system should recognize two SSDs (one of which is the system disk). Then, we obtain the device tree information of the SSD at the bottom layer, including the InstallState value, HardwareIDs value, LocationPaths value, LocationInfo value, InstanceID value and DeviceParent value of the SSD. After obtaining the device tree information of the SSD, cache the device tree information of the SSD into a special structure array, and then insert the disk in sequence until all valid ports of the test platform have experienced a separate disk insertion action. At this time, the test platform has completely saved a physical location information structure array that is full of all ports of the test platform. Finally, we write the information in the structure array into a special file according to the array subscript in sequence. This file only needs to be generated once from beginning to end.
[0044] At this point, we have obtained the physical location information that will be matched after all ports of the test platform are connected to the solid-state hard disk corresponding to the port to be determined. Since some information values of solid-state hard disks of different master control types on these ports are likely to be the same. Therefore, just having this information is not enough to support us to achieve the purpose of unique positioning. Therefore, we select a unique binary information to maintain the physical location information that will be formed after a physical port is inserted into the solid-state hard disk of the port to be determined. In the embodiment, we select the LocationInfo value and the DeviceParent value in the device tree information of the solid-state hard disk of the port to be determined as a binary information, so that the purpose of unique positioning can be achieved. The information format of LocationInfo is similar to: Bus Number 2, Target Id 0, LUN 0. The information format of DeviceParent is similar to: PCI\VEN_8086&DEV_8D02&SUBSYS_72708086&REV_05\3&11583659&0&FA. This value is different for different test platforms, but all can uniquely locate a target.
[0045] We redirect the selected binary information to a special file. Before the SSD of the undetermined port is connected to the test platform for testing, we read the value in the special file and match it with the position information value of the SSD of the undetermined port that has been connected to the test platform. Then, the physical position information of the corresponding SSD of the undetermined port can be displayed on the corresponding port. At this point, we have achieved the purpose of unique positioning. In this case, even if different main controllers and different types of SSDs are inserted, the positioning can be correctly reflected.
[0046] In this embodiment, the core method and code for locating the physical location information of the solid state drive of the port to be determined are as follows:
[0047] A)SetupDiGetDeviceRegistryPropertyA(
[0048] HDEVINFO DeviceInfoSet,
[0049] PSP_DEVIINFO_DATA DeviceInfoData,
[0050] DWORD Property,
[0051] PDWORD PropertyRegDataType,
[0052] PBYTE PropertyBuffer,
[0053] DWROD PropertyBudderSize,
[0054] PDWORD RequiredSize);
[0055] : When the third parameter is SPDRP_LOCATION_PATHS, SPDRP_BUSNUMBER, SPDRP_INSTALL_STATE, SPDRP_HARDWAREID, the device can be obtained:
[0056] 1) LocationPaths (LocationPaths indicates the location path of a device. In a computer system, the location path of a device refers to the path or position of the device in the system hierarchy. The LocationPaths field is used to record the location path of the device in the system for device positioning and management.)
[0057] 2) busnumber (busnumber indicates the bus number to which the device is connected. In a computer system, a device is usually connected to a host or other devices through a bus. The busnumber field is used to identify the bus number to which the device is connected, so as to facilitate device identification and management in the system.)
[0058] 3) InstallState (represents the installation status of the device. It may have multiple states, such as installed, not installed, partially installed, etc., used to track the deployment of the device.)
[0059] 4) HardwareIDs (HardwareID is an ID number used to uniquely identify a hardware device. It can be the device's serial number, MAC address, or other unique identifier provided by the manufacturer to distinguish different hardware devices).
[0060] B) Get-device|where{$_.Service-eq'disk'}|format-table Name,InstanceId,DeviceParent,LocationInfo This command can obtain the following information about the device:
[0061] 1) InstanceId (a unique identifier that identifies a specific instance or device)
[0062] 2) DeviceParent (used to indicate the parent device of a device so as to establish associations and hierarchies between devices in the system.)
[0063] 3) LocationInfo (LocationInfo represents the location information of a device. In a computer system, the location information of a device may include a physical location, a logical location, or other information that identifies the location of the device.)
[0064] C) std::map<string,string> LocationMap is a container used to receive the binary information of each interface after positioning.
[0065] It can be seen from the above that the beneficial effects of the present invention are: the present invention provides a universal port positioning method suitable for multiple types of solid-state hard drives, which locates the physical position formed after a physical port is inserted into the solid-state hard drive by selecting LocationInfo and DeviceParent in the solid-state hard drive device tree information as a binary information method, so that multiple types of solid-state hard drives can be easily mapped to the solid-state hard drive physical location information of each port on different test platforms; the test platform is unified and can be adapted to different master controls and different types of solid-state hard drives, whether it is USB type, PCIE type, or SATA type, to achieve a universal effect, independent of the manufacturer of the solid-state hard drive; the connection method of the test platform is standardized, which does not affect the accuracy of the test results at the hardware level, greatly improves the efficiency of mass production testing of solid-state hard drives, and solves the problem in the prior art that the difference in physical location information of solid-state hard drives on different test platforms will lead to difficulty in port positioning during testing.
[0066] The specific implementation modes described above are preferred implementation modes of the present invention, and are not intended to limit the specific implementation scope of the present invention. The scope of the present invention includes but is not limited to the specific implementation modes, and all equivalent changes made according to the present invention are within the protection scope of the present invention.
Claims
1. A universal porting method applicable to multiple types of solid state drives. It is characterized in that The following steps are included: Step 1: Start to determine the mouth; Step 2: Start the test platform, set the test platform parameters and import path; Step 3: Determine whether the solid-state drive type of the port to be determined is SATA type; Step 4: When the type of the SSD of the port to be determined is SATA, insert the SSD of the port to be determined into all ports of the test platform in turn, and obtain the device tree information of the SSD each time it is inserted; Step 5: Get the LocationInfo value, LocationPaths value, and DeviceParent value in the device tree information of the solid state drive; Step 6: Determine whether the LocationPaths value of the solid state drive matches the LocationInfo value; Step 7: When the LocationPaths value of the solid state drive matches the LocationInfo value, the LocationInfo value of the solid state drive and the DeviceParent value are saved as a tuple of information; Step 8: Determine whether the number of ports of the solid-state hard disk that has been plugged into the test platform has reached the maximum value of the test platform; Step 9: When the number of ports of the SSD to be assigned ports that have been plugged into the test platform reaches the maximum value of the test platform, a SSD assignment information file is generated; Step 10: Finishing.
2. The universal porting method applicable to multiple types of solid state drives as claimed in claim 1, Features: In step 3, the SSD type of the port to be determined includes SATA type and PCIE type. When the SSD type of the port to be determined is not SATA type, shut down the test platform, insert the SSD of the port to be determined, and then start the test platform to obtain the device tree information of the SSD.
3. The universal porting method applicable to multiple types of solid state drives as claimed in claim 2, Features: In step 7, when the LocationPaths value of the solid state drive does not match the LocationInfo value, it is prompted that the acquisition of the device tree information of the solid state drive is abnormal and needs to be re-operated.
4. The universal porting method applicable to multiple types of solid state drives as claimed in claim 3, Features: In step 8, when the number of ports of the solid-state hard disk to be determined that has been plugged into the test platform does not reach the maximum value of the test platform, step 3 is executed.
5. The universal porting method applicable to multiple types of solid state hard disks as claimed in claim 4, Features: In step 4, when the solid state hard disks of the ports to be determined are inserted into all the ports of the test platform in sequence, only one solid state hard disk of the ports to be determined is inserted each time.
6. The universal porting method applicable to multiple types of solid state hard disks as claimed in claim 5, Features: In step 4, the SetiupDiGetDeviceResitryProperty method of the operating system is called to obtain the device tree information of the solid state drive, including the InstallState value, HardwareIDs value, LocationPaths value, LocationInfo value, InstanceID value and DeviceParent value of the solid state drive.
7. The universal porting method applicable to multiple types of solid state hard disks as claimed in claim 6, Features: In step 5, the Get-device command is called to obtain the LocationInfo value, LocationPaths value, and DeviceParent value in the device tree information of the solid state drive.
8. The universal porting method applicable to multiple types of solid state hard disks as claimed in claim 7, Features: In step 6, LocationPaths represents the location path of the solid state drive, which refers to the path or location of the solid state drive in the system hierarchy; LocationInfo represents the location information of the solid state drive, including the physical location information of the solid state drive.
