Method and apparatus for acquiring startup log, and method for transmitting startup log

By determining the fixed memory space in the server memory module to store the boot log and judging the operating status according to the log type, the problem of low efficiency in collecting boot logs in the existing technology is solved, and the boot logs are quickly obtained and transmitted, which improves the efficiency of abnormal analysis.

WO2024244642A1PCT designated stage expired Publication Date: 2024-12-05INSPUR SUZHOU INTELLIGENT TECH CO LTD

Patent Information

Application Number
PCT/CN2024/083375
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-05-26
Filing Date
2024-03-22
Publication Date
2024-12-05

AI Technical Summary

Technical Problem

The prior art is inefficient and long-term when collecting server boot logs, especially when the server is running abnormally, it cannot effectively obtain boot logs, resulting in inefficient analysis of the causes of the abnormality.

Method used

By determining the fixed memory space used to store the boot log in the server's memory stick, and determining the operating status of the server based on whether there is a self-test log in the boot log, the boot log is actively transmitted during normal operation and through the motherboard during abnormal operation The management controller obtains logs of memory space to avoid restart and reproduction operations.

Benefits of technology

It realizes that when the server is running abnormally, it can obtain recorded boot logs without reproduction operation, save resources, reduce the time to obtain boot logs, and improve the efficiency of server problem analysis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024083375_05122024_PF_FP_ABST
    Figure CN2024083375_05122024_PF_FP_ABST
Patent Text Reader

Abstract

A method for acquiring a startup log. The method comprises: determining an operation state of a target device, wherein the operation state indicates normal operation or abnormal operation; if the operation state indicates normal operation, acquiring a startup log from a first target memory device in a baseboard management control system of the target device, wherein the first target memory device is a volatile memory device, and the startup log comprises all logs of the target device in a startup process; and if the operation state indicates abnormal operation, acquiring the startup log from a second target memory device in the target device, wherein the second target memory device is a memory device in the target device. In this way, the technical problems of the efficiency of startup log collection being low and the startup log collection taking a long time due to the fact that a startup log is collected by means of operations of restarting a server, updating firmware, reproducing an abnormal phenomenon, etc., in the related art are solved. Further provided are an apparatus for acquiring a startup log, and a method for transmitting a startup log.
Need to check novelty before this filing date? Find Prior Art

Description

Method and device for obtaining boot log, and method for transmitting boot log

[0001] CROSS-REFERENCE TO RELATED APPLICATIONS

[0002] This application claims priority to a Chinese patent application filed with the Patent Office of China on May 26, 2023, with application number 2023106079389 and entitled “Method and device for obtaining boot log, method for transmitting boot log”, the entire contents of which are incorporated herein by reference. Technical Field

[0003] The present application relates to the technical field of data transmission, and in particular, to a method and device for obtaining a boot log, and a method for transmitting a boot log. Background Art

[0004] The Basic Input Output System (BIOS) boot log is a log information used to record the boot status during the server boot process, from the time the server is powered on to the time the operating system (OS) is started. The boot log contains the information and results of the central processing unit (CPU), memory devices, and input and output (I / O) device initialization process, the information loaded by the driver, and the BIOS developer's custom function module information. Therefore, the BIOS boot log is of great significance to server operation and maintenance, for the status monitoring of the server, and error diagnosis and analysis. However, in the related art, the boot log is obtained by updating the firmware and reproducing the abnormal phenomenon of the server. Therefore, there is a problem of wasting resources caused by the need to perform multiple reproduction operations and not being able to collect effective boot logs due to the inability to reproduce the abnormal phenomenon.

[0005] To address the above-mentioned problems, no effective solutions have been proposed so far.

[0006] Summary of the Invention

[0007] The embodiments of the present application provide a method and device for obtaining a boot log, and a method for transmitting a boot log, so as to at least solve the technical problems of low efficiency and long time in collecting boot logs caused by related technologies collecting boot logs through operations such as restarting the server, updating firmware, and reproducing abnormal phenomena.

[0008] According to one aspect of an embodiment of the present application, a method for obtaining a boot log is provided, comprising: determining an operating status of a target device, wherein the operating status includes: normal operation and abnormal operation; if the operating status is normal operation, obtaining a boot log from a first target memory device in a baseboard management control (BMC) system of the target device, wherein the first target memory device is a volatile memory device, and the boot log is a complete log of the target device during the boot process; if the operating status is abnormal operation, obtaining a boot log from a second target memory device in the target device, wherein the second target memory device is a non-volatile memory device in the target device.

[0009] Optionally, an intelligent platform management interface IPMI command is received, and in response to the IPMI command, a timing program is started and timing is started, wherein the timing duration is a preset duration; the first target memory device is detected within the preset duration, a detection result is obtained, and the operating status of the target device is determined based on the detection result.

[0010] Optionally, the detection result includes: the first target memory device receives the boot log within a preset time period, and the first target memory device does not receive the boot log within the preset time period.

[0011] Optionally, the operating status of the target device is determined based on the detection result, including: if the detection result indicates that the first target memory device receives the boot log within the preset time, determining that the operating status of the target device is normal; if the detection result indicates that the first target memory device does not receive the boot log within the preset time, determining that the operating status of the target device is abnormal.

[0012] Optionally, the method for obtaining the boot log further includes: after detecting that the first target memory device receives the boot log within a preset time period, stopping timing and resetting a timing program.

[0013] Optionally, obtaining the boot log from a second target memory device in the target device includes: determining a second target area for storing the boot log in the second target memory device; and dumping the second target area through an extended interface to obtain the boot log.

[0014] Optionally, determining a second target area for storing a boot log in a target device includes: receiving a first address and a data capacity of the second target area, wherein the data capacity is a maximum amount of data that can be stored in the second target area; determining an end address of the second target area based on the first address and the data capacity; and determining the space from the first address to the end address in the second target memory device as the second target area.

[0015] Optionally, obtaining the boot log from a first target memory device in a BMC system of the target device includes: determining a target storage area from the first target memory device, wherein the target storage area is a pre-agreed storage area dedicated to storing the boot log; and reading the boot log from the target storage area.

[0016] Optionally, after obtaining the boot log from the first target memory device in the BMC system of the target device, the method further includes: transferring the boot log to a third target memory device, wherein the third target memory device is a non-volatile storage device in the BMC system.

[0017] According to another aspect of an embodiment of the present application, a method for transmitting a boot log is provided, including: determining a second target area, wherein the second target area is used to store the boot log, and the boot log is all logs of the target device during the boot process; determining the operating status of the target device based on the type of log in the boot log written to the second target area within a preset time period, wherein the operating status includes normal operation and abnormal operation; and transmitting the boot log in a method corresponding to the operating status.

