Test method of storage device, electronic equipment and storage medium

By obtaining the power status of the storage device, determining the target object based on the status mechanism and recording the duration of the power status, the problem of the PLP system's inability to quickly respond to changes in the power status is solved, more efficient data protection and system optimization are achieved, and the data security and stability of the storage device are improved.

CN120708683APending Publication Date: 2025-09-26ZHONGSHAN JIANGBOLONG ELECTRONICS CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410311098.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-03-18
Publication Date
2025-09-26

AI Technical Summary

Technical Problem

Existing PLP systems cannot quickly respond to drastic changes in power status, resulting in data not being saved in time when power is suddenly lost. The lack of the ability to accurately measure power status changes on power lines and power alarm lines limits the optimization and fine-tuning of the PLP mechanism.

Method used

By obtaining the power status of the storage device, determining the target object based on the state mechanism, responding to the level state changes of the target object, recording the duration of the power state, and modifying the power state until the test is completed, the duration of each power state can be accurately measured, providing higher time measurement accuracy and faster response speed.

Benefits of technology

It achieves more efficient data protection, reduces the risk of data loss or damage, improves the overall efficiency and performance of the system, can dynamically adjust the PLP trigger strategy based on real-time monitoring data, reduces false alarms and unnecessary operations, and optimizes the performance of storage devices in the face of power fluctuations or power outages.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120708683A_ABST
    Figure CN120708683A_ABST
Patent Text Reader

Abstract

The invention discloses a test method of a storage device, electronic equipment and a storage medium, and the test method of the storage device comprises the steps: obtaining a power state of the storage device, and determining a corresponding target object based on the power state of the storage device; in response to the change of the level state of the target object, correspondingly modifying the power state of the storage device, and recording the duration of the power state of the storage device before modification; and taking the modified power supply state as a new power supply state of the storage device, and executing the step of determining the corresponding target object based on the power supply state of the storage device again until the test is finished. Through the method, the duration of each power supply state of the storage device can be accurately measured, and higher time measurement precision is provided, so that the change of the power supply state can be predicted and responded more accurately.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention is applied to the technical field of storage devices, and in particular to a storage device testing method, electronic equipment, and storage medium. Background Art

[0002] If a storage device experiences a sudden power loss while processing a write operation, the data being written may be lost or corrupted. To address this issue, storage devices incorporate PLP (Power Loss Protection) technology. When power is detected to be unstable or about to be lost, PLP quickly writes data from the cache to the flash memory, preventing data loss.

[0003] However, existing PLP systems may not respond quickly enough to sudden changes in power status. In the event of a sudden power loss, this can cause data being written to the system to not be saved immediately. Existing systems lack the ability to accurately measure power status changes on the power line and power alarm line. This limits the optimization and fine-tuning of the PLP mechanism. Summary of the Invention

[0004] The present invention provides a storage device testing method, an electronic device, and a storage medium to solve the limitation problems of existing PLP system optimization and fine adjustment.

[0005] To solve the above technical problems, the present invention provides a testing method for a storage device, comprising: obtaining the power status of the storage device, and determining a corresponding target object based on the power status of the storage device; in response to a change in the level state of the target object, modifying the power status of the storage device accordingly, and recording the duration of the power status of the storage device before the modification; using the modified power status as the new power status of the storage device, and again executing the step of determining the corresponding target object based on the power status of the storage device until the test is completed.

[0006] The step of determining the corresponding target object based on the power state of the storage device includes: utilizing a state mechanism of the storage device to determine the corresponding target object based on the power state of the storage device.

[0007] Among them, the state mechanism includes an idle state, a power negative line pull-down state, a power alarm line pull-down state, a power alarm line pull-up state and a power positive line pull-down state; the target object includes a power negative line, a power positive line and a power alarm line; using the state mechanism, the steps of determining the corresponding target object based on the power state of the storage device include: in response to the power state of the storage device being an idle state, determining the corresponding target object as the power negative line; in response to the power state of the storage device being a power negative line pull-down state or a power alarm line pull-down state, determining the corresponding target object as the power alarm line; in response to the power state of the storage device being a power alarm line pull-up state, determining the corresponding target object as the power positive line.

