Log processing method, device, electronic device and storage medium

By storing logs in the target shared memory accessible to both BIOS and BMC, and determining the read execution object according to the management method, the problems of low log acquisition efficiency and incomplete log restoration in the existing technology are solved, and fast acquisition and high efficiency are achieved. Stored log processing method.

CN116361106BActive Publication Date: 2024-10-18NETTRIX INFORMATION IND CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310159020.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-02-20
Publication Date
2024-10-18
Estimated Expiration
2043-02-20

AI Technical Summary

Technical Problem

When obtaining BIOS logs in the existing technology, turning on the Debug mode causes the machine boot time to be prolonged, and the logs may not be fully restored when the system is down, which cannot meet the needs of quickly obtaining and analyzing logs.

Method used

By storing logs in the target shared memory accessible to both BIOS and BMC, and determining the read execution object according to the current management method, reading and parsing logs from the target shared memory, supporting out-of-band and in-band management methods, and improving log acquisition efficiency and flexibility.

Benefits of technology

It achieves efficient storage and rapid retrieval of logs in Debug mode, avoiding the problem of prolonged machine startup time, and can obtain logs from the target shared memory under different management methods, improving the applicability and convenience of log processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116361106B_ABST
    Figure CN116361106B_ABST
Patent Text Reader

Abstract

The present invention discloses a log processing method, device, electronic device and storage medium. The method comprises: if the log transfer option is turned on through BIOS, the initial memory information of the target shared memory accessible to both BMC and BIOS is read; the memory storage information is determined by BIOS according to the initial memory information and the first preset setting information, and the current log is stored in the target shared memory according to the memory storage information to generate log storage information; the read execution object of the log is determined according to the mode type of the current management mode, and the target log is read from the target shared memory to the preset output position according to the read execution object, the memory storage information and the log storage information. By running the technical solution provided by the embodiment of the present invention, the problem of increasing the machine startup time due to outputting the current log to the serial port in real time can be solved, so that the log can be stored and output with little impact on the startup speed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to computer technology, and in particular to a log processing method, device, electronic equipment and storage medium. Background Art

[0002] When a problem occurs in the machine system or the system operation status needs to be analyzed, it is usually necessary to obtain the BIOS log for specific analysis.

[0003] In the prior art, logs can be obtained by turning on the Debug mode and outputting the logs to the serial port in real time when the machine is turned on, but it will take a long time to start the machine; the Debug mode can also be turned off, and the logs can be obtained again by turning on the Debug mode when the logs need to be obtained. However, when the system crashes and other problems occur, some information will be reset. Therefore, the logs obtained at this time may have problems such as being unable to completely restore the actual logs. Summary of the invention

[0004] The present invention provides a log processing method, device, electronic equipment and storage medium to improve the applicability of log processing.

[0005] According to one aspect of the present invention, a log processing method is provided, the method comprising:

[0006] If the log transfer option is turned on through BIOS, the initial memory information of the target shared memory is read; wherein both the baseboard management controller BMC and the BIOS can access the target shared memory;

[0007] Determining memory storage information according to the initial memory information and first preset setting information through the BIOS, and storing a current log in the target shared memory according to the memory storage information to generate log storage information; wherein the first preset setting information is determined by the BMC and the BIOS;

[0008] Determine the read execution object of the log according to the mode type of the current management mode, and read the target log from the target shared memory to a preset output location according to the read execution object, the memory storage information and the log storage information; wherein the current management mode includes at least one of an out-of-band management mode and an in-band management mode.

[0009] Optionally, if the current management mode is the out-of-band management mode, determining that the read execution object is the BMC;

[0010] Correspondingly, reading the target log from the target shared memory to a preset output location according to the read execution object, the memory storage information and the log storage information includes:

[0011] Acquire the memory storage information and the log storage information through the BMC, read the target log from the target shared memory according to the memory storage information, and parse the target log according to the log storage information;

[0012] The parsed target log is output to a preset file location.

[0013] The advantage of this setting is that since both BMC and BIOS can access the target shared memory, BMC can read the target log from the target shared memory, and realize the reading of the target log when the current management mode is the out-of-band management mode. BMC determines the readable position based on the memory storage information to read the target log from the target shared memory, and parses the target log based on the log storage information to obtain a log that can be read by the user, thereby improving the effectiveness of subsequent log output. The parsed target log is stored in a preset text format, and the storage text file obtained after storage is output to the preset output location, so that it can be downloaded and viewed when needed, thereby improving the convenience of log acquisition.

[0014] Optionally, if the current management mode is the in-band management mode, determining that the read execution object is BIOS;

[0015] Correspondingly, reading the target log from the target shared memory to a preset output location according to the read execution object, the memory storage information and the log storage information includes:

[0016] Obtaining a log output request of a BIOS setup interface through the BIOS, and determining the preset output location according to the log output request; wherein the preset output location includes at least one of a serial port and a preset file location;

[0017] The target log is read from the target shared memory to the preset output location according to the memory storage information and the log storage information.

[0018] The advantage of such a setting is that when the current management mode is the in-band management mode, and the read execution object is the BIOS, the memory storage information and the log storage information can be directly obtained through the BIOS, so that the target log can be read from the target shared memory to the preset output location according to the memory storage information and the log storage information, thereby improving the efficiency of log reading. In addition, the preset output location can be determined according to the log output request, so that the target log can be output to different locations, thereby improving the flexibility of log output.

[0019] Optionally, if the current management mode is the in-band management mode, determining that the read execution object is a unified extensible firmware interface system;

[0020] After determining the memory storage information according to the initial memory information and the first preset setting information by the BIOS, and storing the current log in the target shared memory according to the memory storage information to generate the log storage information, the method further includes:

[0021] Writing the memory storage information and the log storage information into second preset setting information through the BIOS; wherein the second preset setting information is determined by the BIOS;

[0022] Correspondingly, reading the target log from the target shared memory to a preset output location according to the read execution object, the memory storage information and the log storage information includes:

[0023] Reading the memory storage information and the log storage information from the second preset setting information through the unified extensible firmware interface system;

[0024] The target log is read from the target shared memory to the preset output location according to the memory storage information and the log storage information.

[0025] The advantage of such a setting is that when the current management mode is the in-band management mode, and the read execution object is a unified extensible firmware interface system, the memory storage information and the log storage information can be correspondingly obtained from the second preset setting information for writing the memory storage information and the log storage information through the unified extensible firmware interface system, thereby solving the problem that the unified extensible firmware interface system cannot directly obtain the target shared memory information, and expanding the implementation object that can read the target log from the target shared memory, so as to meet the needs of log acquisition in different application scenarios and improve the applicability of log acquisition.

[0026] Optionally, if the current management mode is the in-band management mode, determining that the read execution object is at least one of an operating system and a third-party hardware tool;

[0027] Correspondingly, reading the target log from the target shared memory to a preset output location according to the read execution object, the memory storage information and the log storage information includes:

[0028] Reading the target log from the target shared memory to the preset output location through the read execution object according to the memory storage information and the log storage information;

[0029] Or, trigger a preset interrupt through the read execution object to switch the read execution object to the BIOS, and read the target log from the target shared memory to the preset output location through the BIOS according to the memory storage information and the log storage information; wherein the interrupt type of the preset interrupt is determined according to the object type of the read execution object.

[0030] The advantage of such a setting is that when the current management mode is the in-band management mode, and the read execution object is at least one of the operating system and the third-party hardware tool, the memory storage information and the log storage information can be directly obtained through the operating system or the third-party hardware tool to read the target log; the read execution object can also be changed to BIOS by triggering an interrupt, and the target log can be read through BIOS. Thus, the implementation object that can read the target log from the target shared memory is expanded, and the read execution object can also be changed to meet the needs of log acquisition in different application scenarios, and improve the flexibility of log acquisition.

[0031] Optionally, before storing the current log in the target shared memory according to the memory storage information, the method further includes:

[0032] Obtain the current log through the BIOS, and determine whether there is an end mark in the current log;

[0033] If it exists, the separation method of the current log is determined according to the end identifier, and the storage method of the current log is determined according to the separation method.

[0034] The advantage of this setting is that if a single byte is stored as a single log, a header file of the log needs to be generated when storing each log, and the header file will occupy part of the memory, resulting in the log storage occupying too much memory space of the target shared memory when the number of bytes is too large; if all bytes are stored as a single log, the amount of log information will be large, affecting the speed of subsequent log parsing. By separating and storing the current log according to whether there is an end mark in the current log, the log storage does not occupy too much space, and the parsing speed of the subsequent log reading is improved.

[0035] Optionally, before determining through BIOS whether the log transfer option is enabled, the following is also included:

[0036] In response to the switch operation according to the log dump option, the memory size of the available memory of the target shared memory is determined by the BIOS.

[0037] The advantage of such a setting is that different memory usage requirements are determined by switching the log transfer option, so as to determine the size of the target shared memory according to different usage requirements. For example, when logs need to be stored in the target shared memory, the target shared memory is expanded to avoid the inability to store logs due to too small storage space of the target shared memory; when logs do not need to be stored in the target shared memory, the size of the target shared memory is maintained to avoid idle memory space in the target shared memory and improve the memory utilization of the target shared memory; thereby improving the effectiveness of determining the memory size of the available memory of the target shared memory.

[0038] According to another aspect of the present invention, a log processing device is provided, the device comprising:

[0039] A memory information reading module, used for reading the initial memory information of the target shared memory if the log transfer option is turned on through the BIOS; wherein both the baseboard management controller BMC and the BIOS can access the target shared memory;

[0040] a storage information generating module, configured to determine memory storage information according to the initial memory information and first preset setting information through the BIOS, and store the current log in the target shared memory according to the memory storage information to generate log storage information; wherein the first preset setting information is determined by the BMC and the BIOS;

[0041] A log reading module is used to determine a log reading execution object according to a mode type of a current management mode, and read a target log from the target shared memory to a preset output location according to the reading execution object, the memory storage information and the log storage information; wherein the current management mode includes at least one of an out-of-band management mode and an in-band management mode.

[0042] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:

[0043] at least one processor; and

[0044] a memory communicatively connected to the at least one processor; wherein,

[0045] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the log processing method described in any embodiment of the present invention.

[0046] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the log processing method described in any embodiment of the present invention when executed.

[0047] The technical solution of the embodiment of the present invention, when the debug mode is turned on, stores the current log in the target shared memory accessible to both the BMC and the BIOS, so that both the BMC and the BIOS can process the log, thereby improving the application scope of the log processing; and the current log is stored in the target shared memory, so that the log can be obtained from the target shared memory when the log is needed, without the need to output the current log to the serial port in real time during the machine startup process, thereby avoiding the problem of increasing the machine startup time due to the real-time output, thereby realizing the storage of the log with less impact on the startup speed.

[0048] According to the determined memory storage information, the current log is stored in the shared memory, so that the current log is stored in the target shared memory according to the rules, which improves the effectiveness of log storage. Logs can be read later according to the memory storage information and the generated log storage information, without the need for disordered queries in the target shared memory, which improves the pertinence and efficiency of log acquisition. Different read execution objects are determined for different management methods, so that logs can be obtained from the target shared memory in different current management methods, which improves the applicability of log acquisition.

[0049] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] Figure 1 A flow chart of a log processing method provided in Embodiment 1 of the present invention;

[0051] Figure 2 A flow chart of a log processing method provided in Embodiment 2 of the present invention;