[0018] Optionally, the boot log is transmitted in a method corresponding to the operating status, including: if there is a log of the target type in the boot log written to the second target area within a preset time period, after the log of the target type is written to the second target area, the boot log is transmitted to the first target memory device.

[0019] Optionally, determining the second target area includes: determining a first address of the second target area and a data capacity of the second target area, wherein the data capacity is a maximum amount of data stored in the second target area; determining an end address of the second target area based on the first address and the data capacity; and determining the space from the first address to the end address in the second target memory device as the second target area.

[0020] Optionally, after determining the second target area, the method for transmitting the boot log includes: sending the first address and data capacity to the BMC system in the target device through an IPMI command.

[0021] Optionally, the operating status of the target device is determined based on the type of log in the boot log written to the second target area within a preset time period, including: reading the boot log written to the second target area within the preset time period, and determining the type of each log in the boot log; if there is no log of the target type in the boot log, determining that the operating status of the target device is abnormal operation, wherein the log of the target type is a log indicating that the target device has completed self-test; if there is a log of the target type in the boot log, determining that the operating status of the target device is normal operation.

[0022] Optionally, the boot log is transmitted in a method corresponding to the operating status, including: if the operating status of the target device is normal operation, after determining that the target type of log is written in the second target area, determining a first target memory device in the BMC system of the target device, wherein the first target memory device is a volatile memory device; and writing the boot log to the first target memory device by direct memory read DMA.

[0023] Optionally, determining the first target memory device in the BMC system of the target device includes: determining multiple volatile memory devices that transmit data with the target device through a peripheral component interconnect express (PCIe) link; and determining a volatile memory device that communicates data with the BMC system among the multiple volatile memory devices as the first target memory device.

[0024] Optionally, the boot log is written to the second target memory device by the following method: determining the number of bytes of the first boot log to be written, and determining a new address based on the first address and the number of bytes, wherein the first boot log to be written is the log in the boot log that is currently to be written to the second target area, the new address is the starting address of the second boot log to be written to the second target area after the first boot log to be written is written to the second target area, and the second boot log to be written is the next log to be written to the first boot log; comparing the new address with the last address to obtain a comparison result; if the new address is greater than the last address, refusing to write the first boot log to the second target area; if the new address is less than or equal to the last address, allowing the first boot log to be written to the second target area.

[0025] Optionally, the method for transmitting the boot log further includes: modifying the read object of the second target area from the basic input and output system BIOS of the target device and the operating system of the target device to the BIOS of the target device.

[0026] According to another aspect of an embodiment of the present application, a server is further provided, comprising: a BMC, a BIOS module, and a memory device, wherein the memory device is configured to store a boot log of the server; the BIOS module is configured to transfer the boot log in the memory device to the BMC when the server is operating normally; and the BMC is configured to dump the boot log from the memory device when the server is operating abnormally.

[0027] Optionally, the BIOS module is further configured to send the boot log to the BMC in a DMA manner.

[0028] Optionally, the BMC is further configured to obtain a boot log from a memory device through an expansion interface, and store the boot log in a non-volatile storage device of the BMC.

[0029] According to another aspect of an embodiment of the present application, a method for transmitting a boot log is also provided, including: determining a first target memory device, wherein the first target memory device is a volatile memory device in a management system of the target device; receiving a boot command, and starting a timing program according to the boot command, wherein the timing program is used to control the target device to perform timing for a preset duration; determining an operating status of the target device according to an operating result of the timing program, wherein the operating status includes normal operation and abnormal operation; transmitting the boot log in a method corresponding to the operating status, wherein the boot log is a complete log of the target device during the boot process.

[0030] According to another aspect of an embodiment of the present application, a device for obtaining a boot log is also provided, including: a determination module, configured to determine the operating status of a target device, wherein the operating status includes: normal operation and abnormal operation; a first acquisition module, configured to obtain a boot log from a first target memory device in a baseboard management control (BMC) system of the target device when the operating status is normal operation, wherein the first target memory device is a volatile memory device, and the boot log is a complete log of the target device during the boot process; a second acquisition module, configured to obtain a boot log from a second target memory device in the target device when the operating status is abnormal operation, wherein the second target memory device is a non-volatile memory device in the target device.

[0031] According to another aspect of an embodiment of the present application, a non-volatile readable storage medium is also provided, in which a computer program is stored. The device where the non-volatile readable storage medium is located executes the above-mentioned method for obtaining a boot log and the method for transmitting a boot log by running the computer program.

[0032] According to another aspect of an embodiment of the present application, an electronic device is also provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to execute the above-mentioned method for obtaining a boot log and the method for transmitting a boot log through the computer program.

[0033] In an embodiment of the present application, the operating status of the target device is determined, where the operating status includes: normal operation and abnormal operation; if the operating status is normal operation, the boot log is obtained from the first target memory device in the baseboard management control BMC system of the target device, where the first target memory device is a volatile memory device, and the boot log is the entire log of the target device during the boot process; if the operating status is abnormal operation, the boot log is obtained from the second target memory device in the target device, where the second target memory device is a non-volatile memory device in the target device, and the boot log is stored in the fixed memory space by determining the fixed memory space in the memory bar of the server. The invention can realize the technical effect of improving the efficiency of analyzing server problems by storing all logs of the server startup process in a fixed memory space; achieving the purpose of obtaining all logs of the server startup process; providing different startup log transmission methods for different operating states of the server, achieving the purpose of obtaining the startup log recording the abnormal operation when the server is running abnormally without the need for reproducing the operation, thereby achieving the purpose of saving resources and reducing the time of obtaining the startup log, thereby achieving the technical effect of improving the efficiency of analyzing server problems, and further solving the technical problem of low efficiency and long time of collecting startup logs caused by related technologies collecting startup logs through operations such as restarting the server, updating the firmware and reproducing the abnormal phenomenon. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0035] FIG1 is a flow chart of a method for obtaining a boot log according to an embodiment of the present application;

[0036] FIG2 is a flow chart of a method for transmitting a boot log according to an embodiment of the present application;

[0037] FIG3 is a structural diagram of a server according to an embodiment of the present application;

[0038] FIG4 is a flow chart of a server transmitting a boot log according to an embodiment of the present application;

[0039] FIG5 is a flowchart of another method for transmitting a boot log according to an embodiment of the present application;