[0008] Among them, the power state of the storage device is an idle state, and the target object is the negative power line; in response to the change in the level state of the target object, the power state of the storage device is modified accordingly, and the duration of the power state of the storage device before the modification is recorded. The steps include: when the level state of the negative power line becomes a low level, the power state of the storage device is modified to a negative power line pull-down state, and the starting time point of the negative power line pull-down state of the storage device is recorded.

[0009] Among them, the power state of the storage device is a power negative line pull-down state, and the target object is a power alarm line; in response to a change in the level state of the target object, the power state of the storage device is modified accordingly, and the duration of the power state of the storage device before the modification is recorded. The steps include: when the level state of the power alarm line becomes a low level, the power state of the storage device is modified to a power alarm line pull-down state, and the first duration of the power negative line pull-down state of the storage device is recorded.

[0010] Among them, the power state of the storage device is a power alarm line pull-down state, and the target object is the power alarm line; in response to the change in the level state of the target object, the power state of the storage device is modified accordingly, and the duration of the power state of the storage device before the modification is recorded. The steps include: when the level state of the power alarm line becomes a high level, the power state of the storage device is modified to the power alarm line pull-down state, and the second duration of the power alarm line pull-down state of the storage device is recorded.

[0011] Among them, the power state of the storage device is a power alarm line pull-up state, and the target object is the power positive line; in response to the change in the level state of the target object, the power state of the storage device is modified accordingly, and the duration of the power state of the storage device before the modification is recorded. The steps include: when the level state of the power positive line becomes a low level, the power state of the storage device is modified to a power positive line pull-up state, and the third duration of the power alarm line pull-up state of the storage device is recorded.

[0012] Among them, in response to the change in the level state of the target object, the power state of the storage device is modified accordingly, and the step of recording the duration of the power state of the storage device before the modification also includes: in response to the level state of the power positive line changing to a low level, the power state of the storage device is modified to the power positive line pull-down state, and the fourth duration of the power state of the storage device is recorded.

[0013] Among them, in response to the change in the level state of the target object, the step of correspondingly modifying the power state of the storage device and recording the duration of the power state of the storage device before the modification includes: determining the corresponding handle function based on the power state of the storage device, and using the corresponding handle function to monitor the level state of the target object.

[0014] To solve the above technical problems, the present invention further provides an electronic device, which includes: a processor and a memory, wherein program data is stored in the memory, and the processor is used to execute any of the above storage device testing methods.

[0015] To solve the above technical problems, the present invention further provides a computer-readable storage medium, which stores program data. The program data can be executed to implement any of the above storage device testing methods.

[0016] To address the above technical issues, the present invention provides a storage device testing method that obtains the power state of the storage device and determines a corresponding target object based on the power state of the storage device; in response to a change in the power level of the target object, modifies the power state of the storage device accordingly and records the duration of the power state of the storage device before the modification; uses the modified power state as the new power state of the storage device and repeats the step of determining the corresponding target object based on the power state of the storage device until the test is completed. This method accurately measures the duration of each power state of the storage device, providing higher time measurement accuracy for more accurately predicting and responding to changes in power state. Furthermore, due to the ability to more accurately monitor the power state of the storage device and respond promptly, the data protection capability of this embodiment is more efficient, reducing the risk of data loss or corruption. This embodiment can also dynamically adjust the PLP triggering strategy based on real-time monitoring data to more effectively respond to various power supply changes. Accurate time measurement and power state monitoring help reduce false alarms and unnecessary operations of the PLP mechanism, improve overall system efficiency and performance, and address the limitations of existing PLP system optimization and fine-tuning to better understand the performance of storage devices in the face of power fluctuations or power outages, thereby providing data support for future product design and improvement. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] Figure 11 is a flow chart of an embodiment of a method for testing a storage device provided by the present invention;

[0018] Figure 2 is a flow chart of another embodiment of a method for testing a storage device provided by the present invention;

[0019] Figure 3 is a schematic diagram of an implementation method of a state mechanism;

[0020] Figure 4 is a structural diagram of an embodiment of an electronic device provided by the present invention;