[0052] Figure 3 A log processing method provided in Example 3 of the present invention Figure 1 ;

[0053] Figure 4 A log processing method provided in Example 3 of the present invention Figure 2 ;

[0054] Figure 5 A log processing method provided in Example 3 of the present invention Figure 3 ;

[0055] Figure 6 A schematic diagram of the structure of a log processing device provided in Embodiment 4 of the present invention;

[0056] Figure 7It is a schematic diagram of the structure of an electronic device used to implement an embodiment of the present invention. DETAILED DESCRIPTION

[0057] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below 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 of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

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

[0059] Embodiment 1

[0060] Figure 1 This is a flow chart of a log processing method provided in the first embodiment of the present invention. This embodiment can be applied to storing BIOS (Basic Input Output System) logs and outputting BIOS logs. This method can be executed by the log processing device provided in the embodiment of the present invention. The device can be implemented by software and / or hardware. Figure 1 The log processing method provided in this embodiment includes:

[0061] Step 110: If it is determined through BIOS that the log transfer option is turned on, the initial memory information of the target shared memory is read; wherein both the baseboard management controller BMC and the BIOS can access the target shared memory.

[0062] Among them, if the log transfer option is turned on, it indicates that the log processing method is to store it in the target shared memory. If the log transfer option is not turned on, it indicates that the log processing method is to process it according to the original preset method, such as outputting it to the serial port. This embodiment does not limit this.

[0063] After the machine is powered on, the BIOS may read the BIOS settings at the beginning of the preparation phase of the EFI (Extensible Firmware Interface) environment, and determine whether the log dump option is enabled according to a variable related to the log dump option in the settings.

[0064] If the log transfer option is judged to be turned on, the initial memory information of the target shared memory is read; wherein the target shared memory is a shared memory for storing logs, which can be accessed by both BMC (Baseboard Management Controller) and BIOS, such as VGA (Video Graphics Array) shared memory, and this embodiment does not limit this.

[0065] The initial memory information of the target shared memory is the memory information when no log is stored, and may include the initial memory address and initial memory size of the target shared memory. The initial memory information may be obtained by reading a register for writing memory information related to the BMC. For example, if the target shared memory is a VGA memory, the register storing memory information in the VGA device included in the BMC chip may be read to obtain the initial memory information.

[0066] In this embodiment, optionally, before determining through BIOS whether the log transfer option is enabled, the method further includes:

[0067] In response to the switch operation according to the log dump option, a memory size of an available memory of the target shared memory is determined by the BIOS.

[0068] The log transfer option may be located in the BIOS setting interface, and the switch operation of the log transfer option may be triggered manually or actively by the system, which is not limited in this embodiment.

[0069] The memory size of the available memory of the target shared memory is determined by BIOS. For example, if it is detected that the log dump option is turned on, the BIOS can set the size of the target shared memory to an extended size, such as 64M. If it is detected that the log dump option is turned off, the BIOS can set the size of the target shared memory to a default size, such as 16M or 32M.

[0070] The advantage of such a setting is that different memory usage requirements are determined by switching the log transfer option, so as to determine the size of the target shared memory according to different usage requirements. For example, when logs need to be stored in the target shared memory, the target shared memory is expanded to avoid the inability to store logs due to too small storage space of the target shared memory; when logs do not need to be stored in the target shared memory, the size of the target shared memory is maintained to avoid idle memory space in the target shared memory and improve the memory utilization of the target shared memory; thereby improving the effectiveness of determining the memory size of the available memory of the target shared memory.

[0071] Step 120: determining memory storage information according to the initial memory information and the first preset setting information through BIOS, and storing the current log in the target shared memory according to the memory storage information to generate log storage information; wherein the first preset setting information is determined by BMC and BIOS.

[0072] The first preset setting information is determined by the BMC and the BIOS, and may be a method of storing logs pre-agreed between the BIOS and the BMC, for example, may include static storage and dynamic storage, wherein the static storage may be a fixed storage method, for example, the target shared memory size is 64M, and a fixed 32M thereof is used to store logs, and the start address and end address of the storage are determined accordingly.

[0073] Dynamic storage can be determined for storage mode according to the actual size of log to be stored or other storage information in the target shared memory, i.e. the starting address and the end address of storage change according to the situation of actual storage. For example, if the log size to be stored exceeds the preset threshold, the 32M in the distribution target shared memory is used for storage, if the log size to be stored is less than or equal to the preset threshold, the 16M in the distribution target shared memory is used for storage, avoiding the log amount to be stored being large and the storage space being insufficient, or the problem of taking up too much memory space when the log amount to be stored is small, thereby improving the flexibility of log storage. Or log and other storage information are adjacently stored in the target shared memory, other storage information originally stores 2M size, and now needs to store 4M size, then the address of the storage log needs corresponding offset 2M etc.

[0074] The memory storage information is determined according to the initial memory information and the first preset setting information, that is, the storage method is determined according to the first preset setting information, the memory storage information to be followed during storage is determined according to the storage method and the initial memory information, and the storage is actually performed according to the memory storage information. Exemplarily, if the initial memory information includes the initial memory address of the target shared memory, and the initial memory size is 64M, and the first preset setting information is static information, including a fixed start address and end address in the target shared memory, and a space of 32M in size is used to store logs, then the memory storage information is: the log can be stored in a space of 32M in size with a fixed start address and end address in the target shared memory of 64M in size, and the address is the initial memory address.

[0075] The current log is stored in the target shared memory according to the memory storage information, wherein the current log is the BIOS log that needs to be stored currently, and the BIOS log is the log generated in the BIOS stage, which can be all the BIOS logs currently generated, or the BIOS logs that need to be obtained currently, such as BIOS logs of some specific sources in all BIOS logs, etc. This embodiment does not limit this.