[0040] FIG6 is a structural diagram of an apparatus for obtaining a boot log according to an embodiment of the present application. DETAILED DESCRIPTION

[0041] In order to enable those skilled in the art to better understand the present invention, the following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the drawings 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 in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of this application.

[0042] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in a sequence other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0043] In order to better understand the embodiments of the present application, the technical terms involved in the embodiments of the present application are explained as follows:

[0044] BIOS: A set of programs stored on a flash memory chip on the motherboard. It stores the computer's most important basic input and output programs, system settings, power-on self-test programs, and system bootstrap programs. BIOS is the first program loaded when the computer starts, initializes itself before the operating system runs, and checks and sets parameters for various hardware.

[0045] Boot log: The BIOS is loaded first when the computer starts. Therefore, the system log output by the BIOS during the computer boot process is called the boot log. The boot log includes the names and models of devices such as the processor, memory, hard drive, and display adapter, as well as their status and performance parameters. It also includes information such as errors, warnings, or prompts that appear during the computer boot process.

[0046] Baseboard Manager Controller (BMC): An independent system that does not rely on other system hardware (such as the CPU, memory, etc.), nor does it rely on the BIOS or OS. The BMC can interact with the BIOS to better manage the platform. As a server platform management system, the BMC can communicate with the BIOS in various ways.

[0047] Volatile memory device: A memory device, such as random-access memory (RAM), that retains its stored data through a continuous power supply. When the power is turned off, all data in a volatile memory device is cleared.

[0048] Non-volatile memory device: A memory device with persistent storage capabilities that can retain its stored data when power is turned off or restore its original stored data after power is restored; it is designed to retain data long-term.

[0049] Watchdog: An electronic or software timer.

[0050] IO operation: Data transmission between the CPU and external devices (such as disks and networks) requires processing by the I / O controller and other hardware devices, and is relatively slow.

[0051] Memory read and write operations: The CPU directly exchanges data with the memory device; reading or writing is performed by accessing the memory address.

[0052] Dump: Copy, move, or back up data from one storage device or system to another. Dumping can save files on disk to an external device (such as a USB drive) or make a complete copy of an entire database and save it on another server.

[0053] In the related art, when collecting boot logs, it is necessary to update the BIOS firmware or use the BIOS debugging function to restart the server where the BIOS is located, and then collect the boot log during the server restart process. Therefore, there is a problem that only the server's immediate boot log can be collected, and past boot logs cannot be obtained. In addition, when the server has an abnormal operation, the server's boot process is interrupted, and the boot log recording the server's abnormal information can only be obtained by reproducing the server's abnormal state. Therefore, it takes a long time to collect the boot log recording the server's abnormal information, resulting in low efficiency in analyzing the cause of the server abnormality; and the inability to reproduce the server's abnormal state makes it impossible to collect valid boot logs, and thus it is impossible to analyze the cause of the server abnormality. In order to solve this problem, the embodiment of the present application provides two different boot log transmission methods for the two operating states of the server. A fixed memory space for storing the boot log is determined in the memory bar of the server, the boot log of the server is stored in the fixed space, and the operating state of the server is judged by whether there is a self-test log (BIOS Post Complete) in the boot log of the server. When it is determined that the server is operating normally, the memory space actively transmits the boot log; when it is determined that the server is operating abnormally, the log of the memory space is obtained through the baseboard management controller (BMC) on the server motherboard; thereby, the above-mentioned problem can be solved, which is described in detail below.

[0054] According to an embodiment of the present application, a method embodiment of a method for transmitting a boot log is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0055] FIG1 is a flow chart of a method for obtaining a boot log according to an embodiment of the present application. As shown in FIG1 , the method includes the following steps:

[0056] Step S102: determining the operating status of the target device, where the operating status includes: normal operation and abnormal operation.

[0057] In the embodiments of the present application, a server is used as the target device, and the method for transmitting the server's BIOS boot log is explained in detail by collecting the server's boot log. The server, or any computer's motherboard, includes a memory device (e.g., a memory stick), a flash memory chip capable of transferring data with the memory device and having the BIOS program written therein, and a baseboard management (BMC) system capable of interacting with the memory device. In step S102, the BMC determines whether the server (i.e., the target device) is operating normally or abnormally during the boot process.

[0058] According to an optional embodiment of the present application, determining the operating status of the target device includes: receiving an intelligent platform management interface IPMI command, responding to the IPMI command, starting a timing program and starting timing, wherein the timing duration is a preset duration; detecting a first target memory device within the preset duration, obtaining a detection result, and determining the operating status of the target device based on the detection result.

[0059] Under normal operation, the server (i.e., the target device) will transmit the boot log to a volatile memory device (i.e., the first target memory device) in the server (i.e., the target device) after completing the self-test. In this embodiment, the BMC determines the operating status of the server by detecting whether the server receives the boot log within a preset time period. An optional method is as follows: after the server is powered on and the BIOS code is loaded to complete the initialization of the server, the BIOS sends a startup command to the BMC in the form of an IPMI command. After receiving the startup command, the BMC starts executing a watchdog (i.e., a timing program) to count within a preset time period. While counting, the BMC detects whether the above-mentioned volatile memory device (i.e., the first target memory device) has received the boot log, and determines the operating status of the server based on the detection result.

[0060] According to another optional embodiment of the present application, the operating status of the target device is determined based on the detection result, including: if the detection result indicates that the first target memory device receives the boot log within the preset time, determining that the operating status of the target device is normal operation; if the detection result indicates that the first target memory device does not receive the boot log within the preset time, determining that the operating status of the target device is abnormal operation.

[0061] In this embodiment, the detection results (i.e., operation results) output by the watchdog include the following two types: the first type indicates that the volatile memory device (i.e., the first target memory device) received the boot log within a preset time period; the second type indicates that the volatile memory device (i.e., the first target memory device) did not receive the boot log within the preset time period. If the detection result output by the watchdog is the first type, it indicates that the server (i.e., the target device) was able to boot successfully, and the target device is determined to be operating normally; otherwise, if the detection result output by the watchdog is the second type, it indicates that the server's boot process was interrupted, and the target device is determined to be operating abnormally.

[0062] Step S104 , if the operation status is normal, obtain a boot log from a first target memory device in a baseboard management control (BMC) system of the target device, wherein the first target memory device is a volatile memory device, and the boot log is a complete log of the target device during the boot process.