[0021] Figure 5 It is a structural diagram of an embodiment of a computer-readable storage medium provided by the present invention. DETAILED DESCRIPTION

[0022] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.

[0023] It should be noted that if the embodiments of the present invention involve directional indications (such as up, down, left, right, front, back, etc.), the directional indications are only used to explain the relative position relationship, movement status, etc. between the various components under a certain specific posture (as shown in the accompanying drawings). If the specific posture changes, the directional indications will also change accordingly.

[0024] In addition, if there are descriptions involving "first", "second", etc. in the embodiments of the present invention, the descriptions of "first", "second", etc. are only for descriptive purposes and cannot be understood as indicating or implying their relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features specified as "first" and "second" may explicitly or implicitly include at least one of such features. In addition, the technical solutions between the various embodiments can be combined with each other, but this must be based on the fact that ordinary technicians in this field can implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such a combination of technical solutions does not exist and is not within the scope of protection required by the present invention.

[0025] See also Figure 1 , Figure 1 It is a flowchart of an embodiment of a method for testing a storage device provided by the present invention.

[0026] Step S11: Acquire the power status of the storage device, and determine the corresponding target object based on the power status of the storage device.

[0027] The storage device includes but is not limited to a hard disk, a solid-state drive, a mobile hard disk, a USB flash drive, a memory card, a non-volatile memory (NAND FLASH) or an optical disk.

[0028] The power state of the storage device is set based on the actual test requirements of the storage device. When the purpose of testing the storage device is to improve the PLP (Power Loss Protection) mechanism, the power state of the storage device can be divided based on the various power states of the PLP mechanism. When the purpose of testing the storage device is to improve other power mechanisms, the power state of the storage device can be divided based on other mechanisms, which are not limited here. Other mechanisms include but are not limited to power mechanisms such as low power consumption mechanism, power saving mechanism, or instant wake-up mechanism.

[0029] The target object is the object that needs to be monitored during the test. Since the objects that need to be monitored may be different when the storage device is in different power states, the target object is set accordingly based on the specific power state of the storage device.

[0030] In a specific application scenario, the level state of the target object can be measured by a measuring instrument. In a specific application scenario, the level state of the target object can be detected by a corresponding function. The specific monitoring means are not limited here.

[0031] Among them, when monitoring the level status of the target object, monitoring can be performed based on a preset frequency, and the preset frequency can be set based on actual needs, including but not limited to 10 microseconds / time, 15 microseconds / time, 20 microseconds / time, 30 microseconds / time, 40 microseconds / time, etc.

[0032] Step S12: In response to the change in the power level state of the target object, the power state of the storage device is modified accordingly, and the duration of the power state of the storage device before the modification is recorded.

[0033] The storage device's power state is linked to the target object's power level. When the target object's power level changes, the storage device's power state changes accordingly, and the storage device's power state is modified accordingly. That is, the previous power state of the storage device ends, and the next power state begins. At this point, the duration of the storage device's power state before the modification—that is, the duration of the previous power state of the storage device—is recorded and applied to the storage device test.

[0034] Step S13: The modified power state is used as the new power state of the storage device, and the step of determining the corresponding target object based on the power state of the storage device is performed again until the test is completed.

[0035] The modified power state of the storage device is set as the new power state of the storage device, and the step of determining the corresponding target object based on the power state of the storage device is performed again until the test is completed to obtain the duration of each power state of the storage device.

[0036] By accurately detecting the duration of each power state of the storage device, it is used to analyze the pattern and speed of the power state change of the storage device, so as to dynamically adjust the PLP trigger strategy to ensure that data is safely saved before power is lost.

[0037] The storage device testing method of this embodiment can be applied to 5216 solid-state drives, 1602 solid-state drives, and all NVME SSD products.

