CN116361106A - Log processing method and device, electronic equipment and storage medium - Google Patents

Log processing method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN116361106A
CN116361106A CN202310159020.2A CN202310159020A CN116361106A CN 116361106 A CN116361106 A CN 116361106A CN 202310159020 A CN202310159020 A CN 202310159020A CN 116361106 A CN116361106 A CN 116361106A
Authority
CN
China
Prior art keywords
log
storage information
memory
bios
target
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310159020.2A
Other languages
Chinese (zh)
Inventor
王佳佳
鲁碧兰
胡远明
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Nettrix Information Industry Beijing Co Ltd
Original Assignee
Nettrix Information Industry Beijing Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Nettrix Information Industry Beijing Co Ltd filed Critical Nettrix Information Industry Beijing Co Ltd
Priority to CN202310159020.2A priority Critical patent/CN116361106A/en
Publication of CN116361106A publication Critical patent/CN116361106A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3065Monitoring arrangements determined by the means or processing involved in reporting the monitored data
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3089Monitoring arrangements determined by the means or processing involved in sensing the monitored data, e.g. interfaces, connectors, sensors, probes, agents
    • G06F11/3093Configuration details thereof, e.g. installation, enabling, spatial arrangement of the probes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3089Monitoring arrangements determined by the means or processing involved in sensing the monitored data, e.g. interfaces, connectors, sensors, probes, agents
    • G06F11/3096Monitoring arrangements determined by the means or processing involved in sensing the monitored data, e.g. interfaces, connectors, sensors, probes, agents wherein the means or processing minimize the use of computing system or of computing system component resources, e.g. non-intrusive monitoring which minimizes the probe effect: sniffing, intercepting, indirectly deriving the monitored data from other directly available data
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/544Buffers; Shared memory; Pipes
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Quality & Reliability (AREA)
  • Software Systems (AREA)
  • Computing Systems (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention discloses a log processing method, a log processing device, electronic equipment and a storage medium. The method comprises the following steps: if the BIOS determines that the log transfer option is started, the initial memory information of the target shared memory accessible to both the BMC and the BIOS is read; determining memory storage information according to the initial memory information and the first preset setting information by the BIOS, and storing a current log in a target shared memory according to the memory storage information to generate log storage information; and determining a reading execution object of the log according to the mode type of the current management mode, and reading the target log to a preset output position from the target shared memory according to the reading execution object, the memory storage information and the log storage information. By operating the technical scheme provided by the embodiment of the invention, the problem that the current log is output to the serial port in real time to increase the starting time of the machine can be solved, so that the log can be stored and output under the condition of less influence on the starting speed.

Description

Log processing method and device, electronic equipment and storage medium
Technical Field
The present invention relates to computer technologies, and in particular, to a log processing method, apparatus, electronic device, and storage medium.
Background
In the event of a problem with the system of the machine or the need to analyze the system operating conditions, it is often necessary to obtain a BIOS log for specific analysis.
In the prior art, the log can be obtained by starting a Debug mode and outputting the log to a serial port in real time when the machine is started, but the machine can take more time when the machine is started; the Debug mode can be closed, and the log is obtained again by starting the Debug mode when the log is required to be obtained, however, partial information is reset when the system is in downtime and other problems, so that the obtained log may have the problem that the actual log cannot be completely restored.
Disclosure of Invention
The invention provides a log processing method, a log processing device, electronic equipment and a storage medium, so as to improve the applicability of log processing.
According to an aspect of the present invention, there is provided a log processing method, the method including:
if the BIOS determines that the log transfer option is opened, the initial memory information of the target shared memory is read; wherein, the baseboard management controller BMC and the BIOS can both access the target shared memory;
determining memory storage information according to the initial memory information and first preset setting information by the BIOS, and storing a current log in the target shared memory according to the memory storage information to generate log storage information; the first preset setting information is determined through the BMC and the BIOS;
Determining a reading execution object of a log according to the mode type of the current management mode, and reading a target log to a preset output position from the target shared memory according to the reading execution object, the memory storage information and the log storage information; the current management mode comprises at least one of an out-of-band management mode and an in-band management mode.
Optionally, if the current management mode is the out-of-band management mode, determining that the reading execution object is the BMC;
correspondingly, the reading the target log from the target shared memory to the preset output position according to the reading execution object, the memory storage information and the log storage information includes:
acquiring the memory storage information and the log storage information through the BMC, reading the target log from the target shared memory according to the memory storage information, and analyzing the target log according to the log storage information;
and outputting the analyzed target log to a preset file position.
The advantages of this arrangement are that: because both the BMC and the BIOS can access the target shared memory, the BMC can read the target log from the target shared memory, and the target log is read when the current management mode is the out-of-band management mode. The BMC determines a readable position according to the memory storage information to read a target log from the target shared memory, and analyzes the target log according to the log storage information to obtain a log which can be read by a user, so that the effectiveness of subsequent log output is improved. And storing the analyzed target log in a preset text format, and outputting the stored text file obtained after storage to a preset output position, so that downloading and checking can be conveniently carried out when needed, and the convenience degree of log acquisition is improved.
Optionally, if the current management mode is the in-band management mode, determining that the reading execution object is a BIOS;
correspondingly, the reading the target log from the target shared memory to the preset output position according to the reading execution object, the memory storage information and the log storage information includes:
acquiring a log output request of a BIOS setting interface through the BIOS, and determining the preset output position according to the log output request; the preset output position comprises at least one of a serial port and a preset file position;
and reading the target log from the target shared memory to the preset output position according to the memory storage information and the log storage information.
The advantages of this arrangement are that: when the current management mode is an in-band management mode and the reading execution object is a BIOS, the memory storage information and the log storage information can be directly obtained through the BIOS, so that the target log is read to a preset output position from the target shared memory according to the memory storage information and the log storage information, and the log reading efficiency is improved. And the preset output position can be determined according to the log output request, so that the target log is output to different positions, and the flexibility of log output is improved.
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;
and after determining, by the BIOS, memory storage information according to the initial memory information and first preset setting information, and storing a current log in the target shared memory according to the memory storage information, to generate log storage information, further including:
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, the reading the target log from the target shared memory to the preset output position according to the reading 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;
and reading the target log from the target shared memory to the preset output position according to the memory storage information and the log storage information.
The advantages of this arrangement are that: when the current management mode is an in-band management mode and the reading execution object is a unified extensible firmware interface system, the memory storage information and the log storage information can be correspondingly acquired from the second preset setting information written in the memory storage information and the log storage information through the unified extensible firmware interface system, the problem that the unified extensible firmware interface system cannot directly acquire the target shared memory information is solved, the realization object of the target log can be read from the target shared memory is expanded, so that the requirement of log acquisition under different application scenes is met, and the applicability of log acquisition is improved.
Optionally, if the current management mode is the in-band management mode, determining that the reading execution object is at least one of an operating system and a third-party hardware tool;
correspondingly, the reading the target log from the target shared memory to the preset output position according to the reading 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 position according to the memory storage information and the log storage information by the reading execution object;
Or triggering a preset interrupt through the read execution object to switch the read execution object to the BIOS, and reading the target log to the preset output position from the target shared memory through the BIOS according to the memory storage information and the log storage information; and determining the interrupt type of the preset interrupt according to the object type of the read execution object.
The advantages of this arrangement are that: when the current management mode is an in-band management mode and the reading execution object is at least one of an operating system and a 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 so as to read the target log; the read execution object can be changed to be the BIOS by triggering the interrupt, and the target log is read by the BIOS. Therefore, the realization object capable of reading the target log from the target shared memory is expanded, and the reading execution object can be changed, so that the requirement of log acquisition under different application scenes is met, and the flexibility of log acquisition is improved.
Optionally, before storing the current log in the target shared memory according to the memory storage information, the method further includes:
Acquiring the current log through the BIOS, and judging whether an ending mark exists in the current log or not;
if the current log exists, determining a separation mode of the current log according to the ending mark, and determining a storage mode of the current log according to the separation mode.
The advantages of this arrangement are that: if a single byte is stored as a single log, the header file of the log needs to be generated when each log is stored, and the header file occupies part of the memory, so that when the number of bytes is too large, the log storage occupies the memory space of too many target shared memories; if all bytes are stored as a single log, the log information amount is large, and the subsequent log analysis speed is affected. According to whether the end mark exists in the current log, the current log is separated and stored, and the analysis speed of the log in the subsequent log reading process is improved under the condition that the log storage does not occupy excessive space.
Optionally, before the BIOS judges whether the log transfer option is opened, the method further comprises:
and responding to the switching operation according to the log transfer option, and determining the memory size of the usable memory of the target shared memory through the BIOS.
The advantages of this arrangement are that: different memory use requirements are determined through the switching operation of the log transfer options, so that the size of the target shared memory is determined according to the different use requirements, for example, when the log is required to be stored in the target shared memory, the target shared memory is enlarged, and the problem that the log cannot be stored due to too small storage space of the target shared memory is avoided; when the log is not needed to be stored in the target shared memory, the size of the target shared memory is kept, the memory space in the target shared memory is prevented from being idle, and the memory utilization rate of the target shared memory is improved; thereby improving the effectiveness of memory size determination of the usable memory of the target shared memory.
According to another aspect of the present invention, there is provided a log processing apparatus including:
the memory information reading module is used for reading initial memory information of the target shared memory if the BIOS determines that the log transfer option is opened; wherein, the baseboard management controller BMC and the BIOS can both access the target shared memory;
the storage information generation module is used for 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 so as to generate log storage information; the first preset setting information is determined through the BMC and the BIOS;
The log reading module is used for determining a reading execution object of a log according to the mode type of the current management mode and reading a target log to a preset output position from the target shared memory according to the reading execution object, the memory storage information and the log storage information; the current management mode comprises at least one of an out-of-band management mode and an in-band management mode.
According to another aspect of the present invention, there is provided an electronic apparatus including:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein, the liquid crystal display device comprises a liquid crystal display device,
the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the log processing method according to any one of the embodiments of the present invention.
According to another aspect of the present invention, there is provided a computer readable storage medium storing computer instructions for causing a processor to execute a log processing method according to any embodiment of the present invention.
According to the technical scheme, under the condition that the Debug mode is started, the current logs are stored in the target shared memory which can be accessed by both the BMC and the BIOS, so that the BMC and the BIOS can process the logs conveniently, and the application range of log processing is improved; and the current log is stored in the target shared memory, and can be acquired from the target shared memory when the log is needed, so that the current log is not required to be output to the serial port in real time in the starting process of the machine, the problem that the starting time of the machine is prolonged due to real-time output is avoided, and the log can be stored under the condition of less influence on the starting speed.
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 rule, the validity of log storage is improved, log reading can be carried out according to the memory storage information and the generated log storage information, unordered query is not needed in the target shared memory, and the pertinence and the efficiency of log acquisition are improved. And different reading execution objects are determined according to different management modes, so that logs can be obtained from the target shared memory in different current management modes, and the applicability of log obtaining is improved.
It should be understood that the description in this section is not intended to identify key or critical features of the embodiments of the invention or to delineate the scope of the invention. Other features of the present invention will become apparent from the description that follows.
Drawings
FIG. 1 is a flowchart of a log processing method according to a first embodiment of the present invention;
FIG. 2 is a flowchart of a log processing method according to a second embodiment of the present invention;
FIG. 3 is a flowchart I of a log processing method according to a third embodiment of the present invention;
fig. 4 is a flowchart two of a log processing method according to a third embodiment of the present invention;
FIG. 5 is a flowchart III of a log processing method according to a third embodiment of the present invention;
fig. 6 is a schematic structural diagram of a log processing device according to a fourth embodiment of the present invention;
fig. 7 is a schematic structural diagram of an electronic device for implementing an embodiment of the present invention.
Detailed Description
In order that those skilled in the art will better understand the present invention, a technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in which it is apparent that the described embodiments are only some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present invention without making any inventive effort, shall fall within the scope of the present invention.
It should be noted that the terms "first," "second," "target," and the like in the description and claims of the present invention and in the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the invention described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Example 1
Fig. 1 is a flowchart of a log processing method according to an embodiment of the present invention, where the embodiment is applicable to storing a BIOS (Basic Input Output System ) log and outputting a BIOS log, and the method may be performed by a log processing device according to an embodiment of the present invention, and the device may be implemented by software and/or hardware. Referring to fig. 1, the log processing method provided in this embodiment includes:
Step 110, if the BIOS determines that the log transfer option is opened, the initial memory information of the target shared memory is read; wherein, the BMC and BIOS can access the target shared memory.
If the log transfer option is opened, the log is indicated to be processed in the target shared memory, and if the log transfer option is not opened, the log is indicated to be processed in the original preset mode, for example, output to the serial port, which is not limited in this embodiment.
For example, after the machine is powered on, the BIOS reads the setting of the BIOS at the beginning of the preparation phase of the EFI (Extensible Firmware Interface ) environment, and determines whether the log transfer option is turned on according to the variable related to the log transfer option in the setting.
If the log transfer option is judged to be opened, the initial memory information of the target shared memory is read; the target shared memory is a shared memory storing logs, and the BMC (Baseboard Management Controller ) and the BIOS can access the shared memory, for example, VGA (Video Graphics Array ), which is not limited in this embodiment.
The initial memory information of the target shared memory is the memory information when the log is not stored, and may include an initial memory address, an initial memory size, and the like of the target shared memory. The initial memory information can be obtained by reading a register related to the BMC and written with the memory information, and if the target shared memory is VGA memory, the initial memory information can be obtained by reading a register, which is contained in VGA equipment and contains the BMC chip, of the memory information.
In this embodiment, optionally, before determining, by the BIOS, whether the log-forwarding option is turned on, the method further includes:
and in response to the switching operation according to the log transfer option, determining the memory size of the usable memory of the target shared memory through the BIOS.
The log transfer option may be located in the BIOS setting interface, and the switching operation of the log transfer option may be triggered manually or actively by the system, which is not limited in this embodiment.
By way of example, if the log transfer option is detected to be open, the BIOS may set the size of the target shared memory to an extended size, such as 64M, and if the log transfer option is detected to be closed, the BIOS may set the size of the target shared memory to a default size, such as 16M or 32M.
The advantages of this arrangement are that: different memory use requirements are determined through the switching operation of the log transfer options, so that the size of the target shared memory is determined according to the different use requirements, for example, when the log is required to be stored in the target shared memory, the target shared memory is enlarged, and the problem that the log cannot be stored due to too small storage space of the target shared memory is avoided; when the log is not needed to be stored in the target shared memory, the size of the target shared memory is kept, the memory space in the target shared memory is prevented from being idle, and the memory utilization rate of the target shared memory is improved; thereby improving the effectiveness of memory size determination of the usable memory of the target shared memory.
Step 120, determining memory storage information according to the initial memory information and the first preset setting information by the BIOS, and storing a current log in the target shared memory according to the memory storage information to generate log storage information; the first preset setting information is determined through the BMC and the BIOS.
The first preset setting information is determined by the BMC and the BIOS, and may be a mode about how to store the log, which is pre-agreed between the BIOS and the BMC, for example, may include static storage and dynamic storage, where the static storage may be a storage mode, for example, the size of the target shared memory is 64M, and if the fixed 32M is used to store the log, the starting address and the ending address of the storage are determined correspondingly.
The dynamic storage can be determined according to the actual size of the log to be stored or other storage information in the target shared memory in a storage mode, namely the starting address and the ending address of the storage change according to the actual storage condition. For example, if the size of the log to be stored exceeds a preset threshold, 32M in the target shared memory is allocated for storage, and if the size of the log to be stored is smaller than or equal to the preset threshold, 16M in the target shared memory is allocated for storage, so that the problem that the storage space is insufficient due to the large amount of the log to be stored or the excessive memory space is occupied when the amount of the log to be stored is small is avoided, and the flexibility of log storage is improved. Or the log and other storage information are stored adjacently in the target shared memory, the other storage information originally stores the size of 2M, the 4M is needed to be stored, and the address for storing the log needs to be offset by 2M correspondingly.
And determining memory storage information according to the initial memory information and the first preset setting information, namely determining a storage mode according to the first preset setting information, determining memory storage information to be followed in storage according to the storage mode and the initial memory information, and actually storing according to the memory storage information. For example, if the initial memory information includes an initial memory address of the target shared memory, and the initial memory size is 64M, the first preset setting information is static information, including fixing a start address and a stop address in the target shared memory, and a space with a size of 32M is used for storing the log, the memory storage information is: the log may be stored in a space with an initial memory address, a fixed starting address and ending address in a target shared memory with a size of 64M, and a size of 32M.
The current log is stored in the target shared memory according to the memory storage information, wherein the current log is a BIOS log to be stored currently, and the BIOS log is a log generated in the BIOS stage, may be all the BIOS logs generated currently, or may be all the BIOS logs to be acquired currently, for example, may be part of BIOS logs of specific sources in all the BIOS logs, which is not limited in this embodiment.
Optionally, before the current log is stored in the target shared memory according to the memory storage information, the target shared memory may be preprocessed, so that the efficiency of subsequent log storage is improved, a preprocessing manner may be determined according to a data structure during log storage, and if the data structure during log storage is an exemplary bidirectional linked list, the preprocessing may be memory alignment processing on the target shared memory.
And generating log storage information after storing the current log, wherein the log storage information is information obtained after actually storing the log, such as data structure information, log number, storage address of a first log, storage address of a last log and the like, when storing the log, and the data structure information can be a bidirectional linked list and the like, which is not limited in the embodiment.
In this embodiment, optionally, before storing the current log in the target shared memory according to the memory storage information, the method further includes:
acquiring a current log through a BIOS (basic input output system), and judging whether an ending mark exists in the current log;
if the current log exists, determining a separation mode of the current log according to the ending mark, and determining a storage mode of the current log according to the separation mode.
The current log is obtained by the BIOS, and the current log is composed of one or more bytes.
If the ending mark exists, the ending mark exists between bytes of the current log, the ending mark can be added through a preset function when the log is generated, the adding position can be determined manually or the log generating source can be determined automatically, for example, if the obtained log source changes, the ending mark is added after the last byte obtained before the change. Where the end identifier is, for example, "/n", which is not limiting in this embodiment.
Separating the current logs according to an ending identifier, wherein the ending identifier is used for identifying that a single log in the current log ends, bytes before the ending identifier can be stored as a single log, and if the current log comprises byte 1, byte 2..byte 12, line feed identifier, byte 13 and byte 14..byte 20, then bytes 1-12 and bytes 13-20 can be separated, and bytes 1-12 and bytes 13-20 can be respectively stored as a single log in a target shared memory.
The advantages of this arrangement are that: if a single byte is stored as a single log, the header file of the log needs to be generated when each log is stored, and the header file occupies part of the memory, so that when the number of bytes is too large, the log storage occupies the memory space of too many target shared memories; if all bytes are stored as a single log, the log information amount is large, and the subsequent log analysis speed is affected. According to whether the end mark exists in the current log, the current log is separated and stored, and the analysis speed of the log in the subsequent log reading process is improved under the condition that the log storage does not occupy excessive space.
130, determining a reading execution object of the log according to the mode type of the current management mode, and reading the target log to a preset output position from the target shared memory according to the reading execution object, the memory storage information and the log storage information; the current management mode comprises at least one of an out-of-band management mode and an in-band management mode.
And determining a reading execution object of the log according to the mode type of the current management mode, wherein the reading execution object is an object for executing the reading of the log from the shared memory. Different current management modes, for example, if the current management mode is an out-of-band management mode, that is, when the machine main system is managed by the BMC, the read execution object may be determined to be the BMC; if the current management mode is an in-band management mode, that is, when the machine main system is managed by the CPU, the read execution object may be determined as an operating system, a third-party hardware tool, or the like, and if the current management mode is an in-band management mode, the determined read execution object may be any object capable of executing a log read operation, or may be determined according to the current system running condition, for example, when the system is down and cannot enter the operating system, the log read operation may be executed by other currently available read execution objects.
And reading the target log from the target shared memory to a preset output position according to the reading execution object, the memory storage information and the log storage information, wherein the target log is the log which needs to be output currently, can be all logs stored in the target shared memory or partial logs, and is not limited in the embodiment. The reading mode can be that the position of the log in the shared memory is determined according to the memory storage information by reading the execution object, and the required log is analyzed from the shared memory by the log storage information so as to read. And outputting the read log to a preset output position, wherein the output mode can be that the log is directly output to the preset output position, and the preset output position can be any preset position for storing the output log.
Optionally, the range of the stored output log can be determined according to the size of the storage space of the preset output position, and if the storage space is larger than the corresponding preset range threshold, the log generated by multiple times of machine startup can be stored, so that analysis, comparison and tracking of the log can be performed at a later stage; if the storage space is smaller than the corresponding preset range threshold value, the log generated by single starting of the machine can be saved, and the old log originally stored is covered when the new starting log is generated, so that the space is saved.
According to the technical scheme provided by the embodiment, under the condition that the Debug mode is started, the current logs are stored in the target shared memory which can be accessed by both the BMC and the BIOS, so that the BMC and the BIOS can process the logs conveniently, and the application range of log processing is improved; and the current log is stored in the target shared memory, and can be acquired from the target shared memory when the log is needed, so that the current log is not required to be output to the serial port in real time in the starting process of the machine, the problem that the starting time of the machine is prolonged due to real-time output is avoided, and the log can be stored under the condition of less influence on the starting speed.
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 rule, the validity of log storage is improved, log reading can be carried out according to the memory storage information and the generated log storage information, unordered query is not needed in the target shared memory, and the pertinence and the efficiency of log acquisition are improved. And different reading execution objects are determined according to different management modes, so that logs can be obtained from the target shared memory in different current management modes, and the applicability of log obtaining is improved.
Example two
Fig. 2 is a flowchart of a log processing method according to a second embodiment of the present invention, where the present technical solution is to supplement the process of reading a target log from a target shared memory to a preset output position according to a read execution object, memory storage information and log storage information if a current management mode is an out-of-band management mode.
Specifically, a flow chart of the log processing method is shown in fig. 2:
step 210, if the BIOS determines that the log transfer option is opened, reading the initial memory information of the target shared memory; wherein, the BMC and BIOS can access the target shared memory.
Step 220, determining memory storage information according to the initial memory information and the first preset setting information by the BIOS, and storing a current log in the target shared memory according to the memory storage information to generate log storage information; the first preset setting information is determined through the BMC and the BIOS.
Step 230, if the current management mode is the out-of-band management mode, determining that the read execution object is the BMC, acquiring the memory storage information and the log storage information through the BMC, reading the target log from the target shared memory according to the memory storage information, and analyzing the target log according to the log storage information.
If the current management mode is the out-of-band management mode, the management of the machine main system through the BMC at the moment is indicated, and the read execution object is determined to be the BMC. The memory storage information and the log storage information are obtained through the BMC, wherein the mode of obtaining the memory storage information can be determined according to the type of the first preset setting information, and for example, when the mode of determining the storage log in the first preset setting information comprises 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 through the BMC and the BIOS, so that the BMC can directly obtain the memory storage information. When the mode of determining the storage log in the first preset setting information comprises 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 that the BMC cannot directly acquire the memory storage information, and the memory storage information can be sent to the BMC through the BIOS. Because the BMC can only read and analyze the readable data which is agreed in advance in the target shared memory in an out-of-band management mode, the BMC cannot directly acquire the log storage information, and the log storage information can be acquired by sending the BIOS to the BMC.
Optionally, the process of the BMC reading the target log from the target shared memory may be triggered in response to a click operation of a preset button, where the click operation of the preset button may be performed manually, which is not limited in this embodiment.
The BMC reads the target log from the target shared memory according to the memory storage information, for example, the data of the target log can be read from the target shared memory according to the starting address and the like of the log storage in the memory storage information, wherein the target log data can be binary data. The target log is analyzed according to the log storage information, for example, the read data can be analyzed according to the data structure information and the like in the log storage information, so that the read binary data can be converted into text information or character information which can be read by a user.
And 240, outputting the parsed target log to a preset file position.
Outputting the log obtained after analysis to a text file at a preset file position, and storing the text file in a preset text format, wherein the preset file position is a position for storing files. The stored text file may be packed and compressed to reduce the footprint size.
The advantages of this arrangement are that: because both the BMC and the BIOS can access the target shared memory, the BMC can read the target log from the target shared memory, and the target log is read when the current management mode is the out-of-band management mode. The BMC determines a readable position according to the memory storage information to read a target log from the target shared memory, and analyzes the target log according to the log storage information to obtain a log which can be read by a user, so that the effectiveness of subsequent log output is improved. And storing the analyzed target log in a preset text format, and outputting the stored text file obtained after storage to a preset output position, so that downloading and checking can be conveniently carried out when needed, and the convenience degree of log acquisition is improved.
Example III
Fig. 3 is a flowchart of a log processing method according to a third embodiment of the present invention, where the present technical solution is to supplement the process of reading a target log from a target shared memory to a preset output position according to a read execution object, memory storage information and log storage information when the current management mode is an in-band management mode and the read execution object is determined to be a BIOS. Specifically, a flowchart of the log processing method is shown in fig. 3:
step 310, if the BIOS determines that the log transfer option is opened, the initial memory information of the target shared memory is read; wherein, the BMC and BIOS can access the target shared memory.
Step 320, determining memory storage information according to the initial memory information and the first preset setting information by the BIOS, and storing a current log in the target shared memory according to the memory storage information to generate log storage information; the first preset setting information is determined through the BMC and the BIOS.
Step 330, if the current management mode is an in-band management mode, determining that the read execution object is a BIOS; acquiring a log output request of a BIOS setting interface through a BIOS, and determining a preset output position according to the log output request; the preset output position comprises at least one of a serial port and a preset file position.
The log output request of the BIOS setting interface may be triggered by a clicking operation of a preset button in the BIOS setting interface, where the clicking operation of the preset button may be performed manually, which is not limited in this embodiment. Triggering different log output requests according to clicking of different keys, wherein preset output positions corresponding to the different log output requests are different. The preset output location may be at least one of a serial port and a preset file location.
And 340, reading the target log from the target shared memory to a preset output position according to the memory storage information and the log storage information.
Because the in-band management mode is adopted, the BIOS can directly acquire the related information of the target shared memory, so that the BIOS can directly acquire the memory storage information and the log storage information, the BIOS reads the target log from the target shared memory according to the memory storage information, analyzes the target log according to the log storage information, and reads the target log to a preset output position.
When the preset output position is a serial port, outputting the target log to the serial port according to a preset sequence; when the preset output position is the preset file position, the log obtained after analysis can be output to a text file at the preset file position, the text file is stored in a preset text format, and the stored text file can be packed and compressed, so that the occupied size is reduced, downloading and checking are convenient when needed, and the convenience degree of log acquisition is improved.
The advantages of this arrangement are that: when the current management mode is an in-band management mode and the reading execution object is a BIOS, the memory storage information and the log storage information can be directly obtained through the BIOS, so that the target log is read to a preset output position from the target shared memory according to the memory storage information and the log storage information, and the log reading efficiency is improved. And the preset output position can be determined according to the log output request, so that the target log is output to different positions, and the flexibility of log output is improved.
Fig. 4 is a flowchart of a log processing method according to a third embodiment of the present invention, where the present technical solution is to supplement the process of reading a target log from a target shared memory to a preset output location according to a read execution object, memory storage information and log storage information when the current management mode is an in-band management mode and the read execution object is determined to be a unified extensible firmware interface system. Specifically, a second flowchart of the log processing method is shown in fig. 4:
step 410, if the BIOS determines that the log transfer option is opened, reading the initial memory information of the target shared memory; wherein, the BMC and BIOS can access the target shared memory.
Step 420, determining memory storage information according to the initial memory information and the first preset setting information by the BIOS, and storing a current log in the target shared memory according to the memory storage information to generate log storage information; the first preset setting information is determined through the BMC and the BIOS.
Step 430, if the current management mode is an in-band management mode, determining that the read execution object is a unified extensible firmware interface system; 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.
The unified extensible firmware interface (Unified Extensible Firmware Interface, UEFI) system may be UEFI Shell, which is an independent system contained in the BIOS, so that the memory storage information and the log storage information cannot be directly obtained.
Writing the memory storage information and the log storage information into second preset setting information; the second preset setting information is determined by the BIOS, and the settable preset interface is associated with the second preset setting information for calling other in-band systems with association relation with the BIOS.
Step 440, reading the memory storage information and the log storage information from the second preset setting information through the unified extensible firmware interface system.
The unified extensible firmware interface system calls a preset interface, and second preset setting information corresponding to the preset interface is obtained, so that memory storage information and log storage information are read from the second preset setting information.
And step 450, reading the target log from the target shared memory to a preset output position according to the memory storage information and the log storage information.
The unified extensible firmware interface system reads the target log from the target shared memory according to the memory storage information, analyzes the target log according to the log storage information, and reads the target log to a preset output position. The preset output position may be a console or a preset file position, which is not limited in this embodiment.
The advantages of this arrangement are that: when the current management mode is an in-band management mode and the reading execution object is a unified extensible firmware interface system, the memory storage information and the log storage information can be correspondingly acquired from the second preset setting information written in the memory storage information and the log storage information through the unified extensible firmware interface system, the problem that the unified extensible firmware interface system cannot directly acquire the target shared memory information is solved, the realization object of the target log can be read from the target shared memory is expanded, so that the requirement of log acquisition under different application scenes is met, and the flexibility of log acquisition is improved.
Fig. 5 is a flowchart III of a log processing method according to a third embodiment of the present invention, where the present technical solution is to supplement the process of reading a target log from a target shared memory to a preset output location according to a read execution object, memory storage information and log storage information when the current management mode is an in-band management mode and the read execution object is determined to be at least one of an operating system and a third party hardware tool. Specifically, a third flowchart of the log processing method is shown in fig. 5:
step 510, if the BIOS determines that the log transfer option is opened, the initial memory information of the target shared memory is read; wherein, the BMC and BIOS can access the target shared memory.
Step 520, determining memory storage information according to the initial memory information and the first preset setting information by the BIOS, and storing a current log in the target shared memory according to the memory storage information to generate log storage information; the first preset setting information is determined through the BMC and the BIOS.
The process then proceeds to either step 530 or step 540.
Step 530, if the current management mode is an in-band management mode, determining that the reading execution object is at least one of an operating system and a third-party hardware tool; and reading the target log from the target shared memory to a preset output position according to the memory storage information and the log storage information by reading the execution object.
The operating system may be a Windows system, a Linux system, or the like, and the third-party hardware tool is used for implementing debugging of the operating system in a hardware manner, so as to solve a problem generated by the operating system, and may be a DCI (Direct Connect Interface, direct connection interface) Debug tool, which is not limited in this embodiment.
The operating system and the third-party hardware tool can directly acquire the memory storage information and the log storage information, so that the target log can be read from the target shared memory according to the memory storage information, the target log is analyzed according to the log storage information, and the target log is read to a preset output position. The preset output position may be a console or a preset file position, which is not limited in this embodiment.
Step 540, if the current management mode is an in-band management mode, determining that the reading execution object is at least one of an operating system and a third-party hardware tool; switching the read execution object into a BIOS (basic input/output system) by triggering a preset interrupt through the read execution object, and reading a target log to a preset output position from a target shared memory through the BIOS according to memory storage information and log storage information; the interrupt type of the preset interrupt is determined according to the object type of the read execution object.
Switching the read execution object into the BIOS by triggering a preset interrupt through the read execution object, wherein 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 an 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.
After the read execution object is switched to the BIOS, the method described in this embodiment after determining that the read execution object is the BIOS may be used to read the target log 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.
The advantages of this arrangement are that: when the current management mode is an in-band management mode and the reading execution object is at least one of an operating system and a 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 so as to read the target log; the read execution object can be changed to be the BIOS by triggering the interrupt, and the target log is read by the BIOS. Therefore, the realization object capable of reading the target log from the target shared memory is expanded, and the reading execution object can be changed, so that the requirement of log acquisition under different application scenes is met, and the flexibility of log acquisition is improved.
In order to make the solution more clear for those skilled in the art, the embodiment of the present invention further provides a specific implementation manner.
And step 1, determining the memory size of the usable memory of the target shared memory through the BIOS in response to the switching operation according to the log transfer option.
Step 2, if the BIOS determines that the log transfer option is opened, reading initial memory information of the target shared memory; wherein, the BMC and BIOS can access the target shared memory.
Step 3, determining memory storage information according to the initial memory information and the first preset setting information by the BIOS, and storing a current log in a target shared memory according to the memory storage information to generate log storage information; the first preset setting information is determined through the BMC and the BIOS.
Before storing the current log in the target shared memory according to the memory storage information, the method further comprises: acquiring a current log through a BIOS (basic input output system), and judging whether an ending mark exists in the current log; if the current log exists, determining a separation mode of the current log according to the ending mark, and determining a storage mode of the current log according to the separation mode.
Step 4, determining a reading execution object of the log according to the mode type of the current management mode, and reading the target log to a preset output position from the target shared memory according to the reading execution object, the memory storage information and the log storage information; the current management mode comprises at least one of an out-of-band management mode and an in-band management mode.
Step 4.1, if the current management mode is an out-of-band management mode, determining that the reading execution object is BMC; obtaining memory storage information and log storage information through the BMC, reading a target log from a target shared memory according to the memory storage information, and analyzing the target log according to the log storage information; and outputting the analyzed target log to a preset file position.
Step 4.2, if the current management mode is an in-band management mode, determining that the reading execution object is a BIOS; acquiring a log output request of a BIOS setting interface through a BIOS, and determining a preset output position according to the log output request; the preset output position comprises at least one of a serial port and a preset file position; and reading the target log from the target shared memory to a preset output position according to the memory storage information and the log storage information.
Step 4.3, if the current management mode is an in-band management mode, determining that the read execution object is a unified extensible firmware interface system; reading memory storage information and log storage information from the second preset setting information through a unified extensible firmware interface system; and reading the target log from the target shared memory to a preset output position according to the memory storage information and the log storage information.
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 second preset setting information through the BIOS; the second preset setting information is determined by the BIOS.
Step 4.4, if the current management mode is an in-band management mode, determining that the reading execution object is at least one of an operating system and a third-party hardware tool; reading a target log from a target shared memory to a preset output position according to the memory storage information and the log storage information by reading an execution object;
or, triggering a preset interrupt by the read execution object to switch the read execution object into the BIOS, and reading the target log to a preset output position from the target shared memory by the BIOS according to the memory storage information and the log storage information; the interrupt type of the preset interrupt is determined according to the object type of the read execution object.
Example IV
Fig. 6 is a schematic structural diagram of a log processing device according to a fourth embodiment of the present invention. The device can be realized by hardware and/or software, and the log processing method provided by any embodiment of the invention can be executed and has the corresponding functional modules and beneficial effects of the execution method. As shown in fig. 6, the apparatus includes:
The memory information reading module 610 is configured to read initial memory information of the target shared memory if the BIOS determines that the log transfer option is opened; wherein, the baseboard management controller BMC and the BIOS can both access the target shared memory;
the storage information generating module 620 is configured to determine, by using the BIOS, memory storage information according to the initial memory information and first preset setting information, and store a current log in the target shared memory according to the memory storage information, so as to generate log storage information; the first preset setting information is determined through the BMC and the BIOS;
the log reading module 630 is configured to determine a reading execution object of a log according to a mode type of a current management mode, and read a target log from the target shared memory to a preset output position according to the reading execution object, the memory storage information and the log storage information; the current management mode comprises at least one of an out-of-band management mode and an in-band management mode.
On the basis of the above technical solutions, optionally, if the current management mode is the out-of-band management mode, determining that the reading execution object is the BMC;
Correspondingly, the log reading module comprises:
the first information acquisition unit is used for acquiring the memory storage information and the log storage information through the BMC, reading the target log from the target shared memory according to the memory storage information, and analyzing the target log according to the log storage information;
and the log output unit is used for outputting the analyzed target log to a preset file position.
On the basis of the above technical solutions, optionally, if the current management mode is the in-band management mode, determining that the reading execution object is a BIOS;
correspondingly, the log reading module comprises:
the position determining unit is used for obtaining a log output request of a BIOS setting interface through the BIOS and determining the preset output position according to the log output request; the preset output position comprises at least one of a serial port and a preset file position;
and the first log reading unit is used for reading the target log from the target shared memory to the preset output position according to the memory storage information and the log storage information.
On the basis of the above technical solutions, optionally, if the current management mode is the in-band management mode, determining that the reading execution object is a unified extensible firmware interface system;
And the device further comprises:
the information writing module is used for the stored information generating module to determine memory stored information according to the initial memory information and first preset setting information through the BIOS, and write the memory stored information and the log stored information into second preset setting information through the BIOS after the current log is stored in the target shared memory according to the memory stored information; wherein the second preset setting information is determined by the BIOS;
correspondingly, the log reading module comprises:
the information reading unit is used for reading the memory storage information and the log storage information from the second preset setting information through the unified extensible firmware interface system;
and the second log reading unit is used for reading the target log from the target shared memory to the preset output position according to the memory storage information and the log storage information.
On the basis of the above technical solutions, optionally, if the current management mode is the in-band management mode, determining that the reading execution object is at least one of an operating system and a third-party hardware tool;
Correspondingly, the log reading module comprises:
the third log reading unit is used for reading the target log to the preset output position from the target shared memory according to the memory storage information and the log storage information through the reading execution object;
or, a fourth log reading unit, configured to trigger a preset interrupt through the reading execution object to switch the reading execution object to the BIOS, and read, through the BIOS, the target log from the target shared memory to the preset output position according to the memory storage information and the log storage information; and determining the interrupt type of the preset interrupt according to the object type of the read execution object.
On the basis of the above technical solutions, optionally, the apparatus further includes:
the mark existence judging module is used for acquiring the current log through the BIOS before the memory storage information is used for storing the current log in the target shared memory according to the memory storage information, and judging whether an ending mark exists in the current log or not;
and the storage mode determining module is used for determining the separation mode of the current log according to the ending mark and determining the storage mode of the current log according to the separation mode if the mark existence judging module judges that the mark exists.
On the basis of the above technical solutions, optionally, the apparatus further includes:
and the memory size determining module is used for determining the memory size of the usable memory of the target shared memory through the BIOS in response to the switching operation according to the log transfer option before the memory information reading module.
Example five
Fig. 7 shows a schematic diagram of an electronic device 10 that may be used to implement an embodiment of the invention. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. Electronic equipment may also represent various forms of mobile devices, such as personal digital processing, cellular telephones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the inventions described and/or claimed herein.
As shown in fig. 7, the electronic device 10 includes at least one processor 11, and a memory, such as a Read Only Memory (ROM) 12, a Random Access Memory (RAM) 13, etc., communicatively connected to the at least one processor 11, in which the memory stores a computer program executable by the at least one processor, and the processor 11 may 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 into the Random Access Memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 may also be stored. The processor 11, the ROM 12 and the RAM 13 are connected to each other via a bus 14. An input/output (I/O) interface 15 is also connected to bus 14.
Various 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, and the like; a storage unit 18 such as a magnetic disk, an optical disk, or the like; and a communication unit 19 such as a network card, modem, wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information/data with other devices via a computer network, such as the internet, and/or various telecommunication networks.
The processor 11 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various processors running machine learning model algorithms, digital Signal Processors (DSPs), and any suitable processor, controller, microcontroller, etc. The processor 11 performs the respective methods and processes described above, such as a log processing method.
In some embodiments, the log processing method may be implemented as a computer program tangibly embodied on a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and/or installed onto 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 perform the log processing method in any other suitable way (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuit systems, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), systems On Chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs, the one or more computer programs may be executed and/or interpreted on a programmable system including at least one programmable processor, which may be a special purpose or general-purpose programmable processor, that may receive data and instructions from, and transmit data and instructions to, a storage system, at least one input device, and at least one output device.
A computer program for carrying out 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, special purpose computer, or other programmable data processing apparatus, such that the computer programs, when executed by the processor, cause the functions/acts specified in the flowchart and/or block diagram block or blocks to be implemented. The computer program may execute entirely on the machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of the present invention, a computer-readable storage medium may be a tangible medium that can contain, or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. The computer readable storage medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. Alternatively, the computer readable storage medium may be a machine readable signal medium. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, 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 disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can 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 a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) through which a user can provide input to the electronic device. Other kinds of devices may also be used to provide for interaction with a user; for example, 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, speech input, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a background component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such background, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), blockchain networks, and the internet.
The computing system may include clients and servers. The client and server are typically remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, also called a cloud computing server or a cloud host, and is a host product in a cloud computing service system, so that the defects of high management difficulty and weak service expansibility in the traditional physical hosts and VPS service are overcome.
It should be appreciated that various forms of the flows shown above may be used to reorder, add, or delete steps. For example, the steps described in the present invention may be performed in parallel, sequentially, or in a different order, so long as the desired results of the technical solution of the present invention are achieved, and the present invention is not limited herein.
The above embodiments do not limit the scope of the present invention. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives are possible, depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the scope of the present invention.