[0063] The server (i.e., the target device) stores the boot log generated during the boot process in a non-volatile memory device (i.e., the second target memory device) in the server, such as a memory stick, from the time the server (i.e., the target device) is powered on to the time the boot process is completed. Therefore, in step S104, if the server (i.e., the target device) performs the boot process normally (i.e., operates normally), then after the server completes the self-test, the server transfers the boot log stored in the server's non-volatile memory device (i.e., the second target memory device) to a volatile memory device (i.e., the first target memory device) in the BMC (Host to BMC Bridge, H2B). Therefore, when the server is operating normally, the boot log is extracted from the volatile memory device (i.e., the first target memory device) in the BMC system. The boot log records information such as errors, warnings, or prompts that occur during the server boot process, as well as information such as the model and name of the electronic device in the server.

[0064] According to some optional embodiments of the present application, obtaining a boot log from a first target memory device in a BMC system of a target device includes: determining a target storage area from the first target memory device, wherein the target storage area is a pre-agreed storage area dedicated to storing the boot log; and reading the boot log from the target storage area.

[0065] In some embodiments, before reading from the volatile memory device in the BMC system (i.e., the first target memory device), H2B is first addressed, and the area for storing the boot log (i.e., the target storage area) agreed upon by the BMC and BIOS is searched in H2B, and the address of the area for storing the boot log (i.e., the target storage area) is determined. Subsequently, when the server (i.e., the target device) is running normally, the boot log is read from the area indicated by the address.

[0066] According to other optional embodiments of the present application, after obtaining the boot log from the first target memory device in the BMC system of the target device, the method for obtaining the boot log also includes: transferring the boot log to a third target memory device, wherein the third target memory device is a non-volatile storage device in the BMC system.

[0067] In other embodiments, the purpose of obtaining the boot log is to preserve it long-term so that it can be used to analyze the server later. Since non-volatile memory devices cannot store data long-term and are prone to data loss, to preserve the boot log long-term, after obtaining the boot log from the volatile memory device of the BMC (i.e., the first target memory device), it is stored in a non-volatile memory device in the BMC system that is only accessible to the BMC (i.e., the third target memory device).

[0068] It should be noted that the boot logs obtained in the embodiments of the present application are ultimately stored in a non-volatile memory device (i.e., the third target memory device) in the BMC system that only the BMC is allowed to access. Therefore, the boot logs in the non-volatile memory device (i.e., the second target memory device) in the server will also ultimately be stored in a non-volatile memory device (i.e., the third target memory device) in the BMC system that only the BMC is allowed to access.

[0069] According to an optional embodiment of the present application, the method for obtaining the boot log further includes: after detecting that the first target memory device receives the boot log within a preset time period, stopping timing and resetting a timing program.

[0070] In this embodiment, if the server (i.e., the target device) is operating normally, when it is detected that the volatile memory device (i.e., the first target memory device) has received the boot log, the timing operation in the current watchdog is stopped to output the detection result that the target device is operating normally. At the same time, the watchdog in the BMC is reset and the timing program is restored to the default value to ensure that the next timing still starts from 0.

[0071] Step S106 : if the operation status is abnormal operation, obtain a boot log from a second target memory device in the target device, wherein the second target memory device is a non-volatile memory device in the target device.

[0072] In step S106, if the server (i.e., the target device) has not completed the boot process (i.e., it operates abnormally), the boot log is still stored in the above-mentioned non-volatile memory device (i.e., the second target memory device). At this time, the BMC actively obtains the server's boot log from the above-mentioned non-volatile memory device (i.e., the second target memory device).

[0073] It should be noted that the non-volatile memory device in the server (i.e., the second target memory device) can be a hardware storage device such as a memory stick. The storage device is divided into an exclusive area for storing the boot log, and the exclusive area for storing the boot log only allows the server's basic input and output system BIOS to access and modify it, but does not allow the server's source operating system (OS) to access and modify it; the exclusive area is invisible to the OS.

[0074] According to an optional embodiment of the present application, obtaining a boot log from a second target memory device in a target device includes: determining a second target area for storing the boot log in the second target memory device; and dumping the second target area through an extended interface to obtain the boot log.

[0075] In this embodiment, when a server (i.e., the target device) experiences an abnormal operation, the BMC proactively retrieves the boot log from the target device's non-volatile memory device (the second target memory device). When accessing the second target memory device, the BMC first determines the memory space dedicated to storing the boot log (i.e., the second target area) within the second target memory device. It then invokes an interface on the BMC's communication chip to dump the memory space in the target device's memory device, enabling memory read and write operations. For example, the boot log can be dumped via the remote extended debug port (XDP).

[0076] According to an optional embodiment of the present application, determining a second target area for storing a boot log in a target device includes: receiving a first address and a data capacity of the second target area, wherein the data capacity is a maximum amount of data stored in the second target area; determining an last address of the second target area based on the first address and the data capacity; and determining the space from the first address to the last address in the second target memory device as the second target area.

[0077] After the server is powered on and initialized, the BIOS determines a memory space (i.e., a second target area) dedicated to storing the server's boot log in the non-volatile memory device (the second target memory device) of the target device, and after determination, sends the starting address (first address) and the maximum data storage capacity (i.e., data capacity) of the memory space (i.e., the second target area) to the BMC. In this embodiment, after receiving the starting address (first address) and data capacity sent by the BIOS, the BMC converts the first address and data capacity into the same base, and based on this, determines the ending address (last address) of the memory space (i.e., the second target area) dedicated to storing the server's boot log; subsequently, when the server operates abnormally, when the BMC reads the boot log from the non-volatile memory device (the second target memory device) of the target device, the starting address (first address) is used as the starting position for reading the boot log, and the ending address (last address) is used as the ending position for reading the boot log; and only the data in the memory segment from the starting address (first address) to the ending address (last address) is read. For example, if the BMC receives a starting address of 0x10000000 and a data capacity of 2 megabytes (MBytes), then after receiving 0x10000000 and 2M, the BMC first converts 2M into hexadecimal form, namely, 0x200000, and then calculates the sum of the starting address 0x10000000 and the data capacity 0x200000. The sum of the starting address and the data capacity is the final address, which is 0x102000000. When the BMC reads data from the non-volatile memory device of the target device (the second target memory device), it only reads the data between the two addresses 0x10000000 and 0x102000000.

[0078] Through the above steps, the method of transmitting logs is replaced by memory read and write operations instead of traditional IO operations. When the target device's operating status is abnormal, there is no need to restart, change firmware, change firmware configuration, etc., which reduces dependence on firmware. There is no need to perform reproduction operations, which increases the speed of transmitting boot logs and thus increases the speed of analyzing the cause of the abnormal operating status of the target device.