[0076] Optionally, before storing the current log in the target shared memory according to the memory storage information, the target shared memory can be preprocessed to improve the efficiency of subsequent log storage. The preprocessing method can be determined according to the data structure when the log is stored. For example, if the data structure when the log is stored is a bidirectional linked list, the preprocessing can be memory alignment processing of the target shared memory, etc.

[0077] After storing the current log, log storage information is generated, where the log storage information is information obtained after the log is actually stored, such as data structure information when the log is stored, the number of logs, the storage address of the first log, the storage address of the last log, etc., where the data structure information can be a data structure of a bidirectional linked list, etc., which is not limited in this embodiment.

[0078] In this embodiment, optionally, before storing the current log in the target shared memory according to the memory storage information, the method further includes:

[0079] Get the current log through BIOS and determine whether there is an end mark in the current log;

[0080] If it exists, the separation method of the current log is determined according to the end identifier, and the storage method of the current log is determined according to the separation method.

[0081] Get the current log through BIOS. The current log consists of one or more bytes.

[0082] If there is an end marker, the end marker exists between the bytes of the current log. The end marker can be added by a preset function when the log is generated. The adding position can be determined manually or automatically by the log generation source. For example, if the source of the acquired log changes, the end marker is added after the last byte acquired before the change. The end marker is, for example, " / n", which is not limited in this embodiment.

[0083] The current log is separated according to the end marker, and the end marker is used to mark the end of a single log in the current log. The bytes before the end marker can be stored as a single log. For example, if the current log includes byte 1, byte 2...byte 12, a line break marker, byte 13, byte 14...byte 20, bytes 1-12 and bytes 13-20 can be separated, and bytes 1-12 and bytes 13-20 are respectively stored in the target shared memory as a single log.

[0084] The advantage of this setting is that if a single byte is stored as a single log, a header file of the log needs to be generated when storing each log, and the header file will occupy part of the memory, resulting in the log storage occupying too much memory space of the target shared memory when the number of bytes is too large; if all bytes are stored as a single log, the amount of log information will be large, affecting the speed of subsequent log parsing. By separating and storing the current log according to whether there is an end mark in the current log, the log storage does not occupy too much space, and the parsing speed of the subsequent log reading is improved.

[0085] Step 130, determine the log read execution object according to the mode type of the current management mode, and read the target log from the target shared memory to the preset output location according to the read execution object, memory storage information and log storage information; wherein the current management mode includes at least one of an out-of-band management mode and an in-band management mode.

[0086] The read execution object of the log is determined according to the mode type of the current management mode, and the read execution object is the object that executes the reading of the log from the shared memory. Different current management modes have different read execution objects. For example, if the current management mode is an out-of-band management mode, that is, when the machine main system is managed through the BMC, the read execution object can be determined as the BMC; if the current management mode is an in-band management mode, that is, when the machine main system is managed through the CPU, the read execution object can be determined as the operating system, a third-party hardware tool, etc. If the current management mode is an in-band management mode, the determined read execution object can be any object that can perform log reading operations, or it can be determined according to the current system operation status. For example, when the system crashes and cannot enter the operating system, the log reading operation can be performed through other currently available read execution objects. This embodiment does not limit this.

[0087] According to the read execution object, the memory storage information and the log storage information, the target log is read from the target shared memory to the preset output position. The target log is the log that needs to be output currently. It can be all the logs stored in the target shared memory, or it can be part of the logs. This embodiment does not limit this. The reading method can be to determine the location of the log in the shared memory according to the memory storage information by reading the execution object, and parse the required log from the shared memory through the log storage information to read it. And the log obtained by reading is output to the preset output position. The output method can be to output the log directly to the preset output position, wherein the preset output position can be any predetermined position for storing the output log.

[0088] Optionally, the range of the saved output logs can be determined based on the size of the storage space of the preset output location. For example, if the storage space is larger than the corresponding preset range threshold, the logs generated by multiple startups of the machine can be saved to facilitate later analysis, comparison and tracking of the logs; if the storage space is smaller than the corresponding preset range threshold, the logs generated by a single startup of the machine can be saved, and when a new startup log is generated, the old log originally stored will be overwritten to save space.

[0089] The technical solution provided in this embodiment, when the Debug mode is turned on, stores the current log in the target shared memory accessible to both the BMC and the BIOS, so that both the BMC and the BIOS can process the log, thereby improving the scope of application of log processing; and the current log is stored in the target shared memory, so that the log can be obtained from the target shared memory when the log is needed, without the need to output the current log to the serial port in real time during the machine startup process, thereby avoiding the problem of increasing the machine startup time due to real-time output, thereby achieving the storage of the log with little impact on the startup speed.

[0090] According to the determined memory storage information, the current log is stored in the shared memory, so that the current log is stored in the target shared memory according to the rules, which improves the effectiveness of log storage. Logs can be read later according to the memory storage information and the generated log storage information, without the need for disordered queries in the target shared memory, which improves the pertinence and efficiency of log acquisition. Different read execution objects are determined for different management methods, so that logs can be obtained from the target shared memory in different current management methods, which improves the applicability of log acquisition.

[0091] Embodiment 2

[0092] Figure 2A flowchart of a log processing method provided for Embodiment 2 of the present invention. This technical solution provides supplementary explanation for the process of reading the target log from the target shared memory to a preset output location based on reading the execution object, memory storage information and log storage information if the current management mode is an out-of-band management mode.

[0093] Specifically, the flow chart of the log processing method is as follows Figure 2 As shown:

[0094] Step 210: If the log transfer option is enabled as determined by the BIOS, the initial memory information of the target shared memory is read; wherein both the baseboard management controller BMC and the BIOS can access the target shared memory.