[0038] Through the above steps, the storage device testing method of this embodiment obtains the power state of the storage device and determines the corresponding target object based on the power state of the storage device; in response to changes in the power level of the target object, the power state of the storage device is modified accordingly, and the duration of the power state of the storage device before the modification is recorded; the modified power state is used as the new power state of the storage device, and the step of determining the corresponding target object based on the power state of the storage device is repeated until the test is completed. This accurately measures the duration of each power state of the storage device, providing higher time measurement accuracy, allowing for more accurate prediction and response to changes in power state. Furthermore, due to the ability to more accurately monitor the power state of the storage device and respond promptly, the data protection capabilities of this embodiment are more efficient, reducing the risk of data loss or corruption. This embodiment can also dynamically adjust the PLP triggering strategy based on real-time monitoring data to more effectively respond to various power supply changes. Accurate time measurement and power state monitoring help reduce false alarms and unnecessary operations of the PLP mechanism, improve overall system efficiency and performance, and address the limitations of existing PLP system optimization and fine-tuning. This allows for a better understanding of the performance of storage devices in the face of power fluctuations or power outages, thereby providing data support for future product design and improvement.

[0039] See also Figure 2 , Figure 2 FIG. 4 is a flow chart of another embodiment of a method for testing a storage device provided by the present invention.

[0040] Step S21: Obtain the power status of the storage device, and use the status mechanism of the storage device to determine the corresponding target object based on the power status of the storage device.

[0041] Prior to step S21, a test instruction may be received and a determination may be made as to whether the test instruction is for testing the PLP. If the test instruction is determined to be for testing the PLP, a determination is made as to whether a test cycle is enabled. If the test cycle is not enabled, a timer for the storage device is started, the state is initialized, and the negative power line is pulled down to enable the test cycle. If the test cycle is already enabled, indicating that the storage device is currently being tested, no new test is initiated. The timer is used to measure the time points at which the power supply of the storage device changes to determine the duration of each power state.

[0042] The state mechanism of this embodiment can be set accordingly based on the power mechanism targeted by the test. Figure 3 , Figure 3 FIG2 is a schematic diagram of an embodiment of a state mechanism. The state mechanism of this embodiment may be directed to a PLP mechanism.

[0043] The state mechanism of this embodiment may include an idle state 31 , a power negative line pull-up state 32 , a power alarm line pull-up state 33 , a power alarm line pull-up state 34 , and a power positive line pull-up state 35 .

[0044] In a specific application scenario, when the storage device of this embodiment is tested, the storage device will first be in an idle state 31, and then as the negative power line is pulled down, the storage device will be in a negative power line pull-down state 32, and further as the power alarm line is pulled down, the storage device will be in a power alarm line pull-down state 33; further as the power alarm line is pulled down, the storage device will be in a power alarm line pull-down state 34, and finally as the positive power line is pulled down, the storage device will be in a positive power line pull-down state 35.

[0045] Among them, the steps of pulling down the negative power line and the positive power line are executed by the external host corresponding to the storage device, while the steps of pulling down the power alarm line and the power alarm line are executed by the storage device itself after being affected by the negative power line. Therefore, this test can perform various tests on the storage device and observe the specific performance of the storage device by actively adjusting the timing of pulling down the negative power line and / or the positive power line. That is, the above application scenario only provides a complete illustration of the state mechanism and does not limit the specific steps of the test. In actual application, the state of the storage device can be affected by the positive power line being pulled down and only be in a partial power state. For example, when the storage device is in the negative power line pull-down state 32, if the positive power line is pulled down at this time, the storage device directly switches from the negative power line pull-down state 32 to the positive power line pull-down state 35, while the power alarm line pull-down state 33 and the power alarm line pull-up state 34 are not experienced.

[0046] In other embodiments, if the test targets other power supply mechanisms of the storage device, the state mechanism will also be adaptively modified, which is not specifically limited here.

[0047] This embodiment first obtains the power status of the storage device, and uses the status mechanism of the storage device to determine the corresponding target object based on the power status of the storage device.

[0048] The target objects include the power line negative (PLN), the power line positive (Vcc, VoltCurrent Condenser), and the power loss alert line (PLA). The purpose of monitoring the target objects in this embodiment is essentially to monitor changes in the power state. Therefore, the target object corresponding to the power state of the storage device is the object that causes the power state to change under that power state. When the target object changes, the power state also changes, and the target object is monitored.

