A time synchronization method and apparatus
By actively sending a time synchronization request to the NOS through the BMC system and modifying register bits and NOS time information, the problem of low time synchronization reliability of the BMC system is solved, and efficient and low-cost time synchronization is achieved.
Patent Information
- Application Number
- CN202211612796.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-15
- Publication Date
- 2026-01-13
- Estimated Expiration
- 2042-12-15
AI Technical Summary
Existing time synchronization solutions for BMC systems have low reliability, cannot provide timely and effective time synchronization for BMC systems, and are costly or require additional hardware design.
The BMC system proactively sends a time synchronization request to the NOS. By modifying the preset bit values of the commonly accessed registers, it uses the time information in the NOS for synchronization, avoiding the uncertainty of network communication and requiring no additional hardware devices.
This achieves reliability and efficiency in time synchronization of the BMC system, reduces implementation costs, and improves the accuracy and feasibility of time synchronization.
Smart Images

Figure CN118214509B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, specifically to a time synchronization method and apparatus. Background Technology
[0002] With the development of Software-Defined Networking (SDN), the integration of data centers is constantly increasing, and the number of devices in the network is also growing, making the operation and maintenance of internal devices in the entire SDN network more complex. Therefore, configuring a Baseboard Management Controller (BMC) system for white-box switches, as a crucial component of hardware devices in SDN networks, has become standard practice. The main functions of the BMC system are to monitor the hardware status of white-box switches, generate alarms, and record device logs. These logs include System Event Logs (SELs), audit logs, and hardware monitoring fault logs. Accurate log recording is crucial for daily fault location; therefore, the BMC system needs to provide accurate system time.
[0003] However, current mechanisms for obtaining time in BMC systems include: time synchronization via the Network Time Protocol (NTP); time recording via an external Real-Time Clock (RTC); or time synchronization by receiving the time sent by the Basic Input Output System (BIOS) during startup. However, in practice, Solution 1 fails to synchronize BMC time over the network because users often disable the NTP service; Solution 2 requires additional hardware design, increasing implementation costs; and Solution 3 prevents a separately rebooted BMC system from obtaining accurate real-time time from the BIOS. In short, existing time synchronization solutions for BMC systems have low reliability and cannot provide timely and effective time synchronization functionality.
[0004] There is an urgent need for a new time synchronization solution to provide reliable, effective and convenient time synchronization functionality for the BMC system. Summary of the Invention
[0005] This application provides a time synchronization method and apparatus to improve the reliability, effectiveness, and convenience of the time synchronization function of a BMC system.
[0006] In a first aspect, this application provides a time synchronization method applied to a BMC system, specifically comprising: sending a time synchronization request to a NOS according to a first triggering condition, wherein the time synchronization request is used to request the NOS to send time information to provide a basis for time synchronization of the BMC system; receiving a time synchronization instruction from the NOS, the time synchronization instruction carrying the time information; and in response to the time synchronization instruction, obtaining the time information from the time synchronization instruction and synchronizing the time in the BMC system according to the time information.
[0007] In this solution, the BMC system actively sends a time synchronization request to the NOS to achieve synchronization between the BMC system time and the NOS time. This method requires neither network communication nor additional hardware, making it reliable, efficient, and low-cost. Furthermore, it utilizes the standard time instructions existing in the NOS to set the time for the BMC system, requiring minimal modification and demonstrating high implementability.
[0008] Optionally, the first triggering condition includes: the BMC system starting up; and / or, a first time interval having elapsed since the BMC system started up.
[0009] This approach provides multiple triggering conditions, which improves the flexibility of implementing this solution.
[0010] Optionally, sending a time synchronization request to the NOS includes: setting the value of a preset bit in a register jointly accessed by the BMC system and the NOS to a first preset value, indicating that a message notification exists in the BMC system; receiving a message acquisition request from the NOS; and in response to the message acquisition request, sending the time synchronization request to the NOS.
[0011] In this approach, the BMC system and NOS achieve the function of the BMC system actively notifying the user through a register shared by both. This ensures the timely transmission of time synchronization requests without adding hardware. By modifying the value of a preset bit in the register shared with the sensor, the presence of a message notification from the BMC system is transmitted reliably and efficiently. This approach also avoids the uncertainty and instability of network communication, improving the feasibility of the time synchronization scheme.
[0012] Optionally, the time synchronization request carries a time request message, wherein the OEM field in the time request message is a second preset value, used to request the NOS to send the time information.
[0013] In this approach, by setting the OEM field in the response message to a preset value to transmit the time request information to the NOS, the utilization rate of the OEM field in the message is improved, and the implementation method is simple and effective, thus improving the feasibility of this solution.
[0014] Optionally, the method further includes: obtaining the system time of the BMC system; updating the timestamp stored in the BMC system according to the system time; wherein the timestamp is used to provide initial time information when the BMC system starts up.
[0015] In this method, the local time stored in the BMC system is updated according to the system time of the BMC system, which reduces the deviation between the initialization time of the BMC system and the actual time. This not only improves the accuracy of the time when the BMC system records logs, but also reduces the operation and maintenance costs of the equipment.
[0016] Optionally, the method further includes: periodically updating the timestamp stored in the BMC system according to a second time interval.
[0017] In this approach, the BMC system periodically updates the timestamp, which can further shorten the gap between the initialization time provided by the timestamp and the actual time, thereby improving the accuracy of the BMC system's log recording work.
[0018] Secondly, this application provides a time synchronization method applied to a NOS (Normally Independent System). The method specifically includes: receiving a time synchronization request from a BMC (Browser Controlled Memory) system, wherein the time synchronization request is used to request the NOS to send time information to provide a basis for time synchronization of the BMC system; and responding to the time synchronization request, sending a time synchronization instruction to the BMC system, wherein the time synchronization instruction carries the time information and instructs the BMC system to synchronize its time according to the time information.
[0019] Optionally, receiving a time synchronization request from the BMC system includes: monitoring a register jointly accessed by the BMC system and the NOS according to a second triggering condition; if it is determined that the value of a preset bit in the register is a first preset value, then sending a message acquisition request to the BMC system, the message acquisition request being used to instruct the BMC system to respond to the time synchronization request; and receiving the time synchronization request from the BMC system.
[0020] Optionally, the time synchronization request carries a time request message, wherein the OEM field in the time request message is a second preset value, used to request the NOS to send the time information.
[0021] In this approach, by setting the OEM field in the response message to a preset value to transmit the time request information to the NOS, the utilization rate of the OEM field in the message is improved, and the implementation method is simple and effective, thus improving the feasibility of this solution.
[0022] Optionally, the second triggering condition includes: periodically triggering the monitoring of the register according to a preset third time interval.
[0023] This approach can improve the NOS's monitoring effectiveness over the BMC system and help detect potential issues with the BMC system as quickly as possible.
[0024] Optionally, before sending a message acquisition request to the NOS, the method further includes: clearing the value of a preset bit in the register.
[0025] In this method, the value of the preset bit in the register is restored to its original state, ensuring the accuracy and one-to-one correspondence of the message notification method.
[0026] Thirdly, this application provides a time synchronization device applied to a BMC system. The device includes: a first sending module, configured to send a time synchronization request to a Network Operating System (NOS) according to a first triggering condition, wherein the time synchronization request is used to request the NOS to send time information to provide a basis for time synchronization of the BMC system; a first receiving module, configured to receive a time synchronization instruction from the NOS, wherein the time synchronization instruction carries the time information; and a first processing module, configured to, in response to the time synchronization instruction, obtain the time information from the time synchronization instruction and synchronize the time in the BMC system according to the time information.
[0027] Optionally, the first triggering condition includes: the BMC system starting up; and / or, a first time interval having elapsed since the BMC system started up.
[0028] Optionally, when the sending module sends a time synchronization request to the NOS, it is specifically configured to: set the value of a preset bit in a register jointly accessed by the BMC system and the NOS to a first preset value, indicating that the BMC system has a message notification; the receiving module is further configured to receive a message acquisition request from the NOS; and the processing module is further configured to send the time synchronization request to the NOS in response to the message acquisition request.
[0029] Optionally, the time synchronization request carries a time request message, wherein the OEM field in the time request message is a second preset value, used to request the NOS to send the time information.
[0030] Optionally, the first processing module is further configured to: obtain the system time of the BMC system; update the timestamp stored in the BMC system according to the system time; wherein the timestamp is used to provide initial time information when the BMC system starts up.
[0031] Optionally, the first processing module is further configured to: periodically update the timestamp stored in the BMC system according to a second time interval.
[0032] Fourthly, this application provides a time synchronization device applied to a NOS (Normally Independent System). The device includes: a second receiving module, configured to receive a time synchronization request from a BMC (Browser Controlled Memory) system, wherein the time synchronization request is used to request the NOS to send time information to provide a basis for time synchronization of the BMC system; and a second processing module, configured to send a time synchronization instruction to the BMC system in response to the time synchronization request, wherein the time synchronization instruction carries the time information and instructs the BMC system to synchronize the time in the BMC system according to the time information.
[0033] Optionally, when the second receiving module receives a time synchronization request from the BMC system, it is specifically configured to: monitor a register jointly accessed by the BMC system and the NOS according to a second triggering condition; the device further includes a second sending module; if it is determined that the value of a preset bit in the register is a first preset value, the second sending module is configured to: send a message acquisition request to the BMC system, the message acquisition request being used to instruct the BMC system to respond to the time synchronization request; the second receiving module is also configured to: receive the time synchronization request from the BMC system.
[0034] Optionally, the time synchronization request carries a time request message, wherein the OEM field in the time request message is a second preset value, used to request the NOS to send the time information.
[0035] Optionally, the second triggering condition includes: periodically triggering the monitoring of the register according to a preset third time interval.
[0036] Optionally, before the second sending module sends a message acquisition request to the NOS, the processing module is further configured to: clear the value of a preset bit in the register.
[0037] Fifthly, an electronic device is provided, comprising: 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 at least one processor, by executing the instructions stored in the memory, causes the at least one processor to perform the method described in the first aspect or any optional embodiment of the first aspect.
[0038] In a sixth aspect, a computer-readable storage medium is provided for storing instructions that, when executed, cause a method as described in the first aspect or any alternative embodiment of the first aspect to be implemented.
[0039] The technical effects or advantages of one or more technical solutions provided in the third, fourth, fifth and sixth aspects of this application can all be explained by the corresponding technical effects or advantages of one or more technical solutions provided in the first and second aspects. Attached Figure Description
[0040] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0041] Figure 1 This is a schematic diagram illustrating a possible application scenario provided by an embodiment of this application;
[0042] Figure 2 This is a flowchart of a time synchronization method provided in an embodiment of this application;
[0043] Figure 3 This is a flowchart illustrating a method for sending a time synchronization request according to an embodiment of this application;
[0044] Figure 4 This is a definition diagram of an interface register provided in an embodiment of this application;
[0045] Figure 5 This is a schematic diagram illustrating another time relationship between timers provided in an embodiment of this application;
[0046] Figure 6 This is a schematic diagram of the structure of a time synchronization device provided in an embodiment of this application;
[0047] Figure 7 This is a schematic diagram of another time synchronization device provided in an embodiment of this application;
[0048] Figure 8 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0049] The technical solution of this application will be described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the embodiments and specific features in the embodiments are detailed descriptions of the technical solution of this application, rather than limitations thereof. In the absence of conflict, the embodiments and technical features in the embodiments can be combined with each other.
[0050] It should be understood that in the description of the embodiments of this application, terms such as "first" and "second" are used only for the purpose of distinguishing descriptions and should not be construed as indicating or implying relative importance, nor should they be construed as indicating or implying order. In the description of the embodiments of this application, "multiple" refers to two or more.
[0051] The term "and / or" in the embodiments of this application is merely a description of the association relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Additionally, the character " / " in this document generally indicates that the preceding and following related objects have an "or" relationship.
[0052] The BMC system is a hardware management system deployed within a white-box switch. It shares the same space with the Network Operating System (NOS) within the white-box switch, providing switching services and hardware management functions, respectively. For the white-box switch to function properly, the BMC system and NOS typically communicate via a Keyboard Controller Style (KCS) interface. This eliminates the need for network interfaces for communication between the BMC system and NOS within the white-box switch. The method provided in this application is based on this fundamental application scenario. For details, see [link to specific details]. Figure 1 This is a schematic diagram illustrating an application scenario provided by an embodiment of this application. In such... Figure 1 In the scenario shown, the white-box switch includes a BMC system and a NOS system, which communicate with each other through the KCS interface. It should be noted that a single SDN network can contain multiple white-box switches; this embodiment uses a single white-box switch within an SDN network as an example to illustrate the solution.
[0053] Based on the above application scenarios, this application proposes a scheme for providing time synchronization for the BMC system, jointly executed by the BMC system and NOS. See also... Figure 2The flowchart below illustrates a time synchronization method provided in this application. The implementation steps of this method are as follows:
[0054] S201: The BMC system sends a time synchronization request to the NOS according to the first triggering condition. The time synchronization request is used to request the NOS to send time information to provide a basis for time synchronization of the BMC system. Correspondingly, the NOS receives the time synchronization request from the BMC system.
[0055] In this step, the BMC system actively requests time information from the NOS. In this way, by using the time information in the NOS, the BMC system can obtain the time information to be synchronized that is very close to the actual time.
[0056] Optionally, the first triggering condition mentioned above may include the startup of the BMC system, and / or a first time interval remaining since the BMC system startup. Thus, depending on different first triggering conditions, the BMC system may send time synchronization requests to the NOS at different times in several ways.
[0057] Method 1: The first trigger condition is the BMC system startup. Thus, whenever the BMC system starts up or restarts for the first time, it can send a time synchronization request to the NOS, thereby achieving time synchronization within its own system.
[0058] In this method, the BMC system immediately sends a time synchronization request to the NOS upon startup or restart, ensuring that the BMC system can synchronize and update the system time in a timely manner, thus maximizing the accuracy of the system time.
[0059] Method 2: The first triggering condition is a first time interval remaining since the BMC system started. Thus, when the first time interval has elapsed since the BMC system started, the BMC system can proactively send a time synchronization request to the NOS, thereby achieving system time synchronization for the BMC system.
[0060] In this method, the BMC system sends a time synchronization request to the NOS according to the first time interval. This ensures both the rapid startup of the BMC system and timely completion of time synchronization within an acceptable time range, thereby improving the reliability of the BMC system's time synchronization.
[0061] Method 3: The first triggering condition is the BMC system and a first time interval remaining since the BMC system started. In this case, the BMC system will send time synchronization requests to the NOS at startup and again at the first time interval after startup to synchronize its own system time. This dual time synchronization request ensures the accuracy of the BMC system's time. Furthermore, the first time interval can also be set as a periodic time interval. Thus, in this method, the BMC system can achieve time synchronization immediately upon system startup and can also periodically send time requests to the NOS at the specified time interval, thereby maximizing the accuracy of the BMC system's time.
[0062] In this approach, the triggering conditions combine the two methods mentioned above, ensuring that the BMC system can complete time synchronization as quickly as possible after startup, and also ensuring the accuracy of the system time during operation. Furthermore, the BMC system can periodically synchronize the system time at time intervals to prevent prolonged periods of erroneous system time due to unsuccessful synchronization attempts.
[0063] The above describes the triggering conditions for the BMC system to send a time synchronization request to the NOS. However, the specific implementation details of how the BMC system sends this request require further explanation. Figure 3 The steps shown are as follows:
[0064] S301: After the first trigger condition is met, the BMC system sets the value of the preset bit in the register to the first preset value, thereby indicating to the NOS that there is a message notification in the BMC system.
[0065] The register accessed by the BMC system is a KCS-defined register. This register can be accessed by both the BMC system and the NOS on the same white-box switch. In this way, when the BMC system modifies a bit in this register, the NOS can also detect the modification.
[0066] For example, this register can specifically be defined by KCS as follows: Figure 4The KCS interface registers shown above contain a preset bit, which can be bit 2 in the I / O address of these interface registers, specifically the location identified by the System Management Software Attention (SMS_ATN). This SMS_ATN location is used to notify the NOS whether a message notification exists in the BMC system. Therefore, when the BMC system sets this SMS_ATN bit to the first preset value (which can be 1), it informs the NOS that a message notification exists in the BMC system.
[0067] S302: NOS monitors the registers accessed by both the BMC system and NOS according to the second trigger condition.
[0068] The second triggering condition may include periodically triggering monitoring of the aforementioned registers according to a preset third time interval. In this way, the NOS can monitor whether the value of a preset bit in the register is the first preset value after each third time interval. This method improves the NOS's monitoring effectiveness over the BMC system and allows for faster detection of potential message notifications from the BMC system.
[0069] Alternatively, the NOS can monitor the aforementioned registers using a polling method. The NOS sequentially queries its peripheral devices to determine if they require service. When it's the turn of a register shared with the BMC, the NOS can determine that the BMC needs service (a notification message is present) based on the register's value. The NOS can continuously repeat this sequential access process, thus achieving periodic monitoring of the register.
[0070] Alternatively, NOS can monitor this register via interrupts. Whenever the BMC system modifies the value of a preset bit in the register, NOS immediately suspends the currently executing task and switches to handling the BMC system's request. This method effectively ensures NOS's response speed and reduces the time spent in time out of sync with the BMC system.
[0071] S303: The NOS determines whether the value of the preset bit in the register is the first preset value. If it is determined to be the first preset value, the NOS executes step S304; if it is determined not to be the first preset value, it continues to wait for the next time interval before monitoring the register again.
[0072] S304: The NOS sends a message retrieval request to the BMC system, which instructs the BMC system to respond to the aforementioned time synchronization request; correspondingly, the BMC system receives the message retrieval request from the NOS.
[0073] The NOS, by detecting the value at a preset location in the register, learns that a message notification currently exists in the BMC system. Therefore, the NOS sends a message retrieval request to the BMC system, prompting the BMC system to respond with the content of its message notification. For example, when the NOS sends a message retrieval request to the BMC system, the NOS can send a Get Message Flags Command, defined according to the Intelligent Platform Management Interface (IPMI) protocol, to retrieve the message status of the BMC system.
[0074] Optionally, after the NOS detects that the value of the preset bit in the register has changed to the first preset value, and before the NOS sends a message retrieval request to the BMC system, the NOS can also perform the following operation: clear the value of the preset bit in the register. In this way, the value of the preset bit in the register returns to its original state, ensuring the accuracy and one-to-one correspondence of this message notification method.
[0075] S305: In response to the above message acquisition request, the BMC system sends a time synchronization request to the NOS; the corresponding NOS receives the time synchronization request.
[0076] Taking the response of the BMC system to the Get Message Flags Command sent by the NOS as an example, the above step S305 is as follows: The BMC system receives the Get Message Flags Command instruction and, in response to the instruction, sends a time synchronization request to the NOS.
[0077] Optionally, the time synchronization request may include a time request message, and the Original Equipment Manufacturer (OEM) field in the time request message may be a second preset value.
[0078] For example, when the BMC system responds to the NOS's Get Message Flags Command, it can send a message response message, in which the OEM field is set to a second preset value. In this way, the BMC system sends a time synchronization request to the NOS, which can then respond to the request, thus assisting the BMC system in completing time synchronization. It should be noted that the OEM field in the aforementioned message response message consists of bits 5 to 7; therefore, the second preset value in these bits can be any three-bit binary number, such as 001 or 010. This application does not impose any restrictions on this, and the value can be set according to actual usage requirements.
[0079] In this way, by setting the OEM field in the response message to a preset value to transmit the time request information to the NOS, the utilization rate of the OEM field in the message is improved, and the implementation method is simple and effective, thus improving the feasibility of this solution.
[0080] In this approach, the BMC system and NOS achieve the function of the BMC system actively notifying the user through a register shared by both. This ensures the timely transmission of time synchronization requests without adding hardware. By modifying the value of a preset bit in the register shared with the sensor, the presence of a message notification from the BMC system is transmitted reliably and efficiently. This approach also avoids the uncertainty and instability of network communication, improving the feasibility of the time synchronization scheme.
[0081] Using the above method, the BMC system successfully sent a time synchronization request to the NOS. Therefore, to fulfill the BMC system's time synchronization requirement, the subsequent execution steps are as follows:
[0082] S202: In response to the aforementioned time synchronization request, the NOS sends a time synchronization instruction to the BMC system. The time synchronization instruction carries the time information requested in the time synchronization request, and the time synchronization instruction is used to instruct the BMC system to synchronize the time in the BMC system according to the time information in the instruction; correspondingly, the BMC system receives the time synchronization instruction.
[0083] Following the aforementioned series of interactions between the BMC system and the NOS, the BMC system successfully sends a time synchronization request to the NOS. In response, the NOS sends a time synchronization command to the BMC system, including time information to instruct the BMC system to synchronize its system time accordingly. This time information can be the moment the NOS receives the time synchronization request, the moment the NOS sends the time synchronization command, or the moment the NOS anticipates the BMC will complete time synchronization. This application does not impose any restrictions and the information can be set according to actual usage requirements.
[0084] For example, after NOS sends a Get Message Flags Command to the BMC system according to the IPMI protocol, it receives a message response message from the BMC system. Upon further discovering that the OEM field in the response message is a second preset value, NOS will respond to the message response message by sending a Set SEL TimeCommand to the BMC system. This command will include a timestamp so that the BMC system can set its own system time based on the information in the timestamp.
[0085] S203: The BMC system responds to the received time synchronization command, obtains time information from the time synchronization command, and synchronizes the time in the BMC system according to the time information.
[0086] In this way, the BMC system can successfully complete its time synchronization, thereby providing accurate timestamps for the device's log records.
[0087] In this solution, the BMC system actively sends a time synchronization request to the NOS to achieve synchronization between the BMC system time and the NOS time. This method requires neither network communication nor additional hardware, making it reliable, efficient, and low-cost. Furthermore, it utilizes the standard time instructions existing in the NOS to set the time for the BMC system, requiring minimal modification and demonstrating high implementability.
[0088] Optionally, in addition to the time synchronization method of BMC described above, the method provided in this application embodiment also includes a method for reducing the deviation between the initial time and the actual time of the BMC system.
[0089] First, it should be noted that the current BMC system initialization time uses the time information stored in the timestamp of the BMC system. Generally, in the BMC system, this timestamp is set to 1970-01-01 or the time when the BMC system was compiled. Both of these times differ too much from the actual time of the BMC system. As a result, before the BMC system completes time synchronization, the time stamp used to mark the logs differs too much from the actual time, which further affects the maintenance of the white-box switch on which the BMC system is located.
[0090] Therefore, in this embodiment, the BMC system obtains its own system time and updates the timestamp stored in the BMC system to provide initial time information when the BMC system starts up, based on this system time. In this way, updating the timestamp according to the BMC system's system time can minimize the deviation between the BMC system's initial time and the actual time period.
[0091] Take a BMC system managed by systemd as an example. In systemd, the BMC initialization time uses the timestamp information from the file at address / usr / lib / clock-epoch, which is generally fixed. However, in this embodiment, the BMC system can update the timestamp in this file ( / usr / lib / clock-epoch) according to the synchronized system time, thereby making the deviation between the next BMC initialization time and the actual time smaller.
[0092] In this method, the local time stored in the BMC system is updated according to the system time of the BMC system, which reduces the deviation between the initialization time of the BMC system and the actual time. This not only improves the accuracy of the time when the BMC system records logs, but also reduces the operation and maintenance costs of the equipment.
[0093] Optionally, regarding the above-mentioned method for updating timestamps, the BMC system can also periodically update the timestamps stored in the BMC system according to the second time interval.
[0094] In this way, the BMC system can periodically update the timestamp, which can further shorten the gap between the initialization time provided by the timestamp and the actual time, thereby improving the accuracy of the BMC system's log recording work.
[0095] The above describes various possible solutions for the embodiments of this application. It should be understood that the above possible solutions can achieve different effects through various combinations. The following describes one possible combination solution.
[0096] See Figure 5 This is a flowchart illustrating a possible time synchronization method provided in an embodiment of this application. The method is jointly executed by the BMC system and the NOS to synchronize the time between the BMC system and the NOS. The specific implementation steps of this method are as follows:
[0097] S501: BMC system restart.
[0098] S502: The BMC system sets the value of the SMS_ATN bit in the KCS interface register and sets its value to 1.
[0099] S503: NOS discovered through polling that the value of the SMS_ATN bit in the KCS interface register was set to 1.
[0100] S504: NOS clears the value of the SMS_ATN bit in the interface register.
[0101] S505: NOS sends a Get Message Flags Command message to the BMC system according to the IPMI protocol; correspondingly, the BMC system receives the message from NOS.
[0102] S506: The BMC system sends a time synchronization request to the NOS, which carries a time request message. The value of the OEM field in the message is 001. The NOS receives the time synchronization request.
[0103] S507: If NOS determines that the value of the OEM field in the time request message is 001, it will obtain the current time from NOS and create a timestamp.
[0104] S508: NOS sends a command to the BMC system – Set SEL Time Command, which carries the timestamp created above; correspondingly, the BMC system receives the command.
[0105] S509: The BMC system obtains the timestamp from the instruction and sets the BMC system's time according to the time information in the timestamp.
[0106] S510: The BMC system sends a time setting response message to the NOS to indicate that the BMC system has completed time synchronization.
[0107] Based on the same inventive concept, embodiments of this application also provide a time synchronization device.
[0108] See Figure 6 This application provides a time synchronization device, which may be the aforementioned terminal device or a chip or integrated circuit in the device. The device includes modules / units / technical means for executing the method executed by the terminal device in the above method embodiments.
[0109] For example, the device 600 includes:
[0110] The first sending module 601 is used to send a time synchronization request to the Network Operating System (NOS) according to a first triggering condition, wherein the time synchronization request is used to request the NOS to send time information to provide a basis for time synchronization of the BMC system.
[0111] The first receiving module 602 is used to receive a time synchronization instruction from the NOS, wherein the time synchronization instruction carries the time information.
[0112] The first processing module 603 is configured to respond to the time synchronization command, obtain the time information from the time synchronization command, and synchronize the time in the BMC system according to the time information.
[0113] As one example, Figure 6 The device described can be used to perform Figure 2 The method described in the illustrated embodiment is therefore relevant to the functions that each functional module of the device can achieve. Figure 2 The description of the embodiments shown will not be repeated here.
[0114] Based on the same inventive concept, embodiments of this application also provide a time synchronization device.
[0115] See Figure 7This application provides a time synchronization device, which may be the aforementioned terminal device or a chip or integrated circuit in the device. The device includes modules / units / technical means for executing the method executed by the terminal device in the above method embodiments.
[0116] For example, the device 700 includes:
[0117] The second receiving module 701 is used to receive a time synchronization request from the BMC system, wherein the time synchronization request is used to request the NOS to send time information to provide a basis for time synchronization of the BMC system;
[0118] The second processing module 702 is configured to send a time synchronization instruction to the BMC system in response to the time synchronization request, wherein the time synchronization instruction carries the time information and is used to instruct the BMC system to synchronize the time in the BMC system according to the time information.
[0119] As one example, Figure 7 The device described can be used to perform Figure 2 The method described in the illustrated embodiment is therefore relevant to the functions that each functional module of the device can achieve. Figure 2 The description of the embodiments shown will not be repeated here.
[0120] It should be noted that although several modules or sub-modules of the device have been mentioned in the detailed description above, this division is merely exemplary and not mandatory. In fact, according to embodiments of the present invention, the features and functions of two or more units described above can be embodied in a single module. Conversely, the features and functions of a module described above can be further divided and embodied by multiple modules.
[0121] As one possible product form of the aforementioned device, see [link to product description]. Figure 8 This application also provides an electronic device 800, comprising:
[0122] At least one processor 801; and a communication interface 803 communicatively connected to the at least one processor 801; the at least one processor 801 causes the electronic device 800 to execute the method steps performed by any device in the above method embodiments through the communication interface 803 by executing instructions stored in the memory 802.
[0123] Optionally, the memory 802 is located outside the electronic device 800.
[0124] Optionally, the electronic device 800 includes the memory 802, which is connected to the at least one processor 801, and stores instructions executable by the at least one processor 801. (Appendix) Figure 8 The dashed line indicates that memory 802 is optional for electronic device 800.
[0125] The processor 801 and the memory 802 can be coupled through an interface circuit or integrated together; no restriction is imposed here.
[0126] This application embodiment does not limit the specific connection medium between the processor 801, memory 802, and communication interface 803. This application embodiment... Figure 8 The processor 801, memory 802, and communication interface 803 are connected via a bus 804. Figure 8 The connections between other components are shown in bold and are for illustrative purposes only, not as limiting information. The bus can be divided into address bus, data bus, control bus, etc. For ease of illustration, Figure 8 The text uses only a single thick line to represent a bus, but this does not imply that there is only one bus or one type of bus. It should be understood that the processor mentioned in the embodiments of this application can be implemented in hardware or software. When implemented in hardware, the processor can be a logic circuit, integrated circuit, etc. When implemented in software, the processor can be a general-purpose processor, implemented by reading software code stored in memory.
[0127] For example, the processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor or any conventional processor.
[0128] It should be understood that the memory mentioned in the embodiments of this application can be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. The non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate Synchronous DRAM (DDR SDRAM), Enhanced Synchronous DRAM (ESDRAM), Synchlink DRAM (SLDRAM), and Direct RAM (DR RAM).
[0129] It should be noted that when the processor is a general-purpose processor, DSP, ASIC, FPGA, or other programmable logic device, discrete gate or transistor logic device, or discrete hardware component, the memory (storage module) can be integrated into the processor.
[0130] It should be noted that the memories described herein are intended to include, but are not limited to, these and any other suitable types of memories.
[0131] As another possible product form, this application embodiment also provides a computer-readable storage medium for storing instructions that, when executed, cause a computer to perform the method steps performed by any of the devices in the above method examples.
[0132] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0133] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0134] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0135] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0136] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the spirit and scope of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.
Claims
1. A time synchronization method, characterized in that, The method, applied to a baseboard management controller (BMC) system, includes: According to the first triggering condition, a time synchronization request is sent to the Network Operating System (NOS), wherein the time synchronization request is used to request the NOS to send time information to provide a basis for time synchronization of the BMC system; Receive a time synchronization instruction from the NOS, the time synchronization instruction carrying the time information; In response to the time synchronization command, the time information is obtained from the time synchronization command, and the time in the BMC system is synchronized according to the time information.
2. The method as described in claim 1, characterized in that, The first triggering condition includes: the BMC system starting up; and / or, a first time interval having elapsed since the BMC system started up.
3. The method as described in claim 1, characterized in that, Sending a time synchronization request to the Network Operating System (NOS) includes: Set the value of a preset bit in a register accessed by both the BMC system and the NOS to a first preset value to indicate that a message notification has been received by the BMC system. Receive a message retrieval request from the NOS; In response to the message retrieval request, the time synchronization request is sent to the NOS.
4. The method according to any one of claims 1-3, characterized in that, The method further includes: Obtain the system time of the BMC system; Update the timestamp stored in the BMC system according to the system time; wherein the timestamp is used to provide initial time information when the BMC system starts.
5. The method as described in claim 4, characterized in that, The method further includes: The timestamp stored in the BMC system is periodically updated according to the second time interval.
6. A time synchronization method, characterized in that, Applied to NOS, the method includes: Receive a time synchronization request from the BMC system, wherein the time synchronization request is used to request the NOS to send time information to provide a basis for time synchronization of the BMC system; In response to the time synchronization request, a time synchronization instruction is sent to the BMC system, wherein the time synchronization instruction carries the time information and is used to instruct the BMC system to synchronize the time in the BMC system according to the time information.
7. The method as described in claim 6, characterized in that, Receiving a time synchronization request from the BMC system includes: Based on the second triggering condition, monitor the registers accessed by both the BMC system and the NOS; If the value of the preset bit in the register is determined to be a first preset value, a message acquisition request is sent to the BMC system. The message acquisition request is used to instruct the BMC system to respond to the time synchronization request. Receive the time synchronization request from the BMC system.
8. The method as described in claim 7, characterized in that, The second triggering condition includes periodically triggering the monitoring of the register according to a preset third time interval.
9. The method as described in claim 7, characterized in that, Before sending the message retrieval request to the BMC system, the method further includes: Clear the value of the preset bit in the register.
10. A time synchronization device, characterized in that, The device, applied to a BMC system, includes: The first sending module is used to send a time synchronization request to the Network Operating System (NOS) according to a first triggering condition, wherein the time synchronization request is used to request the NOS to send time information to provide a basis for time synchronization of the BMC system; The first receiving module is configured to receive a time synchronization instruction from the NOS, wherein the time synchronization instruction carries the time information. The first processing module is configured to respond to the time synchronization command, obtain the time information from the time synchronization command, and synchronize the time in the BMC system according to the time information.
11. The apparatus as claimed in claim 10, characterized in that, The first triggering condition includes: the BMC system starting up; and / or, a first time interval having elapsed since the BMC system started up.
12. The apparatus as claimed in claim 10, characterized in that, When the sending module sends a time synchronization request to the NOS, it is specifically used for: Set the value of a preset bit in a register accessed by both the BMC system and the NOS to a first preset value to indicate that a message notification has been received by the BMC system. The receiving module is also used to receive a message acquisition request from the NOS; The processing module is also configured to send the time synchronization request to the NOS in response to the message acquisition request.
13. A time synchronization device, characterized in that, Applied to NOS, the device includes: The second receiving module is used to receive a time synchronization request from the BMC system, wherein the time synchronization request is used to request the NOS to send time information to provide a basis for time synchronization of the BMC system; The second processing module is configured to send a time synchronization instruction to the BMC system in response to the time synchronization request, wherein the time synchronization instruction carries the time information and is used to instruct the BMC system to synchronize the time in the BMC system according to the time information.
14. The apparatus as claimed in claim 13, characterized in that, When the second receiving module receives a time synchronization request from the BMC system, it is specifically used to: monitor the registers jointly accessed by the BMC system and the NOS according to the second triggering condition; The device further includes a second sending module; if the value of the preset bit in the register is determined to be a first preset value, the second sending module is used to: send a message acquisition request to the BMC system, the message acquisition request being used to instruct the BMC system to respond to the time synchronization request; The second receiving module is further configured to: receive the time synchronization request from the BMC system.
15. An electronic device, characterized in that, include: At least one processor; and a memory communicatively connected to the at least one processor; The memory stores instructions executable by the at least one processor, which executes the instructions stored in the memory to perform the method as described in any one of claims 1-5 and 6-9.
16. A computer-readable storage medium, characterized in that, The computer-readable storage medium is used to store instructions that, when executed, cause the method as described in any one of claims 1-5 and 6-9 to be implemented.
Citation Information
Patent Citations
BMC fault processing method and device, electronic equipment and storage medium
CN111045866A
Time synchronization method, device and equipment and readable storage medium
CN114189305A