Method for testing power supply stability and starting performance of Linux equipment
Through the combination of power management chip and automation scripts, fully automatic testing of power stability and startup performance of Linux devices is achieved, solving the problems of low manual testing efficiency and poor accuracy in the existing technology, and improving testing efficiency and accuracy.
Patent Information
- Application Number
- CN202411750513.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-02
- Publication Date
- 2025-04-25
AI Technical Summary
In the prior art, testing the power stability and startup performance of Linux devices mainly relies on manual means, which is inefficient and easy to introduce errors, resulting in the accuracy and reliability of the test results being affected.
The power supply of Linux devices is controlled through the power management chip, and combined with automated scripts, the system's automated monitoring and testing process is realized. The automated script records power-on information, startup time and abnormal conditions, and simulates the process of frequent power-on and power-off of the equipment through the power management chip to conduct cycle tests.
A fully automatic test process is realized, testing efficiency and accuracy are improved, and the power stability and startup performance of Linux devices under frequent power-on and power-off conditions are comprehensively evaluated.
Smart Images

Figure CN119881722A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of electronic technology, and in particular to a method for testing power stability and startup performance of Linux equipment. Background Art
[0002] Power stability refers to the stability of power output, which is an important basis for ensuring the normal operation of electrical equipment. Stable power output is of great significance to all fields. The importance of power stability includes ensuring the normal operation of electrical equipment. Electrical equipment requires stable current, voltage and frequency to operate normally. If the current, voltage and frequency are unstable, it will affect the working efficiency of electrical equipment and their lifespan. Ensure data security. The instability of power supply will affect the data in computers and other equipment, and may cause problems such as computer system crashes or data loss, posing a threat to data security. Reduce maintenance costs. Stable power supply can reduce the failure rate of equipment, reduce the cost of equipment maintenance, and improve the reliability and stability of equipment. Enhance market competitiveness. In today's fierce market competition, ensure the normal operation of equipment, effectively improve the performance of equipment, and enhance the market competitiveness of enterprises.
[0003] At present, the power stability test of Linux devices mostly uses manual means to repeatedly power on and off the devices, and record the number of operations and abnormal conditions to determine the stability of the power on and off of the devices.
[0004] However, the prior art uses manual testing methods to test the power stability and startup performance of Linux devices, which has significant shortcomings. For example, manual operation is not only inefficient and difficult to perform large-scale repeated tests, but also easily introduces errors due to human factors, resulting in the accuracy and reliability of the test results being affected. Summary of the invention
[0005] In view of the above problems, the present invention provides a method for testing the power stability and startup performance of a Linux device, which is used to overcome the above problems or at least partially solve the above problems.
[0006] The present invention provides the following scheme:
[0007] A method for testing power stability and startup performance of a Linux device, comprising:
[0008] Control the power supply of Linux devices through the power management chip;
[0009] The Linux device system starts and runs an automation script, wherein the automation script is used to record power-on information after confirming that the system starts normally, wherein the power-on information at least includes the time of entering the system and the time taken to start, and the number of times the system is entered after the test starts;
[0010] After determining that the startup of the Linux device reaches the target startup time, triggering the shutdown of the Linux device;
[0011] After determining that the Linux device has reached the target shutdown time, the power management chip starts a power-on process to power the Linux device and perform the next round of cycle testing.
[0012] Preferably: the automation script is configured as a system service or added to rc.local so as to be automatically executed each time the system starts.
[0013] Preferably: the current system time is recorded as the time of entering the system this time.
[0014] Preferably, the current startup time is compared with the previous startup time to determine whether there is any abnormality in the system.
[0015] Preferably: the automation script triggers the shutdown of the Linux device through a system command or by calling a power management chip.
[0016] Preferably: receiving a system shutdown signal of the Linux device through the power management chip, and recording the time when the shutdown signal is received as the shutdown start time;
[0017] According to the shutdown start time, the Linux device determines that after the target shutdown time has passed, the power-on process is started through the power management chip to supply power to the Linux device for the next round of cycle testing.
[0018] Preferably: the power-on information and abnormal information are stored in a log file.
[0019] Preferably: according to the periodic analysis task configuration information, the log file is parsed to collect key indicators and generate analysis results, wherein the key indicators include at least startup time consumption and number of exceptions.
[0020] Preferably: a test report is generated according to the analysis result, and the test report at least includes a startup time-consuming trend and an abnormality record.
[0021] Preferably: after the target power-on time has passed, the power-off process is started by the power management chip to prevent the computer from freezing during abnormal startup and enter the next cycle.
[0022] According to the specific embodiments provided by the present invention, the present invention discloses the following technical effects:
[0023] The embodiment of the present application provides a method for testing the power stability and startup performance of a Linux device. Through the dual means of hardware control and software monitoring, the process of frequent power on and off of the device is simulated, and combined with script automated monitoring, a fully automated test process is implemented, and the startup reliability and performance of the Linux device under extreme power conditions are effectively recorded. The test process is optimized through automated means, the test efficiency and accuracy are improved, and the power stability and startup performance of the Linux device under frequent power on and off conditions are comprehensively evaluated.
[0024] Of course, any product implementing the present invention does not necessarily need to achieve all of the advantages described above at the same time. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0026] Figure 1 The present invention provides a flowchart of a method for testing power stability and startup performance of a Linux device. DETAILED DESCRIPTION
[0027] The technical scheme in the embodiment of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiment of the present invention. Obviously, the described embodiment is only a part of the embodiment of the present invention, not all of the embodiments. Based on the embodiment of the present invention, all other embodiments obtained by ordinary technicians in this field belong to the scope of protection of the present invention.
[0028] See also Figure 1 , a method for testing power stability and startup performance of a Linux device provided by an embodiment of the present invention, such as Figure 1 As shown, the method may include:
[0029] Control the power supply of Linux devices through the power management chip;
[0030] The Linux device system starts and runs an automation script, which is used to record power-on information after determining that the system has started normally, and the power-on information at least includes the time of entering the system and the time consumed for startup; and the number of times the system has been entered after the test started; in specific implementation, the embodiment of the present application can provide the automation script to be configured as a system service or added to rc.local so that it is automatically executed each time the system starts.
[0031] Furthermore, the current system time is recorded as the time of entering the system this time. The startup time of this time is compared with the startup time of the previous times to determine whether there is any abnormality in the system.
[0032] After determining that the startup of the Linux device reaches the target startup time, the Linux device is triggered to shut down; in specific implementation, the automation script triggers the shutdown of the Linux device through a system command or calling a power management chip.
[0033] After determining that the Linux device has reached the target shutdown time, the power management chip starts the power-on process to power the Linux device and conduct the next round of cycle testing. In specific implementation, the power management chip receives the system shutdown signal of the Linux device and records the time when the shutdown signal is received as the shutdown start time;
[0034] According to the shutdown start time, Linux determines that after the target shutdown time has passed, the power-on process is started through the power management chip to supply power to the Linux device and perform the next round of cycle testing.
[0035] According to the power-on start time, Linux determines that after the target power-on time, the power-on process is started through the power management chip to prevent the computer from getting stuck during abnormal startup and to perform the next round of cycle testing.
[0036] Furthermore, the power-on information and the abnormal information are stored in a log file. According to the periodic analysis task configuration information, the log file is parsed and statistically analyzed to generate analysis results of key indicators, wherein the key indicators at least include the startup time consumption and the number of abnormalities. A test report is generated according to the analysis results, wherein the test report at least includes the startup time consumption trend and the abnormality record.
[0037] The test method for the power stability and startup performance of a Linux device provided in the embodiment of the present application simulates the process of frequent power on and off of the device through the dual means of hardware control and software monitoring, combines script automated monitoring to achieve a fully automatic test process, and effectively records the startup reliability and performance of the Linux device under extreme power conditions.
[0038] The method provided in the embodiments of the present application is described in detail below.
[0039] The embodiment of the present application proposes an automated test of power stability and startup performance of a Linux device to improve test efficiency and accuracy.
[0040] In specific implementation, the power management chip is used to control the automatic power on and off of the device. After the device is powered on, the system starts and runs the automation script. The script records the time, calculates the startup time, and sends a shutdown signal to the power management chip. After receiving the signal, the power management chip powers off the device and automatically powers on after one minute. Repeat this process for multiple tests.
[0041] The specific process of the program includes:
[0042] a. Hardware support: The device must have a programmable power management chip that can accurately control the power-on and power-off time.
[0043] b. Configure the power management chip through a hardware interface or a dedicated software tool, set it to start the power-on process after a set target shutdown time (one minute) in the power-off state, and automatically power off after a set target startup time (such as five minutes).
[0044] c. Software automation and shutdown scripts:
[0045] i. Start automatically: Configure the script as a system service or add it to rc.local to ensure that it is automatically executed every time the system starts.
[0046] ii. Time record: record the current system time as the time of this entry into the system, increase the count of entering the system, and obtain the last recorded time of entering the system.
[0047] iii. Time difference calculation: Calculate the time taken for this startup and compare it with the previous startup times to determine whether there is any abnormality.
[0048] iv. Other records: record other logs to be recorded during this startup.
[0049] v. Automatic shutdown: After completing time recording and necessary log writing, the script triggers the device to shut down through system commands or calls the power management chip. (Note: The time for executing the shutdown command after startup should not be too short, leaving enough time to shut down the script, otherwise the system will shut down quickly and cannot be operated, and the cycle will continue. When it returns to normal, it can only be restored from the system).
[0050] vi. Log recording: Record the time taken for each startup, the time, whether it is abnormal, and other information in the log file for subsequent review and analysis.
[0051] d. Power management chip and software collaboration
[0052] i. Shutdown signal reception: The power management chip must be able to receive a shutdown signal from the system and immediately start timing to prepare for power off after receiving the signal.
[0053] ii. Power-on cycle: After the set power-off time ends, the power management chip automatically starts the power-on process to power the device for the next round of cycle testing.
[0054] III. Exception handling cycle: Timing starts from power-on. After a certain period of time, the power management chip automatically powers off to prevent startup abnormalities and not performing the next cycle, thereby performing the next round of cycle testing.
[0055] e. Data analysis and feedback
[0056] i. Regular analysis: Set up regular analysis tasks, parse log files, and count key indicators such as startup time and number of exceptions.
[0057] ii. Report generation: Generate a test report based on the analysis results, including startup time trends, exception records, etc., for reference by the development or testing team.
[0058] In summary, the test method for the power stability and startup performance of Linux devices provided in this application optimizes the test process through automation, improves test efficiency and accuracy, and comprehensively evaluates the power stability and startup performance of Linux devices under frequent power-on and power-off conditions.
[0059] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0060] It can be known from the description of the above implementation methods that those skilled in the art can clearly understand that the present application can be implemented by means of software plus a necessary general hardware platform. Based on such an understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product can be stored in a storage medium such as ROM / RAM, a magnetic disk, an optical disk, etc., and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in the various embodiments of the present application or certain parts of the embodiments.
[0061] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can refer to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system or system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can refer to the partial description of the method embodiment. The system and system embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without creative work.
[0062] The above description is only a preferred embodiment of the present invention and is not intended to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.
Claims
1. A method for testing power stability and startup performance of a Linux device, characterized in that: The method comprises: Control the power supply of Linux devices through the power management chip; The Linux device system starts and runs an automation script, wherein the automation script is used to record power-on information after confirming that the system starts normally, wherein the power-on information at least includes the time of entering the system and the time taken to start, and the number of times the system is entered after the test starts; After determining that the startup of the Linux device reaches the target startup time, triggering the shutdown of the Linux device; After determining that the Linux device has reached the target shutdown time, the power management chip starts a power-on process to power the Linux device and perform the next round of cycle testing.
2. The method for testing power stability and startup performance of a Linux device according to claim 1, characterized in that: The automation script is configured as a system service or added to rc.local so that it is automatically executed every time the system starts.
3. The method for testing power stability and startup performance of a Linux device according to claim 1, characterized in that: Record the current system time as the time of entering the system this time.
4. The method for testing power stability and startup performance of a Linux device according to claim 3, characterized in that: Compare the startup time of this time with the startup time of the previous times to determine whether there is any abnormality in the system.
5. The method for testing power stability and startup performance of a Linux device according to claim 1, characterized in that: The automation script triggers the shutdown of the Linux device through a system command or by calling a power management chip.
6. The method for testing power stability and startup performance of a Linux device according to claim 1, characterized in that: Receiving a system shutdown signal of the Linux device through the power management chip, and recording the time when the shutdown signal is received as the shutdown start time; According to the shutdown start time, the Linux device determines that after the target shutdown time has passed, the power-on process is started through the power management chip to supply power to the Linux device for the next round of cycle testing.
7. The method for testing power stability and startup performance of a Linux device according to claim 1, characterized in that: The power-on information and abnormal information are stored in a log file.
8. The method for testing power stability and startup performance of a Linux device according to claim 7, characterized in that: According to the periodic analysis task configuration information, the log file is parsed to generate analysis results by counting key indicators, where the key indicators at least include startup time consumption and number of exceptions.
9. The method for testing power stability and startup performance of a Linux device according to claim 8, characterized in that: A test report is generated according to the analysis result, and the test report at least includes a startup time consumption trend and an abnormality record.
10. The method for testing power stability and startup performance of a Linux device according to claim 1, characterized in that: After the target power-on time, the power-off process is started through the power management chip to prevent the computer from being stuck during abnormal startup and enter the next cycle.