A computer hibernation stability test system and method
By combining the hibernation and wake-up log recording and analysis modules of BIOS and operating system, the problems of automation of hibernation stability testing and difficulty in fault location in existing technologies are solved, and efficient hibernation stability testing and fault diagnosis are achieved.
Patent Information
- Application Number
- CN202111664635.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-31
- Publication Date
- 2026-01-13
- Estimated Expiration
- 2041-12-31
AI Technical Summary
Existing methods for testing computer hibernation and startup stability are mainly performed under the operating system, which cannot be automated and cannot effectively verify the consistency of the system environment before and after hibernation and wake-up. This results in low efficiency in hibernation stability testing and difficulty in fault location.
Design a computer hibernation stability testing system that combines BIOS and operating system. Through hibernation and wake-up log recording and analysis components, it realizes fully automated recording and analysis of the entire process, including modules such as policy configuration, file system driver, file writing, and log analysis, to ensure the consistency comparison of process states before and after hibernation.
It achieves linkage between the BIOS and operating system levels, automates the recording and analysis of the hibernation and wake-up process, accurately locates faults, improves the efficiency and accuracy of hibernation stability testing, and supports compatibility with domestic computer platforms.
Smart Images

Figure CN114490287B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of computer firmware technology, specifically relating to a computer hibernation stability testing system and method. Background Technology
[0002] The BIOS is used to initialize the computer's processor platform and load the operating system. Its basic functions include: after the hardware platform is powered on, it gains control of the system, initializes key components such as the processor, memory, and chipset, enumerates peripherals and allocates resources to them, initializes necessary peripherals such as graphics cards, hard drives, and network cards, establishes the operating environment for the operating system, and then hands over control to the operating system.
[0003] Most existing stability tests for computer hibernation and startup use hibernation wake-up scripts within the operating system.
[0004] 1) System hibernation is an important performance characteristic of well-designed firmware, and continuous hibernation tests can measure the stability of the firmware and the system. According to computer performance indicators, hibernation stability testing requires 1000 cycles, which cannot be verified manually.
[0005] 2) The key to hibernation stability testing is to verify whether the system environment is consistent before and after each wake-up from hibernation, that is, to confirm whether the process exists before and after hibernation.
[0006] 3) If hibernation wake-up fails, location information cannot be retained and hibernation stability test will be terminated. Summary of the Invention
[0007] In view of this, the present invention provides a computer hibernation stability testing system and method, which can solve the problem of how to combine BIOS and operating system to perform automated computer hibernation testing.
[0008] A computer hibernation stability testing system includes a hibernation / wake-up log recording component and a hibernation / wake-up analysis component;
[0009] The hibernation / wake-up log recording component is loaded during BIOS operation and is used to record key hibernation / wake-up operations of the computer during BIOS operation and write them to the hibernation / wake-up log file (BIOS).
[0010] The hibernation / wake-up analysis component runs in the operating system and is used to store hibernation / wake-up files (operating system) at the operating system level. It also performs comprehensive comparison and analysis by combining the hibernation / wake-up log files in the BIOS and the operating system.
[0011] The BIOS layer's hibernation / wake-up logging component and the operating system's hibernation / wake-up analysis component work together to achieve complete recording of the operating system's hibernation / wake-up process in BIOS logs and system logs.
[0012] Furthermore, the hibernation / wake-up logging component includes a policy configuration module, a file system driver, a file writing module, and a BIOS hibernation / wake-up log file.
[0013] The policy configuration module is used to configure the content and format of the BIOS sleep / wake log file;
[0014] The file system driver module is used to identify the file system and support read and write operations on the file.
[0015] The file writing module is used to call the file system driver module to identify the hard drive and file system, and write the BIOS hibernation / wake-up record file to the specified path;
[0016] The BIOS sleep / wake log file is a text file that records sleep / wake cycles sequentially according to a specific format.
[0017] Furthermore, the hibernation / wake-up analysis component includes three modules: a policy configuration module, a log analysis module, and a hibernation / wake-up script module, along with the operating system hibernation / wake-up log file and a copy of the BIOS hibernation / wake-up log file.
[0018] The policy configuration module is used to specify the content and format of logs stored in the operating system, and the number of loops for the hibernation restart test;
[0019] Hibernation / wake-up scripts are scripts that perform hibernation and wake-up operations under the operating system.
[0020] The operating system sleep / wake log file is a log file that records events before and after sleep in the operating system.
[0021] The BIOS sleep / wake log file copy is the BIOS log file that the BIOS copies to the operating system after the BIOS performs a sleep / wake operation.
[0022] The log analysis module compares the hibernation / wake-up log file, which records the state of system processes before hibernation, with the state of processes after wake-up to check for similarities. If they differ, the module searches for the corresponding log in the hibernation / wake-up log file in the BIOS based on the recorded time to troubleshoot the corresponding BIOS fault.
[0023] A method for testing computer hibernation stability, the implementation of which includes the following steps:
[0024] Step 1: Power on the computer, enter the operating system, start the configuration file, and begin the hibernation and wake-up test;
[0025] Step 2: Start executing the hibernation and wake-up script, read the tests that need to be repeated from the configuration file, as well as the format and storage range of the hibernation and wake-up logs;
[0026] Step 3: Determine if the number of loop tests is greater than or equal to 1; if yes, proceed to the next step; otherwise, the process ends.
[0027] Step 4: The hibernation and wake-up script in the operating system records the processes running in the current environment and the context, and saves them to the hibernation and wake-up record (operating system) file;
[0028] Step 5: The BIOS performs a hibernation operation and records the relevant BIOS operations in a cache (or file);
[0029] Step 6: Enter sleep mode and automatically wake up after two minutes;
[0030] Step 7: Enter the wake-up operation. The BIOS records the relevant operations in the cache (or file).
[0031] Step 8: The BIOS calls the file writing module to write the current computer hibernation / wake-up record (BIOS) to the specified path;
[0032] Step 9: The operating system's log analysis module compares the hibernation / wake-up records (operating system) before and after hibernation to determine if they are consistent. If they are, proceed to the next step; otherwise, automatically locate and analyze the relevant operation logs of the operating system and BIOS, preserve the current state for analysis, and the process ends.
[0033] Step 10: Decrement the number of loop tests by one, and determine if the number of loop tests is greater than or equal to 1. If yes, proceed to the next step; if no, save the hibernation / wake-up log records (operating system) and hibernation / wake-up log records (BIOS) for later analysis.
[0034] Step 11: Process complete.
[0035] Beneficial effects:
[0036] 1. The method of the present invention combines the two levels of BIOS and operating system. By linking BIOS and operating system, it realizes the logging of the entire process of hibernation and wake-up of BIOS and operating system, and can automatically save the scene and perform automatic analysis when a fault occurs.
[0037] 2. The method of the present invention can record the processes before the operating system hibernates and the processes after hibernation wakes up. If the process states before and after hibernation wakes up are found to be inconsistent, the script will be terminated and relevant log information will be recorded, providing accuracy and effectiveness in locating hibernation wake-up problems.
[0038] 3. This invention is compatible with domestic computer multiprocessing platforms. By adding a logging component to the BIOS layer of a domestic computer and running a log analysis component in the operating system, the continuous sleep-wake test function of this system can be realized.
[0039] 4. The log analysis module in this invention can compare the process state information saved in the operating system wake-up log file with the process state information after wake-up to determine whether hibernation / wake-up is normal. If hibernation / wake-up is abnormal, the fault location and diagnosis can be performed based on the BIOS hibernation / wake-up log file recorded by the BIOS during the hibernation / wake-up process. This module can solve the problem that the BIOS process log cannot be recorded during hibernation / wake-up testing, which leads to the inability to analyze BIOS faults during hibernation / wake-up. Attached Figure Description
[0040] Figure 1 This is a framework diagram of a computer hibernation stability testing system.
[0041] Figure 2 This is a flowchart of a computer hibernation stability test method. Detailed Implementation
[0042] The present invention will now be described in detail with reference to the accompanying drawings and embodiments.
[0043] As attached Figure 1 As shown, the present invention provides a computer hibernation stability testing system, which includes a hibernation / wake-up log recording component and a hibernation / wake-up analysis component.
[0044] The hibernation / wake-up logging component includes a policy configuration module, a file system driver, a file writing module, and a BIOS hibernation / wake-up log file. The policy configuration module configures the content and format of the BIOS hibernation / wake-up log file. The file system driver module identifies the file system and supports read and write operations on the file. The file writing module calls the file system driver module to identify the hard drive and file system, and writes the data to the BIOS hibernation / wake-up log file at the specified path. The BIOS hibernation / wake-up log file is used to record hibernation / wake-up events sequentially in a specific format, forming a text file.
[0045] The hibernation / wake-up analysis component comprises three modules: a policy configuration module, a log analysis module, and a hibernation / wake-up script. It also includes an operating system hibernation / wake-up log file and a copy of the BIOS hibernation / wake-up log file. The policy configuration module specifies the content and format of the logs stored in the operating system, as well as the number of loops for the hibernation / restart test. The hibernation / wake-up script executes hibernation and wake-up operations within the operating system. The operating system hibernation / wake-up log file records the data before and after hibernation. The copy of the BIOS hibernation / wake-up log file is the BIOS log file copied to the operating system after the BIOS performs a hibernation / wake-up operation.
[0046] The log analysis module compares the hibernation / wake-up log file, which records the state of system processes before hibernation, with the state of processes after wake-up to check for similarities. If they differ, the module searches for the corresponding log in the hibernation / wake-up log file in the BIOS based on the recorded time to troubleshoot the corresponding BIOS fault.
[0047] This invention also provides a method for testing the stability of computer hibernation, as shown in the appendix. Figure 2 As shown, the implementation steps are explained below, in conjunction with the specific implementation process:
[0048] Step 1: Enter the operating system, modify the configuration file, and change the loop count to 1000, for example: max_count = 1000;
[0049] Step 2: Start the configuration file and execute the sleep / wake-up script;
[0050] Step 3: Read the number of loop tests and determine whether to continue, for example: for((num=1; num<=$max_count; num++));
[0051] Step 4: If the number of loop tests is greater than or equal to 1, it means that the 1000 loops have not yet ended, so proceed to the next step; otherwise, it means that the set 1000 loops have ended, so proceed to step 12.
[0052] Step 5: Save the running program state of the environment before hibernation to the operating system's log, for example: execute `echo ps -ef> / opt / S4 / process_Before.log`;
[0053] Step 6: The BIOS performs a hibernation operation and records the relevant operations in a cache (file), for example: echo boot> / sys / power / disk&&echo disk> / sys / power / state;
[0054] Step 7: Wait 2 minutes;
[0055] Step 8: The BIOS performs a wake-up operation and records the relevant operations in a cache (file);
[0056] Step 9: The BIOS calls the file writing module to write the BIOS hibernation and wake-up records to the specified path, for example: / boot / efi / EFI / boot / BiosS4.log;
[0057] Step 10: Enter the operating system and save the current running program state. For example, execute `echo ps -ef> / opt / S4 / process_After.log`. Compare the program state before and after hibernation in the hibernation wake-up log. If they are consistent, decrement the loop count by 1 and return to Step 3. Otherwise, it proves that the system program has changed after waking up. Record the operating system log, for example: `dmesg|egrep "error|failed|warning">> / opt / S4 / S4.log`, and proceed to the next step.
[0058] Step 11: Obtain and analyze the relevant operation logs of the operating system and BIOS. The process ends here.
[0059] Step 12: Retain the log records of hibernation and wake-up. The process ends.
[0060] In summary, the above are merely preferred embodiments of the present invention and are not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A computer hibernation stability testing system, characterized in that, Includes a sleep / wake-up logging component and a sleep / wake-up analysis component; The hibernation / wake-up log recording component is loaded during BIOS operation and is used to record key hibernation / wake-up operations of the computer during BIOS operation and write them to the hibernation / wake-up log file; The hibernation / wake-up analysis component runs in the operating system and is used to store hibernation / wake-up files at the operating system level. It also performs comprehensive comparison and analysis by combining hibernation / wake-up log files in the BIOS and the operating system. The BIOS layer's hibernation / wake-up logging component and the operating system's hibernation / wake-up analysis component work together to achieve complete recording of the operating system's hibernation / wake-up process in BIOS logs and system logs; The hibernation / wake-up log recording component includes a policy configuration module, a file system driver module, a file writing module, and a BIOS hibernation / wake-up log file. The policy configuration module is used to configure the content and format of the BIOS sleep / wake log file; The file system driver module is used to identify the file system and support read and write operations on the file. The file writing module is used to call the file system driver module to identify the hard drive and file system, and write the BIOS hibernation / wake-up record file to the specified path; The BIOS sleep / wake log file is a text file that records sleep / wake cycles sequentially according to a specific format.
2. The computer hibernation stability testing system as described in claim 1, characterized in that, The sleep / wake analysis component includes a policy configuration module, a log analysis module, sleep / wake scripts, operating system sleep / wake log files, and copies of BIOS sleep / wake log files.
3. The computer hibernation stability testing system as described in claim 2, characterized in that, The policy configuration module specifies the content and format of the logs stored in the operating system, and the number of loops for the hibernation restart test. The log analysis module compares the hibernation / wake-up log file (which records the state of the system running processes before hibernation) with the state of the processes after wake-up to check for similarities. If they differ, the module searches for the corresponding log in the BIOS hibernation / wake-up log file based on the recording time to troubleshoot the corresponding BIOS fault. The hibernation / wake-up script is a script that executes hibernation and wake-up operations under the operating system. The operating system hibernation / wake-up log file is a log file that records the state before and after hibernation under the operating system. The BIOS hibernation / wake-up log file copy is the BIOS log file that the BIOS copies to the operating system after hibernation / wake-up.
Citation Information
Patent Citations
Method and device for recording BIOS level logs
CN101446915A
Server stability testing method and device and related components
CN112256505A