CN116701338A - Log time correction method and device, electronic equipment and storage medium - Google Patents

Log time correction method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN116701338A
CN116701338A CN202310980940.0A CN202310980940A CN116701338A CN 116701338 A CN116701338 A CN 116701338A CN 202310980940 A CN202310980940 A CN 202310980940A CN 116701338 A CN116701338 A CN 116701338A
Authority
CN
China
Prior art keywords
time
bmc
log
rtc
target log
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
CN202310980940.0A
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.)
Jinzhou Yuanhang Beijing Information Industry Co ltd
Original Assignee
Jinzhou Yuanhang Beijing Information Industry 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 Jinzhou Yuanhang Beijing Information Industry Co ltd filed Critical Jinzhou Yuanhang Beijing Information Industry Co ltd
Priority to CN202310980940.0A priority Critical patent/CN116701338A/en
Publication of CN116701338A publication Critical patent/CN116701338A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/18File system types
    • G06F16/1805Append-only file systems, e.g. using logs or journals to store data
    • G06F16/1815Journaling file systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/16File or folder operations, e.g. details of user interfaces specifically adapted to file systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/17Details of further file system functions
    • G06F16/1734Details of monitoring file system events, e.g. by the use of hooks, filter drivers, logs
    • 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)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention provides a log time correction method, a device, electronic equipment and a storage medium, belonging to the technical field of computer systems, wherein the method comprises the following steps: determining that the BMC is electrified and started, and acquiring a first target log of the server system from the BMC; under the condition that the RTC is determined to work normally, first time information is acquired from the RTC, and then time synchronization is carried out on the time of the BMC, so that the initial time stamp of the first target log is corrected, and a second target log is obtained. According to the log time correction method, the accurate coordinated universal time is obtained from the real-time clock chip which normally works, and then the coordinated universal time is converted into the local time zone time to perform time synchronization on the BMC, so that the BMC can correct the initial time stamp in the obtained first target log, a second target log with the correct time stamp can be obtained, and management and maintenance personnel can conveniently analyze and locate faults of the server system in the starting process of the BMC.

Description

