Clock synchronization method and device, server, storage medium and program product

By setting two real-time clocks in the server, one for clock synchronization in the unstarted state and the other for time update at startup, the problem of difficulty in obtaining clock information in the unstarted state of the server is solved, and the efficiency of abnormal diagnosis and maintenance is improved.

CN119576070APending Publication Date: 2025-03-07SUMA TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411595839.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-08
Publication Date
2025-03-07

AI Technical Summary

Technical Problem

The server cannot accurately obtain clock information when it is not started, resulting in low abnormal diagnosis and maintenance efficiency.

Method used

Set at least two real-time clocks in the server, one connected to the substrate management controller and one connected to the central processor. The clock information of the substrate management controller is synchronized in the unstarted state by the first real-time clock, and the time information of the second real-time clock is updated when the server is started.

Benefits of technology

The clock information synchronization of the substrate management controller in the server is not started, improving the efficiency of abnormal diagnosis and maintenance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119576070A_ABST
    Figure CN119576070A_ABST
Patent Text Reader

Abstract

The invention provides a clock synchronization method and device, a server, a storage medium and a program product, the method is applied to the server comprising a first real-time clock and a second real-time clock, and the method comprises the following steps: under the condition that a power supply is switched on, determining the working state of the server; and when the working state is a non-starting state, taking first time information of the first real-time clock as synchronous clock information of the substrate management controller. And in response to a starting instruction of the server, obtaining second time information of the second real-time clock. And updating synchronous clock information of the baseboard management controller based on the second time information. According to the method provided by the invention, the server can realize clock information synchronization of the substrate management controller in a non-starting state, so that the server can conveniently carry out abnormality diagnosis according to the clock information, and the abnormality diagnosis and maintenance efficiency of the server is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and in particular to a clock synchronization method, device, server, storage medium and program product. Background Art

[0002] In existing servers, the real-time clock is mainly configured for the Basic Input Output System (BIOS) to provide clock information. The Baseboard Management Controller (BMC) can obtain clock information from the BIOS and record system logs related to the above functions when implementing functions such as monitoring, management and control of the server motherboard.

[0003] During the operation of the server, if an abnormal situation occurs, the time when the abnormal event occurred can be determined based on the clock information carried in the system log.

[0004] However, when the server is not started (including when the server is not powered on or when an abnormality occurs in the BIOS), the BMC cannot accurately obtain clock information, so that the server cannot determine the occurrence of an abnormal event, resulting in low efficiency in abnormal diagnosis and maintenance operations of the server. Summary of the invention

[0005] The present application provides a clock synchronization method, device, server, storage medium and program product, which are used to solve the technical problem that the clock synchronization of a baseboard management controller cannot be achieved when the server is not started.

[0006] In a first aspect, the present application provides a clock synchronization method, which is applied to a server, wherein the server includes a first real-time clock and a second real-time clock; wherein the first real-time clock is connected to a baseboard management controller of the server, and the second real-time clock is connected to a central processing unit of the server;

[0007] The clock synchronization method comprises:

[0008] When the power is turned on, determining the working status of the server;

[0009] When the working state is an unstarted state, determining that the first time information of the first real-time clock is the synchronous clock information of the baseboard management controller;

[0010] In response to a start instruction from the server, acquiring second time information of the second real-time clock;

[0011] The synchronous clock information of the baseboard management controller is updated based on the second time information.

[0012] By setting at least two real-time clocks for the server, when the server is in an unstarted state, synchronization of the synchronous clock information in the baseboard management controller is achieved according to the first real-time clock. When the server is started, the synchronous clock information of the baseboard management controller is updated according to the time information of the second real-time clock, so that the clock information of the baseboard management controller is synchronized when the server is in an unstarted state, which facilitates the server to perform abnormal diagnosis according to the clock information, thereby improving the abnormal diagnosis and maintenance efficiency of the server.

[0013] Optionally, updating the synchronous clock information of the baseboard management controller based on the second time information includes:

[0014] Acquiring third time information of the baseboard management controller;

[0015] Performing consistency detection on the third time information and the second time information;

[0016] When the third time information is different from the second time information, the synchronous clock information of the baseboard management controller is updated to the second time information.

[0017] According to the comparison result of the second time information of the second real-time clock and the current time of the baseboard management controller, the baseboard management controller is synchronized with the second real-time clock by performing a second clock synchronization.

[0018] Optionally, when the third time information is different from the second time information, after updating the synchronous clock information of the baseboard management controller to the second time information, the method further includes:

[0019] The second time information is written into the first real-time clock.

[0020] While performing clock synchronization operation on the baseboard management controller based on the second real-time clock, the clock information updated by the baseboard management controller is written into the first real-time clock, thereby improving the accuracy of the clock information for clock synchronization operation based on the first real-time clock when the server is not started.

