Method for determining boot system starting duration, server, device and medium
By using the controller in the server to obtain the level change time of the processor pin and the boot status of the boot system, and determine the boot time of the boot system, it solves the problem of low efficiency and low accuracy when manually analyzing the log or observing the interface, and achieves more efficient and accurate startup time statistics.
Patent Information
- Application Number
- CN202411737004.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-29
- Publication Date
- 2025-03-07
AI Technical Summary
When dealing with the statistical requirements of booting system startup time for a large number of machines, there are problems of low efficiency and low accuracy in manual analysis of logs or observation interfaces.
Determine the boot time of the boot system by using the controller in the server to obtain the level change time of the processor pin and the boot system startup status. The method includes obtaining the time of level change and the start state, establishing a correspondence between the pin level value and the start state, and calculating the duration of each start phase to determine the start time.
It improves the efficiency and accuracy of obtaining boot system startup time, avoids the influence of human factors, and reduces the delay in communication between the processor and the controller.
Smart Images

Figure CN119576726A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a method, server, device and medium for determining the startup duration of a boot system. Background Art
[0002] During the server development process and daily maintenance, statistics on the boot time of the boot system (such as the Basic Input / Output System (BIOS)) are very important for performance monitoring, fault diagnosis, user experience optimization, system management and maintenance, and security considerations.
[0003] In the related methods of obtaining the boot system startup time, statisticians check and analyze the relevant logs collected by the Baseboard Management Controller (BMC) to obtain detailed information about the boot system startup process that may be contained in various system startup logs, and indirectly calculate the boot system startup time by analyzing these logs. However, this method requires statisticians to have certain system knowledge and log analysis capabilities; or statisticians carefully observe the screen display during the boot process and use instruments to record the time from pressing the power button to the appearance of the operating system login interface. When manual comprehensive analysis or manual observation of the startup log is performed, due to the influence of human factors, there are problems of low efficiency and low accuracy when facing the statistical needs of processing the boot system startup time of a large number of machines.
[0004] It can be seen that how to improve the efficiency and accuracy of obtaining the boot time of the boot system is a technical problem that people in this field need to solve urgently. Summary of the invention
[0005] The purpose of the present invention is to provide a method, server, device and medium for determining the boot system startup time, so as to solve the problem of low efficiency and low accuracy when manually performing comprehensive analysis or manual observation of the startup log, due to the influence of human factors, when facing the statistical needs of processing the boot system startup time of a large number of machines.
[0006] In order to solve the above technical problems, the present invention provides a method for determining the boot time of a boot system, which is applied to a controller in a server, and the method comprises:
[0007] Obtaining the level change time of the pin of the processor connected to the controller and obtaining the startup state of the boot system;
[0008] Obtain the level change time corresponding to the startup state of the boot system;
[0009] The booting time of the guidance system is determined according to the level change time corresponding to the booting state of the guidance system.
[0010] On the one hand, the obtaining the startup status of the guidance system includes:
[0011] Acquire each stage included in the boot system startup process; wherein the stage includes each startup stage and a stage after the startup stage;
[0012] The various stages of the boot system startup process are sequentially used as the startup states of the boot system according to the startup sequence.
[0013] On the other hand, before obtaining the startup status of the guidance system, the method further includes:
[0014] Get the current level value of the pin at the moment of level change;
[0015] The obtaining of the startup status of the guidance system comprises:
[0016] The boot state of the boot system corresponding to the current level value is determined according to the pre-established correspondence between the pin level value and the boot state of the boot system; wherein the boot state of the boot system is the various stages of the boot process of the boot system, wherein the stages include each startup stage and the next stage of the startup stage.
[0017] On the other hand, establishing the correspondence between the pin level value and the startup state of the boot system includes:
[0018] Determining the number of pins of the processor connected to the controller according to the number of stages included in the boot system startup process; wherein the level signal combination of the pins of the processor is greater than the number of startup stages included in the boot system startup process;
[0019] Acquire the startup state of the guidance system when the processor is in each level signal combination;
[0020] The corresponding relationship is established according to each level signal combination and the corresponding startup state of the guidance system.
[0021] On the other hand, before the level change moment corresponding to the startup state of the guidance system is obtained, the method further includes:
[0022] Starting from monitoring the level signal of the pin of the processor, the level change moment acquired within a preset time length is stored in a first buffer;
[0023] The current level signal combination composed of the current level value of the pin at the moment of level change is stored in the second buffer;
[0024] Reading current level signal combinations from the second buffer, and sorting the current level signal combinations according to the order of level change moments;
[0025] Determining the current startup sequence of the guidance system according to the sequence of the current level signal combinations and the corresponding relationship;
[0026] Determining whether the current startup sequence is the same as the sequence of each stage of the boot system startup process;
[0027] If not, clearing the level change time stored in the first buffer and the current level signal combination stored in the second buffer, and returning to the step of obtaining the level change time of the pin of the processor connected to the controller and obtaining the startup state of the boot system;
[0028] If yes, then enter the step of obtaining the level change time corresponding to the startup state of the guidance system;
[0029] The step of obtaining the level change time corresponding to the startup state of the guidance system includes:
[0030] Reading the level change time from the first buffer;
[0031] According to the sequence of the level change moments, each level change moment is used as the level change moment corresponding to each stage of the boot system in the startup process.
[0032] On the other hand, determining the booting time of the guidance system according to the level change time corresponding to the booting state of the guidance system includes:
[0033] Obtain the level change moments of two adjacent stages during the boot system startup process;
[0034] Obtaining the time difference between the level change moments of two adjacent stages, and using the time difference as the duration corresponding to the earliest stage of the two adjacent stages, so as to obtain the duration of each startup stage of the guidance system;
[0035] The sum of the durations of the various startup phases in the startup process of the boot system is used as the startup duration of the boot system.
[0036] On the other hand, after obtaining the duration of each startup phase of the boot system, it also includes:
[0037] Obtaining the preset duration of each startup phase of the boot system;
[0038] Obtain the difference between the preset duration and the duration of each startup phase respectively;
[0039] Determining whether the difference is within a preset range;
[0040] If yes, output a prompt message indicating that the boot system is started normally;
[0041] If not, the startup phase in which the difference is not within the preset range is obtained, and prompt information indicating startup abnormality in the startup phase in which the difference is not within the preset range is output.
[0042] In order to solve the above technical problem, the present invention further provides a server, comprising:
[0043] A first acquisition module, used to acquire the level change time of the pin of the processor connected to the controller and to acquire the startup state of the boot system;
[0044] A second acquisition module is used to acquire the level change time corresponding to the startup state of the guidance system;
[0045] The determination module is used to determine the startup duration of the guidance system according to the level change moment corresponding to the startup state of the guidance system.
[0046] In order to solve the above technical problem, the present invention further provides a device for determining the boot time of a boot system, comprising:
[0047] Memory for storing computer programs;
[0048] The processor is used to implement the steps of the above-mentioned method for determining the boot system startup time when executing the computer program.
[0049] In order to solve the above technical problem, the present invention also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the method for determining the boot system startup duration are implemented.
[0050] The beneficial effects of the present invention are as follows: firstly, compared with the method of manually collecting logs during the boot process of the boot system or manually observing the interface to obtain the boot time of the boot system, in the method provided by the present invention, the controller in the server determines the boot duration of the boot system according to the level change moment corresponding to the boot state of the boot system, that is, the boot duration of the boot system is determined by the controller, thereby avoiding the influence of human factors and improving the efficiency and accuracy of determining the boot duration of the boot system; secondly, compared with the method of transmitting the boot phase of the boot system between the controller and the processor through the communication protocol stack, in the method provided by the present invention, the controller is connected to the processor, and the pin level signal of the processor can be directly transmitted by the connecting line between the controller and the processor, thereby avoiding the problem that the communication protocol stack cannot be initialized in the early stage of the boot system when the communication protocol stack is used to transmit information, resulting in the processor being unable to communicate with the controller through the communication protocol stack, and the occurrence of a certain delay, thereby reducing the communication delay between the processor and the controller, thereby improving the efficiency of determining the boot duration of the boot system.
[0051] In addition, when obtaining the startup status of the boot system, each stage of the boot system startup process can be directly used as the startup status of the boot system in the order of startup, or the startup status of the boot system corresponding to the current level value of the pin at the moment of level change can be determined according to the correspondence between the pre-established pin level value and the startup status of the boot system, so that the startup status of the boot system can be flexibly obtained in different ways; and in the method of determining the startup status of the boot system corresponding to the current level value of the pin at the moment of level change according to the correspondence between the pre-established pin level value and the startup status of the boot system, since the current level value of the processor pin reflects the actual situation of the processor, this method can more accurately determine the startup status of the boot system.
[0052] When establishing the correspondence between the pin level value and the startup state of the boot system, the level signal combination of the processor pin is set to be greater than the number of startup stages included in the boot system startup process, thereby ensuring as much as possible that the startup stages included in the boot system startup process can all be represented by the pin level signal combination.
[0053] The level change moment obtained within the preset time length is stored in the first buffer, and the current level signal combination composed of the current level value of the pin at the level change moment is stored in the second buffer, that is, the level change moment and the level signal combination are stored separately, thereby avoiding interference between different data; and when the current startup sequence of the boot system determined according to the sequence and corresponding relationship of the current level signal combination is consistent with the sequence of each stage of the boot system startup process, each level change moment is used as the level change moment corresponding to each stage of the boot system in the startup process according to the sequence of the level change moment, thereby avoiding the occurrence of a situation where the startup sequence determined according to the current level signal combination is inconsistent with the standard startup sequence, and the accuracy of the level change moment corresponding to each stage of the boot system in the startup process is guaranteed as much as possible, thereby improving the accuracy of the determined startup duration of the boot system.
[0054] The boot duration of the boot system is determined according to the level change moment corresponding to the boot state of the boot system, the time difference between the level change moments of two adjacent stages is obtained, the duration of each boot phase of the boot system is obtained, and the sum of the durations of each boot phase of the boot process of the boot system is taken as the boot duration of the boot system. Compared with the method of directly taking the difference between the level change moment corresponding to the latter stage of the boot phase in the boot process and the level change moment of the initial stage as the boot duration, the method provided by the present invention can clearly understand the duration of each boot phase of the boot system. And by comparing the duration of each boot phase with the preset duration, the user can understand whether the boot phase is normal or abnormal, and the detection of the boot phase of the boot system is realized.
[0055] In addition, the present invention also provides a device for determining the boot system startup duration, a server, and a computer-readable storage medium, which have the same or corresponding technical features as the above-mentioned method for determining the boot system startup duration, and have the same effects as above. BRIEF DESCRIPTION OF THE DRAWINGS
[0056] In order to more clearly illustrate the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0057] Figure 1 A schematic diagram of a device for obtaining boot system startup time provided by an embodiment of the present invention;
[0058] Figure 2 A flowchart of a method for determining the boot time of a boot system provided by an embodiment of the present invention;
[0059] Figure 3 A flowchart of a method for interrupt processing triggered by a level change provided by an embodiment of the present invention;
[0060] Figure 4 A flowchart of a method for data processing tasks provided by an embodiment of the present invention;
[0061] Figure 5 A stacked bar chart of startup time for a four-time startup boot system provided by an embodiment of the present invention;
[0062] Figure 6 This is a structural diagram of a device for determining the boot time of a guidance system provided by another embodiment of the present invention. DETAILED DESCRIPTION
[0063] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0064] The core of the present invention is to provide a method, server, device and medium for determining the boot system startup time, so as to solve the problem of low efficiency and low accuracy when manually performing comprehensive analysis or manual observation of the startup log, due to the influence of human factors, when facing the statistical needs of processing the boot system startup time of a large number of machines.
[0065] In the server development process and daily maintenance and use, statistics on the boot system boot time are very important for performance monitoring, fault diagnosis, user experience optimization, system management and maintenance, and security considerations. Taking the boot system as BIOS as an example, the benefits of statistics on BIOS boot time are multifaceted. It is beneficial to performance monitoring and optimization. By measuring the BIOS boot time, you can understand the performance of the computer during the boot process. If the boot time is too long, it may mean improper hardware configuration, BIOS setting problems, or potential hardware failures. It is beneficial to fault diagnosis. Abnormal BIOS boot time may be an indicator of hardware failure, such as hard disk problems, insufficient memory, or processor failure. By analyzing the boot time, technicians can locate the problem more quickly and troubleshoot it. It is beneficial to improve user experience. For users, shorter boot time means faster system response and better user experience. Statistics on BIOS boot time help evaluate and optimize user experience, especially in scenarios where frequent restarts or boots are required. It is beneficial to system management and maintenance. In an enterprise or organizational environment, when managing a large number of computers, understanding the BIOS boot time of each machine is crucial for system maintenance and management. This helps to develop maintenance plans, predict potential problems, and ensure that all systems are kept in optimal condition.
[0066] There are two main conventional methods for counting BIOS startup time. One is that users can obtain detailed information about the BIOS startup process that may be contained in various system startup logs by viewing and analyzing the relevant logs collected by the BMC, and the BIOS startup time can be indirectly calculated by analyzing these logs. However, this method requires certain system knowledge and log analysis capabilities for statistical personnel. The disadvantages of obtaining the startup time by viewing and analyzing the system startup log are obvious. It is necessary to conduct a comprehensive analysis of the startup log manually. When facing the statistical needs of processing a large number of machine BIOS startup time, the efficiency is low, time-consuming and laborious. The other is to observe and count manually. After the computer is completely shut down and restarted, carefully observe the screen display during the startup process, especially the screen of the BIOS self-test and hardware initialization stage. Pay attention to record the time from pressing the power button to the appearance of the operating system login interface. There are many disadvantages in manually observing and counting the BIOS startup time, including subjectivity and error, limited accuracy, poor repeatability, time-consuming and low efficiency, inability to be automated, and limited by the experience of the observer. It can be seen that the related methods for obtaining the BIOS startup time have the problems of low efficiency and low accuracy. Therefore, an embodiment of the present invention provides a new method for obtaining the boot system startup time.
[0067] In order to enable those skilled in the art to better understand the solution of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific implementation methods. Figure 1A schematic diagram of a device for obtaining boot system startup time provided by an embodiment of the present invention. Figure 1 As shown, the device includes a controller and a processor. The controller and the processor are connected by a hard wire, and the controller can obtain the level signal of the processor pin (i.e., the general purpose input / output (GPIO) control signal). The controller can be a BMC, and the processor can be a central processing unit (CPU). There is no limitation on the number of connecting wires between the controller and the processor (i.e., the number of output pins of the processor), which is determined according to actual conditions. The startup of the boot system usually includes multiple stages. If the startup duration of the boot system is determined according to the duration of each stage, the number of connecting wires between the controller and the processor can be determined according to the number of stages included in the boot system startup process, ensuring that each stage can be characterized by the level signal combination of the processor's output pins, so that the stage of the boot system can be directly determined according to the level signal combination.
[0068] It is worth noting that the controller and the processor generally interact through a communication protocol stack (such as the Intelligent Platform Management Interface (IPMI) protocol). Taking the boot system as BIOS as an example, in the early stages of BIOS such as the Security Phase (SEC) stage, the IPMI protocol stack cannot be initialized, so it is impossible to communicate with the BMC through IPMI. On the other hand, there is a certain delay in transmitting the BIOS boot Stage through the communication protocol stack. Taking the above two factors into consideration, the method provided in the embodiment of the present invention transmits the start and end states of each stage of the BIOS to the BMC through a set of GPIO high and low level states. This method not only has low latency but also is simple in design.
[0069] Figure 2 A flowchart of a method for determining the boot time of a boot system provided by an embodiment of the present invention is applied to a controller in a server, such as Figure 2 As shown, the method includes:
[0070] S10: Acquire the level change time of the pin of the processor connected to the controller and acquire the startup state of the boot system;
[0071] S11: Obtaining the level change time corresponding to the startup state of the guidance system;
[0072] S12: Determine the booting time of the booting system according to the level change time corresponding to the booting state of the booting system.
[0073] When the level of the processor pin changes, a GPIO interrupt of the controller may be triggered. After entering the interrupt, the current time is first read and the current time is used as the level change time of the processor pin. There is no limitation on the method of obtaining the startup status of the boot system.
[0074] Specifically, when obtaining the boot status of the boot system, the various stages included in the boot process of the boot system can be obtained; wherein the stages include various boot stages and the next stage of the boot stage; and then the various stages of the boot process of the boot system are sequentially used as the boot status of the boot system in the order of the boot. This method is suitable for scenarios where multiple stages in the boot process of the boot system cannot be directly distinguished by level signals, such as when there is only one connection line between the controller and the processor, then the level signal has only two conditions, 0 and 1. At this time, the various stages of the boot system startup can be directly used as the boot status of the boot system. Taking BIOS startup as an example, the startup stages in the BIOS startup process include: SEC stage, Pre-EFI Initialization (PEI) stage, Driver Execution Environment (DXE) stage, Boot Device Select (BDS) stage, and after the startup stage, it also includes: Transient System Load (TLS) stage, Run Time (RT) stage, Afterlife (AL) stage, etc. Correspondingly, when obtaining the level change moment corresponding to the startup state of the boot system, the initial level signal corresponds to the SEC stage. When the level signal change is detected, the changed level signal corresponds to the PEI stage, and the moment when the level signal changes is the level change moment corresponding to the PEI stage; when the level signal change is detected again, the changed level signal corresponds to the DXE stage, and the moment when the level signal changes is the level change moment corresponding to the DXE stage.
[0075] In addition to the above-mentioned method of directly using each stage of booting the booting system as the booting system startup state, in order to accurately determine the booting system startup state, before obtaining the booting system startup state, it includes: obtaining the current level value of the pin at the time of level change. Obtaining the booting system startup state includes:
[0076] The boot state of the boot system corresponding to the current level value is determined according to the pre-established correspondence between the pin level value and the boot state of the boot system; wherein the boot state of the boot system is the various stages of the boot process of the boot system, wherein the stages include various startup stages and the next stage of the startup stage.
[0077] Specifically, establishing the corresponding relationship between the pin level value and the startup state of the boot system includes:
[0078] Determine the number of pins of the processor connected to the controller according to the number of stages included in the boot system startup process; wherein the level signal combination of the pins of the processor is greater than the number of startup stages included in the boot system startup process;
[0079] Acquire the boot status of the boot system when the processor is in various level signal combinations;
[0080] A corresponding relationship is established according to each level signal combination and the corresponding startup state of the guidance system.
[0081] This method is suitable for scenarios where multiple stages in the boot system startup process can be distinguished by level signal combinations. For example, there are three connecting lines between the controller and the processor, and the level signals output by each connecting line are 0 and 1. There are 8 possible level signal combinations. At this time, each stage in the BIOS startup phase and the next stage (TLS phase) of the startup phase can be fully characterized by level signal combinations. There is no limitation on the level signal combination corresponding to each stage. At present, the startup phase of BIOS mainly includes four stages: SEC, PEI, DXE and BDS. Using 3 GPIO output pins, the status can be transmitted to the controller with low latency. Table 1 is a correspondence table between a BIOS stage and a GPIO pin combination.
[0082] Table 1
[0083]
[0084] After obtaining the level change time and the level signal combination, in order to avoid interference between types of data, before obtaining the level change time corresponding to the startup state of the boot system, the following is also included:
[0085] Starting from the level signal of the pin of the self-monitoring processor, the level change moments acquired within a preset time length are stored in a first buffer;
[0086] The current level signal combination composed of the current level value of the pin at the moment of level change is stored in the second buffer.
[0087] There is no limitation on the first buffer and the second buffer, as long as the cache addresses are different. There is no limitation on the preset time length either.
[0088] In order to avoid the situation that the boot sequence determined according to the current level signal combination is inconsistent with the standard boot sequence (such as the order of SEC, PEI, DXE, BDS and TLS in the BIOS stage), resulting in the error of the level change time corresponding to the boot state of the boot system obtained. In the implementation, the current level signal combination is read from the second buffer, and the current level signal combination is sorted according to the order of the level change time;
[0089] Determine the current startup sequence of the boot system according to the sequence and corresponding relationship of the current level signal combination;
[0090] Determine whether the current startup sequence is the same as the sequence of each stage of the boot system startup process;
[0091] If not, clear the level change time stored in the first buffer and the current level signal combination stored in the second buffer, and return to the step of obtaining the level change time of the pin of the processor connected to the controller and obtaining the startup state of the boot system;
[0092] If yes, the step of obtaining the level change time corresponding to the startup state of the boot system is entered.
[0093] Take the correspondence between the level signal combination and the corresponding boot system startup state specified in Table 1 as an example. Assume that starting from the BIOS startup trigger, the level change moments of the five stages (the startup stage and the next stage of the startup stage) are t0, t1, t2, t3 and t4 in sequence. If the level signal combination corresponding to t0 is 111 and the level signal combination corresponding to t1 is 100, it is incorrect to directly use t1 as the level change moment corresponding to the PEI stage, because in fact, the level signal combination of 100 corresponds to the BDS stage, that is, t1 should be the level change moment corresponding to the BDS stage. Therefore, first determine whether the current startup sequence is consistent with the sequence of each stage of the boot system startup process. If not, clear the level change moment stored in the first buffer and the current level signal combination stored in the second buffer, and return to the steps of obtaining the level change moment of the pin of the processor connected to the controller and obtaining the boot system startup state; if consistent, read the level change moment from the first buffer, and directly use each level change moment as the level change moment corresponding to each stage of the boot system in the startup process according to the sequence of the level change moments.
[0094] After determining the level change time corresponding to the startup state of the guidance system, in order to clearly understand the duration of each startup stage of the guidance system, in implementation, determining the startup duration of the guidance system according to the level change time corresponding to the startup state of the guidance system includes:
[0095] Obtain the level change moments of two adjacent stages during the boot system startup process;
[0096] Obtaining the time difference between the level change moments of two adjacent stages, and using the time difference as the duration corresponding to the earliest stage of the two adjacent stages, so as to obtain the duration of each startup stage of the guidance system;
[0097] The sum of the durations of the various startup phases in the startup process of the boot system is taken as the startup duration of the boot system.
[0098] If the level change moments of the five stages (the startup stage and the stage after the startup stage) are t0, t1, t2, t3 and t4 respectively, then the duration of the SEC stage is t1-t0, the duration of the PEI stage is t2-t1, the duration of the DXE stage is t3-t2, and the duration of the BDS stage is t4-t3, then the startup duration of the BIOS is t4-t1.
[0099] In order to determine whether each startup phase is normal or abnormal, in implementation, after obtaining the duration of each startup phase of the boot system, the following steps are also included:
[0100] Obtaining the preset duration of each startup phase of the boot system;
[0101] Obtain the difference between the preset duration and the duration of each startup phase respectively;
[0102] Determine whether the difference is within a preset range;
[0103] If yes, then output a prompt message indicating that the boot system is started normally;
[0104] If not, the startup phase in which the difference is not within the preset range is obtained, and prompt information for indicating startup abnormality in the startup phase in which the difference is not within the preset range is output.
[0105] There is no limit on the preset duration and preset range of each startup stage, which are determined based on actual conditions.
[0106] In order to enable those skilled in the art to better understand the solution of the present invention, the method of the present invention will be described below in conjunction with the accompanying drawings and specific embodiments. Figure 3 The present invention provides a flowchart of a method for interrupt processing triggered by a level change. Figure 3 As shown, the method includes:
[0107] S13: trigger control signal interruption;
[0108] S14: Read the current clock and save it sequentially to the first buffer;
[0109] S15: Read the current states of the pins corresponding to the three connecting wires and save them sequentially to the second buffer;
[0110] S16: Release the binary semaphore and activate the task;
[0111] S17: Clear interrupt flag;
[0112] S18: End control signal interruption.
[0113] At the very beginning of each phase, BIOS pulls down or pulls up GPIO according to the combination in Table 1. Initialize the selected three GPIO pins in advance and configure the interrupt. When the level of any of the three selected pins changes, the controller's GPIO interrupt is triggered. After entering the interrupt, the current time is first read and saved in the first buffer, then the current level state combination of the three connection line pins is read and saved in the second buffer address, the binary semaphore is released to activate the data processing task, and finally the interrupt flag is cleared.
[0114] Figure 4 A flowchart of a method for data processing tasks provided by an embodiment of the present invention, such as Figure 4 As shown, the method includes:
[0115] S19: blocking task, obtaining binary semaphore;
[0116] S20: open the file;
[0117] S21: Read the data in the second buffer and save it to the first column of the last row;
[0118] S22: Read the data in the first buffer and save it to the second column of the last row;
[0119] S23: Determine whether the file has only one line of data; if not, proceed to step S24; if yes, proceed to step S28;
[0120] S24: Read the second to last row and second column time data 1;
[0121] S25: Read the second moment data of the last row and the second column;
[0122] S26: Subtracting the moment data 2 from the moment data 1 to obtain the duration data;
[0123] S27: Save the duration data to the third column of the second to last row;
[0124] S28: Close the file.
[0125] After step S28, the process can return to step S19. The data processing task functions are: saving the time and level status data of the buffer area written by the interrupt to a file; calculating the time of the previous stage of BIOS. Figure 4 Describe the data processing task. When the BIOS stage does not switch and the level state of the selected GPIO pin does not change, the task enters the blocking state. When the interrupt releases the binary semaphore and exits, the task is activated. First, open (create) the file; then read the data in the first buffer and the second buffer respectively, save the data in the second buffer, that is, the level signal combination state of the pin, to the first column, and save the data in the first buffer to the second column of the file at the moment; read the moment data of the last row and the second to last row and subtract them to calculate the duration of the previous BIOS stage, and save it to the third column of the second to last row of the file. If the file has only one row of data, the calculation of the duration of the previous BIOS stage will no longer be performed.
[0126] After obtaining the time difference between the level change moments of two adjacent stages and taking the time difference as the duration corresponding to the earliest stage of the two adjacent stages to obtain the duration of each startup stage of the boot system, the method further includes:
[0127] Get the duration of each startup phase;
[0128] The duration of each stage is used as the length of each segment on the stacked bar chart, and the order of the startup stages is used as the order of different segments on the stacked bar chart;
[0129] Compare the duration of the same startup phase in multiple startup processes of the boot system according to the stacked bar chart;
[0130] The stage at which the boot system starts abnormally is determined based on the comparison results.
[0131] For data display, it is necessary to traverse each row of data in the file. If the value of the second column of a row of data is 0b111, the value of the third column of the row is used as the Sec length of a single column of the bar graph; if the value of the second column of the data offset by 1 row is 0b110, the value of the third column of the row is used as the PEI length of a single column of the bar graph, otherwise the drawing of the bar graph for this column is terminated; if the value of the second column of the data offset by 2 rows is 0b101, the value of the third column of the row is used as the DXE length of a single column of the bar graph, otherwise the drawing of the bar graph for this column is terminated; if the value of the second column of the data offset by 3 rows is 0b100, the value of the third column of the row is used as the BDS length of a single column of the bar graph, otherwise the drawing of the bar graph for this column is terminated; if the value of the second column of a row of data is data other than 0b111, 0b110, 0b101, 0b100, the drawing of the bar graph for this column is terminated. The length of each column represents the boot time of the entire BIOS stage, and the divisions inside the column are used to show the time occupied by each BIOS stage. The divisions are arranged from left to right in the order of BIOS booting. The processor displays this stacked bar chart on the web interface. Figure 5 A stacked bar chart of startup time for a four-time startup boot system provided by an embodiment of the present invention. Figure 5 The horizontal axis in the middle represents time, and the vertical axis represents the number of starts. From left to right on each column are the SEC stage (represented by a), PEI stage (represented by b), DXE stage (represented by c), and BDS stage (represented by d).
[0132] In this method, the data stacking relationship of different stages of the boot system is clearly displayed in the form of stacked bar charts. The height of each column represents the boot system startup time, and the division inside the column shows the specific values of each stage of the boot system, making the hierarchy and comparative relationship of the data clear at a glance. Through horizontal comparison, the historical boot data of the boot system can be compared to quickly identify the differences and change trends between each startup. Through the cumulative height of the column, it is possible to intuitively see the time occupied by each stage in the startup, which is helpful for fault diagnosis and helps to provide more readable historical data for time optimization.
[0133] In the method for obtaining the boot system startup time provided by the embodiment of the present invention, the controller can perceive the transformation of each stage of the boot system with low latency, record the time of the boot system stage transformation, calculate the time interval between two adjacent state transformations, and accurately obtain the time occupied by each stage of the boot system without the help of external instruments. In the early stage of BIOS, effective communication with the controller has not been established, and the method can simply and directly transmit the BIOS state to the controller. That is, the time occupied by each stage of the boot system can be obtained without relying on external tools, which greatly simplifies the steps, and is not limited by the communication between the early stage of BIOS and the controller. The state is simply and directly transmitted to the controller, making the data statistics of this stage more accurate. And the data display method provided uses a stacked bar chart to display the boot system startup time of each time. The method can intuitively display the total time occupied by each boot system startup, and can also display the time occupied by each stage. By comparing the historical data of the startup, it is possible to quickly screen out the startup that may have abnormalities, and it is also possible to quickly locate the boot system startup stage where the abnormality is located by comparing the segmentation in the stacked bar chart, that is, the occupancy time of a specific stage.
[0134] In the above embodiments, the method for determining the boot system startup duration is described in detail, and the present invention also provides embodiments corresponding to the server and the device for determining the boot system startup duration. It should be noted that the present invention describes the embodiments of the device part from two perspectives, one is based on the functional module perspective, and the other is based on the hardware perspective.
[0135] A server provided by an embodiment of the present invention, based on the perspective of functional modules, includes:
[0136] A first acquisition module, used to acquire the level change time of the pin of the processor connected to the controller and to acquire the startup state of the boot system;
[0137] A second acquisition module is used to acquire the level change time corresponding to the startup state of the guidance system;
[0138] The determination module is used to determine the startup duration of the guidance system according to the level change moment corresponding to the startup state of the guidance system.
[0139] In some embodiments, the server further comprises:
[0140] The third acquisition module is used to obtain the current level value of the pin at the moment of level change.
[0141] In some embodiments, the server further comprises:
[0142] A first storage module, configured to store the level change moments acquired within a preset time period in a first buffer starting from the level signal of the pin of the self-monitoring processor;
[0143] A second storage module, used for storing a current level signal combination composed of the current level value of the pin at the moment of level change in a second buffer;
[0144] A reading and sorting module, used for reading the current level signal combination from the second buffer, and sorting the current level signal combination according to the order of level change moments;
[0145] A first determination module, used to determine the current startup sequence of the guidance system according to the sequence and corresponding relationship of the current level signal combination;
[0146] The first judgment module is used to judge whether the current startup sequence is the same as the sequence of each stage of the boot system startup process; if not, the clearing module is triggered, and if so, the second acquisition module is triggered;
[0147] The clearing module is used to clear the level change moment stored in the first buffer and the current level signal combination stored in the second buffer, and return to trigger the first acquisition module.
[0148] The second acquisition module is specifically used for: reading the level change time from the first buffer; and taking each level change time as the level change time corresponding to each stage of the boot system in the startup process according to the sequence of the level change times.
[0149] In some embodiments, the server further comprises:
[0150] A fourth acquisition module is used to acquire a preset duration of each startup phase of the guidance system;
[0151] A fifth acquisition module, used to respectively acquire the difference between the preset duration and the duration of each startup phase;
[0152] A second judgment module is used to judge whether the difference is within a preset range; if so, the first output module is triggered; if not, the second output module is triggered;
[0153] A first output module, used for outputting prompt information for indicating that the boot system is started normally;
[0154] The second output module is used to obtain the startup stage when the difference is not within the preset range, and output prompt information for indicating startup abnormality in the startup stage when the difference is not within the preset range.
[0155] Since the embodiments of the apparatus part correspond to the embodiments of the method part, please refer to the description of the embodiments of the method part for the embodiments of the apparatus part, which will not be repeated here.
[0156] Figure 6This is a structural diagram of a device for determining the boot time of a boot system provided by another embodiment of the present invention. This embodiment is based on the hardware perspective, such as Figure 6 As shown, the device for determining the boot time of the boot system includes:
[0157] A memory 20, used for storing computer programs;
[0158] The processor 21 is used to implement the steps of the method for determining the booting time length of the booting system mentioned in the above embodiment when executing the computer program.
[0159] Among them, the processor 21 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 21 can be implemented in at least one hardware form of a digital signal processor (DSP), a field-programmable gate array (FPGA), and a programmable logic array (PLA). The processor 21 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a CPU; the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 21 may be integrated with a graphics processing unit (GPU), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 21 may also include an artificial intelligence (AI) processor, which is used to process computing operations related to machine learning.
[0160] The memory 20 may include one or more computer-readable storage media, which may be non-transitory. The memory 20 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In this embodiment, the memory 20 is at least used to store the following computer program 201, wherein, after the computer program is loaded and executed by the processor 21, it can implement the relevant steps of the method for determining the boot system startup time length disclosed in any of the aforementioned embodiments. In addition, the resources stored in the memory 20 may also include an operating system 202 and data 203, etc., and the storage method may be temporary storage or permanent storage. Among them, the operating system 202 may include Windows, Unix, Linux, etc. The data 203 may include, but is not limited to, the data involved in the method for determining the boot system startup time length mentioned above, etc.
[0161] In some embodiments, the device for determining the booting time of the booting system may further include a display screen 22 , an input / output interface 23 , a communication interface 24 , a power supply 25 , and a communication bus 26 .
[0162] Those skilled in the art will understand that Figure 6 The structure shown in the figure does not constitute a limitation on the device for determining the boot time of the boot system, and may include more or fewer components than those shown in the figure.
[0163] The device for determining the boot system startup duration provided by an embodiment of the present invention includes a memory and a processor. When the processor executes the program stored in the memory, it can implement the following method: the method for determining the boot system startup duration, the effect is the same as above.
[0164] An embodiment of the present invention further provides a computer program product, including a computer program / instruction, which implements the steps of the above-mentioned method for determining the boot system startup duration when executed by a processor.
[0165] Finally, the present invention also provides an embodiment corresponding to a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps recorded in the above method embodiment are implemented.
[0166] It is understandable that if the method in the above embodiment is implemented in the form of 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 part 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 the computer software product is stored in a storage medium to execute all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc. Various media that can store program codes.
[0167] The computer-readable storage medium provided by the present invention includes the above-mentioned method for determining the boot system startup duration, and the effect is the same as above.
[0168] The above is a detailed introduction to a method for determining the boot system startup duration provided by the present invention, a server, a device and a medium. The various embodiments in the specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same and similar parts between the embodiments can be referenced to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description. It should be pointed out that for ordinary technicians in this technical field, without departing from the principle of the present invention, several improvements and modifications can be made to the present invention, and these improvements and modifications also fall within the scope of protection of the present invention.
[0169] It should also be noted that, in this specification, 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 "comprise", "include" 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, an element defined by the statement "comprises a ..." does not exclude the presence of other identical elements in the process, method, article or device including the element.
Claims
1. A method for determining the boot time of a boot system, characterized in that: A controller applied to a server, the method comprising: Obtaining the level change time of the pin of the processor connected to the controller and obtaining the startup state of the boot system; Obtain the level change time corresponding to the startup state of the guidance system; The booting time of the booting system is determined according to the level change time corresponding to the booting state of the booting system.
2. The method for determining the boot time of a boot system according to claim 1, characterized in that: The obtaining of the startup status of the guidance system comprises: Acquire each stage included in the boot system startup process; wherein the stage includes each startup stage and a stage after the startup stage; The various stages of the boot system startup process are sequentially used as the startup state of the boot system according to the startup sequence.
3. The method for determining the boot time of a boot system according to claim 1, characterized in that: Before obtaining the startup status of the boot system, the method further includes: Get the current level value of the pin at the moment of level change; The obtaining of the startup status of the guidance system comprises: The boot state of the boot system corresponding to the current level value is determined according to the pre-established correspondence between the pin level value and the boot state of the boot system; wherein the boot state of the boot system is the various stages of the boot process of the boot system, wherein the stages include various startup stages and the next stage of the startup stage.
4. The method for determining the boot time of a boot system according to claim 3, characterized in that: Establishing the correspondence between the pin level value and the boot system startup state includes: Determining the number of pins of the processor connected to the controller according to the number of stages included in the boot system startup process; wherein the level signal combination of the pins of the processor is greater than the number of startup stages included in the boot system startup process; Acquire the startup state of the guidance system when the processor is in each level signal combination; The corresponding relationship is established according to each level signal combination and the corresponding startup state of the guidance system.
5. The method for determining the boot time of a boot system according to claim 4, characterized in that: Before the step of acquiring the level change moment corresponding to the startup state of the guidance system, the step further includes: Starting from monitoring the level signal of the pin of the processor, the level change moment acquired within a preset time length is stored in a first buffer; The current level signal combination composed of the current level value of the pin at the moment of level change is stored in the second buffer; Reading current level signal combinations from the second buffer, and sorting the current level signal combinations according to the order of level change moments; Determining the current startup sequence of the guidance system according to the sequence of the current level signal combinations and the corresponding relationship; Determining whether the current startup sequence is the same as the sequence of each stage of the boot system startup process; If not, clearing the level change time stored in the first buffer and the current level signal combination stored in the second buffer, and returning to the step of obtaining the level change time of the pin of the processor connected to the controller and obtaining the startup status of the boot system; If yes, then enter the step of obtaining the level change time corresponding to the startup state of the guidance system; The step of obtaining the level change time corresponding to the startup state of the guidance system includes: Reading the level change time from the first buffer; According to the sequence of the level change moments, each level change moment is used as the level change moment corresponding to each stage of the boot system in the startup process.
6. The method for determining the boot time of a boot system according to any one of claims 2 to 5, characterized in that: Determining the boot time of the guidance system according to the level change time corresponding to the boot state of the guidance system includes: Obtain the level change moments of two adjacent stages during the boot system startup process; Obtaining the time difference between the level change moments of two adjacent stages, and using the time difference as the duration corresponding to the earliest stage of the two adjacent stages, so as to obtain the duration of each startup stage of the guidance system; The sum of the durations of the various startup phases in the startup process of the boot system is used as the startup duration of the boot system.
7. The method for determining the boot time of a boot system according to claim 6, characterized in that: After obtaining the duration of each booting stage of the booting system, it also includes: Obtaining the preset duration of each startup phase of the boot system; Obtain the difference between the preset duration and the duration of each startup phase respectively; Determining whether the difference is within a preset range; If yes, output a prompt message indicating that the boot system is started normally; If not, the startup phase in which the difference is not within the preset range is obtained, and prompt information indicating startup abnormality in the startup phase in which the difference is not within the preset range is output.
8. A server, characterized in that: include: A first acquisition module, used to acquire the level change time of the pin of the processor connected to the controller and to acquire the startup state of the boot system; A second acquisition module is used to acquire the level change time corresponding to the startup state of the guidance system; The determination module is used to determine the startup duration of the guidance system according to the level change moment corresponding to the startup state of the guidance system.
9. A device for determining the boot time of a boot system, characterized in that: include: Memory for storing computer programs; A processor, configured to implement the steps of the method for determining the boot system startup duration as described in any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method for determining the boot system startup duration according to any one of claims 1 to 7 are implemented.