D3hot low power test method and system based on solid state drive
Patent Information
- Application Number
- CN202311592649.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-27
- Publication Date
- 2026-10-09
- Estimated Expiration
- 2043-11-27
AI Technical Summary
而这些测试软硬件不提供D3hot低功耗的测量
[0029] The aforementioned D3hot low-power testing method, system, computer equipment, and storage medium based on solid-state drives (SSDs) acquire a D3hot low-power test request, read the APST status of the SSD under test and determine whether the APST function is disabled; if not disabled, the APST function is disabled; the power state of the SSD under test is set to PS0, and the value of the PMCS register is read and saved; after a period of inactivity, the value of the PMCS register is modified to put the SSD under test into the D3hot state, and power consumption data collection begins; after a period of waiting, power consumption data collection stops, and the collected data is imported into a data template for visualization. This invention can efficiently and accurately acquire the D3hot low power consumption of the SSD under test, and can graphically display the D3hot power consumption change trend in detail, objectively providing a power consumption evaluation for each firmware version during the optimization phase.
Smart Images

Figure CN117524293B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of solid-state drive (SSD) testing technology, and in particular to a D3hot low-power testing method, system, computer device, and storage medium based on SSDs. Background Technology
[0002] In the storage industry, low power consumption of solid-state drives (SSDs) has always been a crucial testing criterion. This includes power consumption in PS3 (Power State), PS4, and Modern Standyby modes, as well as idle power consumption when a laptop is connected only by battery. These power consumption values are closely related to the power consumption specifications in the SSD's datasheet. When SSDs are used in mobile devices like laptops, users are particularly concerned about power consumption. Low power consumption increases battery life, but lower isn't always better; excessively low power consumption can suppress performance. Therefore, SSD development often requires a balance between power consumption and performance, involving repeated optimization of both. Power consumption may change with each firmware update during optimization, making accurate and timely measurement of low power consumption during optimization and rapid provision of graphical data a significant challenge in SSD power consumption testing.
[0003] Currently, the industry standard for measuring low power consumption involves using a laptop supporting modern standby to issue a sleep command and remove the AC power adapter to idle the computer for power consumption measurement. Measuring low power consumption in PS3 and PS4 involves using a computer supporting ASPM (Active State Power Management) and DriveMaster hardware / software to issue a "set feature" command to disable the SSD's APST function, and then using the same command to switch the SSD's power state to a low-power state like PS3 or PS4 to test and evaluate its power consumption. However, these testing hardware / software systems do not provide D3hot low power consumption measurement. Summary of the Invention
[0004] Therefore, it is necessary to provide a D3hot low-power testing method, system, computer equipment, and storage medium based on solid-state drives to address the aforementioned technical problems.
[0005] A D3hot low-power testing method based on solid-state drives, the method comprising:
[0006] Obtain the D3hot low-power test request, read the APST status of the solid-state drive under test and determine whether the APST function is turned off. If it is not turned off, turn off the APST function.
[0007] Set the power state of the solid-state drive under test to PS0, and read and save the value of the PMCS register;
[0008] After a period of inactivity, the value of the PMCS register is modified to make the solid-state drive under test enter the D3hot state and start collecting power consumption data.
[0009] After waiting for a period of time, stop collecting power consumption data and import the collected data into a data template for visualization.
[0010] In one embodiment, before the step of reading the APST status of the solid-state drive under test and determining whether the APST function is disabled, and disabling the APST function if it is not disabled, the method further includes:
[0011] Read the value of the Link Controller register and determine whether the solid-state drive under test supports and enables the ASPM function. If it is not enabled, enable the ASPM function.
[0012] In one embodiment, after the step of reading the value of the Link Controller register and determining whether the solid-state drive under test supports and enables the ASPM function, and enabling the ASPM function if it is not enabled, the method further includes:
[0013] If ASPM is supported and enabled, the value of the L1PM register is read and it is determined whether L1.2 is supported and enabled.
[0014] In one embodiment, after the step of stopping the collection of power consumption data after waiting for a period of time and importing the collected data into a data template for visualization, the method further includes:
[0015] After leaving it idle for a period of time, switch the solid-state drive under test from D3hot state to D0 state.
[0016] A D3hot low-power testing system based on a solid-state drive, the system comprising:
[0017] The first judgment module is used to obtain the D3hot low power test request, read the APST status of the solid-state drive under test and determine whether the APST function is turned off. If it is not turned off, the APST function is turned off.
[0018] The status setting module is used to set the power state of the solid-state drive under test to PS0 and read and save the value of the PMCS register.
[0019] The modification module is used to modify the value of the PMCS register after a period of inactivity so that the solid-state drive under test enters the D3hot state and starts collecting power consumption data.
[0020] The data import module is used to wait for a period of time before stopping the collection of power consumption data and importing the collected data into a data template for visualization.
[0021] In one embodiment, the system further includes a second determination module, the second determination module being used to:
[0022] Read the value of the Link Controller register and determine whether the solid-state drive under test supports and enables the ASPM function. If it is not enabled, enable the ASPM function.
[0023] In one embodiment, the system further includes a third determination module, the third determination module being used to:
[0024] If ASPM is supported and enabled, the value of the L1PM register is read and it is determined whether L1.2 is supported and enabled.
[0025] In one embodiment, the system further includes a state switching module, the state switching module being used to:
[0026] After leaving it idle for a period of time, switch the solid-state drive under test from D3hot state to D0 state.
[0027] A computer device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of any of the methods described above.
[0028] A computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of any of the above methods.
[0029] The aforementioned D3hot low-power testing method, system, computer equipment, and storage medium based on solid-state drives (SSDs) acquire a D3hot low-power test request, read the APST status of the SSD under test and determine whether the APST function is disabled; if not disabled, the APST function is disabled; the power state of the SSD under test is set to PS0, and the value of the PMCS register is read and saved; after a period of inactivity, the value of the PMCS register is modified to put the SSD under test into the D3hot state, and power consumption data collection begins; after a period of waiting, power consumption data collection stops, and the collected data is imported into a data template for visualization. This invention can efficiently and accurately acquire the D3hot low power consumption of the SSD under test, and can graphically display the D3hot power consumption change trend in detail, objectively providing a power consumption evaluation for each firmware version during the optimization phase. Attached Figure Description
[0030] Figure 1 This is a flowchart illustrating a D3hot low-power testing method based on a solid-state drive in one embodiment.
[0031] Figure 2 This is a flowchart illustrating a D3hot low-power testing method based on a solid-state drive in another embodiment.
[0032] Figure 3 This is an application environment diagram of a D3hot low-power testing method based on solid-state drives in one embodiment;
[0033] Figure 4 This is a power consumption trend graph from a D3hot low-power test in one embodiment;
[0034] Figure 5 This is a block diagram of a D3hot low-power test system based on a solid-state drive in one embodiment.
[0035] Figure 6 This is a block diagram of a D3hot low-power test system based on a solid-state drive in another embodiment.
[0036] Figure 7 This is a block diagram of a D3hot low-power test system based on a solid-state drive in another embodiment;
[0037] Figure 8 This is a block diagram of a D3hot low-power test system based on a solid-state drive in yet another embodiment.
[0038] Figure 9 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0039] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0040] In one embodiment, such as Figure 1 As shown, a D3hot low-power testing method based on solid-state drives is provided, which includes:
[0041] Step 102: Obtain the D3hot low-power test request, read the APST status of the solid-state drive under test and determine whether the APST function is turned off. If it is not turned off, turn off the APST function.
[0042] Step 104: Set the power state of the solid-state drive under test to PS0, and read and save the value of the PMCS register;
[0043] Step 106: After a period of inactivity, modify the value of the PMCS register to make the solid-state drive under test enter the D3hot state and start collecting power consumption data;
[0044] Step 108: After waiting for a period of time, stop collecting power consumption data and import the collected data into the data template for visualization.
[0045] In this embodiment, a D3hot low-power testing method based on solid-state drives is provided. The specific testing environment for this method is as follows:
[0046] Hardware Requirements: The computer under test is an ASUS Z790. For this computer, the method described in this embodiment is applicable to desktops, laptops, and other computers supporting the M.2 PCIe interface; the specific model is not mandatory. In this embodiment, the ASUS Z790 is preferred as the computer under test. High-precision power consumption data acquisition instrument: The high-precision power consumption data acquisition software client is a PC with Fluke software installed; the specific model is not mandatory. The solid-state drive under test is an M.2 solid-state drive supporting D3hot. Location of the solid-state drive under test: Slave drive.
[0047] Software requirements: The operating system is Linux Ubuntu (the machine under test), and Win11 (the data acquisition software client); the tools include FIO, NVME-cli, setpci, and the data acquisition software; the test script is a self-written shell script.
[0048] First, obtain a D3hot low-power test request, read the APST status of the SSD under test, and determine whether the APST function is disabled. If it is not disabled, disable the APST function. Specifically, use the nvme tool to send the get-feature -H command to read the contents of configuration 0xc. If the returned content contains "enabled", it means that the APST function of the SSD is enabled. You need to use the nvme tool to send set-feature / dev / device_name -f0xc -v 0 to disable the APST function of the drive under test.
[0049] Next, set the power state of the SSD under test to PS0, and read and save the value of the PMCS register. This can be done using the nvme tool by sending the command `set-feature / dev / device_name-f0x2-v 0` to set the power state of the drive under test to PS0.
[0050] Then, after a period of inactivity, the value of the PMCS register is modified to put the SSD under test into D3hot state and begin collecting power consumption data. Specifically, the command `setpci -s B:D:F CAP_PM+4.B` is used to read and save the default value of the PMCS (Power Management Control / Status) register. After 60 seconds of inactivity, the PMCS register is modified using the `setpci` tool to put it into D3hot state and begin collecting power consumption data.
[0051] Finally, after waiting for a period of time, stop collecting power consumption data and import the collected data into a data template for visualization. Specifically, for example, stop collecting power consumption data immediately after waiting one minute, save the data, and import it into Excel for data visualization.
[0052] In this embodiment, by acquiring a D3hot low-power test request, the APST status of the SSD under test is read and it is determined whether the APST function is disabled. If not disabled, the APST function is disabled. The power state of the SSD under test is set to PS0, and the value of the PMCS register is read and saved. After a period of inactivity, the value of the PMCS register is modified to make the SSD under test enter the D3hot state, and power consumption data collection begins. After a period of waiting, power consumption data collection is stopped, and the collected data is imported into a data template for visualization. This solution can efficiently and accurately acquire the D3hot low power consumption of the SSD under test, and can graphically display the D3hot power consumption trend in detail, objectively providing a power consumption evaluation for each firmware version during the optimization phase.
[0053] In one embodiment, before the step of reading the APST status of the solid-state drive under test and determining whether the APST function is disabled, and disabling the APST function if it is not disabled, the method further includes: reading the value of the Link Controller register and determining whether the solid-state drive under test supports and enables the ASPM function, and enabling the ASPM function if it is not enabled.
[0054] In one embodiment, after reading the value of the Link Controller register and determining whether the solid-state drive under test supports and enables the ASPM function, and enabling the ASPM function if it is not enabled, the method further includes: if the ASPM function is supported and enabled, reading the value of the L1PM register and determining whether L1.2 is supported and enabled.
[0055] In one embodiment, after waiting for a period of time to stop collecting power consumption data and importing the collected data into a data template for visualization, the method further includes: after being idle for a period of time, switching the solid-state drive under test from the D3hot state to the D0 state.
[0056] Specifically, refer to Figure 2 The flowchart shown illustrates the D3hot low-power testing method based on solid-state drives. In this embodiment, open-source tools FIO, NVME-cli, and setpci are used to write shell scripts on a Linux system, combined with a high-precision power data acquisition instrument, FLUKE 2680A, to achieve D3hot state switching, workload combination, and automatic collection of power data. After the test, the collected power data is automatically imported into Excel for processing. Finally, the power consumption trends under various power states are presented graphically.
[0057] The application environment of this method is as follows: Figure 3 As shown, the solid-state drive under test is inserted into the power board on the host computer, ensuring good ventilation to prevent thermal throttling and thus avoid deviations from the expected power consumption data. The two test leads on the power board are connected to the available measurement channels of the high-precision power data acquisition instrument, FLUKE 2680A. Finally, the high-precision power data acquisition instrument is connected to the client computer of the power data acquisition software via network. The specific test procedure in this embodiment is as follows:
[0058] Step 1: Use `setpci-s B:D:F CAP_EXP+10.B` to check if the value of ASPMbit 0,1 is 00. If it is 00, it means that ASPM is off. You need to check if the slot is used incorrectly or if there is a problem with the test environment settings.
[0059] Step 2: Use setpci -s B:D:F ECAP_L1PM+4.B to read the data of L1PM (Link layer power management, hereinafter referred to as L1PM), print out the status of L1 and record it, and ensure that L1.2 (the sub-power management of link layer power management L1) is enabled.
[0060] Step 3: Use the nvme tool to send the get-feature -H command to read the contents of configuration 0xC. If the returned content contains "enabled" (if it is disabled, proceed directly to step 4), it means that the APST function of the solid-state drive is enabled. You need to use the nvme tool to send the set-feature / dev / device_name -f0xc -v 0 command to disable the APST function of the drive under test.
[0061] Step 4: Use the nvme tool to send the command set-feature / dev / device_name-f0x2-v 0 to set the power status of the disk under test to PS0.
[0062] Step 5: Use the command setpci-s B:D:F CAP_PM+4.B to read and save the default value of register PMCS.
[0063] Step 6: After Idle for 60 seconds, use the setpci tool to modify the PMCS register to enter D3hot (command setpci -sB:D:F CAP_PM+4.B = (use the value "03" to perform an "OR" operation with the value read in step 5), and start collecting power consumption data.
[0064] Step 7: After waiting for 1 minute, immediately stop collecting power consumption data, save the data and import it into Excel for data visualization.
[0065] Step 8: After 60 seconds of inactivity, exit D3 hot and switch to D0 (command setpci -s B:D:F CAP_PM+4.B = the default value saved in step 5).
[0066] Step 9: Send NVMe reset to return the PW state of the corresponding function to the D0 (maximum device power state) active state for subsequent operations on the tested disk.
[0067] The D3hot low power consumption and trend charts for each product are as follows: Figure 4 As shown, in this embodiment, the D3hot low-power test of solid-state drives can be covered and the switching between D0 state and D3hot state can be realized. The collected power consumption data can be displayed in an intuitive graphical form, which can objectively give the power consumption evaluation of each firmware version in the optimization stage.
[0068] It should be understood that, although Figures 1-4 The steps in the flowchart are shown sequentially as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order in which these steps are executed, and they can be performed in other orders. Figures 1-4 At least some of the steps in the process may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least some of the sub-steps or stages of other steps.
[0069] In one embodiment, such as Figure 5 As shown, a D3hot low-power testing system 500 based on a solid-state drive is provided. The system includes:
[0070] The first judgment module 501 is used to obtain the D3hot low power test request, read the APST status of the solid-state drive under test and determine whether the APST function is turned off. If it is not turned off, the APST function is turned off.
[0071] Status setting module 502, the status setting module is used to set the power status of the solid-state drive under test to PS0, and read and save the value of the PMCS register;
[0072] Modification module 503 is used to modify the value of the PMCS register after a period of inactivity so that the solid-state drive under test enters the D3hot state and starts collecting power consumption data;
[0073] The data import module 504 is used to wait for a period of time before stopping the collection of power consumption data and import the collected data into a data template for visualization.
[0074] In one embodiment, such as Figure 6 As shown, a D3hot low-power testing system 500 based on a solid-state drive is provided. This system further includes a second judgment module 505, which is used for:
[0075] Read the value of the Link Controller register and determine whether the solid-state drive under test supports and enables the ASPM function. If it is not enabled, enable the ASPM function.
[0076] In one embodiment, such as Figure 7 As shown, a D3hot low-power testing system 500 based on a solid-state drive is provided. This system further includes a third judgment module 506, which is used for:
[0077] If ASPM is supported and enabled, the value of the L1PM register is read and it is determined whether L1.2 is supported and enabled.
[0078] In one embodiment, such as Figure 8 As shown, a D3hot low-power testing system 500 based on a solid-state drive is provided. This system also includes a state switching module 507, which is used for:
[0079] After leaving it idle for a period of time, switch the solid-state drive under test from D3hot state to D0 state.
[0080] For specific limitations regarding the D3hot low-power test system based on solid-state drives, please refer to the limitations of the D3hot low-power test method based on solid-state drives mentioned above, which will not be repeated here.
[0081] In one embodiment, a computer device is provided, the internal structure of which can be shown as follows: Figure 9 As shown, the computer device includes a processor, memory, and a network interface connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The network interface is used for communication with external terminals via a network connection. When the computer program is executed by the processor, it implements a D3hot low-power testing method based on a solid-state drive.
[0082] Those skilled in the art will understand that Figure 9 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0083] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps in the various method embodiments described above.
[0084] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps in the various method embodiments described above.
[0085] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and RAMbus dynamic RAM (RDRAM), etc.
[0086] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0087] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.
Claims
1. A D3hot low-power testing method based on a solid-state drive, the method comprising: Obtain the D3hot low-power test request, read the APST status of the solid-state drive under test and determine whether the APST function is turned off. If it is not turned off, turn off the APST function. Set the power state of the solid-state drive under test to PS0, and read and save the value of the PMCS register; After a period of inactivity, the value of the PMCS register is modified to make the solid-state drive under test enter the D3hot state and start collecting power consumption data. After waiting for a period of time, stop collecting power consumption data and import the collected data into a data template for visualization. Before the step of reading the APST status of the solid-state drive under test and determining whether the APST function is disabled, and disabling the APST function if it is not disabled, the following steps are also included: Read the value of the Link Controller register and determine whether the solid-state drive under test supports and enables the ASPM function. If it is not enabled, enable the ASPM function. After the steps of reading the value of the Link Controller register and determining whether the solid-state drive under test supports and enables the ASPM function, and enabling the ASPM function if it is not enabled, the following steps are also included: If ASPM is supported and enabled, read the value of the L1PM register and determine whether L1.2 is supported and enabled. After the step of stopping the collection of power consumption data after a certain period of waiting and importing the collected data into a data template for visualization, the following is also included: After leaving it idle for a period of time, switch the solid-state drive under test from D3hot state to D0 state.
2. A D3hot low-power testing system based on a solid-state drive, characterized in that, The system includes: The first judgment module is used to obtain the D3hot low power test request, read the APST status of the solid-state drive under test and determine whether the APST function is turned off. If it is not turned off, the APST function is turned off. The status setting module is used to set the power state of the solid-state drive under test to PS0 and read and save the value of the PMCS register. The modification module is used to modify the value of the PMCS register after a period of inactivity so that the solid-state drive under test enters the D3hot state and starts collecting power consumption data. The data import module is used to wait for a period of time and then stop collecting power consumption data, and import the collected data into a data template for visualization. The system further includes a second judgment module, which is used for: Read the value of the Link Controller register and determine whether the solid-state drive under test supports and enables the ASPM function. If it is not enabled, enable the ASPM function. The system further includes a third judgment module, which is used for: If ASPM is supported and enabled, read the value of the L1PM register and determine whether L1.2 is supported and enabled. The system further includes a state switching module, which is used for: After leaving it idle for a period of time, switch the solid-state drive under test from D3hot state to D0 state.
3. A computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the method of claim 1.
4. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the method of claim 1.
Citation Information
Patent Citations
Method for implementing controllable timing work of data terminal unit
CN101296137A
Method, device and equipment for testing BER of solid state disk
CN110956997A