[0021] Optionally, the unstarted state includes an input / output system failure state;

[0022] When the working state is the unstarted state, after determining that the first time information of the first real-time clock is the synchronous clock information of the baseboard management controller, the method further includes:

[0023] When the working state is a fault state, in response to a fault diagnosis instruction, target time information corresponding to the fault diagnosis instruction is determined.

[0024] In this way, when the basic input and output system is abnormal, the baseboard management controller can still achieve clock synchronization through the first real-time clock and complete the corresponding system log generation process. Based on this, when the user diagnoses a fault on the server, it can respond to the fault diagnosis instruction in a timely manner and obtain the occurrence time of the target system event (that is, the target time information), so as to determine the cause of the fault based on the above target time information, thereby improving the fault detection efficiency of the server.

[0025] Optionally, the first real-time clock includes a first power supply and a second power supply; the method further includes:

[0026] supplying power to the first real-time clock via the first power supply;

[0027] When the first power supply is abnormal, the first real-time clock is powered by the second power supply.

[0028] By setting a main power supply and a backup power supply, it is possible to switch the backup power supply to supply power to the first real-time clock when the main power supply is abnormal, thereby avoiding power failure of the first real-time clock, which causes the baseboard management controller to be unable to achieve clock synchronization under abnormal server conditions. This improves the stability of the clock synchronization of the baseboard management controller and facilitates the server to perform abnormal diagnosis based on clock information.

[0029] Optionally, in response to the start instruction of the server, acquiring the second time information of the second real-time clock includes:

[0030] In response to the startup instruction, performing initialization;

[0031] When the initialization is completed, updating the working state to a startup state;

[0032] Obtaining system log information corresponding to the second real-time clock;

[0033] The system log information is parsed to obtain second time information of the second real-time clock.

[0034] When the server is initialized, the baseboard management controller obtains the second time information of the second real-time clock based on the system log information corresponding to the second real-time clock, thereby facilitating clock synchronization of the baseboard management controller when the server is started.

[0035] In a second aspect, the present application provides a clock synchronization device, which is applied to a server, wherein the server includes a first real-time clock and a second real-time clock; wherein the first real-time clock is connected to a baseboard management controller of the server, and the second real-time clock is connected to a central processing unit of the server;

[0036] A clock synchronization device, comprising:

[0037] A status determination module, used to determine the working status of the server when the power is turned on;

[0038] A first synchronization module, configured to determine, when the working state is an unstarted state, that the first time information of the first real-time clock is the synchronization clock information of the baseboard management controller;

[0039] an acquisition module, configured to acquire second time information of the second real-time clock in response to a startup instruction of the server;

[0040] A second synchronization module is used to update the synchronization clock information of the baseboard management controller based on the second time information.

[0041] Optionally, the second synchronization module includes:

[0042] A first information acquisition unit, configured to acquire third time information of the baseboard management controller;

[0043] a consistency detection unit, configured to perform consistency detection on the third time information and the second time information;

[0044] The first synchronization unit is used to update the synchronization clock information of the baseboard management controller to the second time information when the third time information is different from the second time information.

[0045] Optionally, the second synchronization module further includes:

[0046] A second synchronization unit is configured to write the second time information into the first real-time clock.

[0047] Optionally, the unstarted state includes an input / output system failure state;

[0048] The device further comprises:

[0049] The fault detection module is used to determine the target time information corresponding to the fault diagnosis instruction in response to the fault diagnosis instruction when the working state is a fault state.

[0050] Optionally, the first real-time clock includes a first power supply and a second power supply;

[0051] The clock synchronization device further comprises:

[0052] A first power supply module, used for supplying power to the first real-time clock through the first power supply;

[0053] The second power supply module is used to supply power to the first real-time clock through the second power supply when the first power supply is abnormal.

[0054] Optionally, the acquisition module includes:

[0055] an initialization unit, configured to perform initialization in response to the startup instruction;

[0056] A state updating unit, used for updating the working state to a startup state when the initialization is completed;

[0057] A log information acquisition unit, used to acquire system log information corresponding to the second real-time clock;

[0058] The parsing unit is used to parse the system log information to obtain the second time information of the second real-time clock.

[0059] In a third aspect, an embodiment of the present application provides a server, comprising: a first real-time clock, a second real-time clock, a processor, and a memory communicatively connected to the processor;

[0060] The memory stores computer-executable instructions;

[0061] The processor executes the computer-executable instructions stored in the memory, so that the processor executes the clock synchronization method described in the first aspect and various possible designs of the first aspect.

[0062] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which computer execution instructions are stored. When a processor executes the computer execution instructions, the clock synchronization method described in the first aspect and various possible designs of the first aspect is implemented.

[0063] In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program. When the computer program is executed by a processor, it implements the clock synchronization method described in the first aspect and various possible designs of the first aspect.

[0064] The present application provides a clock synchronization method, device, server, storage medium and program product, which realizes synchronization of synchronous clock information in a baseboard management controller according to the first real-time clock by setting at least two real-time clocks for the server when the server is in an unstarted state. When the server is started, the synchronous clock information of the baseboard management controller is updated according to the time information of the second real-time clock, so that the server can realize clock information synchronization of the baseboard management controller in an unstarted state, which is convenient for the server to perform abnormal diagnosis according to the clock information, and improve the abnormal diagnosis and maintenance efficiency of the server. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0066] Figure 1 A scene diagram of a clock synchronization method in the related art;

[0067] Figure 2 A flowchart of a clock synchronization method provided in an embodiment of the present application;

[0068] Figure 3 A data flow diagram of a server provided in an embodiment of the present application;

[0069] Figure 4 A flowchart of step S104 of a clock synchronization method provided in an embodiment of the present application;

[0070] Figure 5 A flowchart of step S102 of a clock synchronization method provided in an embodiment of the present application;

[0071] Figure 6 A flowchart of step S103 of a clock synchronization method provided in an embodiment of the present application;

[0072] Figure 7 A schematic diagram of the circuit structure of a first real-time clock provided in an embodiment of the present application;

[0073] Figure 8 A schematic diagram of the structure of a clock synchronization device provided in an embodiment of the present application;

[0074] Fig. 9 A schematic diagram of the structure of a server provided in an embodiment of the present application.

[0075] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION

[0076] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.

[0077] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in one or more embodiments of this specification are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards, and corresponding operation entrances shall be provided for users to choose to authorize or refuse.

[0078] Terminology explanation:

[0079] A baseboard management controller (BMC) may indicate a microcontroller or small computer system that can be integrated on a server motherboard to implement monitoring, management, and control functions on the server motherboard, such as remote management and control, hardware monitoring, system monitoring, fault recording and reporting, network management, log recording, fan speed control, etc.

[0080] The basic input and output system BIOS (BIOS) is a driver that can be fixed on the server motherboard. It is used to save the server's basic input and output programs, system setting information, self-test programs after power-on, and system self-starting programs to implement server hardware settings and control.

[0081] Intelligent Platform Management Interface (IPMI), including out-of-band management, hardware monitoring, event logging, remote power control, virtual media, user management, and other functions.

[0082] A real-time clock (RTC) is a time device, also known as a clock chip, that is used to maintain the current date and time.

[0083] In existing servers, the real-time clock is mainly configured to provide clock information for the Basic Input Output System (BIOS). In the process of realizing the monitoring, management and control functions of the server motherboard, the Baseboard Management Controller (BMC) can obtain the clock information from the BIOS and record the system logs related to the above functions.

[0084] During the operation of the server, if an abnormal situation occurs, the time when the abnormal event occurred can be determined based on the clock information carried in the system log.

[0085] However, when the server is not started (including when the server is not powered on or when an abnormality occurs in the BIOS), the BMC cannot accurately obtain clock information, so that the server cannot determine the occurrence of an abnormal event, resulting in low efficiency in abnormal diagnosis and maintenance operations of the server.

[0086] Figure 1 A schematic diagram of a scenario of a clock synchronization method in the prior art is provided by way of example.

[0087] See also Figure 1 After the server AC is powered on and in the booting state, the BIOS starts initialization. After the initialization is completed, the BIOS reads the status from the RTC on the server motherboard and synchronizes the system event and kernel time update instructions containing the current RTC time as the system event log command to the BMC through the CPU. After receiving the system event command, the BMC parses it to complete the synchronization of the system time.

[0088] However, when the server is connected to the power supply but not turned on, although the baseboard management controller BMC has been started, since the server is not turned on at this time, the baseboard management controller BMC cannot obtain time information through the basic input and output system BIOS. The time displayed on the baseboard management controller BMC is the initial setting value, not the real time of the server, so it is impossible to generate a log record with accurate time information.

[0089] In addition, when the server is shut down and / or a fault occurs in the basic input and output system BIOS, the basic input and output system BIOS cannot interact with the baseboard management controller BMC, and the baseboard management controller BMC cannot obtain accurate time information, making it impossible to determine the fault time based on the log information of the baseboard management controller BMC when performing fault diagnosis.

[0090] The clock synchronization method provided by the present application is intended to solve the above technical problems of the prior art, and is applied to a server including a first real-time clock and a second real-time clock. The clock synchronization method includes: when the power is turned on, determining the working state of the server, when the working state is an unstarted state, using the first time information of the first real-time clock as the synchronization clock information of the baseboard management controller, responding to the startup instruction of the server, obtaining the second time information of the second real-time clock, and updating the synchronization clock information of the baseboard management controller based on the second time information. In this way, the clock information of the baseboard management controller can be synchronized when the server is in an unstarted state, which facilitates the server to perform abnormal diagnosis according to the clock information, and improves the abnormal diagnosis and maintenance efficiency of the server.

[0091] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.

[0092] Figure 2 A flowchart of a clock synchronization method provided in an embodiment of the present application. Figure 2 , a clock synchronization method, comprising the following steps:

[0093] S101, when the power is turned on, determining the working state of the server;

[0094] S102: When the working state is an unstarted state, determine that the first time information of the first real-time clock is synchronous clock information of a baseboard management controller.

[0095] Specifically, the server includes a first real-time clock and a second real-time clock; wherein the first real-time clock is connected to the baseboard management controller of the server, and the second real-time clock is connected to the central processing unit of the server. When the server is connected to the power supply AC, the power supply AC can provide a certain amount of power, and the baseboard management controller BMC can start normally. The working state of the server can be determined. Among them, the working state includes but is not limited to the unstarted state and the started state. Among them, the started state is used to indicate the working state in which the server is powered on, receives the start command, and completes the initialization. The unstarted state is used to indicate the working state in which the server is powered on but does not receive the start command, or the server is powered on but the basic input and output system is in an abnormal state so that the server cannot operate normally.

[0096] Specifically, when the working state of the server is not started, the clock information cannot be obtained from the second real-time clock through the basic input and output system, so the clock synchronization of the baseboard management controller cannot be achieved. Based on this, the first time information is obtained through the first real-time clock connected to the baseboard management controller as the synchronization clock information of the baseboard management controller. The synchronization clock information is used to indicate the time information of the baseboard management controller after each clock synchronization operation is achieved.

[0097] It is understandable that after the synchronization is completed, the synchronization clock information of the baseboard management controller will also change with time fluctuations.

[0098] Optionally, the second real-time clock may be used to indicate a real-time clock connected to the central processing unit.

[0099] S103: In response to the start instruction of the server, obtain second time information of the second real-time clock.

[0100] Specifically, in response to the startup instruction of the server, the server starts normally, and when the startup is completed, the working state is updated to the startup state, and the second time information of the second real-time clock is obtained from the second real-time clock through the basic input and output system.

[0101] S104: Update the synchronous clock information of the baseboard management controller based on the second time information.

[0102] It is understandable that when the server is updated from the unstarted state to the started state, the basic input and output system of the server can work normally and obtain the second clock information through the second real-time clock. However, since the server has previously executed clock synchronization information, it is determined whether the current clock information of the baseboard management controller is the same as the second clock information, and then further clock synchronization operation is performed on the baseboard management controller based on the second clock information.

[0103] Optionally, the baseboard management controller, the central processing unit, the first real-time clock, and the second real-time clock can all be arranged on a mainboard of the server.

[0104] Optionally, the baseboard management controller may interact with the first real-time clock through an integrated circuit bus interface (IIC) to obtain the first time information.

[0105] Optionally, the baseboard management controller is used as the host device on the server motherboard, and the first real-time clock is used as the cluster device on the server motherboard. The baseboard management controller is mainly used to generate a clock signal SCL and a control data transmission signal SDA, and is connected to the first real-time clock on the bus through address addressing. The first real-time clock is mainly used to respond to the request of the baseboard management controller, receive data sent by the baseboard management controller, or send data to the baseboard management controller.

[0106] By setting at least two real-time clocks for the server, when the server is in an unstarted state, synchronization of the synchronous clock information in the baseboard management controller is achieved according to the first real-time clock. When the server is started, the synchronous clock information of the baseboard management controller is updated according to the time information of the second real-time clock, so that the clock information of the baseboard management controller is synchronized when the server is in an unstarted state, which facilitates the server to perform abnormal diagnosis according to the clock information, thereby improving the abnormal diagnosis and maintenance efficiency of the server.

[0107] Figure 3 A data flow diagram of a server provided in an embodiment of the present application.

[0108] See also Figure 3When the server is powered on and is not started, the baseboard management controller obtains the first time information from the first real-time clock through the IIC interface based on the clock signal SCL and the control data transmission signal SDA, and uses it as the synchronization clock information (represented by a solid line in the figure).

[0109] When the server is powered on and in the startup state, the baseboard management controller obtains the second time information and the system time corresponding to the second time information from the second real-time clock sent by the BIOS through the central processor (indicated by a dotted line in the figure). The baseboard management controller updates the synchronous clock information based on the second real-time clock and the first real-time clock.

[0110] It can be understood that in order to achieve clock synchronization between the baseboard management controller and the first real-time clock, the updated synchronous clock information is written into the first real-time clock.

[0111] Figure 4 A flowchart of step S104 of a clock synchronization method provided in an embodiment of the present application. Figure 4 , step S104, comprises the following steps:

[0112] S1041. Obtain third time information of the baseboard management controller.

[0113] Specifically, the current time information of the baseboard management controller is acquired as the third time information.

[0114] It is understandable that as time passes, the time information in the baseboard management controller also changes continuously. Therefore, when clock synchronization is implemented for the second time, the current time information in the baseboard management controller is used as a reference for implementing clock synchronization.

[0115] S1042, performing consistency detection on the third time information and the second time information;

[0116] S1043: When the third time information is different from the second time information, update the synchronous clock information of the baseboard management controller to the second time information.

[0117] Specifically, a consistency check is performed on the second time information of the second real-time clock and the current time information (ie, the third time information) in the baseboard management controller to determine whether the baseboard management controller is synchronized with the second real-time clock.

[0118] Specifically, when the third time information is different from the second time information, the second time information of the second real-time clock is used as a reference for clock synchronization, and the synchronous clock information of the baseboard management controller is updated to the second time information.

[0119] It is understandable that when the baseboard management controller obtains the second time information from the second real-time clock through the basic input and output system BIOS, the basic input and output system BIOS can directly interact with the RTC to achieve hardware, so that the second time information is more accurate and can be used as the clock reference benchmark data of the operating system and / or system components. Based on this, the information of the second real-time clock can be used as the synchronization clock information of the baseboard management controller.

[0120] In some embodiments, after S1043, the method further includes:

[0121] The second time information is written into the first real-time clock.

[0122] Specifically, when the third time information is different from the second time information, it is determined that the baseboard management controller is not synchronized with the second real-time clock, and the second real-time clock is used as the standard. At this time, the baseboard management controller can write the second time information into the first real-time clock through the IIC interface to keep the first real-time clock synchronized with the baseboard management controller.

[0123] Optionally, the unstarted state includes but is not limited to a shutdown state or an input / output system failure state.

[0124] The input / output system fault state indicates that the basic input / output system is abnormal and cannot send clock information to the baseboard management controller. The shutdown state indicates that the server has not received a startup command and is powered on but not started.

[0125] Figure 5 A flowchart of step S102 of a clock synchronization method provided in an embodiment of the present application. Figure 5 , step S102, comprises the following steps:

[0126] S1021. When the working state is a fault state, in response to a fault diagnosis instruction, determine target time information corresponding to the fault diagnosis instruction.

[0127] Specifically, when the working state is a fault state, it is determined that the baseboard management controller cannot obtain the time information of the second real-time clock through the basic input and output system. Based on this, the baseboard management controller directly uses the first time information obtained by the first real-time clock as the synchronous clock information of the baseboard management controller.

[0128] Specifically, when it is determined that the working state of the server is a fault state, the server cannot operate normally and needs to be diagnosed for a fault. Based on this, the baseboard management controller responds to the fault diagnosis instruction, parses the fault diagnosis instruction, and obtains the target system event carried by the fault diagnosis instruction. The generated system log is parsed to determine the system time corresponding to the target system event in the system log as the target time information corresponding to the fault diagnosis instruction.

[0129] When the basic input and output system is abnormal, the baseboard management controller can still achieve clock synchronization through the first real-time clock and complete the corresponding system log generation process. Based on this, when the user diagnoses the server fault, it can respond to the fault diagnosis instruction in time and obtain the occurrence time of the target system event (that is, the target time information), so as to determine the cause of the fault based on the above target time information, thereby improving the fault detection efficiency of the server.

[0130] Figure 6 A flowchart of step S103 of a clock synchronization method provided in an embodiment of the present application. Figure 6 , step S103, comprises the following steps:

[0131] S1031, in response to the startup instruction, performing initialization;

[0132] S1032: When the initialization is completed, update the working state to a startup state.

[0133] Specifically, the startup instruction is used to instruct the server to start and initialize. When the user presses, clicks, or drags a preset startup button or startup area, the server automatically generates an automatic instruction. Alternatively, the server may receive a startup instruction sent by a third-party device. The third-party device is used to instruct the user terminal device.

[0134] Specifically, it is understandable that when the server is started, the basic input and output system needs to be initialized, so that the baseboard management controller can obtain the time information of the second real-time clock through the input and output system. However, when the basic input and output system is abnormal, it cannot complete the initialization action.

[0135] Based on this, in response to the startup instruction of the server, the state of the basic input and output system can be determined to facilitate determining whether the time information of the second real-time clock can be obtained through the basic input and output system.

[0136] Specifically, when the initialization of the basic input and output system is completed, it is determined that the basic input and output system can normally transmit the time information of the second real-time clock, and the working state is updated to the startup state.

[0137] S1033, obtaining system log information corresponding to the second real-time clock;

[0138] S1034: parse the system log information to obtain second time information of the second real-time clock.

[0139] Specifically, when the server's working state is the startup state, the basic input and output system obtains the second time information of the second real-time clock and the system time corresponding to the second time information from the second real-time clock, thereby obtaining the system log information of the second clock. The baseboard management controller obtains the system log information corresponding to the second real-time clock based on the basic input and output system, and parses the system log information to obtain the second time information of the second real-time clock carried by the system log information.

[0140] In some embodiments, the first real-time clock includes a first power supply and a second power supply, and the clock synchronization method further includes:

[0141] supplying power to the first real-time clock via the first power supply;

[0142] When the first power supply is abnormal, the first real-time clock is powered by the second power supply.

[0143] Specifically, a first power supply and a second power supply are provided for the first real-time clock. The first power supply may also be referred to as a main power supply, and is used to supply power to the first real-time clock when the main power supply is normal. The second power supply may also be referred to as a backup power supply, and is used to supply power to the first real-time clock when the main power supply is abnormal and cannot supply power to the first real-time clock.

[0144] Specifically, when the server is powered on, the first power supply is used to supply power to the first real-time clock. When an abnormality occurs in the first power supply, the second power supply is switched to supply power to the first real-time clock.

[0145] By setting a main power supply and a backup power supply, it is possible to switch the backup power supply to supply power to the first real-time clock when the main power supply is abnormal, thereby avoiding power failure of the first real-time clock, which causes the baseboard management controller to be unable to achieve clock synchronization under abnormal server conditions. This improves the stability of the clock synchronization of the baseboard management controller and facilitates the server to perform abnormal diagnosis based on clock information.

[0146] In some embodiments, after step S104, the clock synchronization method further includes:

[0147] When the second time information is the same as the third time information, the third time information is written into the first real-time clock.

[0148] Specifically, when the second time information of the second real-time clock is obtained, the second time information and the current time of the baseboard management controller (that is, the third time information) are checked for consistency. When the second time information is the same as the third time information, it is determined that the current time of the baseboard management controller has been synchronized with the second real-time clock, and the third time information is written into the first real-time clock to synchronize the baseboard management controller with the first real-time clock.

[0149] While performing clock synchronization operation on the baseboard management controller based on the second real-time clock, the clock information updated by the baseboard management controller is written into the first real-time clock, thereby improving the accuracy of the clock information for clock synchronization operation based on the first real-time clock when the server is not started.

[0150] Figure 7 A schematic diagram of the circuit structure of a first real-time clock provided in an embodiment of the present application.

[0151] See also Figure 7 The first real-time clock chip RTC1 includes 8 pins, namely X1, X2, VBAT, GND, VCC, SQW / INT#, SCL, SDA. The first real-time clock chip RTC1 is equipped with a power monitoring circuit, which can switch to power supply 2 when power supply 1 fails. Among them, the X1 pin and the X2 pin are connected to the crystal oscillator ( Figure 7 The first resistor R1 is connected in parallel, the X1 pin is connected in series with the first capacitor C1 and then connected to ground, the X2 pin is connected in series with the second capacitor C2 and then connected to ground, and the clock information of the first real-time clock chip RTC1 is determined by the solid line. The crystal oscillator Y is used to provide a reference clock for the first real-time clock chip RTC1, and the frequency is 32.768KHz. The GND pin is grounded. The VBAT pin is connected to the second resistor R2 and the second power supply ( Figure 7 The second power supply can be P3V-VABT). The VBAT pin is also connected to the third capacitor C3 and the fourth capacitor C4 in parallel and then grounded. The X2 pin and the VBAT pin are also connected to the power supply 3 in parallel. The VCC pin is connected to the first power supply ( Figure 7 In the figure, power supply 1 is represented, and the first power supply can be connected to P3V-AUX). The SQW / INT# pin is connected in parallel with the third resistor R3, the fifth capacitor C5, and the sixth capacitor C6 and then grounded. When the service is connected to the power supply, power supply 1 is powered on. Power supply 2 is used to supply power to the first real-time clock RT1 when power supply 1 does not supply power to the first real-time clock RT1. After the SCL pin is connected to the fourth resistor R4 through the SCL signal line, it is connected to the baseboard management controller BMC. After the SDA pin is connected to the fifth resistor R5 through the SDA signal line, it is connected to the baseboard management controller BMC to realize the clock information interaction between the first real-time clock chip RTC1 and the baseboard management controller BMC.

[0152] It is understandable that the above Figure 7 The clock chip, capacitors, resistors, crystal oscillators and other components in the circuit shown can be specifically set according to actual needs and are not specifically limited in the embodiments of the present application.

[0153] Exemplarily, the first capacitor C1 and the second capacitor C2 can be set to a capacitor of 10 pF. Exemplarily, the first resistor R1 can be set to a resistor of 20 megohms. Exemplarily, the crystal oscillator Y can be set to an X7 crystal oscillator.

[0154] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily required by the present application.

[0155] It should be further noted that, although the various steps in the flowchart are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless there is a clear description in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a portion of the steps in the flowchart may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these sub-steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a portion of the sub-steps or stages of other steps.

[0156] Figure 8 The present invention provides a schematic diagram of the structure of a clock synchronization device provided in an embodiment of the present invention. The clock synchronization device is applied to a server, and the server includes a first real-time clock and a second real-time clock.

[0157] See also Figure 8 , a clock synchronization device, comprising:

[0158] A state determination module 801 is used to determine the working state of the server when the power is turned on;

[0159] A first synchronization module 802, configured to determine, when the working state is an unstarted state, that the first time information of the first real-time clock is the synchronization clock information of the baseboard management controller;

[0160] An acquisition module 803, configured to acquire second time information of the second real-time clock in response to a startup instruction of the server;

[0161] The second synchronization module 804 is configured to update the synchronization clock information of the baseboard management controller based on the second time information.

[0162] In some embodiments, the second synchronization module includes:

[0163] A first information acquisition unit, configured to acquire third time information of the baseboard management controller;

[0164] a consistency detection unit, configured to perform consistency detection on the third time information and the second time information;

[0165] The first synchronization unit is used to update the synchronization clock information of the baseboard management controller to the second time information when the third time information is different from the second time information.

[0166] In some embodiments, the second synchronization module further includes:

[0167] A second synchronization unit is configured to write the second time information into the first real-time clock.

[0168] In some embodiments, the unactivated state includes an input-output system failure state;

[0169] The clock synchronization device further comprises:

[0170] The fault detection module is used to determine the target time information corresponding to the fault diagnosis instruction in response to the fault diagnosis instruction when the working state is a fault state.

[0171] In some embodiments, the first real-time clock includes a first power supply and a second power supply;

[0172] The clock synchronization device further comprises:

[0173] A first power supply module, used for supplying power to the first real-time clock through the first power supply;

[0174] The second power supply module is used to supply power to the first real-time clock through the second power supply when the first power supply is abnormal.

[0175] In some embodiments, the acquisition module includes:

[0176] an initialization unit, configured to perform initialization in response to the startup instruction;

[0177] A state updating unit, used for updating the working state to a startup state when the initialization is completed;

[0178] A log information acquisition unit, used to acquire system log information corresponding to the second real-time clock;

[0179] The parsing unit is used to parse the system log information to obtain the second time information of the second real-time clock.

[0180] It should be understood that the above-mentioned device embodiments are only illustrative, and the device of the present application can also be implemented in other ways. For example, the division of units / modules in the above-mentioned embodiments is only a logical function division, and there may be other division methods in actual implementation. For example, multiple units, modules or components can be combined, or can be integrated into another system, or some features can be ignored or not executed.

[0181] Fig. 9 This is a schematic diagram of the structure of the server provided in the embodiment of the present application. Fig. 9 As shown, the server may include: a transceiver 901 , a processor 902 , a memory 903 , a mainboard 904 , a baseboard management controller 905 , a first real-time clock 9051 , and a second real-time clock 9021 .

[0182] like Fig. 9 As shown, the transceiver 901 , the processor 902 , the memory 903 , the baseboard management controller 905 , the first real-time clock 9051 , and the second real-time clock 9021 may all be arranged on the mainboard 904 .

[0183] The first real-time clock is connected to the baseboard management controller 905, and the second real-time clock 9021 is connected to the processor. The baseboard management controller 905 can be connected to the transceiver 901, the processor 902, and the memory 903 through a system bus.

[0184] The processor 902 executes the computer execution instructions stored in the memory, so that the processor 902 executes the scheme in the above embodiment. The processor 902 can be a general-purpose processor, including a central processing unit CPU, a network processor (network processor, NP), etc.; it can also be a digital signal processor DSP, an application-specific integrated circuit ASIC, a field programmable gate array FPGA or other programmable logic devices, discrete gates or transistor logic devices, and discrete hardware components.

[0185] The memory 903 is connected to the processor 902 via a system bus and completes communication between them. The memory 903 is used to store computer program instructions.

[0186] The transceiver 901 may be used to obtain a start signal, etc.

[0187] The system bus can be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The system bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus. The transceiver is used to realize the communication between the database access device and other computers (such as clients, read-write libraries, and read-only libraries). The memory may include random access memory (RAM) and may also include non-volatile memory.

[0188] An embodiment of the present application further provides a computer-readable storage medium, in which computer instructions are stored. When the computer instructions are executed on a computer, the computer executes the technical solution of the clock synchronization method in the above embodiment.

[0189] An embodiment of the present application also provides a computer program product, which includes a computer program stored in a computer-readable storage medium. At least one processor can read the computer program from the computer-readable storage medium. When at least one processor executes the computer program, the technical solution of the clock synchronization method in the above embodiment can be implemented.