Log time correction method and device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of computer systems, and in particular, to a method and apparatus for correcting log time, an electronic device, and a storage medium.
Background
After the server system is powered up, the BMC (Baseboard Management Controller ) during the boot process, when the BMC runs until it receives the BIOS from the time, the BMC time is displayed incorrectly, usually a few years ago. The log time stamp recorded during this time is also incorrect. When the log is queried, the time stamp of the log in the time period is represented by 'Pre-init Timestamp', not by an actual time stamp, and the time stamp log is unfavorable for problem analysis and positioning. How to obtain a log with a real timestamp in the BMC startup process is a problem to be solved.
Disclosure of Invention
The invention provides a log time correction method, a device, electronic equipment and a storage medium, which are used for solving the defect of log time stamp errors in a BMC starting process in the prior art and realizing the effect of obtaining a log with correct time stamp.
The invention provides a log time correction method, which comprises the following steps:
determining that a Baseboard Management Controller (BMC) is electrified and started, and acquiring a first target log of a server system from the BMC, wherein the first target log comprises a corresponding initial time stamp;
under the condition that the real-time clock chip RTC works normally, acquiring first time information from the RTC, wherein the first time information is coordinated universal time;
converting the first time information into second time information, wherein the second time information is local time zone time;
based on the second time information, time synchronization is carried out on the time of the BMC;
and correcting the initial timestamp of the first target log based on the time of the BMC after time synchronization to obtain a second target log.
According to the log time correction method provided by the invention, after correcting the initial timestamp of the first target log at the time of the BMC based on time synchronization to obtain a second target log, the method further comprises:
determining that the BMC is connected to the Internet, and acquiring third time information from the Internet through a network time protocol service, wherein the third time information is the standard time of the external network;
comparing the third time information with the time of the BMC after time synchronization;
when the time of the BMC after time synchronization is inconsistent with the third time information, re-performing time synchronization on the time of the BMC based on the third time information;
and correcting the timestamp of the second target log based on the time of the BMC after the time synchronization again to obtain a third target log.
According to the log time correction method provided by the invention, after correcting the time stamp of the second target log based on the time of the BMC after the re-time synchronization to obtain a third target log, the method further comprises:
acquiring external network standard time from the Internet through network time protocol service according to the target frequency;
comparing the external network standard time obtained each time with the BMC time;
and under the condition that the time of the BMC is inconsistent with the external network standard time, time synchronization is carried out on the time of the BMC based on the external network standard time.
According to the log time correction method provided by the invention, the determining that the real-time clock chip RTC works normally comprises the following steps:
the method comprises the steps that RTC voltage data after the BMC is electrified and started are obtained through an RTC voltage detection circuit, wherein the RTC voltage data comprise a plurality of voltage values collected by the RTC voltage detection circuit at different moments;
analyzing the RTC voltage data according to a time sequence, and determining the voltage extreme value and the change rate of the RTC;
and under the condition that the voltage extreme value and the change rate meet the preset RTC voltage condition, determining that the real-time clock chip RTC works normally.
According to the log time correction method provided by the invention, the determination of the power-on start of the BMC comprises the following steps:
detecting an electric signal of a power supply line between the BMC and the server system;
and under the condition that the electric signal is continuously detected from the power line to exceed the target duration, determining that the BMC is electrified and started.
According to the log time correction method provided by the invention, the initial timestamp of the first target log is corrected based on the time of the BMC after time synchronization to obtain a second target log, and the method comprises the following steps:
filtering a third target log received from server management software from the first target log to obtain a fourth target log;
correcting the initial timestamp of the fourth target log based on the time of the BMC after time synchronization to obtain a fifth target log;
and determining the third target log and the fifth target log as the second target log.
According to the log time correction method provided by the invention, the first time information is acquired from the RTC, and the method comprises the following steps:
receiving a wake-up time signal sent by the RTC through the BMC;
and under the condition that the BMC receives the wake-up time signal sent by the RTC, the BMC receives the first time information sent by the RTC.
The invention also provides a log time correction device, which comprises:
the first processing module is used for determining that the BMC is powered on and started, and acquiring a first target log of the server system from the BMC, wherein the first target log comprises a corresponding initial timestamp;
the second processing module is used for acquiring first time information from the RTC under the condition that the real-time clock chip RTC is determined to work normally, wherein the first time information is coordinated universal time;
the third processing module is used for converting the first time information into second time information, wherein the second time information is local time zone time;
the fourth processing module is used for performing time synchronization on the time of the BMC based on the second time information;
and the fifth processing module is used for correcting the initial timestamp of the first target log based on the time of the BMC after time synchronization to obtain a second target log.
The invention also provides an electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the log time correction method as described in any one of the above when executing the program.
The present invention also provides a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements a log time correction method as described in any of the above.
The invention also provides a computer program product comprising a computer program which when executed by a processor implements a log time correction method as described in any one of the above.
According to the log time correction method, the log time correction device, the electronic equipment and the storage medium, the accurate coordinated universal time is obtained from the real-time clock chip which normally works, and then the coordinated universal time is converted into the local time zone time to perform time synchronization on the BMC, so that the BMC can correct the initial timestamp in the obtained first target log, a second target log with the correct timestamp can be obtained, and management maintenance personnel can conveniently analyze and position faults of a server system in the starting process of the BMC. .
Drawings
In order to more clearly illustrate the invention or the technical solutions of the prior art, the following description will briefly explain the drawings used in the embodiments or the description of the prior art, and it is obvious that the drawings in the following description are some embodiments of the invention, and other drawings can be obtained according to the drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic flow chart of a log time correction method according to the present invention;
FIG. 2 is a second flow chart of the log time correction method according to the present invention;
FIG. 3 is a schematic diagram of a log time correction device according to the present invention;
fig. 4 is a schematic structural diagram of an electronic device provided by the present invention.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the present invention more apparent, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings, and it is apparent that the described embodiments are 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 invention without making any inventive effort, are intended to be within the scope of the invention.
The log time correction method, apparatus, electronic device and storage medium of the present invention are described below with reference to fig. 1 to 4.
As shown in fig. 1, the log time correction method according to the embodiment of the present invention mainly includes step 110, step 120, step 130, step 140 and step 150.
In step 110, it is determined that the baseboard management controller BMC is powered on, and a first target log of the server system is obtained from the BMC.
It will be appreciated that the baseboard management controller BMC is a separate microcontroller located on the computer motherboard for monitoring and managing system hardware and software. BMCs are widely used as a remote management solution in servers, workstations, and enterprise-level computing devices.
The BMC may monitor and record key hardware parameters such as temperature, voltage, fan speed, etc., and collect system event and alarm information. By combining with the system management software, an administrator can monitor and manage these data in real time through a remote connection.
BMCs allow administrators to remotely operate and manage computer systems over a network. Through protocols such as IPMI (Intelligent Platform Management Interface ), an administrator can restart, power control, firmware upgrade and the like under the condition that the system cannot be started normally or is unattended, and the availability and maintenance efficiency of the system are improved.
The BMC may monitor and report hardware faults or errors, such as power failures, temperature anomalies, fan failures, etc., and send alarms in time to notify an administrator. The BMC can record the system activity log including hardware faults, system events, user operations and the like, and provides convenience for system fault investigation and audit.
BMCs are typically composed of a separate processor, memory, network interface, and management firmware. The BMC is designed to run isolated from the main operating system to ensure that an administrator can access and manage the server remotely even when the system fails or fails to boot. BMC provides overall control and management of the computer system, enhancing reliability, stability and remote manageability of the system.
The first target log includes a corresponding initial timestamp. During the BMC start-up, when the BMC runs until it receives the BIOS start-up time, the BMC time is displayed incorrectly, typically a time several years ago. The first target log timestamp recorded during this time is also incorrect. When the log is queried, the time stamp of the log in the time period is represented by a 'Pre-init time stamp', namely an initial time stamp, rather than an actual time stamp, and the time stamp log is unfavorable for problem analysis and positioning.
Step 120, under the condition that the real-time clock chip RTC is determined to work normally, acquiring first time information from the RTC.
It can be appreciated that the log time correction method of the embodiment of the present invention is applied to a server system including an RTC.
The RTC is a real time clock chip, also known as an RTC module. The real-time clock chip is an integrated circuit, mainly composed of a crystal oscillator, a clock circuit and a counter, and is used for providing time and date information required by the system and keeping the information after the system is shut down or power down. Meanwhile, the device can realize the functions of dormancy wakeup and the like. It will be appreciated that the first time information provided by the RTC is coordinated universal time, UTC time, which may differ from the time zone local to the server system by some amount. UTC is a unified time standard in seconds based on an atomic clock. Although UTC time is a global standard time, it does not take into account regional special time adjustments such as daylight savings time. Therefore, in calculating the function of the time concerned, the local time to the region where it is located is required to perform the conversion.
Step 130, converting the first time information into second time information.
In this embodiment, the second time information is local time zone time, and the first time information obtained from the RTC is converted into the second time information, that is, the local time zone time, so that the time of the BMC is more convenient to use.
And step 140, performing time synchronization on the time of the BMC based on the second time information.
After the second time information is obtained, the time of the BMC is synchronized, so that the BMC is switched to more accurate local time zone time.
It will be appreciated that since the BMC is typically time synchronized by the basic input output system BIOS, the BMC may be configured in advance.
The second time information may be specially packaged, for example, a time synchronization tag may be set on a data packet of the second time information, where the data packet is received and the time synchronization tag is identified when the BMC is not connected to the internet, and the BMC may automatically perform time synchronization according to the received second time information.
And step 150, correcting the initial timestamp of the first target log based on the time of the BMC after time synchronization to obtain a second target log.
It can be appreciated that the BMC may correct the initial timestamp of the first target log according to the synchronized time and the synchronized accurate time, so as to obtain the second target log with an accurate timestamp.
According to the log time correction method provided by the embodiment of the invention, the accurate coordinated universal time is obtained from the real-time clock chip which normally works, and then the coordinated universal time is converted into the local time zone time to perform time synchronization on the BMC, so that the BMC can correct the initial timestamp in the obtained first target log, further a second target log with the correct timestamp can be obtained, and management maintenance personnel can conveniently analyze and position the fault of the server system in the starting process of the BMC.
In some embodiments, as shown in fig. 2, after correcting the initial timestamp of the first target log based on the time of the BMC after time synchronization to obtain the second target log, the log time correction method in the embodiment of the present invention further includes step 210, step 220, step 230, and step 240.
In step 210, it is determined that the BMC is connected to the internet, and the third time information is acquired from the internet through the network time protocol service.
The implementation of a BMC that connects to the Internet and obtains time information from the Internet through a network time protocol service typically involves the following procedure.
The BMC may be configured first to have a network connection accessible via the Internet. For example, the network interface of the BMC and related parameters such as IP address, subnet mask, gateway, etc. may be configured first.
In the setting of the BMC, a time server NTP address to be used as a network time protocol service is specified. Common NTP servers include some common NTP servers and some NTP servers provided by a particular organization or organization.
On this basis, the BMC communicates with the designated NTP server using the NTP protocol. The BMC sends a time synchronization request to the NTP server and receives third time information returned from the server, wherein the third time information is the standard time of the external network.
Step 220, comparing the third time information with the time of the BMC after the time synchronization.
According to the third time information returned by the NTP server, the BMC compares the time after the time synchronization from the RTC.
In step 230, when the time of the BMC after the time synchronization does not coincide with the third time information, the time of the BMC is re-synchronized based on the third time information.
When the time of the BMC after the time synchronization from the RTC is inconsistent with the third time information, the second time information obtained based on the RTC is not accurate enough, and the BMC can automatically apply the third time information to the system clock and the local time setting. In this way, the clock of the BMC will be synchronized with the time of the NTP server and maintain accuracy.
Step 240, correcting the timestamp of the second target log based on the time of the BMC after the re-time synchronization, to obtain a third target log.
On the basis, correcting the time stamp of the second target log again to obtain a third target log, and further guaranteeing the accuracy of the time stamp of the log.
In this embodiment, the standard time of the synchronous extranet is obtained through the internet, and the accuracy of the second time information obtained from the RTC can be determined, so that the abnormality of the RTC time or the abnormality in the local time zone time conversion process can be identified, and the accuracy of the BMC time can be improved.
In some embodiments, after correcting the timestamp of the second target log based on the time of the BMC after the re-time synchronization to obtain the third target log, the log time correction method according to the embodiment of the present invention further includes: and acquiring external network standard time from the Internet through network time protocol service according to the target frequency, comparing the external network standard time acquired each time with the BMC time, and performing time synchronization on the BMC time based on the external network standard time under the condition that the BMC time is inconsistent with the external network standard time.
It will be appreciated that the target frequency may be set as desired, and is not limited herein. The standard time synchronization can be periodically acquired from the external network NTP server according to the target frequency and can be synchronized into the BMC, so that the time in the BMC and the RTC can be calibrated.
In some embodiments, determining that the real time clock chip RTC is operating properly includes the following process.
The RTC voltage data after the BMC is powered on and started may be obtained by the RTC voltage detection circuit. The RTC voltage data comprises a plurality of voltage values acquired by the RTC voltage detection circuit at different moments.
It can be understood that an independent battery or capacitor is provided in the RTC as an independent power source to supply power, and when the power source of the main board is turned off or the power is turned off, the real-time clock chip is automatically switched to the independent power source to keep running. In this case, the real time clock chip can still continue to calculate the time and save it in the chip memory. When the server is restarted, the real-time clock chip can be automatically switched back to the main board power supply from the independent power supply, and the time information stored before is restored to the system. This ensures that time information is not lost due to system shutdown or power loss.
For monitoring the power state of the RTC, a voltage detection circuit is arranged in the RTC, and the BMC can acquire a voltage value according to a data interface such as an I2C/SPI interface.
Based on the data, the RTC voltage data is analyzed according to the time sequence, and the voltage extreme value and the change rate of the RTC are determined.
The voltage extremum of the RTC includes a voltage maximum and a voltage minimum during a period of time after the BMC is started.
It will be appreciated that the RTC is able to accurately maintain recorded time information even in the event of a power failure or impending battery depletion due to its high accuracy and low current consumption. However, when the RTC power fails, the voltage may dip or rise suddenly, and the power management module in the RTC is in the protection chip to power-off the RTC and isolate the RTC, so that the RTC is powered off.
In this embodiment, the preset RTC voltage condition may be set according to the working reality of the RTC and the power supply, where the preset RTC voltage condition includes the range of the RTC voltage and the range of the change rate.
Only in the voltage range and the change rate range included in the RTC voltage condition, the RTC will normally operate. Under the condition that the voltage extreme value and the change rate meet the preset RTC voltage condition, the real-time clock chip RTC is determined to work normally.
In this embodiment, by determining the voltage of the RTC, it may be determined that the RTC is working normally, so as to ensure that the first time information obtained from the RTC is accurate, thereby improving the accuracy of the time synchronized by the subsequent BMCs.
In some embodiments, determining that the baseboard management controller BMC is powered up includes detecting an electrical signal on a power line between the BMC and the server system, and determining that the BMC is powered up if the electrical signal is continuously detected from the power line for more than a target length of time.
The BMC in the server system is powered by a 5V or 3.3V power supply on the motherboard. These power sources are generated by a server power module, commonly referred to as a system power source or PSU. When the server normally operates, the BMC can obtain electric energy from a system power supply through a rectifying circuit on the main board and provide power for the BMC by utilizing part of the electric energy.
Therefore, whether the BMC is powered on or not can be determined by detecting an electric signal of a power line between the BMC and the server system, and the conditions of cold start and the like under abnormal conditions can be discharged by setting a target duration.
In some embodiments, the first time information is obtained from the RTC, including receiving, by the BMC, a wake-up time signal sent by the RTC, and receiving, by the BMC, the first time information sent by the RTC if the wake-up time signal sent by the RTC is received by the BMC.
It should be noted that when the server system is completely turned off or in a sleep state, all power sources are turned off by the motherboard, and at this time, the BMC cannot obtain power from the system power source and cannot obtain time information from the RTC. Therefore, in order to trigger the BMC to update the time after the incoming call, the BMC and the RTC may be configured, and after the server system is powered on, a wake-up time signal is sent to the BMC through the RTC.
When the BMC receives the wake-up time signal sent by the RTC, the BMC receives the first time information sent by the RTC, and further, after the BMC is started, the time information can be obtained by the RTC.
In some embodiments, the initial timestamp of the first target log is corrected based on the time of the BMC after the time synchronization to obtain a second target log, including the following procedures.
The third target log received from the server management software may be filtered from the first target log to obtain a fourth target log.
It should be noted that, the BMC acquires the hardware running state information through the sensors of the monitoring motherboard and each component, and judges and analyzes the hardware running state information, and if any error, fault or abnormality is found, the BMC immediately generates a corresponding log and records a timestamp, so as to help the administrator to quickly locate the problem.
In some scenarios, the BMC may also timely acquire and process reports from server management software, such as IPMI and SNMP, by means of its independence of operation in a local network outside the operating system environment and a preset behavior rule, where the server management software may nano-tube logs of other computing hardware of the server system local network where the BMC is located, i.e. the third target log. These computing hardware do not need to make corrections because the third target log is time stamped correctly without a power outage.
In this case, the initial timestamp of the fourth target log is corrected based on the time of the BMC after the time synchronization to obtain a fifth target log, and then the third target log and the fifth target log are determined as the second target log.
In the present embodiment, the third target log having the correct time stamp is excluded, and the time stamp is corrected, so that the processing efficiency can be improved.
The log time correction apparatus provided by the present invention will be described below, and the log time correction apparatus described below and the log time correction method described above may be referred to correspondingly to each other.
As shown in fig. 3, the log time correction apparatus according to the embodiment of the present invention mainly includes a first processing module 310, a second processing module 320, a third processing module 330, a fourth processing module 340, and a fifth processing module 350.
The first processing module 310 is configured to determine that the baseboard management controller BMC is powered on, and obtain a first target log of the server system from the BMC, where the first target log includes a corresponding initial timestamp;
the second processing module 320 is configured to obtain first time information from the RTC, where the first time information is coordinated universal time, under a condition that it is determined that the real time clock chip RTC works normally;
the third processing module 330 is configured to convert the first time information into second time information, where the second time information is a local time zone time;
the fourth processing module 340 is configured to perform time synchronization on the time of the BMC based on the second time information;
the fifth processing module 350 is configured to correct the initial timestamp of the first target log based on the time of the BMC after time synchronization, to obtain a second target log.
According to the log time correction device provided by the embodiment of the invention, the accurate coordinated universal time is obtained from the real-time clock chip which normally works, and then the coordinated universal time is converted into the local time zone time to perform time synchronization on the BMC, so that the BMC can correct the initial timestamp in the obtained first target log, further a second target log with the correct timestamp can be obtained, and management maintenance personnel can conveniently analyze and position the fault of the server system in the starting process of the BMC.
In some embodiments, the log time correction device of the embodiment of the present invention further includes a sixth processing module, where the sixth processing module is configured to determine that the BMC is connected to the internet, and acquire third time information from the internet through a network time protocol service, where the third time information is an external network standard time; comparing the third time information with the time of the BMC after time synchronization; when the time of the BMC after time synchronization is inconsistent with the third time information, re-performing time synchronization on the time of the BMC based on the third time information; and correcting the timestamp of the second target log based on the time of the BMC after the time synchronization again to obtain a third target log.
In some embodiments, the log time correction apparatus of the embodiments of the present invention further includes a seventh processing module, where the seventh processing module is configured to obtain, according to a target frequency, an external network standard time from the internet through a network time protocol service; comparing the external network standard time obtained each time with the BMC time; and under the condition that the time of the BMC is inconsistent with the external network standard time, the time of the BMC is synchronized based on the external network standard time.
In some embodiments, the second processing module 320 is further configured to obtain, by using the RTC voltage detection circuit, RTC voltage data after the BMC is powered on, where the RTC voltage data includes a plurality of voltage values collected by the RTC voltage detection circuit at different moments; analyzing the RTC voltage data according to the time sequence, and determining the voltage extreme value and the change rate of the RTC; and under the condition that the voltage extreme value and the change rate meet the preset RTC voltage condition, determining that the real-time clock chip RTC works normally.
In some embodiments, the first processing module 310 is further configured to perform electrical signal detection on a power line between the BMC and the server system; and under the condition that the electric signal is continuously detected from the power line to exceed the target duration, determining that the BMC is electrified and started.
In some embodiments, the fifth processing module 350 is further configured to filter, from the first target log, the third target log received from the server management software, to obtain a fourth target log; correcting the initial timestamp of the fourth target log based on the time of the BMC after time synchronization to obtain a fifth target log; and determining the third target log and the fifth target log as second target logs.
In some embodiments, the second processing module 320 is further configured to receive, through the BMC, a wake-up time signal sent by the RTC; and receiving first time information sent by the RTC through the BMC under the condition that the BMC receives the wake-up time signal sent by the RTC.
Fig. 4 illustrates a physical schematic diagram of an electronic device, as shown in fig. 4, which may include: processor 410, communication interface (Communications Interface) 420, memory 430 and communication bus 440, wherein processor 410, communication interface 420 and memory 430 communicate with each other via communication bus 440. Processor 410 may invoke logic instructions in memory 430 to perform a log time correction method comprising: determining that a Baseboard Management Controller (BMC) is electrified and started, and acquiring a first target log of a server system from the BMC, wherein the first target log comprises a corresponding initial time stamp; under the condition that the real-time clock chip RTC works normally, acquiring first time information from the RTC, wherein the first time information is coordinated universal time; converting the first time information into second time information, wherein the second time information is local time zone time; based on the second time information, time synchronization is carried out on the time of the BMC; and correcting the initial timestamp of the first target log based on the time of the BMC after time synchronization to obtain a second target log.
Further, the logic instructions in the memory 430 described above may be implemented in the form of software functional units and may be stored in a computer-readable storage medium when sold or used as a stand-alone product. Based on this understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a server, a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
In another aspect, the present invention also provides a computer program product, the computer program product comprising a computer program, the computer program being storable on a non-transitory computer readable storage medium, the computer program, when executed by a processor, being capable of performing the log time correction method provided by the methods described above, the method comprising: determining that a Baseboard Management Controller (BMC) is electrified and started, and acquiring a first target log of a server system from the BMC, wherein the first target log comprises a corresponding initial time stamp; under the condition that the real-time clock chip RTC works normally, acquiring first time information from the RTC, wherein the first time information is coordinated universal time; converting the first time information into second time information, wherein the second time information is local time zone time; based on the second time information, time synchronization is carried out on the time of the BMC; and correcting the initial timestamp of the first target log based on the time of the BMC after time synchronization to obtain a second target log.
In yet another aspect, the present invention also provides a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, is implemented to perform the log time correction method provided by the above methods, the method comprising: determining that a Baseboard Management Controller (BMC) is electrified and started, and acquiring a first target log of a server system from the BMC, wherein the first target log comprises a corresponding initial time stamp; under the condition that the real-time clock chip RTC works normally, acquiring first time information from the RTC, wherein the first time information is coordinated universal time; converting the first time information into second time information, wherein the second time information is local time zone time; based on the second time information, time synchronization is carried out on the time of the BMC; and correcting the initial timestamp of the first target log based on the time of the BMC after time synchronization to obtain a second target log.
The apparatus embodiments described above are merely illustrative, wherein the elements illustrated as separate elements may or may not be physically separate, and the elements shown as elements may or may not be physical elements, may be located in one place, or may be distributed over a plurality of network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art will understand and implement the present invention without undue burden.
From the above description of the embodiments, it will be apparent to those skilled in the art that the embodiments may be implemented by means of software plus necessary general hardware platforms, or of course may be implemented by means of hardware. Based on this understanding, the foregoing technical solution may be embodied essentially or in a part contributing to the prior art in the form of a software product, which may be stored in a computer readable storage medium, such as ROM/RAM, a magnetic disk, an optical disk, etc., including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method described in the respective embodiments or some parts of the embodiments.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present invention, and are not limiting; although the invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims (10)