[0049] In a specific application scenario, in response to the power state of the storage device being the idle state 31, since the idle state 31 may be affected by the power negative line pull-down and switched to the power negative line pull-down state 32, the corresponding target object is determined to be the power negative line.

[0050] In a specific application scenario, in response to the power state of the storage device being the power negative line pull-down state 32 or the power alarm line pull-down state 33, since the next states of the power negative line pull-down state 32 and the power alarm line pull-down state 33 are both affected by the power alarm line, the corresponding target object is determined to be the power alarm line.

[0051] In a specific application scenario, in response to the power state of the storage device being the power alarm line pull-up state 34, since the next state of the power alarm line pull-up state 34 is affected by the power positive line, the corresponding target object is determined to be the power positive line.

[0052] In a specific application scenario, a corresponding handle function can be determined based on the power state of the storage device, so as to monitor the level state of the target object using the corresponding handle function. The level state of the target object can also be measured by a measuring instrument.

[0053] In a specific application scenario, when the storage device is in the idle state 31 , the handle_IDLE() function may be called to monitor the level of the negative power line PLN at a preset frequency.

[0054] In a specific application scenario, when the storage device is in the power negative line pull-down state 32, the handle_WAIT_PLA_LOW() function may be called to monitor the level of the power alarm line PLA at a preset frequency.

[0055] In a specific application scenario, when the storage device is in the power alarm line pull-down state 33, the handle_WAIT_PLA_HIGH() function may be called to monitor the level of the power alarm line PLA at a preset frequency.

[0056] In a specific application scenario, when the storage device is in the power alarm line pull-up state 34, the handle_VCC_PULLDOWN_WAIT() function may be called to monitor the level of the power positive line VCC at a preset frequency.

[0057] In a specific application scenario, when the storage device is in the power positive line pull-down state 35 , the handle_VCC_PULLDOWN() function may be called to monitor the level of the power positive line VCC at a preset frequency.

[0058] The preset frequency can be set based on actual needs, including but not limited to 10 microseconds / time, 15 microseconds / time, 20 microseconds / time, 30 microseconds / time, 40 microseconds / time, etc.

[0059] Step S22: In response to the change in the power level of the target object, the power state of the storage device is modified accordingly, and the duration of the power state of the storage device before the modification is recorded.

[0060] In a specific application scenario, when the storage device is in the idle state 31 and the handle_IDLE() function is called to monitor the level status of the target object—the negative power line PLN according to a preset frequency, when the level status of the negative power line becomes a low level, the power state of the storage device is modified to the negative power line pull-down state 32, and the starting time point of the negative power line pull-down state 32 of the storage device is recorded; when the level status of the negative power line is still a high level, the level status of the negative power line is continuously monitored according to the preset frequency.

[0061] In a specific application scenario, when a storage device is in the negative power line pull-down state 32, the handle_WAIT_PLA_LOW() function is called to monitor the level of the target object—the power alarm line PLA—at a preset frequency. If the level of the power alarm line changes to a low level, the storage device's power state is modified to the power alarm line pull-down state 33, and the first duration of the storage device's negative power line pull-down state 32 is recorded. If the level of the power alarm line remains high, the power alarm line's level is continuously monitored at a preset frequency, where the first duration is determined by the starting time of the negative power line pull-down state 32 and the starting time of the power alarm line pull-down. This application scenario can also monitor the level of the positive power line. If the positive power line level changes to a low level, the storage device's power state is directly modified to the positive power line pull-down state 35. If the positive power line level remains high, the power alarm line and the positive power line levels are continuously monitored.

[0062] In a specific application scenario, when the storage device is in the power alarm line pull-down state 33, the handle_WAIT_PLA_HIGH() function is called to monitor the level of the target object—the power alarm line PLA—at a preset frequency. When the level of the power alarm line changes to a high level, the power state of the storage device is modified to the power alarm line pull-down state 34, and the second duration of the power alarm line pull-down state of the storage device is recorded. When the level of the power alarm line is still a low level, the level of the power alarm line is continuously monitored at a preset frequency. The second duration is determined by the starting time point of the power alarm line pull-down and the starting time point of the power alarm line pull-down. This application scenario can also monitor the level of the positive power line. If the level of the positive power line changes to a low level, the power state of the storage device is directly modified to the positive power line pull-down state 35. If the level of the positive power line is still a high level, the level states of the power alarm line and the positive power line are continuously monitored.