[0079] FIG2 is a flow chart of a method for transmitting a boot log according to another aspect of an embodiment of the present application. As shown in FIG2 , the method includes the following steps:

[0080] Step S202 : determining a second target area, wherein the second target area is used to store a boot log, which is a complete log of the target device during the boot process.

[0081] For the BIOS, in step S202, the BIOS determines a memory space (i.e., a second target area) in the memory device of the server (i.e., the target device) for storing all system logs (i.e., boot logs) of the target device during the boot process; wherein, the memory device of the target device is a non-volatile memory device, and the boot log records information such as errors, warnings, or prompts that occur during the boot process of the server; and also records information such as the model and name of the electronic equipment in the server.

[0082] According to an optional embodiment of the present application, determining the second target area includes: determining a first address of the second target area and a data capacity of the second target area, wherein the data capacity is a maximum amount of data stored in the second target area; determining an end address of the second target area based on the first address and the data capacity; and determining the space from the first address to the end address in the second target memory device as the second target area.

[0083] In this embodiment, after the server (i.e., the target device) is powered on, the BIOS code is loaded and the target device is initialized. After the memory device in the server is initialized, the space between two different addresses in the memory device is determined as a fixed memory space (i.e., the second target area), and the fixed memory space (i.e., the second target area) is initialized. The two different addresses in the above-mentioned memory device are respectively a first address and an last address, wherein the first address is a memory address recorded in the BIOS and pre-set; the last address is an address indicated by the sum of the first address and the data capacity of the fixed memory space (i.e., the target area); the data capacity of the fixed memory space (i.e., the second target area) is a number of bytes recorded in the BIOS and pre-set, indicating the maximum amount of data that the fixed memory space (i.e., the second target area) can store, typically 2 megabytes.

[0084] According to some optional embodiments of the present application, after determining the second target area, the method for transmitting the boot log includes: sending the first address and data capacity to the BMC system in the target device through an IPMI command.

[0085] In some optional embodiments, after the BIOS determines the fixed memory space (i.e., the second target area) in the memory device for storing the boot log, it sends the first address and data capacity of the fixed memory space (i.e., the second target area) to the BMC in the form of an IPMI command to inform the BMC of the storage address of the boot log in the memory device.

[0086] Step S204 : determining the operating status of the target device according to the type of the boot log written into the second target area within a preset time period, wherein the operating status includes normal operation and abnormal operation.

[0087] During the boot process of the server (i.e., the target device), the BIOS writes the boot logs one by one into the memory space (i.e., the second target area) in the order in which they were generated. The boot logs include the server's self-test log and information such as the model and name of each electronic device in the server. When the BIOS writes the server's self-test log into the memory space (i.e., the second target area), it indicates that the target device has completed the boot process, i.e., the target device is operating normally. Therefore, in step S204, the operating status of the target device is determined to be normal or abnormal based on whether the self-test log is written into the memory space (i.e., the second target area).

[0088] According to an optional embodiment of the present application, the operating status of the target device is determined based on the type of log in the boot log written to the second target area within a preset time period, including: reading the boot log written to the second target area within the preset time period, and determining the type of each log in the boot log; if there is no log of the target type in the boot log, determining that the operating status of the target device is abnormal operation, wherein the log of the target type is a log indicating that the target device has completed self-test; if there is a log of the target type in the boot log, determining that the operating status of the target device is normal operation.

[0089] In this embodiment, the server (i.e., the target device) stores the boot logs generated by the execution of the boot process one by one in the memory space (i.e., the second target area) in the non-volatile memory device in the server from the time of power-on, and after completing the self-test, all the boot logs generated during the period from power-on to the completion of the self-test are transferred to the fixed space (i.e., the first target area) in H2B pre-agreed by the BMC and BIOS; in this embodiment. Within a preset time, it is detected whether the memory space (i.e., the second target area) in the non-volatile memory device in the server is written with the self-test log (i.e., the log of the target type), wherein the preset time is pre-set, and its time length is greater than the time from the server powering on to the self-test log being transferred to the fixed space (i.e., the first target area) in H2B. That is, in the embodiment of the present application, a sufficiently long time is set for detecting the operating status of the server to ensure that the judgment result of the server operating status is not affected by the preset time. Read each log in the memory space (i.e., the second target area) in the non-volatile memory device in the server written within a preset time and determine the type of each log. If there is no self-test log (i.e., a log of the target type) among the logs in the memory space (i.e., the second target area) in the non-volatile memory device in the server written within the preset time, it means that the server has not completed startup and the server is operating abnormally; if there is a self-test log (i.e., a log of the target type) among the logs in the memory space (i.e., the second target area) in the non-volatile memory device in the server written within the preset time, it means that the server has successfully started and the server is operating normally.

[0090] Step S206: transmitting the boot log in a method corresponding to the running state.

[0091] In step S206, after the operating status of the server (ie, the target device) is determined in step S204, different methods are used to transmit the boot log according to different operating statuses of the server, wherein different operating statuses correspond to different transmission methods.

[0092] According to an optional embodiment of the present application, the boot log is transmitted in a method corresponding to the operating status, including: if the operating status of the target device is normal operation, after determining that the second target area is to write the target type of log, determining a first target memory device in the BMC system of the target device, wherein the first target memory device is a volatile memory device; and writing the boot log to the first target memory device by direct memory read DMA.

[0093] In an embodiment of the present application, two operating states, namely normal operation and abnormal operation, are defined for the server (i.e., target device) based on whether the BIOS transfers the self-test log (i.e., the log of the target type) to the target area within a preset time period. Therefore, in this embodiment, there are two methods for transmitting the boot log. The methods for transmitting logs corresponding to different operating states are different, and the triggering conditions of different methods are also different. In this embodiment, if the operating state of the target device is normal operation, the target device completes the boot as a trigger condition. After the BIOS writes the self-test log to the memory space in the non-volatile memory device in the server (i.e., the second target area), the volatile storage device H2B (i.e., the first target memory device) pre-agreed by the BIOS and BNC for temporarily storing the boot log is determined in the BMC, and the boot log is written to H2B by direct memory access (DMA).

[0094] According to some optional embodiments of the present application, determining a first target memory device in a BMC system of a target device includes: determining multiple volatile memory devices that transmit data with the target device via a Peripheral Component Interconnect Express (PCIe) link; and determining a volatile memory device that communicates data with the BMC system among the multiple volatile memory devices as the first target memory device.