1. A log time correction method, comprising:
determining that a Baseboard Management Controller (BMC) is electrified and started, and acquiring a first target log of a server system from the BMC, wherein the first target log comprises a corresponding initial time stamp;
under the condition that the real-time clock chip RTC works normally, acquiring first time information from the RTC, wherein the first time information is coordinated universal time;
converting the first time information into second time information, wherein the second time information is local time zone time;
based on the second time information, time synchronization is carried out on the time of the BMC;
and correcting the initial timestamp of the first target log based on the time of the BMC after time synchronization to obtain a second target log.
2. The method for correcting log time according to claim 1, wherein after correcting the initial timestamp of the first target log at the time of the BMC based on the time synchronization to obtain a second target log, the method further comprises:
determining that the BMC is connected to the Internet, and acquiring third time information from the Internet through a network time protocol service, wherein the third time information is the standard time of the external network;
comparing the third time information with the time of the BMC after time synchronization;
when the time of the BMC after time synchronization is inconsistent with the third time information, re-performing time synchronization on the time of the BMC based on the third time information;
and correcting the timestamp of the second target log based on the time of the BMC after the time synchronization again to obtain a third target log.
3. The log time correction method according to claim 2, wherein after correcting the time stamp of the second target log at the time of the BMC based on the re-time synchronization to obtain a third target log, the method further comprises:
acquiring external network standard time from the Internet through network time protocol service according to the target frequency;
comparing the external network standard time obtained each time with the BMC time;
and under the condition that the time of the BMC is inconsistent with the external network standard time, time synchronization is carried out on the time of the BMC based on the external network standard time.
4. The method for log time correction as set forth in claim 1, wherein said determining that the real-time clock chip RTC is operating normally comprises:
the method comprises the steps that RTC voltage data after the BMC is electrified and started are obtained through an RTC voltage detection circuit, wherein the RTC voltage data comprise a plurality of voltage values collected by the RTC voltage detection circuit at different moments;
analyzing the RTC voltage data according to a time sequence, and determining the voltage extreme value and the change rate of the RTC;
and under the condition that the voltage extreme value and the change rate meet the preset RTC voltage condition, determining that the real-time clock chip RTC works normally.
5. The method for log time correction according to claim 1, wherein determining that the baseboard management controller BMC is powered on includes:
detecting an electric signal of a power supply line between the BMC and the server system;
and under the condition that the electric signal is continuously detected from the power line to exceed the target duration, determining that the BMC is electrified and started.
6. The method for correcting the log time according to claim 1, wherein correcting the initial timestamp of the first target log based on the time of the BMC after time synchronization to obtain a second target log comprises:
filtering a third target log received from server management software from the first target log to obtain a fourth target log;
correcting the initial timestamp of the fourth target log based on the time of the BMC after time synchronization to obtain a fifth target log;
and determining the third target log and the fifth target log as the second target log.
7. The log time correction method as set forth in claim 1, wherein said obtaining first time information from said RTC comprises:
receiving a wake-up time signal sent by the RTC through the BMC;
and under the condition that the BMC receives the wake-up time signal sent by the RTC, the BMC receives the first time information sent by the RTC.
8. A log time correction apparatus, comprising:
the first processing module is used for determining that the BMC is powered on and started, and acquiring a first target log of the server system from the BMC, wherein the first target log comprises a corresponding initial timestamp;
the second processing module is used for acquiring first time information from the RTC under the condition that the real-time clock chip RTC is determined to work normally, wherein the first time information is coordinated universal time;
the third processing module is used for converting the first time information into second time information, wherein the second time information is local time zone time;
the fourth processing module is used for performing time synchronization on the time of the BMC based on the second time information;
and the fifth processing module is used for correcting the initial timestamp of the first target log based on the time of the BMC after time synchronization to obtain a second target log.
9. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the log time correction method of any one of claims 1 to 7 when the program is executed by the processor.
10. A non-transitory computer readable storage medium having stored thereon a computer program, wherein the computer program when executed by a processor implements the log time correction method according to any of claims 1 to 7.
CN202310980940.0A 2023-08-07 2023-08-07 Log time correction method and device, electronic equipment and storage medium Pending CN116701338A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310980940.0A CN116701338A (en) 2023-08-07 2023-08-07 Log time correction method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310980940.0A CN116701338A (en) 2023-08-07 2023-08-07 Log time correction method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN116701338A true CN116701338A (en) 2023-09-05