[0095] Step 220: Determine memory storage information according to the initial memory information and the first preset setting information through BIOS, and store the current log in the target shared memory according to the memory storage information to generate log storage information; wherein the first preset setting information is determined by BMC and BIOS.

[0096] Step 230: If the current management mode is the out-of-band management mode, determine that the read execution object is the BMC, obtain memory storage information and log storage information through the BMC, read the target log from the target shared memory according to the memory storage information, and parse the target log according to the log storage information.

[0097] If the current management mode is an out-of-band management mode, it means that the main system of the machine is managed through the BMC at this time, and the read execution object is determined to be the BMC. The memory storage information and log storage information are obtained through the BMC, wherein the method of obtaining the memory storage information can be determined according to the type of the first preset setting information. Exemplarily, when the method of storing logs determined in the first preset setting information includes static storage, the memory storage information is directly determined and fixed by the first preset setting information, and the first preset setting information is determined by the BMC and BIOS, so the BMC can directly obtain it. When the method of storing logs determined in the first preset setting information includes dynamic storage, the memory storage information is determined by the first preset setting information and the actual size of the log to be stored, so the BMC cannot directly obtain it, but can send it to the BMC through the BIOS. Since it is an out-of-band management mode, the BMC can only read and parse the pre-agreed readable data in the target shared memory, so the BMC cannot directly obtain the log storage information, so the log storage information can be obtained by sending it to the BMC through the BIOS.

[0098] Optionally, in response to a click operation of a preset button, a process of the BMC reading a target log from a target shared memory may be triggered. The click operation of the preset button may be performed manually, which is not limited in this embodiment.

[0099] The BMC reads the target log from the target shared memory according to the memory storage information, for example, the target log data can be read from the target shared memory according to the starting address of the log storage in the memory storage information, where the target log data can be binary data. The target log is parsed according to the log storage information, for example, the read data can be parsed according to the data structure information in the log storage information, so as to convert the read binary data into text information or character information that can be read by the user.

[0100] Step 240: Output the parsed target log to a preset file location.

[0101] The parsed log is output to a text file in a preset file location and stored in a preset text format, where the preset file location is a location for storing files. The stored text file can be packaged and compressed to reduce the size.

[0102] The advantage of this setting is that since both BMC and BIOS can access the target shared memory, BMC can read the target log from the target shared memory, and realize the reading of the target log when the current management mode is the out-of-band management mode. BMC determines the readable position based on the memory storage information to read the target log from the target shared memory, and parses the target log based on the log storage information to obtain a log that can be read by the user, thereby improving the effectiveness of subsequent log output. The parsed target log is stored in a preset text format, and the storage text file obtained after storage is output to the preset output location, so that it can be downloaded and viewed when needed, thereby improving the convenience of log acquisition.

[0103] Embodiment 3

[0104] Figure 3 A log processing method provided in Example 3 of the present invention Figure 1 This technical solution is to provide a supplementary explanation of the process of reading the target log from the target shared memory to the preset output location according to the read execution object, memory storage information and log storage information when the current management mode is the in-band management mode and the read execution object is determined to be BIOS. Specifically, the process of the log processing method Figure 1 like Figure 3 As shown:

[0105] Step 310: If the log transfer option is enabled as determined by the BIOS, the initial memory information of the target shared memory is read; wherein both the baseboard management controller BMC and the BIOS can access the target shared memory.

[0106] Step 320: Determine memory storage information according to the initial memory information and the first preset setting information through BIOS, and store the current log in the target shared memory according to the memory storage information to generate log storage information; wherein the first preset setting information is determined by BMC and BIOS.

[0107] Step 330: If the current management mode is the in-band management mode, determine that the read execution object is the BIOS; obtain the log output request of the BIOS setting interface through the BIOS, and determine the preset output location according to the log output request; wherein the preset output location includes at least one of a serial port and a preset file location.

[0108] The log output request of the BIOS setup interface can be triggered by clicking a preset button in the BIOS setup interface. The clicking of the preset button can be performed manually, and this embodiment does not limit this. Different log output requests are triggered by clicking different buttons, and different log output requests correspond to different preset output locations. The preset output location can be at least one of a serial port and a preset file location.

[0109] Step 340: read the target log from the target shared memory to a preset output location according to the memory storage information and the log storage information.

[0110] Because it is an in-band management method, the BIOS can directly obtain the relevant information of the target shared memory, so the BIOS can directly obtain the memory storage information and log storage information. The BIOS reads the target log from the target shared memory according to the memory storage information, parses the target log according to the log storage information, and reads the target log to the preset output location.

[0111] When the preset output location is a serial port, the target log can be output to the serial port in a preset order; when the preset output location is a preset file location, the log obtained after parsing can be output to a text file in the preset file location and stored in a preset text format. The stored text file can be packaged and compressed to reduce the size occupied and facilitate downloading and viewing when needed, thereby improving the convenience of log acquisition.

[0112] The advantage of such a setting is that when the current management mode is the in-band management mode, and the read execution object is the BIOS, the memory storage information and the log storage information can be directly obtained through the BIOS, so that the target log can be read from the target shared memory to the preset output location according to the memory storage information and the log storage information, thereby improving the efficiency of log reading. In addition, the preset output location can be determined according to the log output request, so that the target log can be output to different locations, thereby improving the flexibility of log output.

[0113] Figure 4A log processing method provided in Example 3 of the present invention Figure 2 This technical solution is to provide a supplementary explanation of the process of reading the target log from the target shared memory to the preset output location according to the read execution object, memory storage information and log storage information when the current management mode is the in-band management mode and the read execution object is determined to be the unified extensible firmware interface system. Figure 2 like Figure 4 As shown:

[0114] Step 410: If the log transfer option is enabled as determined by the BIOS, the initial memory information of the target shared memory is read; wherein both the baseboard management controller BMC and the BIOS can access the target shared memory.

