CN116185695A - 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
CN116185695A
CN116185695A CN202310227711.1A CN202310227711A CN116185695A CN 116185695 A CN116185695 A CN 116185695A CN 202310227711 A CN202310227711 A CN 202310227711A CN 116185695 A CN116185695 A CN 116185695A
Authority
CN
China
Prior art keywords
log
sol
preset
event
serial port
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
CN202310227711.1A
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 CN202310227711.1A priority Critical patent/CN116185695A/en
Publication of CN116185695A publication Critical patent/CN116185695A/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/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/0766Error or fault reporting or storing
    • G06F11/0781Error filtering or prioritizing based on a policy defined by the user or on a policy defined by a hardware/software module, e.g. according to a severity level
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/0766Error or fault reporting or storing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/079Root cause analysis, i.e. error or fault diagnosis
    • 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)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Health & Medical Sciences (AREA)
  • Biomedical Technology (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: establishing an association relation between a serial port redirection SOL serial port and a preset serial port, so as to obtain an initial SOL log through the preset serial port, and storing the initial SOL log to a first preset position to obtain an intermediate SOL log; responding to the triggering of a data removal event, and performing data removal operation on the intermediate SOL log to obtain a target SOL log; and responding to the triggering of a log transfer event, determining a second preset position according to the log transfer event, and transferring the target SOL log from the first preset position to the second preset position. By operating the technical scheme provided by the embodiment of the invention, the problems that the acquired SOL log contains excessive redundant information, occupies space and is inconvenient to read the log can be solved, and the effectiveness, flexibility and efficiency of log acquisition are improved.

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
With the rapid development of the internet, the wide application of the server has a higher and higher demand for improving the reliability of the server. When the server operating system fails or is down, the system failure cause is obtained by analyzing the collected serial port redirection SOL (Serial Over LAN) log, so that the subsequent rapid processing of the failure is facilitated, and the reliability of the server is improved.
In the prior art, the collected SOL logs are generally directly transmitted to a designated location, and because the SOL logs are continuously generated along with the running of a server, the transmission and storage of the SOL logs easily cause the consumption of a large amount of resources.
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 effectiveness and efficiency of SOL log acquisition.
According to an aspect of the present invention, there is provided a log processing method performed by a baseboard management controller, the method including:
establishing an association relation between a serial port redirection SOL serial port and a preset serial port, so as to obtain an initial SOL log through the preset serial port, and storing the initial SOL log to a first preset position to obtain an intermediate SOL log;
responding to the triggering of a data removal event, and performing data removal operation on the intermediate SOL log to obtain a target SOL log;
and responding to the triggering of a log transfer event, determining a second preset position according to the log transfer event, and transferring the target SOL log from the first preset position to the second preset position.
Optionally, performing a data removal operation on the intermediate SOL log includes:
determining the position of a control character in the intermediate SOL log according to a preset log format;
and removing the control characters in the intermediate SOL log according to the control character positions.
The advantages of this arrangement are that: determining the position of a control character in the intermediate SOL log according to a preset log format; according to the control character position, the control characters in the intermediate SOL log are removed, the problem that the effective content in the SOL log cannot be obtained quickly due to the fact that the control characters are more is avoided, and the initial SOL log is always obtained continuously, if the control characters are more, a large amount of storage space is occupied easily is solved, and the effectiveness of log obtaining and the rationality of log storage are improved.
Optionally, in response to the log transfer event being triggered, determining a second preset location according to the log transfer event includes:
if the log transfer event comprises a log acquisition event, responding to the log acquisition event to be triggered, acquiring a log acquisition position associated with the log acquisition event, and determining the log acquisition position as the second preset position.
The advantages of this arrangement are that: when a log acquisition event is triggered, a target SOL log is transmitted to a log acquisition position associated with the log acquisition event from a first preset position, so that a log acquisition object can acquire the target SOL log in time, and the log acquisition efficiency is improved; meanwhile, the problem that the target SOL log can only be stored in a fixed position and can only be processed in the fixed position is avoided, and therefore the flexibility of log acquisition is improved.
Optionally, the method further comprises:
if a log checking instruction is acquired, determining a log checking serial port according to the log checking instruction;
and switching a log acquisition source of the initial SOL log from the preset serial port to the log checking serial port.
The advantages of this arrangement are that: the method and the device avoid that the initial SOL logs are all sent to the log checking serial port in the log checking process, so that the acquisition of the initial SOL logs is omitted by the preset serial port, and the integrity of log acquisition is improved.
Optionally, in response to the data removal event being triggered, performing a data removal operation on the intermediate SOL log to obtain a target SOL log, including:
if the data removal event comprises a controller exception event, determining a current SOL log in the intermediate SOL log in response to the controller exception event being triggered;
performing the data removal operation on the current SOL log to obtain the target SOL log;
correspondingly, responding to the triggering of the log transfer event, determining a second preset position according to the log transfer event, and transferring the target SOL log from the first preset position to the second preset position, wherein the method comprises the following steps:
and determining the second preset position according to the controller abnormal event, and transmitting the target SOL log from the first preset position to the second preset position.
The advantages of this arrangement are that: when the controller abnormal event is triggered, the data removing operation can be immediately executed on the currently stored SOL log, and the SOL log after the data removing operation is executed is transferred to a second preset position related to the controller abnormal event, so that the SOL log is stored in time when the controller is abnormal, data loss is avoided, and the reliability and the integrity of SOL log acquisition are improved.
Optionally, the log transfer event further includes: an operating system downtime event; the second preset location includes at least one of a preset server external to the baseboard management controller and a preset storage space internal to the baseboard management controller.
The advantages of this arrangement are that: the types of the log transfer event and the second preset position are enriched, so that the target SOL log can be transferred to the second preset position when different log transfer events are generated, and the second preset position can be positioned on the substrate management controller or outside, thereby adapting to the needs of various scenes and improving the applicability of log processing.
According to another aspect of the present invention, there is provided a log processing apparatus configured in a baseboard management controller, the apparatus including:
the system comprises a log storage module, a first SOL log storage module and a second SOL storage module, wherein the log storage module is used for establishing an association relation between a serial port redirection SOL serial port and a preset serial port, acquiring an initial SOL log through the preset serial port, and storing the initial SOL log to a first preset position to obtain an intermediate SOL log;
the log data removing module is used for responding to the triggering of the data removing event and carrying out data removing operation on the intermediate SOL log to obtain a target SOL log;
the log transfer module is used for responding to the triggering of the log transfer event, determining a second preset position according to the log transfer event and transferring the target SOL log from the first preset position to the second preset position.
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 provided by the embodiment, the base plate control manager can acquire an initial SOL log through the preset serial port by establishing the association relation between the serial port redirection SOL serial port and the preset serial port; and storing the initial SOL log to a first preset position to obtain a middle SOL log, responding to the triggering of a data removal event, and performing data removal operation on the middle SOL log to obtain a target SOL log, thereby avoiding the problems that the obtained SOL log contains excessive redundant information, occupies space and is inconvenient to read the log, and improving the effectiveness of log obtaining. And finally transmitting the target SOL log to a second preset position related to the triggered log transmission event, so as to avoid fixing the transmission position, thereby improving the flexibility and efficiency of log acquisition.
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 schematic structural diagram of a log processing device according to a third embodiment of the present invention;
fig. 4 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 the case of collecting and intermediate SOL logs, the method may be performed by a log processing apparatus according to an embodiment of the present invention, and the apparatus may be implemented by software and/or hardware. Referring to fig. 1, the log processing method provided in this embodiment includes:
step 110, establishing an association relation between a serial port redirection SOL serial port and a preset serial port, so as to obtain an initial SOL log through the preset serial port, and storing the initial SOL log to a first preset position to obtain an intermediate SOL log.
The serial port redirection SOL serial port is used for collecting SOL logs, and due to software design and the like, the baseboard control manager (Baseboard Management Controller, BMC) cannot access the SOL serial port, so that SOL logs cannot be obtained from the SOL serial port; by establishing an association relationship between the SOL serial port and the preset serial port, for example, the SOL serial port is routed to the preset serial port, so that the log collected by the SOL serial port can be transferred to the preset serial port, and therefore the baseboard management controller can obtain the initial SOL log by accessing the preset serial port. The preset serial port may be a tty serial port or another serial port that can be directly accessed by the baseboard management controller, for example, a ttyS3 serial port, which is not limited in this embodiment.
After the association relation between the serial port redirection SOL serial port and the preset serial port is established, serial port configuration can be performed on the preset serial port, for example, parameters such as baud rate, data bit, stop bit, flow control information and the like are configured, so that the data output mode of the preset serial port can be determined.
The initial SOL log is a SOL log directly obtained from a preset serial port, the initial log is stored to a first preset position, the initial SOL log stored in the first preset position is recorded as an intermediate SOL log, wherein the first preset position may be a preset storage position in a baseboard control manager, for example, a cyclic array, which is not limited in this embodiment.
And step 120, responding to the triggering of the data removing event, and performing data removing operation on the intermediate SOL log to obtain a target SOL log.
In this embodiment, if the first preset location is a cyclic array, the data removal event may be that the data amount of the intermediate SOL log reaches the upper limit of the storable data amount of the cyclic array.
The data removing operation is to remove a portion of the data in the intermediate SOL log that is not related to the log content, for example, the data in the format of redundant space, which is not limited in this embodiment.
And responding to the data removing event to trigger, performing data removing operation on the intermediate SOL log to obtain a target SOL log, wherein the target SOL log is the SOL log obtained after performing the data removing operation.
Optionally, in response to the data removal event being triggered, performing a data removal operation on the intermediate SOL log to obtain a target SOL log, including:
if the data removal event comprises a controller exception event, determining a current SOL log in the intermediate SOL log in response to triggering the controller exception event;
performing data removal operation on the current SOL log to obtain a target SOL log;
correspondingly, responding to the triggering of the log transfer event, determining a second preset position according to the log transfer event, and transferring the target SOL log from the first preset position to the second preset position, wherein the method comprises the following steps:
and determining a second preset position according to the controller abnormal event, and transmitting the target SOL log from the first preset position to the second preset position.
The abnormal event of the controller is an event that causes an abnormality of the substrate controller due to a downtime of the server, for example, the substrate management controller needs to be updated or restarted; the system event log pushed by the basic input output system (Basic Input Output System, BIOS) may be analyzed to determine whether a controller exception event is triggered, e.g., if the system event log includes a baseboard management controller update command, a baseboard management controller restart command, etc., then the controller exception event is triggered.
The current SOL log in the intermediate SOL logs is the SOL log that has been currently stored in the first preset location. And determining the current SOL log subjected to the data removing operation as a target SOL log.
And determining the abnormal event of the controller as a log transfer event, and determining a corresponding second preset position according to the abnormal event of the controller, for example, a nonvolatile storage space in the baseboard management controller and the like, so as to transfer the target SOL log from the first preset position to the second preset position.
The advantages of this arrangement are that: when the controller abnormal event is triggered, the data removing operation can be immediately executed on the currently stored SOL log, and the SOL log after the data removing operation is executed is transferred to a second preset position related to the controller abnormal event, so that the SOL log is stored in time when the controller is abnormal, data loss is avoided, and the reliability and the integrity of SOL log acquisition are improved.
And 130, responding to the triggered log transfer event, determining a second preset position according to the log transfer event, and transferring the target SOL log from the first preset position to the second preset position.
The log transfer event is triggered, so as to meet the condition of transferring the target SOL log at the first preset position to the second preset position, for example, the time for storing the target SOL log exceeds a preset threshold value, etc.
The second preset position is determined according to the log transfer event, and the corresponding second preset position may be determined according to a different log transfer event, for example, a preset external server having a connection relationship with the baseboard management controller, which is not limited in this embodiment.
The second preset positions corresponding to different log transfer events may be the same or different, for example, if the log transfer event a is triggered, determining the second preset position a; if the log transfer event B is triggered, determining a second preset position B; if the log transfer event C is triggered, a second preset position B is determined.
After determining the second preset position, the target SOL log is transferred from the first preset position to the second preset position, where the transferring manner may be writing the target SOL log into a file and saving the target SOL log to the second preset position, which is not limited in this embodiment.
Optionally, in response to the log transfer event being triggered, determining a second preset location according to the log transfer event includes:
if the log transfer event includes a log acquisition event, acquiring a log acquisition position associated with the log acquisition event in response to the log acquisition event being triggered, and determining the log acquisition position as a second preset position.
The log obtaining event is an event for obtaining all or part of the target SOL log, and may be actively triggered by a user needing to view the target SOL log, for example, sending a log obtaining instruction to the baseboard management controller.
If the log acquisition event is triggered, a log acquisition location associated with the log acquisition event is acquired, and if the log acquisition event is triggered by a log acquisition instruction, the log acquisition location may be included in the log acquisition instruction. The log obtaining location is a location to be transferred after the target SOL log is obtained, for example, is a location that is convenient for the user to view, such as a local folder of the user, and the embodiment is not limited to this.
And determining the log acquisition position as the second preset position, and directly transmitting the target SOL log from the first preset position to the log acquisition position.
The advantages of this arrangement are that: when a log acquisition event is triggered, transmitting a target SOL log from a first preset position to a log acquisition position associated with the log acquisition event, so that a log acquisition object can acquire the target SOL log in time, and the log acquisition efficiency is improved; meanwhile, the problem that the target SOL log can only be stored in a fixed position and can only be processed in the fixed position is avoided, and therefore the flexibility of log acquisition is improved.
According to the technical scheme provided by the embodiment, the base plate control manager can acquire an initial SOL log through the preset serial port by establishing the association relation between the serial port redirection SOL serial port and the preset serial port; and storing the initial SOL log to a first preset position to obtain a middle SOL log, responding to the triggering of a data removal event, and performing data removal operation on the middle SOL log to obtain a target SOL log, thereby avoiding the problems that the obtained SOL log contains excessive redundant information, occupies space and is inconvenient to read the log, and improving the effectiveness of log obtaining. And finally transmitting the target SOL log to a second preset position related to the triggered log transmission event, so as to avoid fixing the transmission position, thereby improving the flexibility and efficiency of log acquisition.
Example two
Fig. 2 is a flowchart of a log processing method according to a second embodiment of the present invention, and the present technical solution is to supplement and explain a process of performing a data removal operation on an intermediate SOL log. Compared with the scheme, the scheme is specifically optimized to perform data removal operation on the intermediate SOL log, and comprises the following steps:
determining the position of a control character in the intermediate SOL log according to a preset log format;
and removing the control characters in the intermediate SOL log according to the control character positions. Specifically, a flow chart of the log processing method is shown in fig. 2:
step 210, establishing an association relationship between the serial port redirection SOL serial port and a preset serial port, so as to obtain an initial SOL log through the preset serial port, and storing the initial SOL log to a first preset position to obtain an intermediate SOL log.
Optionally, the method further comprises:
if the log checking instruction is acquired, determining a log checking serial port according to the log checking instruction;
and switching a log acquisition source of the initial SOL log from a preset serial port to a log checking serial port.
The log checking instruction is an instruction sent to the baseboard management controller when the user checks the log in real time, for example, a sol activate instruction, which is not limited in this embodiment. The connection is generally established between the SOL serial port and the specific log checking serial port, so that after the baseboard management controller receives the log checking instruction, the SOL log is provided for the log checking instruction initiating object through the log checking serial port.
Therefore, if the log checking instruction is acquired, determining a log checking serial port associated with the log checking instruction according to the log checking instruction; and switching a log acquisition source of the initial SOL log from a preset serial port to a log checking serial port.
The advantages of this arrangement are that: the method and the device avoid that the initial SOL logs are all sent to the log checking serial port in the log checking process, so that the acquisition of the initial SOL logs is omitted by the preset serial port, and the integrity of log acquisition is improved.
Step 220, in response to the data removal event being triggered, determining the control character position in the intermediate SOL log according to the preset log format.
The preset log format is a preset format of SOL log, for example, VT100 format, which is not limited in this embodiment. The preset log format may include a location where a control character is located, where the control character is a character included in the SOL log and used for controlling a display mode in the terminal, and is irrelevant to a log text.
And 230, removing the control characters in the intermediate SOL log according to the control character positions to obtain a target SOL log.
Batch processing can be carried out on the intermediate SOL logs, control characters contained in the intermediate SOL logs are found according to the positions of the control characters, and the control characters are removed to obtain target SOL logs containing SOL log text contents.
Step 240, in response to the log transfer event being triggered, determining a second preset location according to the log transfer event, and transferring the target SOL log from the first preset location to the second preset location.
Optionally, the log transfer event further includes: an operating system downtime event; the second preset location includes at least one of a preset server external to the baseboard management controller and a preset storage space internal to the baseboard management controller.
The operation system downtime event may be an event of downtime of the operation system of the server, and the operation condition of the operation system may be detected by the baseboard management controller to determine whether to trigger. The external preset server of the baseboard management controller is an external server for storage, for example, an SNMP server, a TFTP server, etc., which has a preset relationship with the baseboard management controller, and this embodiment is not limited thereto. The preset storage space in the baseboard management controller is a storage space in the baseboard management controller, for example, a nonvolatile storage space, or an SD memory card space applied in the baseboard management controller, which is not limited in this embodiment. The association relationship between the log transfer event and the second preset position is not fixed, for example, when an operating system downtime event is triggered, the second preset position may be determined to be an SNMP server, or may be determined to be a TFTP server.
The advantages of this arrangement are that: the types of the log transfer event and the second preset position are enriched, so that the target SOL log can be transferred to the second preset position when different log transfer events are generated, and the second preset position can be positioned on the substrate management controller or outside, thereby adapting to the needs of various scenes and improving the applicability of log processing.
According to the embodiment of the invention, the position of the control character in the intermediate SOL log is determined according to the preset log format; according to the control character position, the control characters in the intermediate SOL log are removed, the problem that the effective content in the SOL log cannot be obtained quickly due to the fact that the control characters are more is avoided, and the initial SOL log is always obtained continuously, if the control characters are more, a large amount of storage space is occupied easily is solved, and the effectiveness of log obtaining and the rationality of log storage are 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.
Step 1, establishing an association relation between a serial port redirection SOL serial port and a preset serial port, so as to obtain an initial SOL log through the preset serial port, and storing the initial SOL log to a first preset position to obtain an intermediate SOL log.
Step 1 may be completed by a log obtaining thread, where the log obtaining thread obtains an output condition of an initial SOL log from a preset serial port in a blocking manner, and once data output is monitored, the log obtaining thread reads data of the initial SOL log, and then stores the initial SOL log to a first preset position.
Optionally, if the log checking instruction is obtained, determining a log checking serial port according to the log checking instruction; and switching a log acquisition source of the initial SOL log from a preset serial port to a log checking serial port.
And 2, responding to the triggering of the data removing event, and performing data removing operation on the intermediate SOL log to obtain a target SOL log.
The data removing operation may include determining a position of a control character in the intermediate SOL log according to a preset log format, and removing the control character in the intermediate SOL log according to the position of the control character.
If the data removal event comprises a controller exception event, determining a current SOL log in the intermediate SOL log in response to triggering the controller exception event; performing data removal operation on the current SOL log to obtain a target SOL log;
correspondingly, step 3 comprises: and determining a second preset position according to the controller abnormal event, and transmitting the target SOL log from the first preset position to the second preset position.
Step 2 and step 3 may be completed by a removal transfer thread, and if the signal amount sent by the log obtaining thread is received, then a data removal operation is performed, and if the data removal event is triggered, for example, if the data amount of the intermediate SOL log reaches the upper limit of the storable data amount at the first preset position, the log obtaining thread sends the signal amount to the removal transfer thread to notify the removal transfer thread to perform the data removal operation, so that the log obtaining and the log removing can be performed respectively, the influence of each other is reduced, and the efficiency of log obtaining, log data removing and log transferring is improved.
And step 3, responding to the triggering of the log transfer event, determining a second preset position according to the log transfer event, and transferring the target SOL log from the first preset position to the second preset position.
Wherein, the log transfer event may include: an operating system downtime event; the second preset location includes at least one of a preset server external to the baseboard management controller and a preset storage space internal to the baseboard management controller.
If the log transfer event includes a log acquisition event, acquiring a log acquisition position associated with the log acquisition event in response to the log acquisition event being triggered, and determining the log acquisition position as a second preset position.
The user can actively acquire the log by triggering the log acquisition event, and can query the log at the second preset position of the default storage target SOL log, so that the log acquisition mode is enriched.
Example III
Fig. 3 is a schematic structural diagram of a log processing device according to a third embodiment of the present invention. The device can be realized by hardware and/or software, is configured in the baseboard management controller, can execute the log processing method provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method. As shown in fig. 3, the apparatus includes:
the log storage module 310 is configured to establish an association relationship between a serial port redirection SOL serial port and a preset serial port, so as to obtain an initial SOL log through the preset serial port, and store the initial SOL log to a first preset position, so as to obtain an intermediate SOL log;
the log data removing module 320 is configured to perform a data removing operation on the intermediate SOL log in response to the data removing event being triggered, so as to obtain a target SOL log;
the log transfer module 330 is configured to determine a second preset location according to the log transfer event in response to the log transfer event being triggered, and transfer the target SOL log from the first preset location to the second preset location.
On the basis of the above technical solutions, optionally, the log data removing module includes:
the character position determining unit is used for determining the position of the control character in the intermediate SOL log according to a preset log format;
and the character removing unit is used for removing the control characters in the intermediate SOL log according to the control character positions.
Based on the above technical solutions, optionally, the log transfer module includes:
and the position determining unit is used for responding to the triggering of the log acquisition event to acquire a log acquisition position associated with the log acquisition event and determining the log acquisition position as the second preset position if the log transmission event comprises the log acquisition event.
On the basis of the above technical solutions, optionally, the apparatus further includes:
the serial port determining module is used for determining a log checking serial port according to the log checking instruction if the log checking instruction is acquired;
and the source switching module is used for switching the log acquisition source of the initial SOL log from the preset serial port to the log checking serial port.
On the basis of the above technical solutions, optionally, the log data removing module includes:
a current SOL log determining unit, configured to determine a current SOL log in the intermediate SOL log in response to the controller exception event being triggered if the data removal event includes the controller exception event;
the log data removing unit is used for performing the data removing operation on the current SOL log to obtain the target SOL log;
correspondingly, the log transfer module comprises:
and the log transfer unit is used for determining the second preset position according to the controller abnormal event and transferring the target SOL log from the first preset position to the second preset position.
Based on the above technical solutions, optionally, the log transfer event further includes: an operating system downtime event; the second preset location includes at least one of a preset server external to the baseboard management controller and a preset storage space internal to the baseboard management controller.
Example IV
Fig. 4 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. 4, 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 performed by a baseboard management controller, comprising:
establishing an association relation between a serial port redirection SOL serial port and a preset serial port, so as to obtain an initial SOL log through the preset serial port, and storing the initial SOL log to a first preset position to obtain an intermediate SOL log;
responding to the triggering of a data removal event, and performing data removal operation on the intermediate SOL log to obtain a target SOL log;
and responding to the triggering of a log transfer event, determining a second preset position according to the log transfer event, and transferring the target SOL log from the first preset position to the second preset position.
2. The method of claim 1, wherein performing a data removal operation on the intermediate SOL log comprises:
determining the position of a control character in the intermediate SOL log according to a preset log format;
and removing the control characters in the intermediate SOL log according to the control character positions.
3. The method of claim 1, wherein determining a second preset location based on the log transfer event in response to the log transfer event being triggered comprises:
if the log transfer event comprises a log acquisition event, responding to the log acquisition event to be triggered, acquiring a log acquisition position associated with the log acquisition event, and determining the log acquisition position as the second preset position.
4. The method as recited in claim 1, further comprising:
if a log checking instruction is acquired, determining a log checking serial port according to the log checking instruction;
and switching a log acquisition source of the initial SOL log from the preset serial port to the log checking serial port.
5. The method of claim 1, wherein performing a data removal operation on the intermediate SOL log in response to a data removal event being triggered, results in a target SOL log, comprising:
if the data removal event comprises a controller exception event, determining a current SOL log in the intermediate SOL log in response to the controller exception event being triggered;
performing the data removal operation on the current SOL log to obtain the target SOL log;
correspondingly, responding to the triggering of the log transfer event, determining a second preset position according to the log transfer event, and transferring the target SOL log from the first preset position to the second preset position, wherein the method comprises the following steps:
and determining the second preset position according to the controller abnormal event, and transmitting the target SOL log from the first preset position to the second preset position.
6. The method of any of claims 1-5, wherein the log transfer event further comprises: an operating system downtime event; the second preset location includes at least one of a preset server external to the baseboard management controller and a preset storage space internal to the baseboard management controller.
7. A log processing apparatus configured in a baseboard management controller, comprising:
the system comprises a log storage module, a first SOL log storage module and a second SOL storage module, wherein the log storage module is used for establishing an association relation between a serial port redirection SOL serial port and a preset serial port, acquiring an initial SOL log through the preset serial port, and storing the initial SOL log to a first preset position to obtain an intermediate SOL log;
the log data removing module is used for responding to the triggering of the data removing event and carrying out data removing operation on the intermediate SOL log to obtain a target SOL log;
the log transfer module is used for responding to the triggering of the log transfer event, determining a second preset position according to the log transfer event and transferring the target SOL log from the first preset position to the second preset position.
8. The apparatus of claim 7, wherein the log data removal module comprises:
the character position determining unit is used for determining the position of the control character in the intermediate SOL log according to a preset log format;
and the character removing unit is used for removing the control characters in the intermediate SOL log according to the control character positions.
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-6.
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-6.
CN202310227711.1A 2023-03-02 2023-03-02 Log processing method and device, electronic equipment and storage medium Pending CN116185695A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310227711.1A CN116185695A (en) 2023-03-02 2023-03-02 Log processing method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310227711.1A CN116185695A (en) 2023-03-02 2023-03-02 Log processing method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN116185695A true CN116185695A (en) 2023-05-30

Family

ID=86450595

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310227711.1A Pending CN116185695A (en) 2023-03-02 2023-03-02 Log processing method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116185695A (en)

Similar Documents

Publication Publication Date Title
CN101895540B (en) For the system and method that application service process is guarded
WO2021077742A1 (en) Method, system, and device for service processing, and readable storage medium
CN110881224B (en) Network long connection method, device, equipment and storage medium
CN113778644B (en) Task processing method, device, equipment and storage medium
CN116361106A (en) Log processing method and device, electronic equipment and storage medium
CN116545905A (en) Service health detection method and device, electronic equipment and storage medium
CN116450176A (en) Version updating method and device, electronic equipment and storage medium
US11797334B1 (en) BMC parameter configuration and effect-taking method and apparatus, device, and medium
CN116185695A (en) Log processing method and device, electronic equipment and storage medium
CN114500105A (en) Network packet interception method, device, equipment and storage medium
CN115174447B (en) Network communication method, device, system, equipment and storage medium
CN115525415B (en) Data processing method, device, equipment and medium
CN116450120B (en) Method, device, equipment and medium for analyzing kernel of real-time operating system
CN116841773B (en) Data interaction method and device, electronic equipment and storage medium
CN114928540B (en) Preemption method and device, electronic equipment and storage medium
CN117270889A (en) System configuration method, device, electronic equipment and storage medium
CN118012534A (en) Application program loading method and device, electronic equipment and storage medium
CN118034986A (en) Memory fault processing method and device, storage medium and electronic equipment
CN115658341A (en) Method, device, equipment and medium for reading and writing data by Freeswitch
CN116112382A (en) Network data capturing method and device, electronic equipment and storage medium
CN116302796A (en) Process monitoring method and device, electronic equipment and storage medium
CN118018405A (en) Upgrading method and device of Internet of things equipment, server and storage medium
CN117785264A (en) Interface configuration method, device and storage medium for server operation and maintenance
CN117785403A (en) Heartbeat task execution device for equipment, electronic equipment and storage medium
CN117573267A (en) Application program data display method, system, 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