[0063] In a specific application scenario, when a storage device is in the power alarm line pull-up state 34, the handle_VCC_PULLDOWN_WAIT() function is called to monitor the power level of the target object—the positive power line VCC—at a preset frequency. If the power positive line level changes to a low level, the storage device's power state is changed to the positive power line pull-up state 35, and a third duration of the storage device's power alarm line pull-up state is recorded. If the power positive line level remains high, the power positive line level is continuously monitored at a preset frequency. The third duration is determined by the start time of the power alarm line pull-up and the start time of the power positive line pull-down.

[0064] Specifically, when the storage device is in the power negative line pull-down state 32, the power alarm line pull-down state 33, or the power alarm line pull-down state 34, and the target object also includes the power positive line, in response to the positive power line level changing to a low level, the storage device's power state is changed to the power positive line pull-down state 35, and a fourth duration of the storage device's power state is recorded. The fourth duration is determined by the start time of the storage device's power state before the change and the start time of the positive power line pull-down.

[0065] Step S23: The modified power state is used as the new power state of the storage device, and the step of determining the corresponding target object based on the power state of the storage device is performed again until the test is completed.

[0066] Set the modified power state of the storage device as the new power state of the storage device, and execute the step of determining the corresponding target object based on the power state of the storage device again until the test is completed, and accurately obtain the first duration, second duration, third duration of the storage device, and the fourth duration can also be obtained.

[0067] In a specific application scenario, the specific test cycle of the test method for the storage device of this embodiment may include: the power state of the storage device is first in the idle state 31, determining that the target object of the idle state 31 is the negative power line, calling the handle_IDLE() function to monitor the level state of the negative power line PLN according to a preset frequency, and when the level state of the negative power line becomes a low level, modifying the power state of the storage device to the negative power line pull-down state 32, and recording the starting time point of the negative power line pull-down state 32 of the storage device.

[0068] After the power state of the storage device is in the power negative line pull-down state 32, the handle_WAIT_PLA_LOW() function is called to monitor the level state of the target object - the power alarm line PLA according to the preset frequency. When the level state of the power alarm line becomes low, the power state of the storage device is modified to the power alarm line pull-down state 33, and the first duration of the power negative line pull-down state 32 of the storage device is recorded.

[0069] After the power state of the storage device is in the power alarm line pull-down state 33, the handle_WAIT_PLA_HIGH() function is called to monitor the level state of the target object - the power alarm line PLA according to the preset frequency. When the level state of the power alarm line becomes high, the power state of the storage device is modified to the power alarm line pull-up state 34, and the second duration of the power alarm line pull-down state of the storage device is recorded.

[0070] After the power state of the storage device is in the power alarm line pull-up state 34, the handle_VCC_PULLDOWN_WAIT() function is called to monitor the level state of the target object - the power positive line VCC according to the preset frequency. When the level state of the power positive line becomes low, the power state of the storage device is modified to the power positive line pull-down state 35, and the third duration of the power alarm line pull-up state of the storage device is recorded.

[0071] After the power state of the storage device is in the positive power line pull-down state 35, the handle_VCC_PULLDOWN() function is called. After the test cycle is completed, the timer is turned off and the state is initialized.

[0072] The details of each power state can be found in the aforementioned step S23 and will not be repeated here.

[0073] This embodiment accurately measures the first duration, second duration, and third duration between key power state changes, such as when the power negative line is pulled down to the power alarm line, when the power alarm line is pulled down to the power alarm line, and when the power alarm line is pulled up to the power positive line. The collected time data can be used to analyze the pattern and speed of power state changes, which is crucial for predicting and handling potential power loss events. Based on the time measurement results, the system can process data in real time and respond quickly to minimize the risk of data loss. Finally, based on the measurement results of the time interval, the PLP triggering strategy is dynamically adjusted to ensure that data is safely saved before power is lost. Among them, the fourth duration can be used to analyze the data storage performance or other performance performance when the storage device does not start the PLP mechanism.