[0095] In some optional embodiments, the above-mentioned volatile storage device H2B (i.e., the first target memory device) is selected from multiple volatile storage devices connected to the server via a Peripheral Component Interconnect Express (PCIe) link. Since the BIOS and the BMC have pre-agreed on a fixed area (i.e., the first target area) in a certain H2B for storing the boot log, and the BIOS writes the boot log to the target area in the H2B, and the BMC reads the boot log from the H2B, the H2B should be writable and readable by both the BMC and the BIOS, that is, writable and readable by both the BMC and the server. Therefore, the H2B that can communicate with the BMC among the multiple volatile storage devices connected to the server is determined as the target volatile storage device (i.e., the first target memory device).

[0096] Through the above steps, during the BIOS startup process, after the memory is initialized, an area with a fixed memory address and fixed memory size is designated in the memory for storing the BIOS boot log. When the target device is operating normally, after the BIOS self-test is completed, the boot log is moved to the H2B area accessible to both the server and the BMC via DMA, thereby realizing boot log collection. When the server operates abnormally, the memory is directly dumped via the XDP tool to obtain the current BIOS boot log, thereby improving the efficiency of log collection.

[0097] According to an optional embodiment of the present application, the boot log is written to the second target memory device by the following method: determining the number of bytes of the first boot log to be written, and determining a new address based on the first address and the number of bytes, wherein the first boot log to be written is the log currently to be written to the second target area in the boot log, the new address is the starting address of the second boot log to be written to the second target area after the first boot log to be written is written to the second target area, and the second boot log to be written is the next log to be written to the first boot log; comparing the new address with the last address to obtain a comparison result; if the new address is greater than the last address, refusing to write the first boot log to the second target area; if the new address is less than or equal to the last address, allowing the first boot log to be written to the second target area.

[0098] In this embodiment, when writing the boot logs one by one into the memory space (i.e., the second target area) in the non-volatile memory device of the server, a method of defining global variables is used to ensure that the written data does not cross the boundary. The method is as follows. To make a distinction, in this embodiment, the memory space (i.e., the second target area) in the non-volatile memory device of the server is defined as the area "BIOS DEBUG INFO AREA", and pointer global variables P_start and P_end are defined, where P_start is the starting address (first address) of the "BIOS DEBUG INFO AREA", and P_end is the ending address (last address) of the "BIOS DEBUG INFO AREA" determined based on the first address and data capacity; the value of P_end is the initial value of P_start offset backward by the size of the "BIOS DEBUG INFO AREA" memory area. Before writing each boot log entry to the "BIOS DEBUG INFO AREA," the amount of data to be written to the boot log is determined to determine its memory size. P_start is then offset backward by the memory size of the log entry to determine the new end address (i.e., the new address) of the area after the log entry is written to the "BIOS DEBUG INFO AREA." If this new end address (i.e., the new address) is greater than P_end, it indicates that the log entry will be out of bounds after writing, and therefore, the log entry is rejected from the "BIOS DEBUG INFO AREA." Conversely, if this new end address (i.e., the new address) is less than P_end, it indicates that the log entry will not be out of bounds after writing, and therefore, the log entry is allowed to be written to the "BIOS DEBUG INFO AREA." After the log entry is written to the "BIOS DEBUG INFO AREA," the next log entry is written starting from a new starting address, where the new starting address is the original starting address offset backward by the memory size of the previous log entry. The above process of checking for out-of-bounds errors is repeated after each log entry is written.

[0099] According to some optional embodiments of the present application, the method for transmitting a boot log further includes: modifying the read object of the second target area from the basic input and output system BIOS of the target device and the operating system of the target device to the BIOS of the target device.

[0100] In some optional embodiments, after the BIOS determines a memory space (i.e., the second target area) dedicated to storing the boot log in the server's non-volatile memory device, it modifies the read and write permissions of the memory space (i.e., the second target area). After the modification, the memory space (i.e., the second target area) is only accessible and modifiable by the BIOS and is invisible to the server's operating system (OS). Optionally, an Advanced Configuration and Power Management Interface (ACPI) table that records the server's configuration and interfaces can be obtained, and the memory space (i.e., the second target area) recorded in the ACPI table is modified from the BIOS and OS to the BIOS.

[0101] FIG3 is a structural diagram of a server provided according to an embodiment of the present application. As shown in FIG3 , the server includes: a BMC (30), a BIOS module (32) and a memory device 34, wherein the memory device 34 is configured to store the server's boot log; the BIOS module (32) is configured to transfer the boot log in the memory device to the BMC when the server operates normally; and the BMC (30) is configured to dump the boot log from the memory device when the server operates abnormally.

[0102] According to an optional embodiment of the present application, the BIOS module (32) is further configured to send the boot log to the BMC in a DMA manner.

[0103] In this embodiment, when the server is operating normally, after detecting that the memory device has received the self-test log of the server, the boot log in the memory device is sent to the volatile memory device H2B in the BMC via DMA.

[0104] According to another optional embodiment of the present application, the BMC is further configured to obtain a boot log from a memory device through an expansion interface, and store the boot log in a non-volatile storage device of the BMC.

[0105] In this embodiment, when an abnormality occurs in the server operation, the BMC calls XDP to dump the memory in the memory device that is set to store the boot log, and dumps it in the BMC's non-volatile storage device EEPROM.

[0106] Figure 4 is a flow chart for transmitting a server's boot log. As shown in Figure 4, after the server is powered on, the BIOS code loads and initializes the server's CPU. After initialization is complete, the BIOS initializes the memory device and specifies a dedicated area with a fixed size and starting address, dedicating this area to storing the boot log. After determining the dedicated area, the server's ACPI table is modified to grant the BIOS exclusive read and write access to the dedicated area, making it invisible to the server's operating system. Next, the BIOS sends an IPMI command to the BMC, specifying the starting address and size of the dedicated area. Furthermore, the BIOS uses this IPMI command to enable the watchdog program in the BMC and sets the watchdog timeout to a preset duration. Before outputting the boot log, the BIOS initializes a fixed area in the BMC's non-volatile memory device H2B via the PCIe link to temporarily store the server's boot log. When the server boots up, the BIOS writes the boot log to the dedicated area. A watchdog checks to see if the BIOS hasn't written the self-test log to the dedicated area within a preset time. If so, the BIOS writes the boot log to H2B via DMA. After the boot log is written to H2B, the BMC extracts the boot log from H2B and transfers it to the BMC's non-volatile EEPROM, ensuring persistent storage. If the log isn't written within the preset time, the BMC records a server operation anomaly and invokes XDP to dump the target area in the memory device. The log is then transferred to the BMC's non-volatile EEPROM, ensuring persistent storage.