[0115] Step 420: Determine memory storage information according to the initial memory information and the first preset setting information through BIOS, and store the current log in the target shared memory according to the memory storage information to generate log storage information; wherein the first preset setting information is determined by BMC and BIOS.

[0116] Step 430: If the current management mode is the in-band management mode, determine that the read execution object is the unified extensible firmware interface system; and write the memory storage information and the log storage information into the second preset setting information through the BIOS; wherein the second preset setting information is determined by the BIOS.

[0117] The Unified Extensible Firmware Interface (UEFI) system may be a UEFI Shell, which is an independent system included in the BIOS, and therefore the memory storage information and the log storage information cannot be directly obtained.

[0118] The memory storage information and the log storage information are written into the second preset setting information; wherein the second preset setting information is determined by the BIOS, and a preset interface can be set to be associated with the second preset setting information for other in-band systems associated with the BIOS to call.

[0119] Step 440: Read the memory storage information and the log storage information from the second preset setting information through the UEFI system.

[0120] The unified extensible firmware interface system calls a preset interface to obtain second preset setting information corresponding to the preset interface, so as to read the memory storage information and the log storage information from the second preset setting information.

[0121] Step 450: read the target log from the target shared memory to a preset output location according to the memory storage information and the log storage information.

[0122] The UEFI system reads the target log from the target shared memory according to the memory storage information, parses the target log according to the log storage information, and reads the target log to a preset output location. The preset output location can be a console or a preset file location, which is not limited in this embodiment.

[0123] The advantage of such a setting is that when the current management mode is the in-band management mode, and the read execution object is a unified extensible firmware interface system, the memory storage information and the log storage information can be correspondingly obtained from the second preset setting information for writing the memory storage information and the log storage information through the unified extensible firmware interface system, thereby solving the problem that the unified extensible firmware interface system cannot directly obtain the target shared memory information, and expanding the implementation object that can read the target log from the target shared memory, so as to meet the needs of log acquisition in different application scenarios and improve the flexibility of log acquisition.

[0124] Figure 5 A log processing method provided in Example 3 of the present invention Figure 3 This technical solution is to provide a supplementary explanation of the process of reading the target log from the target shared memory to the preset output location according to the read execution object, memory storage information and log storage information when the current management mode is the in-band management mode and the read execution object is determined to be at least one of the operating system and the third-party hardware tool. Figure 3 like Figure 5 As shown:

[0125] Step 510: If it is determined through BIOS that the log transfer option is turned on, the initial memory information of the target shared memory is read; wherein both the baseboard management controller BMC and the BIOS can access the target shared memory.

[0126] Step 520: Determine memory storage information according to the initial memory information and the first preset setting information through BIOS, and store the current log in the target shared memory according to the memory storage information to generate log storage information; wherein the first preset setting information is determined by BMC and BIOS.

[0127] Then go to step 530 or step 540.

[0128] Step 530: If the current management mode is in-band management mode, determine that the read execution object is at least one of an operating system and a third-party hardware tool; read the target log from the target shared memory to a preset output location according to the memory storage information and the log storage information by reading the execution object.

[0129] Among them, the operating system can be a Windows system, a Linux system, etc. The third-party hardware tool debugs the operating system through hardware to solve problems caused by the operating system. It can be a DCI (Direct Connect Interface) Debug tool, which is not limited in this embodiment.

[0130] The operating system and third-party hardware tools can directly obtain the memory storage information and the log storage information, and thus can read the target log from the target shared memory according to the memory storage information, parse the target log according to the log storage information, and read the target log to the preset output location. The preset output location can be a console or a preset file location, which is not limited in this embodiment.

[0131] Step 540: If the current management mode is the in-band management mode, determine that the read execution object is at least one of the operating system and the third-party hardware tool; trigger a preset interrupt through the read execution object to switch the read execution object to BIOS, and read the target log from the target shared memory to the preset output location through BIOS according to the memory storage information and the log storage information; wherein the interrupt type of the preset interrupt is determined according to the object type of the read execution object.

[0132] By reading the execution object to trigger the preset interrupt, the read execution object is switched to BIOS. The interrupt type of the preset interrupt is determined according to the object type of the read execution object. For example, if the read execution object is the operating system, the triggered interrupt is a software interrupt; if the read execution object is a third-party hardware tool, the triggered interrupt is a hardware interrupt.

[0133] After the read execution object is switched to BIOS, the target log can be read from the target shared memory to the preset output location according to the read execution object, memory storage information and log storage information by the method described in this embodiment after determining that the read execution object is BIOS.

[0134] The advantage of such a setting is that when the current management mode is the in-band management mode, and the read execution object is at least one of the operating system and the third-party hardware tool, the memory storage information and the log storage information can be directly obtained through the operating system or the third-party hardware tool to read the target log; the read execution object can also be changed to BIOS by triggering an interrupt, and the target log can be read through BIOS. Thus, the implementation object that can read the target log from the target shared memory is expanded, and the read execution object can also be changed to meet the needs of log acquisition in different application scenarios, and improve the flexibility of log acquisition.

[0135] In order to enable those skilled in the art to more clearly understand the present solution, the embodiment of the present invention also provides a specific implementation method.

[0136] Step 1: In response to a switch operation according to a log transfer option, a memory size of an available memory of a target shared memory is determined through BIOS.

[0137] Step 2: If the log transfer option is enabled through BIOS, the initial memory information of the target shared memory is read; wherein both the baseboard management controller BMC and BIOS can access the target shared memory.

[0138] Step 3: Determine memory storage information through BIOS according to initial memory information and first preset setting information, and store the current log in the target shared memory according to the memory storage information to generate log storage information; wherein the first preset setting information is determined by BMC and BIOS.