[0074] Through the above steps, the storage device testing method of this embodiment accurately calculates the duration of power state changes to improve the storage device's related mechanisms and timely trigger the PLP mechanism, ensuring that data is safely written before power failure, reducing system crashes or data corruption caused by unstable power supplies, and improving overall system stability. Furthermore, by optimizing the timing of PLP triggering, the efficiency and speed of data writing can be improved, reducing performance degradation caused by sudden power changes. Accurate time measurement helps reduce the possibility of false PLP triggering, improving overall system efficiency and performance. This ensures data security and system stability, thereby providing a more reliable storage solution and improving the end-user experience. Specifically, this embodiment can more accurately monitor the power state of the storage device and respond promptly, enhancing data protection capabilities and reducing the risk of data loss or corruption. This embodiment can also dynamically adjust the PLP triggering strategy based on real-time monitored data to more effectively respond to various power supply changes. Accurate time measurement and power state monitoring help reduce false alarms and unnecessary operations of the PLP mechanism, improving overall system efficiency and performance. This embodiment is also applicable to various power supply environments, especially those with unstable or frequently changing power supplies, providing a wider range of applications. In addition to its advantages in practical applications, the invention also provides improvement directions in the testing and quality control of storage devices, helping manufacturers to more effectively evaluate and improve their products.

[0075] Based on the same inventive concept, the present invention also proposes an electronic device, which can be executed to implement the method of any of the above embodiments. Figure 4 , Figure 4 4 is a schematic structural diagram of an electronic device according to an embodiment of the present invention. The electronic device includes a processor 41 and a memory 42 .

[0076] The processor 41 is configured to execute program instructions stored in the memory 42 to implement the steps of any of the above methods. In a specific implementation scenario, the electronic device may include, but is not limited to, a microcomputer and a server. In addition, the electronic device may also include mobile devices such as laptops and tablet computers, which are not limited here.

[0077] Specifically, the processor 41 is used to control itself and the memory 42 to implement the steps of any of the above embodiments. The processor 41 can also be called a CPU (Central Processing Unit). The processor 41 may be an integrated circuit chip with signal processing capabilities. The processor 41 can also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. In addition, the processor 41 can be implemented by an integrated circuit chip.

[0078] The above solution can accurately measure the duration of each power state of the storage device, providing higher time measurement accuracy, so as to more accurately predict and respond to changes in the power state.

[0079] Based on the same inventive concept, the present invention also proposes a computer-readable storage medium, see Figure 5 , Figure 5 The figure is a schematic diagram of the structure of an embodiment of a computer-readable storage medium provided by the present invention. The computer-readable storage medium 50 stores at least one program data 51, which is used to implement any of the above methods. In one embodiment, the computer-readable storage medium 50 includes various media capable of storing program code, such as a USB flash drive, a mobile hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.

[0080] In the several embodiments provided by the present invention, it should be understood that the disclosed methods and devices can be implemented in other ways. For example, the device implementation methods described above are only schematic. For example, the division of modules or units is only a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0081] Units described as separate components may or may not be physically separate, and components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.

[0082] In addition, the functional units in the various embodiments of the present invention may be integrated into a single processing unit, each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.

[0083] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the portion that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product, and this computer software product can be stored in a storage medium.

[0084] The above are merely embodiments of the present invention and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention description and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.

[0085] If the technical solution of this application involves personal information, the product that applies the technical solution of this application has clearly informed the personal information processing rules and obtained the individual's voluntary consent before processing personal information. If the technical solution of this application involves sensitive personal information, the product that applies the technical solution of this application has obtained the individual's separate consent before processing sensitive personal information, and at the same time meets the "explicit consent" requirement. For example, on personal information collection devices such as cameras, a clear and prominent sign is set to inform that the personal information collection scope has been entered and personal information will be collected. If the individual voluntarily enters the collection scope, it is deemed that they agree to the collection of their personal information; or on the personal information processing device, when the personal information processing rules are notified by obvious signs / information, the individual's authorization is obtained through pop-up information or by asking the individual to upload their personal information; among which, the personal information processing rules may include information such as the personal information processor, the purpose of personal information processing, the processing method, and the type of personal information processed.

[0086] The above are merely embodiments of the present invention and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention description and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A method for testing a storage device, characterized in that: include: Acquiring a power status of the storage device, and determining a corresponding target object based on the power status of the storage device; In response to a change in the power level state of the target object, modifying the power state of the storage device accordingly, and recording the duration of the power state of the storage device before the modification; The modified power state is used as the new power state of the storage device, and the step of determining the corresponding target object based on the power state of the storage device is performed again until the test is completed.

2. The storage device testing method according to claim 1, wherein: The step of determining the corresponding target object based on the power state of the storage device includes: The state mechanism of the storage device is utilized to determine a corresponding target object based on the power state of the storage device.

3. The storage device testing method according to claim 2, wherein: The state mechanism includes an idle state, a power negative line pull-down state, a power alarm line pull-down state, a power alarm line pull-down state, and a power positive line pull-down state; the target object includes a power negative line, a power positive line, and a power alarm line; The step of using the state mechanism to determine the corresponding target object based on the power state of the storage device includes: In response to the power state of the storage device being an idle state, determining that the corresponding target object is a negative power line; In response to the power state of the storage device being a power negative line pull-down state or a power alarm line pull-down state, determining that the corresponding target object is a power alarm line; In response to the power state of the storage device being a power alarm line pull-up state, the corresponding target object is determined to be a power positive line.

4. The storage device testing method according to claim 3, wherein: The power state of the storage device is an idle state, and the target object is a negative power line; The step of modifying the power state of the storage device in response to a change in the power level state of the target object and recording the duration of the power state of the storage device before the modification includes: When the level state of the negative power line changes to a low level, the power state of the storage device is modified to a negative power line pull-down state, and a starting time point of the negative power line pull-down state of the storage device is recorded.

5. The storage device testing method according to claim 3, wherein: The power state of the storage device is a power negative line pull-down state, and the target object is a power alarm line; The step of modifying the power state of the storage device in response to a change in the power level state of the target object and recording the duration of the power state of the storage device before the modification includes: When the power alarm line level changes to a low level, the power state of the storage device is modified to a power alarm line pull-down state, and a first duration of the power negative line pull-down state of the storage device is recorded.

6. The storage device testing method according to claim 3, wherein: The power state of the storage device is a power alarm line pull-down state, and the target object is the power alarm line; The step of modifying the power state of the storage device in response to a change in the power level state of the target object and recording the duration of the power state of the storage device before the modification includes: When the power alarm line level changes to a high level, the power state of the storage device is modified to a power alarm line pull-up state, and a second duration of the power alarm line pull-down state of the storage device is recorded.

7. The storage device testing method according to claim 6, wherein: The power state of the storage device is a power alarm line pull-up state, and the target object is a power positive line; The step of modifying the power state of the storage device in response to a change in the power level state of the target object and recording the duration of the power state of the storage device before the modification includes: When the level state of the power positive line changes to a low level, the power state of the storage device is modified to a power positive line pull-down state, and a third duration of the power alarm line pull-down state of the storage device is recorded.

8. The storage device testing method according to any one of claims 3 to 7, wherein: The step of modifying the power state of the storage device in response to a change in the power level state of the target object and recording the duration of the power state of the storage device before the modification further includes: In response to the level state of the positive power line changing to a low level, the power state of the storage device is modified to a positive power line pull-down state, and a fourth duration of the power state of the storage device is recorded.

9. The method for testing a storage device according to claim 1, wherein: The step of modifying the power state of the storage device in response to a change in the power level state of the target object and recording the duration of the power state of the storage device before the modification includes: A corresponding handle function is determined based on the power state of the storage device, so as to monitor the level state of the target object using the corresponding handle function.

10. An electronic device, characterized in that: The electronic device comprises: a processor and a memory, wherein program data is stored in the memory, and the processor is used to execute the storage device testing method according to any one of claims 1 to 9.

11. A computer-readable storage medium, characterized in that The computer-readable storage medium stores program data, and the program data can be executed to implement the storage device testing method according to any one of claims 1 to 9.