Claims (10)

1. A log processing method, comprising:
if the BIOS determines that the log transfer option is opened, the initial memory information of the target shared memory is read; wherein, the baseboard management controller BMC and the BIOS can both access the target shared memory;
determining memory storage information according to the initial memory information and first preset setting information by the BIOS, and storing a current log in the target shared memory according to the memory storage information to generate log storage information; the first preset setting information is determined through the BMC and the BIOS;
Determining a reading execution object of a log according to the mode type of the current management mode, and reading a target log to a preset output position from the target shared memory according to the reading execution object, the memory storage information and the log storage information; the current management mode comprises at least one of an out-of-band management mode and an in-band management mode.
2. The method of claim 1, wherein if the current management mode is the out-of-band management mode, determining that the read execution object is the BMC;
correspondingly, the reading the target log from the target shared memory to the preset output position according to the reading execution object, the memory storage information and the log storage information includes:
acquiring the memory storage information and the log storage information through the BMC, reading the target log from the target shared memory according to the memory storage information, and analyzing the target log according to the log storage information;
and outputting the analyzed target log to a preset file position.
3. The method of claim 1, wherein if the current management mode is the in-band management mode, determining that the read execution object is a BIOS;
Correspondingly, the reading the target log from the target shared memory to the preset output position according to the reading execution object, the memory storage information and the log storage information includes:
acquiring a log output request of a BIOS setting interface through the BIOS, and determining the preset output position according to the log output request; the preset output position comprises at least one of a serial port and a preset file position;
and reading the target log from the target shared memory to the preset output position according to the memory storage information and the log storage information.
4. The method of claim 1, wherein if the current management mode is the in-band management mode, determining that the read execution object is a unified extensible firmware interface system;
and after determining, by the BIOS, memory storage information according to the initial memory information and first preset setting information, and storing a current log in the target shared memory according to the memory storage information, to generate log storage information, further including:
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, the reading the target log from the target shared memory to the preset output position according to the reading 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;
and reading the target log from the target shared memory to the preset output position according to the memory storage information and the log storage information.
5. The method of claim 1, wherein 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, the reading the target log from the target shared memory to the preset output position according to the reading 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 position according to the memory storage information and the log storage information by the reading execution object;
Or triggering a preset interrupt through the read execution object to switch the read execution object to the BIOS, and reading the target log to the preset output position from the target shared memory through the BIOS according to the memory storage information and the log storage information; and determining the interrupt type of the preset interrupt according to the object type of the read execution object.
6. The method of claim 1, further comprising, prior to storing the current log in the target shared memory based on the memory storage information:
acquiring the current log through the BIOS, and judging whether an ending mark exists in the current log or not;
if the current log exists, determining a separation mode of the current log according to the ending mark, and determining a storage mode of the current log according to the separation mode.
7. The method of claim 1, further comprising, prior to determining, by the BIOS, whether the log transfer option is on:
and responding to the switching operation according to the log transfer option, and determining the memory size of the usable memory of the target shared memory through the BIOS.
8. A log processing apparatus, comprising:
the memory information reading module is used for reading initial memory information of the target shared memory if the BIOS determines that the log transfer option is opened; wherein, the baseboard management controller BMC and the BIOS can both access the target shared memory;
the storage information generation module is used for 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 so as to generate log storage information; the first preset setting information is determined through the BMC and the BIOS;
the log reading module is used for determining a reading execution object of a log according to the mode type of the current management mode and reading a target log to a preset output position from the target shared memory according to the reading execution object, the memory storage information and the log storage information; the current management mode comprises at least one of an out-of-band management mode and an in-band management mode.
9. An electronic device, the electronic device comprising:
At least one processor; and
a memory communicatively coupled to the at least one processor; wherein, the liquid crystal display device comprises a liquid crystal display device,
the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the log processing method of any one of claims 1-7.
10. A computer readable storage medium storing computer instructions for causing a processor to perform the log processing method of any one of claims 1-7.
CN202310159020.2A 2023-02-20 2023-02-20 Log processing method and device, electronic equipment and storage medium Pending CN116361106A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310159020.2A CN116361106A (en) 2023-02-20 2023-02-20 Log processing method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310159020.2A CN116361106A (en) 2023-02-20 2023-02-20 Log processing method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN116361106A true CN116361106A (en) 2023-06-30