[0190] In addition, unless otherwise specified, each functional unit / module in each embodiment of the present application may be integrated into one unit / module, each unit / module may exist physically separately, or two or more units / modules may be integrated together. The above-mentioned integrated unit / module may be implemented in the form of hardware or in the form of a software program module.

[0191] If the integrated unit / module is implemented in the form of hardware, the hardware may be a digital circuit, an analog circuit, etc. The physical implementation of the hardware structure includes but is not limited to transistors, memristors, etc. Unless otherwise specified, the processor may be any appropriate hardware processor, such as a CPU, a GPU, an FPGA, a DSP, an ASIC, etc. Unless otherwise specified, the storage unit may be any appropriate magnetic storage medium or magneto-optical storage medium, such as a resistive random access memory (RRAM), a dynamic random access memory (DRAM), a static random access memory (SRAM), an enhanced dynamic random access memory (EDRAM), a high-bandwidth memory (HBM), a hybrid memory cube (HMC), etc.

[0192] If the integrated unit / module is implemented in the form of a software program module and sold or used as an independent product, it can be stored in a computer-readable memory. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a memory, including a number of instructions to enable a computer device (which can be a personal computer, server or network device, etc.) to execute all or part of the steps of the various embodiments of the present application. The aforementioned memory includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, disk or optical disk and other media that can store program codes.

[0193] In the above embodiments, the description of each embodiment has its own emphasis. For parts not described in detail in a certain embodiment, please refer to the relevant description of other embodiments. The technical features of the above embodiments can be combined arbitrarily. In order to make the description concise, all possible combinations of the technical features in the above embodiments are not described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0194] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary techniques in the art that are not disclosed in the present application. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present application are indicated by the following claims.

[0195] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.

Claims

1. A clock synchronization method, characterized in that: Applied in a server, the server comprises a first real-time clock and a second real-time clock; wherein the first real-time clock is connected to a baseboard management controller of the server, and the second real-time clock is connected to a central processing unit of the server; The clock synchronization method comprises: When the power is turned on, determining the working status of the server; When the working state is an unstarted state, determining that the first time information of the first real-time clock is the synchronous clock information of the baseboard management controller; In response to a start instruction from the server, acquiring second time information of the second real-time clock; The synchronous clock information of the baseboard management controller is updated based on the second time information.

2. The method according to claim 1, characterized in that The updating of the synchronous clock information of the baseboard management controller based on the second time information includes: Acquiring third time information of the baseboard management controller; Performing consistency detection on the third time information and the second time information; When the third time information is different from the second time information, the synchronous clock information of the baseboard management controller is updated to the second time information.

3. The method according to claim 2, characterized in that When the third time information is different from the second time information, after updating the synchronous clock information of the baseboard management controller to the second time information, the method further includes: The second time information is written into the first real-time clock.

4. The method according to claim 1 or 2, characterized in that: The unstarted state includes an input and output system failure state; When the working state is the unstarted state, after determining that the first time information of the first real-time clock is the synchronous clock information of the baseboard management controller, the method further includes: When the working state is a fault state, in response to a fault diagnosis instruction, target time information corresponding to the fault diagnosis instruction is determined.

5. The method according to any one of claims 1 to 3, characterized in that The first real-time clock includes a first power supply and a second power supply; the method further includes: supplying power to the first real-time clock via the first power supply; When the first power supply is abnormal, the first real-time clock is powered by the second power supply.

6. The method according to any one of claims 1 to 3, characterized in that The step of obtaining, in response to a start instruction of the server, second time information of the second real-time clock includes: In response to the startup instruction, performing initialization; When the initialization is completed, updating the working state to a startup state; Obtaining system log information corresponding to the second real-time clock; The system log information is parsed to obtain second time information of the second real-time clock.

7. A clock synchronization device, characterized in that: Applied in a server, the server comprises a first real-time clock and a second real-time clock; wherein the first real-time clock is connected to a baseboard management controller of the server, and the second real-time clock is connected to a central processing unit of the server; The clock synchronization device comprises: A status determination module, used to determine the working status of the server when the power is turned on; A first synchronization module, configured to determine, when the working state is an unstarted state, that the first time information of the first real-time clock is the synchronization clock information of the baseboard management controller; an acquisition module, configured to acquire second time information of the second real-time clock in response to a startup instruction of the server; The second synchronization module is used to update the synchronization clock information of the baseboard management controller based on the second time information.

8. A server, characterized in that: include: at least two real-time clocks, a processor, and a memory in communication with the processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the method according to any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 6 when executed by a processor.

10. A computer program product, characterized in that The invention comprises a computer program, which implements the method according to any one of claims 1 to 6 when being executed by a processor.

Citation Information

Cited By

  • Time synchronization method, device and system, network equipment and storage medium

    CN120276552A