Notebook-based dc abnormal power-off test method, device and computer equipment
By setting the battery option to 'Do nothing' in the laptop operating system and combining it with a programmable power distributor to control the AC adapter power supply, the problem of low efficiency or circuit modification caused by DC power supply in the prior art is solved, realizing automated and accurate DC abnormal power failure testing.
Patent Information
- Application Number
- CN202310163966.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-24
- Publication Date
- 2026-01-23
- Estimated Expiration
- 2043-02-24
AI Technical Summary
Existing technologies for testing abnormal power loss in laptops under DC power supply suffer from low efficiency or require modifications to the laptop battery circuitry, leading to distorted test results.
By setting the battery option to 'Do nothing' in the laptop operating system, and using a programmable power distributor to control the power supply of the laptop's AC adapter, automated DC power failure testing can be achieved, avoiding modification of laptop components.
It achieves large-scale automated DC system abnormal power failure testing, accurately restores the original power failure scenario of the laptop, and avoids interference and distortion of test results.
Smart Images

Figure CN116185737B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computer testing, in particular to a DC abnormal power-off test method and device based on a notebook computer, a computer device and a storage medium. BACKGROUND
[0002] Consumer-grade personal notebook computers (hereinafter referred to as notebooks) have widely adopted PCIe NVMe SSDs (hereinafter referred to as SSDs) as their operating system startup disks. Before the SSDs are shipped, manufacturers will install the SSDs in corresponding notebooks and perform a large number of rigorous tests. The notebook whole machine abnormal power-off test is usually an important test item for the SSD in the research and development stage.
[0003] Currently, in the test of notebook whole machine abnormal power-off, the abnormal power-off scenarios of the notebook under AC (Alternating Current) power adapter (i.e. commonly known as "notebook charger") power supply state and DC (Direct Current) power supply (i.e. removing the AC power adapter and using the notebook's own battery for power supply) state are usually covered. Among them, for the abnormal power-off scenario under DC power supply, the currently adopted test methods mainly have two kinds: one method is to manually plug and unplug the notebook battery for abnormal power-off test. Although this method is simple, it is low in efficiency and cannot be tested in large scale and large quantity. The other method is to connect the notebook battery with a programmable DC power supply, and to control the charging and discharging of the notebook battery through the programmable DC power supply to realize abnormal power-off test. This method needs to modify the pipeline of the notebook battery, which will more or less change the overall real application scenario of the notebook and introduce some additional factors, thereby causing interference and distortion to the test results. SUMMARY
[0004] Therefore, it is necessary to provide a DC abnormal power-off test method and device based on a notebook computer, a computer device and a storage medium in view of the above technical problems.
[0005] A DC abnormal power-off test method based on a notebook computer, the method comprising:
[0006] setting the power control options of the notebook to be tested, and setting the "low power operation" option to "use battery: do not take any operation";
[0007] when the battery of the notebook to be tested is depleted, the whole machine is abnormally powered off;
[0008] the host test script controls the PDU to supply power to the AC power adapter of the notebook to be tested for a period of time, so that the notebook to be tested automatically starts up;
[0009] The host test script controls the PDU to stop supplying power to the AC power adapter of the notebook under test, and checks whether the notebook under test can communicate with the host;
[0010] If communication is not possible, it indicates that the SSD of the notebook under test may have an abnormality, at which time the PDU starts again and supplies power to the AC power adapter of the notebook under test all the time to prevent the notebook under test from having an abnormal power-off and losing the problem site after the battery of the notebook under test is depleted, and then the test is terminated.
[0011] In one embodiment, the step of the host test script controlling the PDU to supply power to the AC power adapter of the notebook under test for a period of time further comprises:
[0012] The time of power supply is not more than 120 seconds to avoid charging too much battery of the notebook to increase the entire test cycle.
[0013] In one embodiment, the step of the host test script controlling the PDU to stop supplying power to the AC power adapter of the notebook under test, and checking whether the notebook under test can communicate with the host further comprises:
[0014] If communication is possible, the test is continued, and a continuous read-write test is performed on the SSD to accelerate the depletion of the battery of the notebook;
[0015] The test script waits for a period of time, and the waiting time is not more than 120 seconds.
[0016] In one embodiment, the step of the test script waiting for a period of time further comprises:
[0017] Judging whether the number of test rounds has reached the requirement;
[0018] If not, jumping to the step of the host test script controlling the PDU to supply power to the AC power adapter of the notebook under test for a period of time, and if yes, the test is terminated.
[0019] A notebook-based DC abnormal power-off test device, the device comprises:
[0020] A setting module, the setting module is used for setting the power control options of the notebook under test, and setting the "low battery operation" option as "use battery: do not take any operation";
[0021] A power-off module, the power-off module is used for having an abnormal power-off of the entire machine when the battery of the notebook under test is depleted;
[0022] A power supply module, the power supply module is used for the host test script to control the PDU to supply power to the AC power adapter of the notebook under test for a period of time to make the notebook under test automatically start up;
[0023] checking module for host test script to control PDU to stop supplying power to the notebook AC power adapter under test and check whether the notebook under test can communicate with the host;
[0024] re-supplying module for if communication is not possible, it indicates that the SSD of the notebook under test may have an abnormality, at this time, the PDU starts again and supplies power to the notebook AC power adapter under test all the time to prevent the notebook under test from having an abnormality power-off after the battery of the notebook under test is exhausted and losing the problem site, and then the test is terminated.
[0025] In one embodiment, the power supply time in the power supply module is not more than 120 seconds to avoid charging too much battery of the notebook to increase the whole test period.
[0026] In one embodiment, the device further comprises a read-write module for:
[0027] if communication is possible, the test is continued and the SSD is continuously tested to speed up the exhaustion of the battery of the notebook;
[0028] the test script waits for a period of time, and the waiting time is not more than 120 seconds.
[0029] In one embodiment, the device further comprises a judging module for:
[0030] judging whether the test round has reached the requirement;
[0031] if not, jumping to the step of the host test script controlling the PDU to supply power to the notebook AC power adapter under test for a period of time, and if yes, the test is ended.
[0032] A computer device comprising 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 one of the above methods.
[0033] A computer readable storage medium having a computer program stored thereon, wherein the computer program is executable by a processor to implement the steps of any one of the above methods.
[0034] The notebook-based DC abnormal power-off test method, device, computer equipment and storage medium described above utilize the characteristics of a notebook under DC power supply to perform abnormal power-off testing. The principle is that under DC power supply, a user can set related options of a battery in an operating system, which will cause the notebook battery to be completely depleted. When the battery is depleted, the DC power supply can no longer supply power to the notebook, at which time the notebook will automatically undergo abnormal power-off. After the notebook undergoes abnormal power-off, another host computer is utilized to control a programmable power supply distributor to power on the AC adapter of the notebook through a self-programmed test script, so that the notebook automatically starts up. The present application can automatically perform DC whole-machine abnormal power-off testing on a notebook on a large scale, without the need to modify any components of the notebook computer, thereby maximizing the guarantee of the original power-off scenario of the notebook computer. BRIEF DESCRIPTION OF DRAWINGS
[0035] Figure 1 A flowchart of a notebook-based DC abnormal power-off test method in one embodiment;
[0036] Figure 2 A flowchart of a notebook-based DC abnormal power-off test method in another embodiment;
[0037] Figure 3 A flowchart of a notebook-based DC abnormal power-off test method in still another embodiment;
[0038] Figure 4 A structural block diagram of a notebook-based DC abnormal power-off test device in one embodiment;
[0039] Figure 5 A structural block diagram of a notebook-based DC abnormal power-off test device in another embodiment;
[0040] Figure 6 A structural block diagram of a notebook-based DC abnormal power-off test device in still another embodiment;
[0041] Figure 7 An internal structural diagram of computer equipment in one embodiment. DETAILED DESCRIPTION
[0042] In order to make the purposes, technical solutions and advantages of the present application clearer, the present application is further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and do not limit the present application.
[0043] Currently, there are mainly two methods for testing the abnormal power-off scenario under DC power supply: one method is to manually pull out the notebook battery for abnormal power-off test, which is simple but inefficient and cannot be tested in large scale and large quantity; the other method is to connect the notebook battery with a programmable DC power supply, and to control the charge and discharge of the notebook battery through the programmable DC power supply to realize abnormal power-off test, which needs to modify the pipeline of the notebook battery, so that the overall real application scenario of the notebook is changed to some extent, and some additional factors are introduced, thereby causing interference and distortion to the test results.
[0044] Based on this, the present application provides a notebook-based DC abnormal power-off test method, which can automatically test the DC whole machine abnormal power-off of the notebook in large scale, and does not need to modify any components of the notebook computer, thereby maximizing the guarantee of the original power-off scenario of the notebook computer.
[0045] In one embodiment, as shown in Figure 1 a notebook-based DC abnormal power-off test method is provided, which comprises:
[0046] In step 102, the power control option of the notebook to be tested is set, and the "low power operation" option is set to "use battery: do not take any operation";
[0047] In step 104, when the battery of the notebook to be tested is depleted, the whole machine abnormal power-off occurs;
[0048] In step 106, the host test script controls the PDU to supply power to the AC power adapter of the notebook to be tested for a period of time, so that the notebook to be tested is automatically started;
[0049] In step 108, the host test script controls the PDU to stop supplying power to the AC power adapter of the notebook to be tested, and checks whether the notebook to be tested can communicate with the host;
[0050] In step 110, if communication cannot be established, it indicates that the SSD of the notebook to be tested may be abnormal, at this time the PDU starts again and supplies power to the AC power adapter of the notebook to be tested to prevent the notebook to be tested from being abnormal power-off due to battery depletion and losing the problem site, and then the test is terminated.
[0051] In the embodiment, a notebook-based DC abnormal power-off test method is provided. The method uses the characteristics of a notebook under DC power supply to perform abnormal power-off test. The principle is that under DC power supply, a user can set the related options of the battery in the operating system. The setting will make the notebook battery completely depleted. When the battery is depleted, the DC can no longer supply power to the notebook, at which time the notebook will automatically power off abnormally. After the notebook powers off abnormally, another host is used to control the programmable power supply distributor (PDU) to power on the notebook AC adapter through a self-compiled test script, so that the notebook will automatically start. The specific test process is as follows.
[0052] First, in the "Control Panel" of the Windows system, enter "Power Plan", click "Change Advanced Power Settings", and in the "Battery" option, set the "Low Power Operation" option to "Use battery: Do not take any action". This setting can make the notebook battery in low power, and the system will not actively perform any operation, so that the notebook battery will automatically completely depleted, and the notebook will power off abnormally.
[0053] The host test script controls the PDU to supply power to the notebook AC power adapter for a period of time, which is equivalent to charging the DC power supply and automatically starting the notebook.
[0054] In an embodiment, the step of the host test script controlling the PDU to supply power to the notebook AC power adapter for a period of time further includes:
[0055] The power supply time is not more than 120 seconds to avoid charging too much notebook battery power and increasing the entire test cycle.
[0056] Specifically, the value of the power supply time N can be determined according to the actual situation, and it is recommended that N is not more than 120, so as not to charge too much notebook battery power and increase the entire test cycle.
[0057] Then, the host test script controls the PDU to stop supplying power to the notebook AC power adapter, which is equivalent to notebook battery power supply. The host test script checks whether the notebook can communicate with the host. If yes, continue testing; if not, it indicates that the SSD is likely to abnormally cause the notebook to be unable to communicate with the host. At this time, the PDU starts again and always supplies power to the notebook AC power adapter to prevent the notebook battery from being depleted and causing abnormal power-off and losing the problem site, and then the test is terminated.
[0058] In the above embodiment, the notebook is tested for abnormal power-off under DC power supply. The principle is that the notebook is powered by DC, and the user can set the related options of the battery in the operating system. When the battery is completely discharged, the DC power supply cannot power the notebook, and the notebook will automatically power off abnormally. After the notebook is powered off abnormally, another host is used to control the programmable power supply distributor to power on the notebook AC adapter, so that the notebook will automatically start. The present application can automatically test the notebook for DC whole machine abnormal power-off on a large scale, and does not need to modify any parts of the notebook computer, thereby maximizing the original power-off scene of the notebook computer.
[0059] In one embodiment, as shown in Figure 2 , a notebook-based DC abnormal power-off test method is provided. After the step of the host test script controlling the PDU to stop powering the AC power adapter of the notebook to be tested and checking whether the notebook to be tested can communicate with the host, the method further includes:
[0060] Step 202, if communication is possible, continue testing, and continuously read and write test the SSD to speed up the discharge of the notebook battery;
[0061] Step 204, the test script waits for a period of time, and the waiting time is not more than 120 seconds;
[0062] Step 206, determine whether the test round has reached the requirement;
[0063] Step 208, if not, jump to the step of the host test script controlling the PDU to power the AC power adapter of the notebook to be tested for a period of time, and if yes, end the test.
[0064] Specifically, referring to Figure 3 , a complete DC abnormal power-off test method is provided, and the specific test environment and test process are as follows:
[0065] Hardware requirements: the control host is preferably a Lenovo M8600T desktop computer, the notebook to be tested is a notebook computer that can start automatically after being plugged into the AC adapter without manually pressing the power-on button; the SSD to be tested is an SSD that supports PCIe and NVMe protocols; the PDU device is an AP7921 type PDU of APC company, which can be powered on and off by calling the interface provided by Python language. Among them, for the power-off device, the AP7921 type programmable power supply distribution unit of APC company is preferred as the power-off device.
[0066] Software requirement: The test software is Windows system, MobaXterm software, which is used to call the test script; the test script is a test script written in Python language.
[0067] Step 1, in the "Control Panel" of the Windows system, enter "Power Plan", click "Change advanced power settings", in the "Battery" option, set the "Low power operation" option to "Use battery: Do not take any action". This setting can make the notebook battery in low power, the system does not take any action, so that the notebook battery will be automatically completely depleted, the notebook appears abnormal power failure.
[0068] Step 2, the notebook battery is depleted, and the whole machine is abnormal power failure.
[0069] Step 3, the host test script controls the PDU to supply power to the notebook AC power adapter for N seconds, wherein the value of N can be determined according to the actual situation, and it is recommended that N does not exceed 120, so as not to charge too much notebook battery power, thereby increasing the whole test period, this step is equivalent to charging the DC power supply, and also can make the notebook automatically start.
[0070] Step 4, the host test script controls the PDU to stop supplying power to the notebook AC power adapter, which is equivalent to notebook battery power supply.
[0071] Step 5, the host test script checks whether the notebook can communicate with the host, if yes, continue to test; if not, it indicates that the SSD may be abnormal and cause the notebook to be unable to communicate with the host, at this time the PDU starts again and always supplies power to the notebook AC power adapter to prevent the notebook battery from being depleted and losing the problem site due to abnormal power failure, and then the test is terminated.
[0072] Step 6, continuously read and write test is performed on the SSD to accelerate the depletion of the notebook battery power.
[0073] Step 7, the test script waits for M seconds, wherein the value of M needs to be determined according to how long it takes for the notebook battery to be depleted in step 6, if N≤120 in step 3, M generally does not exceed 120 seconds.
[0074] Step 8, repeat steps 3-7 X times, wherein the value of X is determined according to the actual situation.
[0075] In this embodiment, the real scene of notebook power failure can be restored more accurately, and the notebook does not need to be modified, and batch large-scale automatic test can be realized only by power setting and script control.
[0076] It should be understood that, although Figures 1-3The steps in the flowchart are shown in sequence according to the arrows, but the steps are not necessarily executed in the order indicated by the arrows. Unless otherwise explicitly stated herein, there is no strict order limitation for the execution of the steps, and the steps can be executed in other orders. Moreover, Figures 1-3 At least one part of the steps in the flowchart can include multiple sub-steps or multiple stages, which are not necessarily executed at the same time, but can be executed at different times, and the execution order of the sub-steps or stages is not necessarily sequential, but can be alternately executed with at least one part of other steps or sub-steps or stages of other steps.
[0077] In one embodiment, as shown in Figure 4 a notebook-based DC abnormal power-off test device 400 is provided, which comprises:
[0078] A setting module 401 is configured to set the power control options of the notebook to be tested, and set the "low power operation" option as "use battery: do not take any operation";
[0079] A power-off module 402 is configured to cause the whole machine to abnormally power off when the battery of the notebook to be tested is depleted;
[0080] A power supply module 403 is configured to control the PDU to supply power to the AC power adapter of the notebook to be tested for a period of time, so that the notebook to be tested automatically powers on;
[0081] An inspection module 404 is configured to control the PDU to stop supplying power to the AC power adapter of the notebook to be tested, and check whether the notebook to be tested can communicate with the host;
[0082] A re-powering module 405 is configured to, if communication is not possible, indicate that the SSD of the notebook to be tested may be abnormal, at which time the PDU starts again and supplies power to the AC power adapter of the notebook to be tested at all times to prevent the notebook to be tested from being lost due to abnormal power-off after the battery is depleted, and then the test is terminated.
[0083] In one embodiment, the power supply time in the power supply module 403 does not exceed 120 seconds, so as to avoid charging too much notebook battery power and increasing the entire test period.
[0084] In one embodiment, as shown in Figure 5 a notebook-based DC abnormal power-off test device 400 is provided, which further comprises a read-write module 406 configured to:
[0085] If communication can be performed, the test is continued, and a continuous read-write test is performed on the SSD to speed up the consumption of the notebook battery power;
[0086] The test script waits for a period of time, and the waiting time is no more than 120 seconds.
[0087] In one embodiment, as shown in Figure 6 A notebook-based DC abnormal power-off test device 400 is provided, which further comprises a judgment module 407 configured to:
[0088] Judge whether the number of test rounds has reached the requirement;
[0089] If not, jump to the step of powering the notebook AC power adapter for a period of time by the host test script control PDU, and if yes, the test is ended.
[0090] For specific limitations of the notebook-based DC abnormal power-off test device, refer to the limitations of the notebook-based DC abnormal power-off test method in the foregoing, which will not be repeated here.
[0091] In one embodiment, a computer device is provided, and an internal structure diagram of the computer device can be as shown in Figure 7 The computer device comprises a processor, a memory and a network interface connected through a system bus. The processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operating system and the computer program in the non-volatile storage medium to run. The network interface of the computer device is configured to communicate with an external terminal through a network connection. The computer program is executed by the processor to implement a notebook-based DC abnormal power-off test method.
[0092] Those skilled in the art can understand that Figure 7 The structure shown in the figure is only a block diagram of part of the structure related to the scheme of the present application, and does not constitute a limitation on the computer device to which the scheme of the present application is applied. The specific computer device can comprise more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0093] In one embodiment, a computer device is provided, comprising a memory, a processor and a computer program stored in the memory and executable on the processor, and the processor implements the steps in each of the above method embodiments when executing the computer program.
[0094] In one embodiment, a computer readable storage medium is provided, having stored thereon a computer program, which, when executed by a processor, implements the steps of any of the above method embodiments.
[0095] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiments can be completed by a computer program instructing related hardware, and the computer program can be stored in a non-volatile computer readable storage medium. When the computer program is executed, the processes of the above-mentioned embodiments can be included. Any reference to memory, storage, database or other medium used in each embodiment provided by the present 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. As an illustration but not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0096] Any combination of the technical features of the above embodiments can be made, and in order to make the description simple, all possible combinations of the technical features in the above embodiments are not described, however, as long as the combination of the technical features does not exist, it should be considered as the scope of the present application.
[0097] The above embodiments only express several implementation manners of the present application, and the description is more specific and detailed, but it should not be understood as a limitation on the scope of the patent. It should be pointed out that for ordinary skilled in the art, without departing from the concept of the present application, a number of modifications and improvements can be made, which are within the scope of the present application. Therefore, the scope of the patent of the present application should be subject to the appended claims.
Claims
1. A method for testing abnormal power loss of a DC power source based on a laptop, the method comprising: Configure the power control options of the laptop under test, and set the "Low power operation" option to "Use battery: Do nothing"; The laptop under test experienced an abnormal power loss when its battery was depleted. The host test script controls the PDU to supply power to the AC power adapter of the laptop under test for a period of time so that the laptop under test can be turned on automatically. The host test script controls the PDU to stop supplying power to the AC power adapter of the laptop under test and checks whether the laptop under test can communicate with the host. If communication fails, it indicates that the SSD of the laptop under test may be malfunctioning. At this time, the PDU restarts and continuously supplies power to the AC power adapter of the laptop under test to prevent the laptop from losing power abnormally after the battery is depleted and the problem scene is lost. Then the test is terminated. The step of the host test script controlling the PDU to supply power to the AC power adapter of the laptop under test for a period of time also includes: The power supply time should not exceed 120 seconds to avoid overcharging the laptop battery and thus increasing the overall test cycle. After the steps of the host test script controlling the PDU to stop supplying power to the AC power adapter of the laptop under test and checking whether the laptop under test can communicate with the host, the following is also included: If communication is possible, continue testing by performing continuous read and write tests on the SSD to speed up the depletion of the laptop battery. The test script waits for a period of time, not exceeding 120 seconds. The test script also includes the following steps after waiting for a certain period of time: Determine whether the required number of test rounds has been reached; If the condition is not met, the process will proceed to the step in the host test script whereby the PDU controls the AC power adapter of the laptop under test to supply power for a period of time. If the condition is met, the test will end.
2. A DC abnormal power failure testing device based on a laptop, characterized in that, The device includes: The settings module is used to set the power control options of the laptop under test, and set the "low power operation" option to "use battery: do nothing"; A power-down module, which is used to cause an abnormal power loss of the entire machine when the battery of the laptop under test is depleted; The power supply module is used by the host test script to control the PDU to supply power to the AC power adapter of the laptop under test for a period of time so that the laptop under test can be turned on automatically. The inspection module is used by the host test script to control the PDU to stop supplying power to the AC power adapter of the laptop under test, and to check whether the laptop under test can communicate with the host. The power supply module is used to restart the PDU and continuously supply power to the AC power adapter of the laptop under test if communication fails, indicating that the SSD of the laptop under test may be abnormal. This is to prevent the laptop under test from losing power abnormally after the battery is depleted and the problem scene is lost. Then the test is terminated. The power supply time in the power supply module shall not exceed 120 seconds, so as to avoid charging too much of the laptop battery and thus increasing the entire test cycle. The device further includes a read / write module, which is used for: If communication is possible, continue testing by performing continuous read and write tests on the SSD to speed up the depletion of the laptop battery. The test script waits for a period of time, not exceeding 120 seconds. The device further includes a judgment module, the judgment module being used for: Determine whether the required number of test rounds has been reached; If the condition is not met, the process will proceed to the step in the host test script whereby the PDU controls the AC power adapter of the laptop under test to supply power for a period of time. If the condition is met, the test will end.
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 and system for testing abnormal power failure of SSD complete machine
CN110147299A
System and method for automatically testing power failure of mobile terminal
CN113434347A