Family

ID=87837825

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310980940.0A Pending CN116701338A (en) 2023-08-07 2023-08-07 Log time correction method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116701338A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101706748A (en) * 2009-11-26 2010-05-12 成都市华为赛门铁克科技有限公司 Logging method, system and single board management controller
CN101923369A (en) * 2009-06-16 2010-12-22 鸿富锦精密工业(深圳)有限公司 System and method for managing time of substrate management controller
CN108075876A (en) * 2016-11-18 2018-05-25 腾讯科技(深圳)有限公司 A kind of time calibrating method, apparatus and system
JP2019205016A (en) * 2018-05-22 2019-11-28 日立オートモティブシステムズ株式会社 Control arrangement performing log recording with time stamp and log acquisition device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101923369A (en) * 2009-06-16 2010-12-22 鸿富锦精密工业(深圳)有限公司 System and method for managing time of substrate management controller
CN101706748A (en) * 2009-11-26 2010-05-12 成都市华为赛门铁克科技有限公司 Logging method, system and single board management controller
CN108075876A (en) * 2016-11-18 2018-05-25 腾讯科技(深圳)有限公司 A kind of time calibrating method, apparatus and system
JP2019205016A (en) * 2018-05-22 2019-11-28 日立オートモティブシステムズ株式会社 Control arrangement performing log recording with time stamp and log acquisition device