[0107] FIG5 is a flowchart of a method for transmitting a boot log according to another aspect of an embodiment of the present application. As shown in FIG5 , the method includes the following steps:

[0108] Step S502: Determine a first target memory device, wherein the first target memory device is a volatile memory device in a management system of the target device.

[0109] In step S502 , the BMC system of the server determines a volatile storage device for temporarily storing a boot log from among multiple volatile storage devices in the system.

[0110] Step S504: receiving a start command, and starting a timing program according to the start command, wherein the timing program is used to control the target device to perform timing according to a preset duration.

[0111] In step S504 , the BMC receives the start command and starts a timing program after receiving the command, wherein the timing duration of the timing program is set to a preset duration.

[0112] Step S506: determining the operating status of the target device according to the operating result of the timing program, wherein the operating status includes normal operation and abnormal operation.

[0113] In step S506, after the timing program is started in step S504, the operating status of the target device is detected in the timing program to determine whether the target device is operating normally or abnormally.

[0114] Step S508 : transmitting the boot log in a method corresponding to the operating state, wherein the boot log is a complete log of the target device during the boot process.

[0115] In step S508, after the operating status of the target device is determined in step S506, the boot log is transmitted using a method corresponding to the operating status, wherein the operating status of the target device includes normal operation and abnormal operation; different operating statuses correspond to different methods.

[0116] Figure 6 is a structural diagram of a device for obtaining a boot log provided according to an embodiment of the present application, including: a determination module 60, configured to determine the operating status of a target device, wherein the operating status includes: normal operation and abnormal operation; a first acquisition module 62, configured to obtain a boot log from a first target memory device in a baseboard management control BMC system of the target device when the operating status is normal operation, wherein the first target memory device is a volatile memory device, and the boot log is a complete log of the target device during the boot process; a second acquisition module 64, configured to obtain a boot log from a second target memory device in the target device when the operating status is abnormal operation, wherein the second target memory device is a memory device in the target device.

[0117] It should be noted that, for optional implementations of the embodiment shown in FIG6 , reference can be made to the relevant descriptions of the embodiment shown in FIG1 , which will not be repeated here.

[0118] According to another aspect of an embodiment of the present application, a non-volatile readable storage medium is also provided, in which a computer program is stored. The device where the non-volatile readable storage medium is located executes the above-mentioned method for obtaining a boot log and the method for transmitting a boot log by running the computer program.

[0119] The above-mentioned non-volatile readable storage medium is configured to store a program that performs the following functions: determining the operating status of the target device, where the operating status includes: normal operation and abnormal operation; if the operating status is normal operation, obtaining a boot log from a first target memory device in a baseboard management control (BMC) system of the target device, where the first target memory device is a volatile memory device, and the boot log is a complete log of the target device during the boot process; if the operating status is abnormal operation, obtaining a boot log from a second target memory device in the target device, where the second target memory device is a memory device in the target device.

[0120] The above-mentioned non-volatile readable storage medium is also configured to store a program that performs the following functions: determining a second target area, wherein the second target area is used to store a boot log, which is a complete log of the target device during the boot process; determining the operating status of the target device based on the type of log in the boot log written to the second target area within a preset time period, wherein the operating status includes normal operation and abnormal operation; and transmitting the boot log in a method corresponding to the operating status.

[0121] According to another aspect of an embodiment of the present application, an electronic device is also provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to execute the above-mentioned method for obtaining a boot log and the method for transmitting a boot log through the computer program.

[0122] The processor in the above-mentioned electronic device is configured to run a program that performs the following functions: determining the operating status of the target device, where the operating status includes: normal operation and abnormal operation; if the operating status is normal operation, obtaining a boot log from a first target memory device in a baseboard management control (BMC) system of the target device, where the first target memory device is a volatile memory device, and the boot log is a complete log of the target device during the boot process; if the operating status is abnormal operation, obtaining a boot log from a second target memory device in the target device, where the second target memory device is a memory device in the target device.

[0123] The processor in the above-mentioned electronic device is also configured to run a program that performs the following functions: determining a second target area, wherein the second target area is used to store a boot log, which is a complete log of the target device during the boot process; determining the operating status of the target device based on the type of log in the boot log written to the second target area within a preset time period, wherein the operating status includes normal operation and abnormal operation; and transmitting the boot log in a method corresponding to the operating status.

[0124] It should be noted that the various modules in the above-mentioned device for obtaining the boot log can be program modules (for example, a set of program instructions that implement a certain specific function) or hardware modules. For the latter, it can be expressed in the following forms, but is not limited to this: the expression form of each of the above-mentioned modules is a processor, or the functions of each of the above-mentioned modules are implemented by a processor.

[0125] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0126] In the above embodiments of the present application, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.

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

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

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

[0130] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a non-volatile readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the relevant technology 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 non-volatile readable storage medium, including a number of instructions for enabling a computer device (which can be a personal computer, server or network device, etc.) to execute all or part of the steps of the various embodiments of the present application. The aforementioned non-volatile readable storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and other media that can store program code.

[0131] The above are only optional implementation methods of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A method for obtaining a boot log, characterized in that: include: Determine the operating status of the target device, wherein the operating status includes: normal operation and abnormal operation; If the operation status is normal operation, obtaining a boot log from a first target memory device in a baseboard management control BMC system of the target device, wherein the first target memory device is a volatile memory device, and the boot log is a complete log of the target device during the boot process; If the operation status is the abnormal operation, the boot log is obtained from a second target memory device in the target device, wherein the second target memory device is a non-volatile memory device in the target device.

2. The method according to claim 1, characterized in that Determine the operating status of the target device, including: Receiving an intelligent platform management interface IPMI command, and in response to the IPMI command, starting a timing program and starting timing, wherein the timing duration is a preset duration; The first target memory device is detected within the preset time period to obtain a detection result, and the operating state of the target device is determined according to the detection result.

3. The method according to claim 2, characterized in that The detection result includes: the first target memory device receives the boot log within the preset time period, and the first target memory device does not receive the boot log within the preset time period.

4. The method according to claim 2, characterized in that: Determining the operating state of the target device according to the detection result includes: If the detection result indicates that the first target memory device receives the boot log within the preset time period, determining that the operation status of the target device is the normal operation; If the detection result indicates that the first target memory device has not received the boot log within the preset time period, it is determined that the operating state of the target device is the operating abnormality.

5. The method according to claim 2, characterized in that: The method further includes: after detecting that the first target memory device receives the boot log within the preset time period, stopping timing and resetting the timing program.