[0139] Before storing the current log in the target shared memory according to the memory storage information, it also includes: obtaining the current log through BIOS and judging whether there is an end mark in the current log; if there is, determining the separation method of the current log according to the end mark, and determining the storage method of the current log according to the separation method.

[0140] Step 4: determine the log read execution object according to the mode type of the current management mode, and read the target log from the target shared memory to the preset output location according to the read execution object, memory storage information and log storage information; wherein the current management mode includes at least one of an out-of-band management mode and an in-band management mode.

[0141] Step 4.1: If the current management mode is the out-of-band management mode, determine that the read execution object is the BMC; obtain memory storage information and log storage information through the BMC, read the target log from the target shared memory according to the memory storage information, and parse the target log according to the log storage information; output the parsed target log to a preset file location.

[0142] Step 4.2: If the current management mode is the in-band management mode, determine that the read execution object is BIOS; obtain the log output request of the BIOS setting interface through BIOS, and determine the preset output location according to the log output request; wherein the preset output location includes at least one of a serial port and a preset file location; read the target log from the target shared memory to the preset output location according to the memory storage information and the log storage information.

[0143] Step 4.3: If the current management mode is in-band management mode, determine that the read execution object is a unified extensible firmware interface system; read the memory storage information and log storage information from the second preset setting information through the unified extensible firmware interface system; read the target log from the target shared memory to the preset output location according to the memory storage information and log storage information.

[0144] Wherein, after the current log is stored in the target shared memory according to the memory storage information to generate the log storage information, the memory storage information and the log storage information are written into the second preset setting information through the BIOS; the second preset setting information is determined by the BIOS.

[0145] Step 4.4, if the current management mode is the in-band management mode, determining that the read execution object is at least one of the operating system and the third-party hardware tool; reading the target log from the target shared memory to the preset output location according to the memory storage information and the log storage information by reading the execution object;

[0146] Or, trigger a preset interrupt by reading the execution object to switch the read execution object to BIOS, and read the target log from the target shared memory to the preset output location through BIOS according to the memory storage information and the log storage information; wherein the interrupt type of the preset interrupt is determined according to the object type of the read execution object.

[0147] Embodiment 4

[0148] Figure 6 This is a schematic diagram of the structure of a log processing device provided in the fourth embodiment of the present invention. The device can be implemented by hardware and / or software, can execute a log processing method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method. Figure 6 As shown, the device comprises:

[0149] The memory information reading module 610 is used to read the initial memory information of the target shared memory if the log transfer option is turned on through the BIOS; wherein both the baseboard management controller BMC and the BIOS can access the target shared memory;

[0150] A storage information generating module 620, configured to determine memory storage information according to the initial memory information and first preset setting information through the BIOS, and store the current log in the target shared memory according to the memory storage information to generate log storage information; wherein the first preset setting information is determined by the BMC and the BIOS;

[0151] The log reading module 630 is used to determine the log reading execution object according to the mode type of the current management mode, and read the target log from the target shared memory to a preset output location according to the reading execution object, the memory storage information and the log storage information; wherein the current management mode includes at least one of an out-of-band management mode and an in-band management mode.

[0152] On the basis of the above technical solutions, optionally, if the current management mode is the out-of-band management mode, determining that the read execution object is the BMC;

[0153] Correspondingly, the log reading module includes:

[0154] A first information acquisition unit, configured to acquire the memory storage information and the log storage information through the BMC, read the target log from the target shared memory according to the memory storage information, and parse the target log according to the log storage information;

[0155] The log output unit is used to output the parsed target log to a preset file location.

[0156] On the basis of the above technical solutions, optionally, if the current management mode is the in-band management mode, determining that the read execution object is BIOS;

[0157] Correspondingly, the log reading module includes:

[0158] a location determination unit, configured to obtain a log output request of a BIOS setup interface through the BIOS, and determine the preset output location according to the log output request; wherein the preset output location includes at least one of a serial port and a preset file location;

[0159] The first log reading unit is used to read the target log from the target shared memory to the preset output location according to the memory storage information and the log storage information.

[0160] On the basis of the above technical solutions, optionally, if the current management mode is the in-band management mode, determining that the read execution object is a unified extensible firmware interface system;

[0161] And the device also includes:

[0162] an information writing module, used for the storage information generating module to write the memory storage information and the log storage information into the second preset setting information through the BIOS after the memory storage information is determined through the BIOS according to the initial memory information and the first preset setting information, and the current log is stored in the target shared memory according to the memory storage information; wherein the second preset setting information is determined by the BIOS;

[0163] Correspondingly, the log reading module includes:

[0164] an information reading unit, configured to read the memory storage information and the log storage information from the second preset setting information through the unified extensible firmware interface system;

[0165] The second log reading unit is used to read the target log from the target shared memory to the preset output location according to the memory storage information and the log storage information.

[0166] On the basis of the above technical solutions, optionally, if the current management mode is the in-band management mode, determining that the read execution object is at least one of an operating system and a third-party hardware tool;

[0167] Correspondingly, the log reading module includes:

[0168] A third log reading unit, configured to read the target log from the target shared memory to the preset output location according to the memory storage information and the log storage information through the read execution object;

[0169] Or, a fourth log reading unit is used to trigger a preset interrupt through the read execution object to switch the read execution object to the BIOS, and read the target log from the target shared memory to the preset output location through the BIOS according to the memory storage information and the log storage information; wherein the interrupt type of the preset interrupt is determined according to the object type of the read execution object.

[0170] On the basis of the above technical solutions, optionally, the device further includes:

[0171] an identification existence judgment module, used for the storage information generation module to obtain the current log through the BIOS and judge whether there is an end identification in the current log before storing the current log in the target shared memory according to the memory storage information;