Similar Documents

Publication Publication Date Title
EP3121726B1 (en) Fault processing method, related device and computer
CN113064747A (en) Fault positioning method, system and device in server starting process
US20110314322A1 (en) Time synchronization system and server using same
CN116107819A (en) Server start-up fault detection system, method, device and medium
KR20060111576A (en) Device diagnostic system
CN112506702B (en) Disaster recovery method, device, equipment and storage medium for data center
CN103577298A (en) Baseboard management controller monitoring system and method
CN108932007B (en) Method for acquiring time stamp and computer device
CN103488721A (en) Database bisynchronous method and system for master and slave boards
CN113868101B (en) Server time sequence detection method, device and system
JP2000250664A (en) Method for monitoring and controlling schedule operation of power unit, power controller, and power system
TW201516672A (en) System and method of monitoring a server
CN116701338A (en) Log time correction method and device, electronic equipment and storage medium
CN117251333A (en) Method, device, equipment and storage medium for acquiring hard disk information
CN113946448B (en) Time sequence management method and device for server cluster and electronic equipment
JP2012128552A (en) Information processing apparatus and time synchronizing method of information processing apparatus
CN116032735A (en) Method, device, equipment and medium for determining abnormal information of switch
CN115794486A (en) Robot information acquisition method, system, device and readable medium
CN111414274A (en) Far-end eliminating method for abnormal state of cabinet applied to data center
CN111416721A (en) Far-end eliminating method for abnormal state of cabinet applied to data center
WO2024001423A1 (en) Method and apparatus for determining dimensional measurement time, and devices
TW202026882A (en) Method for remotely clearing abnormal status of racks applied in data center
CN103518188A (en) Supervisor system resuming control
CN111966548B (en) Fault detection method and system for slow startup of server
JP2011034156A (en) Method for rewriting program for monitoring device

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20230905