6. The method according to claim 1, characterized in that Acquiring the boot log from a second target memory device in the target device includes: determining, in the second target memory device, a second target area for storing the boot log; The second target area is dumped through the extended interface to obtain the boot log.

7. The method according to claim 6, characterized in that Determining a second target area for storing the boot log in the target device includes: Receiving the first address and data capacity of the second target area, wherein the data capacity is the maximum amount of data stored in the second target area; Determine the last address of the second target area according to the first address and the data capacity; The space from the first address to the last address in the second target memory device is determined as the second target area.

8. The method according to claim 1, characterized in that Acquiring a boot log from a first target memory device in a BMC system of the target device includes: Determining a target storage area from the first target memory device, wherein the target storage area is a pre-agreed storage area dedicated to storing the boot log; The boot log is read from the target storage area.

9. The method according to claim 1, characterized in that: After obtaining the boot log from the first target memory device in the BMC system of the target device, the method further includes: transferring the boot log to a third target memory device, wherein the third target memory device is a non-volatile storage device in the BMC system.

10. A method for transmitting a boot log, characterized in that: include: Determine a second target area, wherein the second target area is used to store a boot log, and the boot log is a complete log of the target device during the boot process; Determine the operating state of the target device according to the type of the log in the boot log written into the second target area within a preset time period, wherein the operating state includes normal operation and abnormal operation; The boot log is transmitted in a method corresponding to the running state.

11. The method according to claim 10, characterized in that Transmitting the boot log in a method corresponding to the running state includes: If there is a log of the target type in the boot log written to the second target area within the preset time period, after the log of the target type is written to the second target area, the boot log is transmitted to the first target memory device.

12. The method according to claim 10, characterized in that Identify the secondary target area, including: Determine the first address of the second target area and the data capacity of the second target area, wherein the data capacity is the maximum amount of data stored in the second target area; Determine the last address of the second target area according to the first address and the data capacity; The space from the first address to the last address in the second target memory device is determined as the second target area.

13. The method according to claim 12, characterized in that After determining the second target area, the method includes: The first address and the data capacity are sent to the BMC system in the target device through an IPMI command.

14. The method according to claim 10, characterized in that Determining the operating state of the target device according to the type of the boot log written into the second target area within a preset time period includes: Reading the boot log written into the second target area within the preset time period, and determining the type of each log in the boot log; If the target type of log does not exist in the boot log, determining that the operating state of the target device is the operating abnormality, wherein the target type of log is a log indicating that the target device has completed a self-check; If a log of the target type exists in the boot log, it is determined that the operating status of the target device is normal.

15. The method according to claim 14, characterized in that Transmitting the boot log in a method corresponding to the running state includes: If the operation state of the target device is the normal operation, after determining that the second target area writes the log of the target type, determining a first target memory device in the BMC system of the target device, wherein the first target memory device is a volatile memory device; The boot log is written into the first target memory device by direct memory access (DMA).

16. The method according to claim 15, characterized in that Determining a first target memory device in a BMC system of the target device includes: determining a plurality of volatile memory devices for data transmission with the target device via a peripheral component interconnect express (PCIe) link; A volatile memory device among the plurality of volatile memory devices that performs data communication with the BMC system is determined as the first target memory device.

17. The method according to claim 12, characterized in that The boot log is written into the second target memory device by the following method: Determine the number of bytes of a first boot log to be written, and determine a new address according to the first address and the number of bytes, wherein the first boot log to be written is a log in the boot log that is currently to be written to the second target area, the new address is a starting address of a second boot log to be written to the second target area after the first boot log to be written is written to the second target area, and the second boot log to be written is the next log of the first boot log to be written; Comparing the new address with the final address to obtain a comparison result; If the new address is greater than the last address, refusing to write the first boot log to be written into the second target area; If the new address is less than or equal to the last address, writing the first boot log to be written into the second target area is allowed.

18. The method according to claim 10, characterized in that The method further comprises: The read object of the second target area is modified from the basic input and output system BIOS of the target device and the operating system of the target device to the BIOS of the target device.

19. A server, characterized in that: include: BMC, BIOS module and memory devices, among which, The memory device is configured to store a boot log of the server; The BIOS module is configured to transmit the boot log in the memory device to the BMC when the server is operating normally; The BMC is configured to dump the boot log from the memory device when the server operates abnormally.

20. The server according to claim 19, characterized in that The BIOS module is further configured to send the boot log to the BMC in a DMA manner.

21. The server according to claim 19, characterized in that The BMC is further configured to obtain the boot log from the memory device through an expansion interface, and store the boot log in a non-volatile storage device of the BMC.

22. A method for transmitting a boot log, characterized in that: include: Determine a first target memory device, wherein the first target memory device is a volatile memory device in a management system of the target device; Receiving a start command, and starting a timing program according to the start command, wherein the timing program is used to control the target device to perform timing for a preset duration; Determining the operating state of the target device according to the operating result of the timing program, wherein the operating state includes normal operation and abnormal operation; The boot log is transmitted in a method corresponding to the operating state, wherein the boot log is a complete log of the target device during the boot process.

23. A device for obtaining a boot log, characterized in that: include: A determination module is configured to determine an operating state of a target device, wherein the operating state includes: normal operation and abnormal operation; A first acquisition module is configured to acquire a boot log from a first target memory device in a baseboard management control BMC system of the target device when the operation state is the normal operation, wherein the first target memory device is a volatile memory device, and the boot log is a complete log of the target device during the boot process; The second acquisition module is configured to acquire the boot log from a second target memory device in the target device when the operation state is the operation abnormality, wherein the second target memory device is a non-volatile memory device in the target device.

24. A non-volatile readable storage medium, characterized in that: A computer program is stored in the non-volatile readable storage medium, wherein the device where the non-volatile readable storage medium is located executes the method for obtaining a boot log of any one of claims 1 to 9 and the method for transmitting a boot log of any one of claims 10 to 18 by running the computer program.

25. An electronic device, comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to execute the method for obtaining a boot log of any one of claims 1 to 9 and the method for transmitting a boot log of any one of claim 1018 through the computer program.

Citation Information

Patent Citations

  • Monitoring information collection method, baseboard management controller and system

    CN106021064A

  • Method, system and device for collecting log, and computer readable storage medium

    CN108197008A

  • Log recording method and device and electronic equipment

    CN114168401A

  • Blade server out-of-band log storage method and system of VPX case

    CN115576783A

  • Method and device for acquiring startup log and method for transmitting startup log

    CN116383012A

Cited By

  • Log collection method and electronic equipment

    CN120780575A