Family

ID=86910449

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310159020.2A Pending CN116361106A (en) 2023-02-20 2023-02-20 Log processing method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116361106A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116991606A (en) * 2023-09-25 2023-11-03 苏州元脑智能科技有限公司 Baseboard management controller, and processing method and device of basic input/output system

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116991606A (en) * 2023-09-25 2023-11-03 苏州元脑智能科技有限公司 Baseboard management controller, and processing method and device of basic input/output system
CN116991606B (en) * 2023-09-25 2024-02-02 苏州元脑智能科技有限公司 Baseboard management controller, and processing method and device of basic input/output system

Similar Documents

Publication Publication Date Title
CN109634718B (en) Method and system for creating mirror image by cloud platform
CN110086658B (en) Interface switching method and device and computer readable storage medium
WO2019169723A1 (en) Test case selection method, device and equipment, and computer-readable storage medium
CN109491736B (en) Display method and device of pop-up frame window
CN112540806A (en) Applet page rendering method and device, electronic equipment and storage medium
CN112506854B (en) Page template file storage and page generation methods, devices, equipment and media
CN111177113A (en) Data migration method and device, computer equipment and storage medium
CN110908837A (en) Application program exception handling method and device, electronic equipment and storage medium
CN116361106A (en) Log processing method and device, electronic equipment and storage medium
CN109992420B (en) Parallel PCIE-SSD performance optimization method and system
CN116578502A (en) Access request processing device, processing method, equipment and storage medium
CN116126719A (en) Interface testing method and device, electronic equipment and storage medium
CN116450176A (en) Version updating method and device, electronic equipment and storage medium
CN116009847A (en) Code generation method, device, electronic equipment and storage medium
CN113190237B (en) Data processing method, system and device
CN115729742A (en) Error processing method and device, electronic equipment and storage medium
CN116841773B (en) Data interaction method and device, electronic equipment and storage medium
CN107888445B (en) Method and device for analyzing performance state, computer equipment and storage medium
CN116450120B (en) Method, device, equipment and medium for analyzing kernel of real-time operating system
CN116579914B (en) Execution method and device of graphic processor engine, electronic equipment and storage medium
CN116225576B (en) Application program data environment switching method and device, electronic equipment and medium
CN116627682B (en) Remote industrial information detection method and device based on shared memory
WO2024066622A1 (en) Cloud system testing method and apparatus
CN116185695A (en) Log processing method and device, electronic equipment and storage medium
CN115454776A (en) Equipment asset information acquisition method and device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination