Multi-source clock real-time synchronization method, device, storage medium and product

CN122593575APending Publication Date: 2026-08-18广东鸿钧微电子科技有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611016785.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-09
Publication Date
2026-08-18

AI Technical Summary

Technical Problem

[0004]本申请的主要目的在于提供一种多源时钟实时同步方法、设备、存储介质和产品,旨在解决BMC和BIOS的时钟无法及时同步的技术问题

Benefits of technology

本申请基于预设的时间同步触发条件,判断是否需要进行时间同步,若需要进行时间同步,则获取本地的BMC时间,基于所述BMC时间,生成元时间信息,将所述元时间信息发送至所述管理控制处理器,以供所述管理控制处理器基于所述元时间信息,确定时间锚点,基于所述时间锚点,确定所述管理控制处理器相对于所述时间锚点的晶振时间,当需要进行时钟的时间同步时,读取RTC时间,基于所述晶振时间、所述BMC时间和所述RTC时间,进行时钟的实时同步。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122593575A_ABST
    Figure CN122593575A_ABST
Patent Text Reader

Abstract

The application discloses a multi-source clock real-time synchronization method and device, a storage medium and a product, relates to the technical field of clock synchronization, and comprises the following steps: after determining that time synchronization is needed, obtaining a local BMC time, generating meta-time information and sending the meta-time information to a management control processor, so that the management control processor determines a time anchor point and a crystal oscillator time relative to the time anchor point based on the meta-time information; when time synchronization of a clock is needed, reading an RTC time, and performing real-time synchronization of the clock based on the crystal oscillator time, the BMC time and the RTC time. The RTC time is the time of a main clock source of BIOS, the BMC time is the time of the last synchronization of BMC, and the crystal oscillator time is the time relative to the BMC time. The above-mentioned time can be used for synchronization, and a window with lag is not needed, so that timely synchronization of the clocks of BMC and BIOS is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of clock synchronization technology, and in particular to methods, devices, storage media and products for real-time synchronization of multi-source clocks. Background Technology

[0002] During server operation, there are multiple clock sources such as RTC (Real Time Clock) and NTP (Network Time Protocol). At the same time, the BMC (Baseboard Management Controller) and BIOS (Basic Input / Output System) in the server need to rely on timestamps to record information such as logs, events and faults.

[0003] Currently, the BIOS relies solely on the motherboard's RTC as its only hardware clock source, while the BMC can also obtain high-precision UTC (Coordinated Universal Time) time from an external server via NTP. When the BIOS uses RTC time and the BMC uses NTP time, the BMC and BIOS maintain their time states independently, and there is a significant time lag window between the BIOS and BMC, causing the clocks of the BMC and BIOS to fail to synchronize in a timely manner. Summary of the Invention

[0004] The main purpose of this application is to provide a method, device, storage medium and product for real-time synchronization of multi-source clocks, which aims to solve the technical problem that the clocks of BMC and BIOS cannot be synchronized in a timely manner.

[0005] To achieve the above objectives, this application proposes a multi-source clock real-time synchronization method applied to a server's baseboard management controller. The server further includes a management control processor, and the baseboard management controller and the management control processor are communicatively connected. The method includes: Based on preset time synchronization trigger conditions, determine whether time synchronization is required; If time synchronization is required, the local BMC time is obtained, and meta-time information is generated based on the BMC time. The meta-time information is sent to the management and control processor so that the management and control processor can determine a time anchor point based on the meta-time information, and determine the crystal oscillator time of the management and control processor relative to the time anchor point based on the time anchor point. When clock time synchronization is required, the RTC time is read, and real-time clock synchronization is performed based on the crystal oscillator time, the BMC time, and the RTC time.

[0006] In one embodiment, the step of determining whether time synchronization is needed based on a preset time synchronization trigger condition includes: Determine whether the local BMC clock source has changed, or whether the local system is in the initialization phase, or whether the local real-time has reached the calibration time in the preset calibration cycle. The initialization phase includes the power-on phase of the server and the phase after local reset. If the clock source changes, or the local system is in the initialization phase, or the real-time time reaches the calibration time, then time synchronization is required.

[0007] In one embodiment, the step of determining whether the local BMC clock source has changed includes: Determine whether the enable status of the BMC clock source has changed, or whether the BMC time zone of the BMC clock source has changed; If the local BMC clock source changes, or the BMC time zone changes, or an interrupt signal is received from the RTC chip, then it is determined that the BMC clock source has changed. The interrupt signal is sent to the local machine by the RTC chip when the RTC time is modified.

[0008] In one embodiment, the BMC clock source includes NTP and RTC, and the step of obtaining the local BMC time and generating meta-time information based on the BMC time includes: Based on the enabled status of the BMC clock source, determine whether the NTP time of the NTP can be obtained; If the NTP time can be obtained, the obtained NTP time will be used as the BMC time. Based on the source of the BMC time, determine the time identifier of the BMC time; The BMC time and the time identifier are encapsulated to obtain the meta-time information.

[0009] To achieve the above objectives, this application also proposes a multi-source clock real-time synchronization method, applied to a server's management and control processor. The server further includes a baseboard management controller, which is communicatively connected to the management and control processor. The method includes: The system receives meta-time information sent by the baseboard management controller and determines a time anchor point based on the meta-time information. The meta-time information is generated by the baseboard management controller based on the BMC time obtained after determining that time synchronization is required based on a preset time synchronization trigger condition. Based on the time anchor point, determine the local crystal oscillator time relative to the time anchor point; When clock synchronization is required, the RTC time is read, and real-time clock synchronization is performed based on the crystal oscillator time, the BMC time, and the RTC time.

[0010] In one embodiment, the step of determining the time anchor point based on the meta-time information includes: Obtain the BMC time from the meta-time information and use the BMC time as the time anchor point; The step of determining the local crystal oscillator time relative to the time anchor point based on the time anchor point includes: Use the time anchor point as the starting time point to restart the local timing. After the timing restarts, the local time relative to the starting time will be used as the crystal oscillator time.

[0011] In one embodiment, the step of reading the RTC time and performing real-time clock synchronization based on the crystal oscillator time, the BMC time, and the RTC time when clock time synchronization is required includes: When time synchronization is required, read the RTC time; Based on the crystal oscillator time and the BMC time, the real-time BMC time of the substrate management controller is determined; Real-time clock synchronization is performed based on the real-time BMC time and the read RTC time.

[0012] In addition, to achieve the above objectives, this application also proposes a multi-source clock real-time synchronization device, the device comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the multi-source clock real-time synchronization method as described above.

[0013] In addition, to achieve the above objectives, this application also proposes a storage medium, which is a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, it implements the steps of the multi-source clock real-time synchronization method described above.

[0014] In addition, to achieve the above objectives, this application also provides a computer program product, which includes a computer program that, when executed by a processor, implements the steps of the multi-source clock real-time synchronization method described above.

[0015] One or more technical solutions proposed in this application have at least the following technical effects: This application determines whether time synchronization is needed based on preset time synchronization trigger conditions. If time synchronization is needed, it obtains the local BMC time, generates meta-time information based on the BMC time, and sends the meta-time information to the management and control processor. The management and control processor then determines the time anchor point based on the meta-time information and the crystal oscillator time of the management and control processor relative to the time anchor point. When clock time synchronization is needed, it reads the RTC time and performs real-time clock synchronization based on the crystal oscillator time, the BMC time, and the RTC time.

[0016] Compared to the BMC and BIOS maintaining their time states independently, and the significant time lag window between the BIOS and BMC causing clock synchronization issues, this application achieves timely clock synchronization through information exchange between the Baseboard Management Controller (BMC) and the Management Control Processor (MCP). Specifically, when time synchronization is required, this application sends meta-time information, including the local BMC time, to the MCP. The MCP determines a time anchor point based on the meta-time information and determines the crystal oscillator time relative to the time anchor point. Since the RTC time is the BIOS's master clock source time, and the BMC time is the BMC time at the time of the last synchronization, and the crystal oscillator time is relative to the BMC time, time synchronization does not need to go through the lag window. Clock synchronization can be completed using only the BMC time stored locally by the MCP, and the real-time available RTC time and crystal oscillator time, thus achieving timely clock synchronization between the BMC and BIOS. Attached Figure Description

[0017] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0018] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0019] Figure 1 This is a flowchart illustrating an embodiment of the multi-source clock real-time synchronization method of this application. Figure 2 This is a schematic diagram of the BMC and MCP clock synchronization process provided in Embodiment 1 of the multi-source clock real-time synchronization method of this application; Figure 3 This is a flowchart illustrating Embodiment 2 of the multi-source clock real-time synchronization method of this application. Figure 4 This is a schematic diagram of the device structure of the hardware operating environment involved in the multi-source clock real-time synchronization method in the embodiments of this application; Figure 5 This is a schematic diagram illustrating the data acquisition consent process involved in the multi-source clock real-time synchronization method in this application embodiment.

[0020] The purpose, features, and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0021] It should be understood that the specific embodiments described herein are merely illustrative of the technical solutions of this application and are not intended to limit this application.

[0022] To better understand the technical solution of this application, a detailed description will be provided below in conjunction with the accompanying drawings and specific implementation methods.

[0023] It should be noted that the executing entity in this embodiment can be a computing service device with data processing, network communication, and program execution functions, such as a tablet computer, personal computer, or mobile phone, or an electronic device capable of performing the above functions, a multi-source clock real-time synchronization device, etc. The following description uses a multi-source clock real-time synchronization device as an example to illustrate this embodiment and the subsequent embodiments.

[0024] During server operation, there are multiple clock sources such as RTC (Real Time Clock) and NTP (Network Time Protocol). At the same time, the BMC (Baseboard Management Controller) and BIOS (Basic Input / Output System) in the server need to rely on timestamps to record information such as logs, events and faults.

[0025] Currently, the BIOS relies solely on the motherboard's RTC as its only hardware clock source, while the BMC can also obtain high-precision UTC (Coordinated Universal Time) time from an external server via NTP. When the BIOS uses RTC time and the BMC uses NTP time, the BMC and BIOS maintain their time states independently, and there is a significant time lag window between the BIOS and BMC, causing the clocks of the BMC and BIOS to fail to synchronize in a timely manner.

[0026] Furthermore, in the current method, if the BIOS or operating system modifies the RTC within the interval between two synchronizations, the BMC will continue to use the expired or incorrect time until the next synchronization cycle. System events occurring during this period (such as hardware alarms, power failures, and hot-plug operations) will have misaligned timestamps in the BIOS log and the BMC SEL (System Event Log), severely hindering root cause analysis (RCA) and cross-domain log correlation. Even if the RTC is not modified, if the BMC is configured with a non-UTC timezone, while the BIOS resolves the RTC to UTC by default, the same physical time will be displayed as different values ​​in the two logs, causing human-induced time discrepancies and increasing operational complexity.

[0027] Based on this, this application provides a multi-source clock real-time synchronization method applied to a server's baseboard management controller. The server further includes a management control processor, and the baseboard management controller and the management control processor are communicatively connected. (Refer to...) Figure 1 , Figure 1 This is a flowchart illustrating the first embodiment of the multi-source clock real-time synchronization method of this application.

[0028] In this embodiment, the multi-source clock real-time synchronization method includes steps S10~S30: Step S10: Based on the preset time synchronization trigger conditions, determine whether time synchronization is required; It should be noted that the preset time synchronization trigger conditions refer to a series of specific events or timings that are pre-set to initiate the time synchronization process. In this embodiment, these conditions mainly include three categories: first, a change in the clock source (such as enabling or disabling NTP, writing to the RTC, or updating the time zone configuration); second, the initialization phase after the server powers on or the BMC is reset; and third, preset periodic calibration time points.

[0029] It is understood that this embodiment clarifies the timing for initiating time synchronization, specifically including three key scenarios: clock source change, system initialization, and periodic calibration. These scenarios cover all major situations that may lead to time deviation between BMC and MCP (such as changes in external time base, system restart and state reset, and cumulative drift caused by long-term operation of hardware crystal oscillators). This allows the synchronization process to be initiated as needed, responding promptly to changes in time and compensating for long-term errors through periodic calibration, thereby achieving low-latency and high-consistency time alignment between BMC and MCP.

[0030] In one feasible implementation, the specific implementation of determining whether time synchronization is needed based on a preset time synchronization trigger condition can also be: Determine whether the local BMC clock source has changed, whether the local system is in the initialization phase, or whether the local real-time has reached the calibration time in the preset calibration cycle. The initialization phase includes the power-on phase of the server and the phase after local reset. If the clock source has changed, or the local system is in the initialization phase, or the real-time has reached the calibration time, then it is determined that time synchronization is required.

[0031] It should be noted that the local BMC clock source refers to the time reference source currently used by the BMC to obtain time, including but not limited to an NTP (Network Time Protocol) server, an RTC (Real-Time Clock) hardware chip, or a manually configured time value. The initialization phase refers to the special phase in which the system or device performs hardware initialization, firmware loading, and state recovery operations from a reset or power-on state. In this embodiment, it specifically includes the server power-on phase and the phase after the BMC itself resets. The preset calibration cycle refers to a pre-set time interval used to periodically perform time synchronization to compensate for the cumulative time drift caused by environmental changes in hardware components such as crystal oscillators. The calibration time refers to a specific time point determined according to the preset calibration cycle; when the local real-time time reaches this time point, a periodic time synchronization is triggered.

[0032] It is understood that this embodiment specifies the triggering conditions for time synchronization into three categories: the immediate response requirement for a step change in the time base corresponding to a clock source change; the requirement to establish an initial time consensus when the system starts up during the initialization phase; and the requirement for continuous compensation of crystal oscillator drift during long-term operation during the preset calibration period. Synchronization is triggered as long as any one of these conditions is met, thereby combining event-driven response with periodic maintenance. This ensures that time consensus can be established immediately at key nodes such as clock source switching and system startup, and eliminates long-term accumulated errors through periodic calibration, effectively overcoming the time window blind spot defect caused by the single periodic polling in the prior art.

[0033] Step S20: If time synchronization is required, obtain the local BMC time and generate meta-time information based on the BMC time. It should be noted that the local BMC time refers to the current time value maintained and used by the BMC itself. This time value may be a high-precision UTC time obtained from a network time server via NTP, or it may be a local time read from RTC and converted to a different time zone, depending on the BMC's clock source configuration. Meta-time information refers to additional data that describes the time source, semantics, and contextual attributes, in addition to the absolute time value itself. In this embodiment, the meta-time information specifically includes: absolute timestamp (UTC), current clock domain identifier (such as UTC or local time), clock source type (such as NTP, RTC, or manually set), and time zone offset.

[0034] It is understood that this embodiment generates meta-time information containing an absolute timestamp, clock domain identifier, clock source type, and time zone offset based on the local BMC time, rather than simply transmitting an isolated numerical value. This enables the MCP receiving the information to accurately understand the semantics of the received time, effectively solving the problem of cross-domain log time interpretation ambiguity caused by inconsistent time zone semantics or lack of time source background in the prior art, so as to achieve highly reliable time synchronization with context between the BMC and MCP in the future.

[0035] In one feasible implementation, the specific implementation of determining whether the local BMC clock source has changed can also be: Determine whether the enabled state of the BMC clock source has changed, or whether the BMC time zone of the BMC clock source has changed. If the local BMC clock source changes, or the BMC time zone changes, or an interrupt signal is received from the RTC chip, then it is determined that the BMC clock source has changed. The interrupt signal is sent to the local machine by the RTC chip when the RTC time is modified.

[0036] It should be noted that the BMC clock source enablement status refers to whether the various clock sources supported by BMC (such as NTP, RTC, etc.) are currently enabled or disabled. For example, when the NTP service switches from a disabled state to an enabled state, it is considered a change in the enablement status. The BMC time zone refers to the time zone offset configuration used by BMC when converting UTC time to local time for display or recording. This configuration can be set by the user based on the geographical location of the server deployment.

[0037] An interrupt signal is an asynchronous notification signal actively sent by a hardware device to the processor to inform the processor that a specific event has occurred. The RTC chip refers to the real-time clock hardware chip on the motherboard, used to maintain hardware-level time counting. In this embodiment, the chip needs to have a write-after-interrupt function, meaning that when the operating system or firmware modifies the RTC time, the chip can automatically generate an interrupt signal.

[0038] It is understandable that this embodiment refines the determination of clock source changes into a triple monitoring of clock source enable status, time zone configuration, and RTC chip hardware interrupt. The RTC chip actively sends an interrupt signal to notify the BMC, so that the BMC can capture the change the moment the RTC time is modified without relying on periodic polling. This achieves near-zero latency real-time perception of clock source changes, and then enables real-time time synchronization of multiple clock sources.

[0039] In one feasible implementation, the BMC clock source includes NTP and RTC. A further specific implementation of obtaining the local BMC time and generating meta-time information based on the BMC time can be: Based on the enabled state of the BMC clock source, it is determined whether the NTP time of the NTP can be obtained. If the NTP time can be obtained, the obtained NTP time is used as the BMC time. Based on the source of the BMC time, the time identifier of the BMC time is determined. The BMC time and the time identifier are encapsulated to obtain the meta-time information.

[0040] It should be noted that NTP, or Network Time Protocol, is a protocol used to achieve time synchronization in distributed systems or computer networks. In this embodiment, NTP serves as a clock source for the BMC, obtaining high-precision UTC time from an external network time server. RTC, or Real-Time Clock, is an independent hardware timing chip on the server motherboard used to maintain time counting even when the system is powered off. In this embodiment, the RTC serves as a clock source for the BIOS, providing a hardware-level basic time reference.

[0041] NTP time refers to the high-precision UTC time value obtained by the BMC from an external network time server via the NTP protocol. Time identifier refers to a label or marker used to describe the BMC's time source attribute. In this embodiment, the identifier is determined based on the BMC's time source (such as NTP or RTC) and is used to indicate the source type of the time to the receiving end.

[0042] It is understandable that, when acquiring BMC time, this implementation prioritizes determining whether high-precision NTP time can be obtained and uses NTP time as the preferred source of BMC time. At the same time, the time source information is encapsulated in the form of a time identifier in the meta-time information, so that BMC can automatically adopt a higher-precision time reference when NTP is available, avoiding the direct use of RTC time, which has relatively low precision and may jump. Furthermore, the generated meta-time information fully preserves the context of the time source, providing the receiving MCP with the ability to distinguish between high-precision network time and hardware reference time, thereby improving the accuracy and reliability of subsequent time synchronization.

[0043] Step S30: The meta-time information is sent to the management and control processor so that the management and control processor can determine the time anchor point based on the meta-time information, determine the crystal oscillator time of the management and control processor relative to the time anchor point based on the time anchor point, and when clock time synchronization is required, read the RTC time and perform real-time clock synchronization based on the crystal oscillator time, the BMC time and the RTC time.

[0044] It should be noted that the Management and Control Processor (MCP) in this embodiment is responsible for receiving time information sent by the BMC and maintaining the local clock. The time anchor point refers to the moment the MCP marks as a reliable reference time after receiving the synchronization time information from the BMC. Subsequently, the MCP maintains and counts the local time based on this anchor point. The crystal oscillator time refers to the time increment generated by the MCP through monotonic counting based on the local high-stability crystal oscillator after marking the time anchor point. This time is used to maintain the continuity and monotonicity of the local clock between two external synchronizations, avoiding frequent reliance on external sources that introduce jitter.

[0045] RTC time refers to the hardware time value maintained by the real-time clock chip. In this embodiment, when clock time synchronization is required, the MCP reads the RTC time as one of the synchronization references. The clock synchronization process of BMC and MCP in this embodiment can be referred to... Figure 2 .

[0046] It is understood that in this embodiment, after receiving the meta-time information, the MCP establishes a reliable time anchor point and performs monotonic counting based on the local high-stability crystal oscillator to maintain the crystal oscillator time. Thus, it can independently maintain a continuous and monotonic local clock without frequently relying on the BMC between two external synchronizations, effectively avoiding time jitter introduced by frequent synchronization.

[0047] When clock synchronization is required, the MCP integrates the crystal oscillator time, BMC time, and RTC time for calibration, thereby achieving the fusion verification of multi-source time information. It utilizes the high-frequency stability of the crystal oscillator time to maintain continuous counting, and performs periodic calibration through BMC time and RTC time, which significantly improves the reliability and accuracy of clock synchronization.

[0048] In summary, this embodiment determines whether time synchronization is needed based on preset time synchronization trigger conditions. If time synchronization is needed, the local BMC time is obtained, and meta-time information is generated based on the BMC time. The meta-time information is then sent to the management and control processor, which determines the time anchor point based on the meta-time information. Based on the time anchor point, the crystal oscillator time of the management and control processor relative to the time anchor point is determined. When clock time synchronization is needed, the RTC time is read, and real-time clock synchronization is performed based on the crystal oscillator time, the BMC time, and the RTC time.

[0049] Compared to the BMC and BIOS maintaining their time states independently, and the significant time lag window between the BIOS and BMC causing clock synchronization issues, this embodiment achieves timely clock synchronization through information exchange between the Baseboard Management Controller (BMC) and the Management Control Processor (MCP). Specifically, when time synchronization is required, this embodiment sends meta-time information, including the local BMC time, to the MCP. The MCP determines a time anchor point based on the meta-time information and determines the crystal oscillator time relative to the time anchor point. Since the RTC time is the BIOS's master clock source time, and the BMC time is the BMC time at the time of the last synchronization, and the crystal oscillator time is relative to the BMC time, time synchronization does not need to go through the lag window. Clock synchronization can be completed using only the BMC time stored locally by the MCP, and the real-time available RTC time and crystal oscillator time, thus achieving timely clock synchronization between the BMC and BIOS.

[0050] Based on the first embodiment of this application, the second embodiment of this application also provides a multi-source clock real-time synchronization method, applied to a server management and control processor. The server further includes a baseboard management controller, which is communicatively connected to the management and control processor. (Refer to...) Figure 3 , Figure 3 This is a flowchart illustrating the first embodiment of the multi-source clock real-time synchronization method of this application.

[0051] In this embodiment, the multi-source clock real-time synchronization method includes steps A10 to A30: Step A10: Receive the meta-time information sent by the baseboard management controller, and determine the time anchor point based on the meta-time information. The meta-time information is generated by the baseboard management controller based on the BMC time obtained after determining that time synchronization is required based on a preset time synchronization trigger condition. In one feasible implementation, the specific implementation of determining the time anchor point based on the meta-time information can also be: Obtain the BMC time from the meta-time information and use the BMC time as the time anchor point.

[0052] It is understandable that in this embodiment, MCP directly extracts the BMC time from the metadata and uses it as the time anchor point without performing any additional conversion or calculation. This ensures that the time anchor point established by MCP is completely consistent with the time currently maintained by BMC, avoiding deviations or delays that may be introduced by intermediate processing steps.

[0053] Step A20: Based on the time anchor point, determine the local crystal oscillator time relative to the time anchor point; In one feasible implementation, the specific implementation of determining the local crystal oscillator time relative to the time anchor point based on the time anchor point can also be: Using the time anchor point as the starting time point, the local timing is restarted based on the starting time point, and the local time relative to the starting time point after the restart is used as the crystal oscillator time.

[0054] It should be noted that the starting time point refers to the time when the MCP receives the BMC time and establishes a time anchor point, using that anchor point as the starting reference time of the local timing system. Restarting local timing means that after receiving the synchronization time, the MCP resets its internal timer and restarts counting from the time anchor point, thus clearing any accumulated time deviations that may have existed before synchronization. Crystal oscillator time refers to the time value generated by the MCP after restarting timing, based on the monotonically increasing oscillation period of the local high-stability crystal oscillator. This time represents the length of time elapsed since the starting time point.

[0055] It should also be noted that, in this embodiment, after determining the crystal oscillator time, the crystal oscillator time will be added as a timestamp to the event record when an event occurs, so as to synchronize the event based on the timestamp, BMC time and RTC time in the subsequent event.

[0056] Understandably, in this implementation, the MCP uses the time anchor point as the starting time point and restarts local timing. Subsequently, all time is generated by monotonic counting based on the local high-stability crystal oscillator, instead of frequently relying on the external BMC for synchronization. This allows the MCP to independently maintain a continuous, monotonic, and jitter-free local time reference during the interval between two external synchronizations. This avoids the time jitter that may be introduced by frequent external communication and ensures short-term time accuracy through the high stability of the crystal oscillator, providing a reliable and independent local time source for the BIOS domain to generate event timestamps.

[0057] Step A30: When clock time synchronization is required, read the RTC time and perform real-time clock synchronization based on the crystal oscillator time, the BMC time, and the RTC time.

[0058] In one feasible implementation, the specific implementation of reading the RTC time and performing real-time clock synchronization based on the crystal oscillator time, the BMC time, and the RTC time when clock time synchronization is required can also be: When time synchronization is required, the RTC time is read, and the real-time BMC time of the substrate management controller is determined based on the crystal oscillator time and the BMC time. Real-time clock synchronization is then performed based on the real-time BMC time and the read RTC time.

[0059] It should be noted that the real-time BMC time refers to the time value that the BMC should be at at the current moment, calculated by the MCP based on the local crystal oscillator time and the previously received BMC time (time anchor point). Specifically, the MCP adds the time anchor point (i.e., the BMC time at the time of the last synchronization) to the crystal oscillator time accumulated from that anchor point, thereby estimating the BMC time at the current moment in real time.

[0060] It is understandable that in this implementation, the MCP does not directly rely on the BMC to retransmit time information. Instead, it calculates the real-time BMC time based on the locally maintained crystal oscillator time and historical time anchor points. This allows it to obtain an estimated value of the current BMC time without additional communication with the BMC. The estimated value is then compared and fused with the directly read RTC time. This reduces reliance on external communication, lowers the communication overhead of the synchronization process, and ensures the continuity of the calculation results through the high-frequency stability of the crystal oscillator time. In addition, it combines the RTC time for verification, achieving low-overhead and high-efficiency real-time synchronization of multiple source clocks.

[0061] In one embodiment, the step of determining the local crystal oscillator time relative to the time anchor point based on the time anchor point further includes: The absolute timestamp, clock source type, and time zone offset in the metadata information are parsed. At the same time, the management control processor reads the real-time clock time stored in the local real-time clock chip and performs a difference calculation between the real-time clock time and the real-time clock time recorded during the last synchronization to obtain the real-time clock time increment. Based on the crystal count accumulated from the last time anchor point of the current local crystal oscillator, combined with the crystal oscillator nominal frequency and the ambient temperature compensation coefficient, the crystal oscillator time increment is calculated. The crystal oscillator time increment is added to the substrate management controller time at the last synchronization to deduce the current real-time substrate management controller time. The deviation between the current real-time baseboard management controller time and the received baseboard management controller time is calculated, and the deviation between the real-time clock time and the received baseboard management controller time is also calculated. Based on the deviation and a preset threshold, a multi-source time fusion verification is performed to determine a new time anchor point. The execution result of the multi-source time fusion verification includes local crystal oscillator cumulative drift, unexpected real-time clock jumps, and consistency of the three times. Write the finalized new time anchor point to the local system clock, reset the local crystal oscillator counter to zero, restart the timing from this anchor point, and record the timestamp, clock source type, real-time clock status, crystal oscillator compensation coefficient update value, and verification result of this synchronization to the local non-volatile storage.

[0062] It should be noted that the absolute timestamp refers to the Coordinated Universal Time (UTC) reference time value included in the metadata sent by the baseboard management controller (BDC), representing the absolute time maintained by the BDC at the time of transmission. The clock source type refers to the time source identifier relied upon by the BDC when generating this time, such as a network time protocol, real-time clock, or manual setting, used to characterize the accuracy and reliability of the time. The real-time clock time increment refers to the difference between the currently read real-time clock time and the real-time clock time recorded during the last synchronization, used to determine whether an unexpected jump occurred in the real-time clock between the two synchronization intervals.

[0063] Crystal oscillator count refers to the number of oscillation cycles accumulated by the counter driven by the local high-stability crystal oscillator inside the management and control processor since the last time anchor point was cleared. Crystal oscillator nominal frequency refers to the rated oscillation frequency of the local high-stability crystal oscillator under standard conditions, used to convert the crystal oscillator count into a time increment. Ambient temperature compensation coefficient refers to the compensation factor used to correct frequency drift caused by changes in ambient temperature, which can be obtained in real time by a temperature sensor or calculated based on a preset temperature-frequency curve. Current real-time board management controller time refers to the estimated time that the board management controller should be at the current moment, calculated by the management and control processor based on the local crystal oscillator count and historical time anchor points. Multi-source time fusion verification refers to the management and control processor simultaneously referencing the board management controller time, real-time clock time, and local crystal oscillator time, comparing the deviations between each pair to determine the reliability of each time source, and accordingly deciding on the verification mechanism for determining the new time anchor point.

[0064] It is understood that this embodiment uses real-time substrate management controller time estimation based on crystal oscillator counting and ambient temperature compensation, combined with real-time clock time increment monitoring and multi-source deviation threshold judgment, to enable the management control processor to autonomously identify different abnormal scenarios at the synchronization time: local crystal oscillator cumulative drift, unexpected real-time clock jump, and consistency of the three times.

[0065] In traditional single-time-source or loosely coupled architectures, the management and control processor cannot simultaneously obtain the baseboard management controller time and the real-time clock time for cross-verification. In the tightly collaborative architecture of this application, the management and control processor can use the trusted time anchor provided by the baseboard management controller, the crystal oscillator time maintained by itself, and the hardware real-time clock time for verification. This not only significantly improves the accuracy and robustness of clock synchronization, but also additionally realizes adaptive compensation for crystal oscillator drift and real-time monitoring and isolation of real-time clock hardware anomalies. This provides additional protection for the long-term reliable operation of the server system in complex environments, exceeding that of conventional synchronization schemes.

[0066] In one embodiment, the step of performing multi-source temporal fusion verification based on the deviation and a preset threshold further includes: If the previous deviation is less than the first preset threshold and the subsequent deviation is less than the second preset threshold, it is determined that the time of the substrate management controller, the real-time clock, and the local crystal oscillator are consistent, and the received substrate management controller time is directly used as the new time anchor. If the previous deviation is greater than the first preset threshold but the subsequent deviation is less than the second preset threshold, it is determined that the local crystal oscillator has experienced cumulative drift, and the weighted average of the received substrate management controller time and the real-time clock time is used as the new time anchor, and the crystal oscillator compensation coefficient is updated. If the subsequent deviation is greater than the second preset threshold, it is determined that the real-time clock has experienced an abnormal jump, the real-time clock time is ignored, the received substrate management controller time is directly used as the new time anchor, and the real-time clock abnormal event is recorded.

[0067] It should be noted that the first preset threshold refers to a pre-set threshold used to determine whether the deviation between the real-time board management controller time calculated by the local crystal oscillator and the reference time sent by the board management controller is within an acceptable range. This threshold can be set according to the drift characteristics and synchronization period of the crystal oscillator, and is used to identify whether the local crystal oscillator has accumulated drift beyond the normal range. The second preset threshold refers to a pre-set threshold used to determine whether the deviation between the real-time clock time and the reference time of the board management controller is within a reasonable range. This threshold is used to identify whether the real-time clock has experienced abnormal jumps, such as unexpected time changes caused by battery power loss, external writing, or hardware failure.

[0068] The weighted average value refers to the average value obtained by weighting the received baseboard management controller time and real-time clock time according to a preset weight ratio when cumulative drift of the local crystal oscillator is determined. This weighted average value serves as a new time anchor point, enabling a smooth compromise between the two time sources. The crystal oscillator compensation coefficient refers to the compensation parameter used to correct frequency drift of the local crystal oscillator caused by factors such as changes in ambient temperature and aging. When cumulative drift of the crystal oscillator is determined, this coefficient is updated to improve the accuracy of subsequent crystal oscillator time estimation.

[0069] It is understood that this embodiment refines multi-source time fusion verification into three differentiated processing paths, corresponding to three typical scenarios: consistency of the three sources, crystal oscillator drift, and real-time clock anomaly. Clear judgment conditions and corresponding processing strategies are set for each scenario. In the case of crystal oscillator drift, weighted average is used to achieve smooth compensation and update the compensation coefficients to optimize subsequent accuracy. In the case of real-time clock anomaly, the fault source is actively isolated to avoid contaminating the time base. When the three sources are consistent, a highly reliable baseboard management controller is directly used to ensure synchronization accuracy. This allows the management control processor to autonomously identify the reliable state of the time source and make optimal decisions without manual intervention. This avoids synchronization errors caused by a single time source failure and significantly improves time retention accuracy during long-term operation through adaptive compensation for crystal oscillator drift, thereby achieving intelligent fault isolation and adaptive compensation, and improving the accuracy of real-time time synchronization.

[0070] In summary, this embodiment is applied to the management and control processor. The MCP receives the meta-time information sent by the BMC through a predefined BMC-MCP communication channel. This meta-time information is generated by the BMC after it obtains its own BMC time and generates it based on the preset trigger conditions. The MCP parses the meta-time information, extracts the BMC time as a reliable time anchor point, uses this time anchor point as the starting time point, and restarts local timing. It performs monotonically increasing counting based on the local high-stability crystal oscillator, and uses the elapsed time from the starting time point as the crystal oscillator time. When clock synchronization is required, the MCP reads the RTC time and calculates the real-time BMC time based on the locally maintained crystal oscillator time and the historical anchor point BMC time. The calculated real-time BMC time is compared and fused with the read RTC time to complete the accurate real-time synchronization of the local clock.

[0071] In this embodiment, during the synchronization establishment phase, the MCP establishes a reliable time anchor point by receiving time information with contextual elements sent by the BMC, ensuring consistency with the BMC's time reference. During the time maintenance phase, the MCP independently maintains the crystal oscillator time based on a local high-stability crystal oscillator, guaranteeing time continuity and monotonicity without frequent reliance on external communication. During the synchronization execution phase, the MCP performs multi-source verification and calibration by fusing the real-time BMC time calculated from the crystal oscillator time with the hardware RTC time, thus achieving full-process autonomous control from time anchor point establishment and independent local time maintenance to multi-source fusion calibration. This embodiment effectively solves the problems of insufficient independent time calibration channels in the MCP / BIOS domain, excessive reliance on external synchronization sources, and insufficient reliability of a single time source in existing technologies. It significantly improves the robustness of time synchronization and the accuracy of cross-domain log time alignment in complex scenarios such as clock source switching, network unavailability, or system initialization.

[0072] It should be noted that the above examples are only for understanding this application and do not constitute a limitation on the multi-source clock real-time synchronization method of this application. Any simple modifications based on this technical concept are within the protection scope of this application.

[0073] This application provides a multi-source clock real-time synchronization device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the multi-source clock real-time synchronization method in Embodiment 1 above.

[0074] The following is for reference. Figure 4 The diagram illustrates a structure suitable for implementing a multi-source clock real-time synchronization device according to embodiments of this application. The multi-source clock real-time synchronization device in embodiments of this application may include, but is not limited to, mobile terminals such as mobile phones, tablets, laptops, digital broadcast receivers, PDAs (Personal Digital Assistants), PMPs (Portable Media Players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 4 The multi-source clock real-time synchronization device shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of this application.

[0075] like Figure 4As shown, the multi-source clock real-time synchronization device may include a processing unit 1001 (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1002 or a program loaded from a storage device 1003 into a random access memory (RAM) 1004. The RAM 1004 also stores various programs and data required for the operation of the multi-source clock real-time synchronization device. The processing unit 1001, ROM 1002, and RAM 1004 are interconnected via a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Typically, the following systems can be connected to the I / O interface 1006: input devices 1007 including, for example, a touchscreen, touchpad, keyboard, mouse, image sensor, microphone, accelerometer, gyroscope, etc.; output devices 1008 including, for example, a liquid crystal display (LCD), speaker, vibrator, etc.; storage devices 1003 including, for example, magnetic tape, hard disk, etc.; and communication devices 1009. Communication device 1009 allows the multi-source clock real-time synchronization device to communicate wirelessly or wiredly with other devices to exchange data. Although the figure shows multi-source clock real-time synchronization devices with various systems, it should be understood that implementation or possession of all the systems shown is not required. More or fewer systems may be implemented alternatively.

[0076] Specifically, according to the embodiments disclosed in this application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments disclosed in this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device, or installed from storage device 1003, or installed from ROM 1002. When the computer program is executed by processing device 1001, it performs the functions defined in the methods of the embodiments disclosed in this application.

[0077] The multi-source clock real-time synchronization device provided in this application, employing the multi-source clock real-time synchronization method described in the above embodiments, can solve the technical problem of the inability to synchronize the clocks of the BMC and BIOS in a timely manner. Compared with the prior art, the beneficial effects of the multi-source clock real-time synchronization device provided in this application are the same as those of the multi-source clock real-time synchronization method described in the above embodiments, and other technical features of this multi-source clock real-time synchronization device are the same as those disclosed in the method of the previous embodiment, and will not be repeated here.

[0078] It should be understood that the various parts disclosed in this application can be implemented using hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials, or characteristics can be combined in any suitable manner in one or more embodiments or examples.

[0079] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

[0080] This application provides a computer-readable storage medium having computer-readable program instructions (i.e., a computer program) stored thereon, the computer-readable program instructions being used to execute the multi-source clock real-time synchronization method described in the above embodiments.

[0081] The computer-readable storage medium provided in this application may be, for example, a USB flash drive, but is not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections having one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, system, or device. The program code contained on the computer-readable storage medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination thereof.

[0082] The aforementioned computer-readable storage medium may be included in a multi-source clock real-time synchronization device; or it may exist independently and not assembled into a multi-source clock real-time synchronization device.

[0083] The aforementioned computer-readable storage medium carries one or more programs, which, when executed by the multi-source clock real-time synchronization device, cause the multi-source clock real-time synchronization device to execute the aforementioned multi-source clock real-time synchronization method.

[0084] Computer program code for performing the operations of this application can be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, and C++, and conventional procedural programming languages ​​such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a Local Area Network (LAN) or a Wide Area Network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0085] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0086] The modules described in the embodiments of this application can be implemented in software or hardware. The names of the modules do not necessarily limit the functionality of the unit itself.