[0172] The storage mode determination module is used to determine the separation mode of the current log according to the end identifier if the identifier existence determination module determines that the log exists, and determine the storage mode of the current log according to the separation mode.

[0173] On the basis of the above technical solutions, optionally, the device further includes:

[0174] The memory size determination module is used before the memory information reading module, in response to the switch operation according to the log transfer option, to determine the memory size of the available memory of the target shared memory through the BIOS.

[0175] Embodiment 5

[0176] Figure 7 A schematic diagram of the structure of an electronic device 10 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.

[0177] like Figure 7 As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0178] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0179] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as a log processing method.

[0180] In some embodiments, the log processing method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the log processing method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to execute the log processing method in any other appropriate manner (e.g., by means of firmware).

[0181] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0182] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0183] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0184] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).

[0185] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0186] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.

[0187] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.

[0188] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A log processing method, characterized in that: include: If the log transfer option is turned on through BIOS, the initial memory information of the target shared memory is read; wherein both the baseboard management controller BMC and the BIOS can access the target shared memory; Determining memory storage information according to the initial memory information and first preset setting information through the BIOS, and storing a current log in the target shared memory according to the memory storage information to generate log storage information; wherein the first preset setting information is determined by the BMC and the BIOS; Determine a log read execution object according to the mode type of the current management mode, and read the target log from the target shared memory to a preset output location according to the read execution object, the memory storage information and the log storage information; wherein the current management mode includes at least one of an out-of-band management mode and an in-band management mode; If the current management mode is the out-of-band management mode, determining that the read execution object is the BMC; correspondingly, reading the target log from the target shared memory to a preset output location according to the read execution object, the memory storage information, and the log storage information includes: Acquire the memory storage information and the log storage information through the BMC, read the target log from the target shared memory according to the memory storage information, parse the target log according to the log storage information; output the parsed target log to a preset file location; If the current management mode is the in-band management mode, determining that the read execution object is BIOS; correspondingly, reading the target log from the target shared memory to a preset output location according to the read execution object, the memory storage information, and the log storage information includes: Obtain a log output request of a BIOS setup interface through the BIOS, and determine the preset output location according to the log output request; wherein the preset output location includes at least one of a serial port and a preset file location; and read the target log from the target shared memory to the preset output location according to the memory storage information and the log storage information.

2. The method according to claim 1, characterized in that: If the current management mode is the in-band management mode, determining that the read execution object is a unified extensible firmware interface system; After determining the memory storage information according to the initial memory information and the first preset setting information by the BIOS, and storing the current log in the target shared memory according to the memory storage information to generate the log storage information, the method further includes: Writing the memory storage information and the log storage information into second preset setting information through the BIOS; wherein the second preset setting information is determined by the BIOS; Correspondingly, reading the target log from the target shared memory to a preset output location according to the read execution object, the memory storage information and the log storage information includes: Reading the memory storage information and the log storage information from the second preset setting information through the unified extensible firmware interface system; The target log is read from the target shared memory to the preset output location according to the memory storage information and the log storage information.

3. The method according to claim 1, characterized in that: If the current management mode is the in-band management mode, determining that the read execution object is at least one of an operating system and a third-party hardware tool; Correspondingly, reading the target log from the target shared memory to a preset output location according to the read execution object, the memory storage information and the log storage information includes: Reading the target log from the target shared memory to the preset output location through the read execution object according to the memory storage information and the log storage information; Or, trigger a preset interrupt through the read execution object to switch the read execution object to the BIOS, and read the target log from the target shared memory to the preset output location through the BIOS according to the memory storage information and the log storage information; wherein the interrupt type of the preset interrupt is determined according to the object type of the read execution object.

4. The method according to claim 1, characterized in that Before storing the current log in the target shared memory according to the memory storage information, the method further includes: Obtain the current log through the BIOS, and determine whether there is an end mark in the current log; If it exists, the separation method of the current log is determined according to the end identifier, and the storage method of the current log is determined according to the separation method.

5. The method according to claim 1, characterized in that Before the BIOS determines whether the log dump option is enabled, the following steps are also required: In response to the switch operation according to the log dump option, the memory size of the available memory of the target shared memory is determined by the BIOS.

6. A log processing device, characterized in that: include: A memory information reading module, used for reading the initial memory information of the target shared memory if the log transfer option is turned on through the BIOS; wherein both the baseboard management controller BMC and the BIOS can access the target shared memory; a storage information generating module, configured to determine memory storage information according to the initial memory information and first preset setting information through the BIOS, and store the current log in the target shared memory according to the memory storage information to generate log storage information; wherein the first preset setting information is determined by the BMC and the BIOS; A log reading module, used to determine a log reading execution object according to a mode type of a current management mode, and read a target log from the target shared memory to a preset output location according to the reading execution object, the memory storage information and the log storage information; wherein the current management mode includes at least one of an out-of-band management mode and an in-band management mode; If the current management mode is the out-of-band management mode, the read execution object is determined to be the BMC; accordingly, the log reading module is used to: Acquire the memory storage information and the log storage information through the BMC, read the target log from the target shared memory according to the memory storage information, parse the target log according to the log storage information; output the parsed target log to a preset file location; If the current management mode is the in-band management mode, it is determined that the read execution object is BIOS; accordingly, the log reading module is used to: Obtain a log output request of a BIOS setup interface through the BIOS, and determine the preset output location according to the log output request; wherein the preset output location includes at least one of a serial port and a preset file location; and read the target log from the target shared memory to the preset output location according to the memory storage information and the log storage information.

7. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the log processing method according to any one of claims 1 to 5.

8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the log processing method according to any one of claims 1 to 5 when executed.

Citation Information

Patent Citations

  • Log management method, system and device and computer readable storage medium

    CN112612766A

  • Server bios log storage method and related device

    CN113868002A