[0087] The readable storage medium provided in this application is a computer-readable storage medium that stores computer-readable program instructions (i.e., a computer program) for executing the above-described multi-source clock real-time synchronization method, which can solve the technical problem that the clocks of the BMC and BIOS cannot be synchronized in a timely manner. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in this application are the same as the beneficial effects of the multi-source clock real-time synchronization method provided in the above embodiments, and will not be repeated here.

[0088] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the multi-source clock real-time synchronization method described above.

[0089] The computer program product provided in this application can solve the technical problem that the clocks of the BMC and BIOS cannot be synchronized in a timely manner. Compared with the prior art, the beneficial effects of the computer program product provided in this application are the same as those of the multi-source clock real-time synchronization method provided in the above embodiments, and will not be repeated here.

[0090] All user-related data involved in this application was obtained with the user's permission or consent, as per [reference]. Figure 5 In other words, when this application is applied to a specific product or technology, user permission is required to acquire and process the relevant data, and the processing of the relevant data must comply with the relevant laws, regulations and regulatory standards of the relevant countries and regions.

[0091] The above description is only a part of the embodiments of this application and does not limit the scope of protection of this application. All equivalent structural transformations made under the technical concept of this application and using the contents of the specification and drawings of this application, or direct / indirect applications in other related technical fields, are included in the patent protection scope of this application.

Claims

1. A method for real-time synchronization of multi-source clocks, characterized in that, A baseboard management controller for a server, the server further including a management control processor, the baseboard management controller and the management control processor being communicatively connected, the method comprising: Based on preset time synchronization trigger conditions, determine whether time synchronization is required; If time synchronization is required, the local BMC time is obtained, and meta-time information is generated based on the BMC time. The meta-time information is sent to the management and control processor so that the management and control processor can determine a time anchor point based on the meta-time information, and determine the crystal oscillator time of the management and control processor relative to the time anchor point based on the time anchor point. When clock time synchronization is required, the RTC time is read, and real-time clock synchronization is performed based on the crystal oscillator time, the BMC time, and the RTC time.

2. The method as described in claim 1, characterized in that, The step of determining whether time synchronization is needed based on preset time synchronization trigger conditions includes: Determine whether the local BMC clock source has changed, or whether the local system is in the initialization phase, or whether the local real-time has reached the calibration time in the preset calibration cycle. The initialization phase includes the power-on phase of the server and the phase after local reset. If the clock source changes, or the local system is in the initialization phase, or the real-time time reaches the calibration time, then time synchronization is required.

3. The method as described in claim 2, characterized in that, The step of determining whether the local BMC clock source has changed includes: Determine whether the enable status of the BMC clock source has changed, or whether the BMC time zone of the BMC clock source has changed; If the local BMC clock source changes, or the BMC time zone changes, or an interrupt signal is received from the RTC chip, then it is determined that the BMC clock source has changed. The interrupt signal is sent to the local machine by the RTC chip when the RTC time is modified.

4. The method as described in claim 2, characterized in that, The BMC clock source includes NTP and RTC. The step of obtaining the local BMC time and generating meta-time information based on the BMC time includes: Based on the enabled status of the BMC clock source, determine whether the NTP time of the NTP can be obtained; If the NTP time can be obtained, the obtained NTP time will be used as the BMC time. Based on the source of the BMC time, determine the time identifier of the BMC time; The BMC time and the time identifier are encapsulated to obtain the meta-time information.

5. A method for real-time synchronization of multi-source clocks, characterized in that, A management control processor for a server, the server further including a baseboard management controller, the baseboard management controller and the management control processor being communicatively connected, the method comprising: The system receives meta-time information sent by the baseboard management controller and determines a time anchor point based on the meta-time information. The meta-time information is generated by the baseboard management controller based on the BMC time obtained after determining that time synchronization is required based on a preset time synchronization trigger condition. Based on the time anchor point, determine the local crystal oscillator time relative to the time anchor point; When clock synchronization is required, the RTC time is read, and real-time clock synchronization is performed based on the crystal oscillator time, the BMC time, and the RTC time.

6. The method as described in claim 5, characterized in that, The step of determining the time anchor point based on the meta-time information includes: Obtain the BMC time from the meta-time information and use the BMC time as the time anchor point; The step of determining the local crystal oscillator time relative to the time anchor point based on the time anchor point includes: Use the time anchor point as the starting time point to restart the local timing. After the timing restarts, the local time relative to the starting time will be used as the crystal oscillator time.

7. The method as described in claim 5, characterized in that, The step of reading the RTC time and performing real-time clock synchronization based on the crystal oscillator time, the BMC time, and the RTC time when clock synchronization is required includes: When time synchronization is required, read the RTC time; Based on the crystal oscillator time and the BMC time, the real-time BMC time of the substrate management controller is determined; Real-time clock synchronization is performed based on the real-time BMC time and the read RTC time.

8. A multi-source clock real-time synchronization device, characterized in that, The device includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the multi-source clock real-time synchronization method as described in any one of claims 1 to 7.

9. A storage medium, characterized in that, The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, it implements the steps of the multi-source clock real-time synchronization method as described in any one of claims 1 to 7.

10. A computer program product, characterized in that, The computer program product includes a computer program that, when executed by a processor, implements the steps of the multi-source clock real-time synchronization method as described in any one of claims 1 to 7.