Time synchronization method, device and readable storage medium

By setting the time zone information of RTC time in the BMC's Impi, the time zone processing error problem when BMC synchronizing time is solved, and accurate time synchronization is achieved.

CN115826680BActive Publication Date: 2025-08-29INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211052252.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-08-31
Publication Date
2025-08-29
Estimated Expiration
2042-08-31

AI Technical Summary

Technical Problem

When BMC synchronizes time, it cannot correctly handle the RTC time set by the user system to have a time zone, resulting in time errors and inaccurate log time.

Method used

By obtaining the configuration information of the user system, confirm whether the RTC time has a time zone, and set 1 or 0 in the BMC's impi, synchronize the RTC time or superimpose the preset time to set the BMC standard time, including comparison and alarm processing every time the preset time.

Benefits of technology

When the user system RTC time comes with its own time zone, obtain the correct BMC time to avoid time errors and ensure that the recorded log time is accurate.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115826680B_ABST
    Figure CN115826680B_ABST
Patent Text Reader

Abstract

The present application discloses a time synchronization method, device, and readable storage medium, relating to the field of information technology. The time synchronization method provided by the present application pre-acquires the user's system configuration by setting a bit in the BMC's impi, modifies the impi bit based on whether the user's system configuration's RTC time includes a time zone, and determines whether the BMC's preset time zone needs to be added based on the impi bit to set the time and obtain the correct time. Compared with the existing method of directly synchronizing the user system's RTC time through the BMC, the method can obtain the correct time even when the user system's RTC time includes a time zone.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of electronic information, and in particular to a time synchronization method, device, and readable storage medium. Background Art

[0002] In recent years, with the advancement of electronic information technology, baseboard management controllers (BMCs) have become increasingly common in the computer industry. Because BMCs lack an independent time source and cannot store time, they must synchronize time from an external source each time they boot. Servers have a clock chip called a real-time clock (RTC) that independently stores time, allowing the BMC to obtain the corresponding time from the RTC after booting. However, due to hardware design limitations, the BMC cannot directly obtain the RTC time and must instead obtain it from other servers in the computer.

[0003] The existing BMC time synchronization method uses the RTC time obtained by the ME as the time in the 0th time zone by default. The time zone set in the BMC is then added to (or subtracted from) the corresponding time to obtain the final BMC time. However, due to different system settings of different users, the RTC time set may be either with or without a time zone. If the user's system is set to have a time zone, the RTC time is already correct, but the BMC will still process it as the time in the 0th time zone and add (or subtract) the time zone set in the BMC. As a result, the final BMC time is several time zones ahead (or behind) the actual time, resulting in a corresponding time error and inaccurate recorded log time.

[0004] In view of the above technology, finding a time synchronization method that can simultaneously meet the two setting conditions is an urgent problem to be solved by those skilled in the art. Summary of the Invention

[0005] The purpose of this application is to provide a time synchronization method, apparatus, and readable storage medium to solve the problem that, if a user system is configured with time zones, the RTC time is already correct, but the BMC still processes it as the time in time zone 0, adding (or subtracting) the time zone configured in the BMC, resulting in the final BMC time being several time zones faster (or slower) than the actual time, thereby causing a corresponding time error and inaccurate recorded log time.

[0006] To solve the above technical problems, the present application provides a time synchronization method applied to BMC, including:

[0007] Obtain the configuration information of the user system and confirm whether the RTC time of the user system includes the time zone;

[0008] If the RTC time of the user system has a time zone, then set the impi bit in the BMC to 1, otherwise set it to 0;

[0009] Synchronize the RTC time in the user system and confirm the setting of impi;

[0010] If the impi bit is set to 1, the RTC time is set to the standard time of the BMC;

[0011] If the impi bit is set to 0, the time obtained by adding the RTC time to the preset time zone of the BMC is set as the standard time of the BMC.

[0012] Preferably, after setting the standard time of the BMC, the method further includes:

[0013] At preset intervals, obtaining the RTC time of the user system and comparing it with the standard time of the BMC to determine whether the BMC time meets a preset condition;

[0014] If the preset conditions are not met, an alarm will be triggered.

[0015] Preferably, the preset condition is that if the impi is set to 1, the difference between the standard time of the BMC and the RTC time is less than the preset difference; if the impi is set to 0, the difference between the standard time of the BMC and the RTC time superimposed on the preset time zone of the BMC is less than the preset difference.

[0016] Preferably, after the alarm processing is performed, the method further includes:

[0017] Resetting the standard time of the BMC, returning to the step of synchronizing the RTC time in the user system, and confirming the setting of the impi.

[0018] Preferably, the configuration information of the user system is obtained to confirm whether the RTC time of the user system includes a time zone;

[0019] Obtain the OS settings of the user system and obtain the motherboard time of the ME in the OS;

[0020] Determine whether the RTC time includes a time zone according to the mainboard time of the ME and the OS settings;

[0021] If yes, determining the RTC time band time zone of the user system;

[0022] If not, it is confirmed that the RTC time of the user system does not include a time zone.

[0023] Preferably, synchronizing the RTC time in the user system includes:

[0024] Send a synchronization request to the ME and synchronize the mainboard time of the ME.

[0025] Preferably, the sending of a synchronization request to the ME and synchronizing the mainboard time of the ME includes:

[0026] Send a synchronization request to the ME in an asynchronous manner and synchronize the mainboard time of the ME.

[0027] To solve the above problems, the present application also provides a time synchronization device, comprising:

[0028] An acquisition module is used to obtain the configuration information of the user system and confirm whether the RTC time of the user system includes a time zone;

[0029] A setting module, configured to set the impi bit in the BMC to 1 if the RTC time zone is in the user system, and to set it to 0 otherwise;

[0030] A synchronization module, configured to synchronize the RTC time in the user system and confirm the setting of impi. If impi is set to 1, a setting module is enabled; if impi is set to 0, a conversion module is enabled.

[0031] A setting module, configured to set the RTC time to the standard time of the BMC;

[0032] The conversion module is configured to set the time obtained by converting the RTC time into the preset time zone of the BMC as the standard time of the BMC.

[0033] Preferably, the device further comprises:

[0034] A preset time module, configured to obtain the RTC time of the user system at preset intervals and compare it with the standard time of the BMC to determine whether the BMC time meets a preset condition;

[0035] The alarm module is activated when the BMC does not meet the preset conditions and is used for alarm processing.

[0036] Preferably, the device further comprises:

[0037] The reset module is used to reset the standard time of the BMC, return to the step of synchronizing the RTC time in the user system, and confirm the setting status of the impi.

[0038] To solve the above problem, the present application further provides a time synchronization device, comprising a memory for storing a computer program;

[0039] The processor is configured to implement the steps of the above-mentioned time synchronization device when executing the computer program.

[0040] To solve the above problem, the present application also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the time synchronization method as described above are implemented.

[0041] The time synchronization method provided in this application obtains the configuration information of the user system and confirms whether the user system's RTC time includes a time zone. If the user system's RTC time includes a time zone, the impi bit in the BMC is set to 1, otherwise it is set to 0, the RTC time in the user system is synchronized, and the setting of impi is confirmed. If impi is set to 1, the RTC time is set to the BMC's standard time. If impi is set to 0, the time obtained by adding the RTC time to the BMC's preset time zone is set as the BMC's standard time. The time synchronization method provided in this application pre-acquires the user's system configuration by setting a bit in the BMC's impi, modifies the impi bit based on whether the RTC time in the user system configuration includes a time zone, and determines whether the BMC's preset time zone needs to be added based on the impi bit to set the time to obtain the correct time. Compared with the original method of directly synchronizing the user system's RTC time through the BMC, the time can be obtained even when the user system's RTC time includes its own time zone.

[0042] The time synchronization device and computer-readable storage medium provided in this application correspond to the above-mentioned time synchronization method, and have the same beneficial effects as above. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] In order to more clearly illustrate the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0044] Figure 1 A flowchart of a time synchronization method provided in an embodiment of the present application;

[0045] Figure 2 A schematic diagram of a time synchronization device provided in an embodiment of the present application;

[0046] Figure 3A schematic diagram of a time synchronization device provided in another embodiment of the present application. DETAILED DESCRIPTION

[0047] The following will be combined with the accompanying drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0048] The core of this application is to provide a time synchronization method, device and readable storage medium to solve the problem of introducing a dual-vector synthesis method, which can be divided into a zero vector combination and a non-zero vector combination according to the type of the second voltage vector used. The voltage vector synthesized by the former has a variable amplitude but a fixed direction, while the latter has a variable direction but a fixed amplitude. Both of these will limit the improvement of control performance.

[0049] In order to enable those skilled in the art to better understand the present application, the present application is further described in detail below with reference to the accompanying drawings and specific implementation methods.

[0050] Figure 1 A flow chart of a time synchronization method provided in an embodiment of the present application is shown in FIG. Figure 1 As shown, the method includes:

[0051] S10: Obtain the configuration information of the user system and confirm whether the RTC time of the user system includes the time zone;

[0052] The baseboard management controller (BMC) provides the intelligence within the IPMI architecture. It is a dedicated microcontroller embedded on the motherboard of a computer (typically a server). The BMC manages the interface between system management software and the platform hardware. The BMC is an independent processor embedded in the server motherboard. It communicates with other hardware and software components within the host through various interfaces, such as the IPMB, LPC (low-pin-count interface), and SMBus. It also provides query and control capabilities to the local host and remote servers via network and serial interfaces.

[0053] It should be noted that the Real-Time Clock (RTC) generates pulses from a clock circuit consisting of a crystal oscillator and related circuits on the computer motherboard. The RTC generates a lower-frequency OS (system) clock (TSC) through frequency conversion by the 8254 circuit. The system clock increments by one with every CPU cycle and is initialized by the RTC at system startup. The 8254 itself also requires its own driver clock (PIT).

[0054] In this embodiment, there is no specific limitation on the models and specific types of the BMC and the user system.

[0055] S11: If the RTC time of the user system has a time zone, set the impi bit in the BMC to 1, otherwise set it to 0;

[0056] A time zone is a region on Earth that uses the same time. It allows for conversion of local time to other times. To accommodate global usage and facilitate conversion of local time to other times, the world is divided into 24 time zones, divided into 12 Eastern and 12 Western time zones. Adjacent time zones differ by one hour, with Eastern adding the hour and Western subtracting the hour. Therefore, the current time = UTC + time zone. UTC is the time in time zone 0 (also known as Universal Time). For example, if the current UTC time is 2022-07-30 08:00:00, Beijing is located in Eastern Time Zone 8, so 8 hours should be added to UTC, resulting in the actual Beijing time being 2022-07-30 16:00:00. New York is located in Western Time Zone 5, so the actual New York time should be subtracted by 5 hours from UTC, resulting in 2022-07-30 03:00:00.

[0057] S12: Synchronize the RTC time in the user system and confirm the setting of impi. If impi is set to 1, enter S13; if impi is set to 0, enter S14.

[0058] Impi is a commonly used instruction in the host and has multiple uses. In this solution, impi is mainly used to control the time conversion program of the BMC. The specific program of impi is not described in detail in this embodiment.

[0059] S13: Set the RTC time to the standard time of the BMC;

[0060] S14: The time obtained by adding the RTC time to the preset time zone of the BMC is set as the standard time of the BMC.

[0061] It can be understood that in this embodiment, the method of setting impi to 1 or 0 is only used to determine whether the RTC time has a time zone. For the impi command, the setting situation corresponds to the result of the judgment, so the setting position code can be an arbitrary code. For example, the setting 1 or 0 mentioned here can be setting A or B, etc., which is not specifically limited here.

[0062] It should be noted that the time superposition conversion method in this embodiment is obtained by superimposing the above-mentioned UTC time on the time zone. Depending on the time zone, the superposition of the eastern zone is positive and the western zone is negative. Therefore, the superposition of time zones here does not simply refer to an increase, it may also be a decrease after superimposing a negative number, which will not be elaborated here.

[0063] The time synchronization method provided in this embodiment obtains the configuration information of the user system and confirms whether the user system's RTC time includes a time zone. If the user system's RTC time includes a time zone, the impi bit in the BMC is set to 1, otherwise it is set to 0. The RTC time in the user system is synchronized and the setting of impi is confirmed. If impi is set to 1, the RTC time is set to the BMC's standard time. If impi is set to 0, the time obtained by adding the RTC time to the BMC's preset time zone is set as the BMC's standard time. The time synchronization method provided in this application pre-acquires the user's system configuration by setting a bit in the impi of the BMC, modifies the impi bit based on whether the RTC time in the user system configuration includes a time zone, and determines whether the BMC's preset time zone needs to be added based on the impi bit to set the time to obtain the correct time. Compared with the original method of directly synchronizing the user system's RTC time through the BMC, the correct time can be obtained even if the user system's RTC time includes its own time zone.

[0064] Considering the time misalignment caused by system operation, the following is a preferred solution: After setting the BMC standard time, the following also applies:

[0065] At preset intervals, the user system's RTC time is obtained and compared with the BMC's standard time to determine whether the BMC time meets preset conditions;

[0066] If the preset conditions are not met, an alarm will be triggered.

[0067] The preset condition is that if impi is set to 1, the difference between the BMC standard time and the RTC time is less than the preset difference; if impi is set to 0, the difference between the BMC standard time and the RTC time plus the BMC preset time zone is less than the preset difference.

[0068] It should be noted that the specific device used for alarm processing in this embodiment is not limited. It can be a warning light or buzzer, etc., or the BMC can directly send a signal feedback to perform alarm processing. It should be noted that in this embodiment, the specific value of the preset difference in the preset condition is not limited. Considering the accuracy of the running time, it is generally not more than one minute. The specific judgment method in this embodiment is mentioned as being performed by comparison, which will not be detailed here.

[0069] In this embodiment, the accuracy of the time in the BMC is ensured by polling and issuing an alarm when an abnormality is found.

[0070] Considering that BMC abnormalities must be handled promptly after an alarm is generated, a preferred solution is provided. After the alarm is processed, the following steps are also included:

[0071] Reset the BMC standard time, synchronize the RTC time in the user system, and confirm the setting of impi.

[0072] The above embodiment does not limit the method for obtaining the RTC time. Here, a preferred solution is provided to obtain the configuration information of the user system and confirm whether the RTC time of the user system includes the time zone;

[0073] Get the OS settings of the user system and get the motherboard time of the ME in the OS;

[0074] Determine whether the RTC time includes a time zone based on the ME motherboard time and OS settings;

[0075] If so, determine the RTC time zone of the user system;

[0076] If not, confirm that the RTC time of the user system does not include the time zone;

[0077] Synchronizing the RTC time in the user system includes:

[0078] Send a synchronization request to ME and synchronize the mainboard time of ME.

[0079] An operating system (OS) is a computer program that manages and controls computer hardware and software resources. It is the most basic system software that runs directly on the bare metal. All other software must be supported by the OS to run. The OS serves as the interface between the user and the computer, as well as between the computer hardware and other software. Its functions include managing the computer system's hardware, software, and data resources, controlling program execution, improving the human-computer interface, and providing support for other application software, maximizing the effectiveness of all computer system resources. It provides various user interfaces to create a user-friendly working environment and provides essential services and interfaces for the development of other software.

[0080] It should be noted that the Management Engine (ME) refers to a microprocessor in the computer motherboard that is independent of the CPU and operating system. The ME has a remote management function that can remotely manage enterprise computers without user control when a serious vulnerability occurs. Because the ME is remotely managed and independent of the processor and operating system, regardless of whether the system is shut down or damaged, the motherboard time in the ME is always the corresponding accurate RTC time, regardless of whether the system is powered on and running or the operating environment. This ensures that regardless of the system status, the RTC time obtained by this solution is the accurate RTC time, preventing time anomalies caused by system power on / off or failures.

[0081] Considering the efficiency of information transmission, a preferred solution is provided here to send a synchronization request to the ME and synchronize the mainboard time of the ME, including:

[0082] Send a synchronization request to ME in an asynchronous manner and synchronize the mainboard time of ME.

[0083] Synchronization refers to the maintenance of a certain relative relationship between two or more time-varying quantities. The original meaning refers to someone or something being performed or produced simultaneously, such as audio and video synchronization or motion synchronization. There are several types of synchronization signals, each with a different purpose. MIDI clock is one of the simpler synchronization signals. The MIDI specification defines the clock byte transmitted by the host over the MIDI line as 24 ppq (clock points per quarter note), and also specifies commands such as song start, stop, and resume. Using these commands, two sequencers can be easily synchronized. Users can transmit operations on the host to the slave via a single MIDI line, allowing the slave to synchronize perfectly with the host.

[0084] There are two ways to synchronize databases. The first is to apply changes made in one database to the other based on the database logs. This method is suitable for identical databases with identical data structures. However, applying this synchronization method to different databases or databases with different data types can be challenging. The second method is to analyze the contents of the two databases, identify any differences, and write the discrepant records to the other database. This method is not strict about data types, as data can be converted appropriately before being transferred from one database to the other. If databases are accessed using interfaces, this synchronization method can also be applied to synchronize heterogeneous databases.

[0085] Asynchronous communication is a communication method that requires minimal equipment. Standard communication interfaces provided by computers are generally asynchronous. Asynchronous communication requires no shared clock, meaning the receiver cannot know when the sender sent the message. Therefore, the message sent must contain information to indicate when the receiver should begin receiving, such as a start bit, and a stop bit at the end. Another meaning of asynchronous communication is asynchronous processing within a computer's multithreaded state. Unlike synchronous processing, asynchronous processing does not block the current thread to wait for the process to complete. Instead, it allows subsequent operations to proceed until the other thread completes the process and notifies the current thread via a callback. However, it is important to clarify that asynchrony, multithreading, and parallelism are not the same concept.

[0086] In the above embodiments, the time synchronization method is described in detail. This application also provides corresponding embodiments of the time synchronization device. It should be noted that this application describes the embodiments of the device from two perspectives: one is based on the functional module perspective, and the other is based on the hardware perspective.

[0087] Figure 2 A schematic diagram of a time synchronization device provided in an embodiment of the present application is shown in FIG. Figure 2 As shown, the device includes:

[0088] The acquisition module 10 is used to obtain the configuration information of the user system and confirm whether the RTC time of the user system includes the time zone;

[0089] The setting module 11 is used to set the impi bit in the BMC to 1 if the RTC time zone of the user system is in the time zone, otherwise it is set to 0;

[0090] Synchronization module 12, used to synchronize the RTC time in the user system and confirm the setting of impi. If impi is set to 1, it starts the setting module 13. If impi is set to 0, it starts the conversion module 14.

[0091] The setting module 13 is used to set the RTC time to the standard time of the BMC;

[0092] The conversion module 14 is configured to convert the RTC time into the preset time zone of the BMC and set the converted time as the standard time of the BMC.

[0093] Preferably, the device further comprises:

[0094] The preset time module is used to obtain the user system's RTC time at preset intervals and compare it with the BMC's standard time to determine whether the BMC time meets the preset conditions;

[0095] The alarm module is activated when the BMC does not meet the preset conditions and is used for alarm processing.

[0096] Preferably, the device further comprises:

[0097] The reset module is used to reset the BMC standard time, synchronize the RTC time in the user system, and confirm the setting status of impi.

[0098] Since the embodiments of the apparatus part correspond to the embodiments of the method part, the embodiments of the apparatus part and their corresponding beneficial effects can be found in the description of the embodiments of the method part, which will not be repeated here.

[0099] The time synchronization device provided in this embodiment obtains the configuration information of the user system to confirm whether the user system's RTC time includes a time zone. If the user system's RTC time includes a time zone, the impi bit in the BMC is set to 1, otherwise it is set to 0, the RTC time in the user system is synchronized, and the setting of impi is confirmed. If impi is set to 1, the RTC time is set to the BMC's standard time. If impi is set to 0, the time obtained by adding the RTC time to the BMC's preset time zone is set as the BMC's standard time. The time synchronization method provided in this application sets a bit in the impi of the BMC, pre-acquires the user's system configuration, and modifies the impi bit based on whether the RTC time in the user system configuration includes a time zone. The impi bit is then used to determine whether the BMC's preset time zone needs to be added to set the time to obtain the correct time. Compared with the original method of directly synchronizing the user system's RTC time through the BMC, the correct time can be obtained even when the user system's RTC time includes its own time zone.

[0100] Figure 3 A schematic diagram of a time synchronization device provided in another embodiment of the present application is shown in FIG. Figure 3 As shown, the time synchronization device includes: a memory 20 for storing computer programs;

[0101] The processor 21 is configured to implement the steps of the time synchronization method mentioned in the above embodiment when executing a computer program.

[0102] The time synchronization device provided in this embodiment may include but is not limited to a smart phone, a tablet computer, a laptop computer, or a desktop computer.

[0103] Among them, the processor 21 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 21 can be implemented in at least one hardware form of a digital signal processor (DSP), a field programmable gate array (FPGA), and a programmable logic array (PLA). The processor 21 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a central processing unit (CPU); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 21 may be integrated with a graphics processing unit (GPU), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 21 may also include an artificial intelligence (AI) processor, which is used to process computing operations related to machine learning.

[0104] The memory 20 may include one or more computer-readable storage media, which may be non-transitory. The memory 20 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In this embodiment, the memory 20 is at least used to store the following computer program 201, wherein, after the computer program is loaded and executed by the processor 21, it can implement the relevant steps of the time synchronization method disclosed in any of the aforementioned embodiments. In addition, the resources stored in the memory 20 may also include an operating system 202 and data 203, etc., and the storage method may be temporary storage or permanent storage. Among them, the operating system 202 may include Windows, Unix, Linux, etc. The data 203 may include but is not limited to data involved in the time synchronization method, etc.

[0105] In some embodiments, the time synchronization device may further include a display screen 22 , an input / output interface 23 , a communication interface 24 , a power supply 25 , and a communication bus 26 .

[0106] Those skilled in the art will understand that Figure 3 The structure shown in the figure does not constitute a limitation to the time synchronization device, and may include more or fewer components than shown in the figure.

[0107] The time synchronization device provided in an embodiment of the present application includes a memory and a processor. When the processor executes the program stored in the memory, it can implement the following method: the time synchronization method involved in the above embodiment.

[0108] Since the embodiments of the apparatus part correspond to the embodiments of the method part, the embodiments of the apparatus part and their corresponding beneficial effects can be found in the description of the embodiments of the method part, which will not be repeated here.

[0109] The time synchronization device provided in this embodiment obtains the configuration information of the user system to confirm whether the user system's RTC time includes a time zone. If the user system's RTC time includes a time zone, the impi bit in the BMC is set to 1, otherwise it is set to 0, the RTC time in the user system is synchronized, and the setting of impi is confirmed. If impi is set to 1, the RTC time is set to the BMC's standard time. If impi is set to 0, the time obtained by adding the RTC time to the BMC's preset time zone is set as the BMC's standard time. The time synchronization method provided in this application sets a bit in the impi of the BMC, pre-acquires the user's system configuration, and modifies the impi bit based on whether the RTC time in the user system configuration includes a time zone. The impi bit is then used to determine whether the BMC's preset time zone needs to be added to set the time to obtain the correct time. Compared with the original method of directly synchronizing the user system's RTC time through the BMC, the correct time can be obtained even when the user system's RTC time includes its own time zone.

[0110] Finally, the present application also provides an embodiment corresponding to a computer-readable storage medium. The computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps described in the above method embodiment.

[0111] It is understandable that if the method in the above embodiment is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially 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, and the computer software product is stored in a storage medium and executes all or part of the steps of the methods of each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0112] Since the embodiments of the readable storage medium part correspond to the embodiments of the method part, the embodiments of the device part and their corresponding beneficial effects can be found in the description of the embodiments of the method part, which will not be repeated here.

[0113] The computer-readable storage medium provided in this embodiment obtains the configuration information of the user system, confirms whether the user system's RTC time includes a time zone, and if the user system's RTC time includes a time zone, sets the impi bit in the BMC to 1, otherwise sets it to 0, synchronizes the user system's RTC time, and confirms the setting of impi. If impi is set to 1, the RTC time is set to the BMC's standard time. If impi is set to 0, the time obtained by adding the RTC time to the BMC's preset time zone is set as the BMC's standard time. The time synchronization method provided in this application sets a bit in the impi of the BMC, pre-acquires the user's system configuration, and modifies the impi bit based on whether the RTC time in the user system configuration includes a time zone. The setting of impi is used to determine whether the BMC's preset time zone needs to be added to set the time to obtain the correct time. Compared with the original method of directly synchronizing the user system's RTC time through the BMC, the time can be obtained even when the user system's RTC time includes its own time zone.

[0114] The above is a detailed introduction to a time synchronization method, device, and computer-readable storage medium provided by the present application. The various embodiments in the specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same and similar parts between the various embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of the present application, several improvements and modifications can be made to the present application, and these improvements and modifications also fall within the scope of protection of the claims of the present application.

[0115] It should also be noted that, in this specification, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or device comprising the element.

Claims

1. A time synchronization method, characterized in that: Applied to BMC, including: Obtaining configuration information of the user system and confirming whether the RTC time of the user system includes a time zone; wherein obtaining the configuration information of the user system includes obtaining the OS settings of the user system and obtaining the motherboard time of the ME in the OS; If the RTC time of the user system has a time zone, then set the impi bit in the BMC to 1, otherwise set it to 0; Synchronize the RTC time in the user system and confirm the setting of impi; If the impi bit is set to 1, the RTC time is set to the standard time of the BMC; If the impi bit is set to 0, the time obtained by adding the RTC time to the preset time zone of the BMC is set as the standard time of the BMC; so that the correct time can be obtained even when the RTC time of the user system has its own time zone; After setting the standard time of the BMC, the method further includes: At preset intervals, the RTC time of the user system is obtained and compared with the standard time of the BMC to determine whether the BMC time meets a preset condition; wherein the preset condition is that if the impi bit is set to 1, the difference between the standard time of the BMC and the RTC time is less than a preset difference; if the impi bit is set to 0, the difference between the standard time of the BMC and the RTC time plus the preset time zone of the BMC is less than the preset difference; If so, end.

2. The time synchronization method according to claim 1, wherein: If the preset conditions are not met, an alarm will be triggered.

3. The time synchronization method according to claim 2, characterized in that: After the alarm processing is performed, the method further includes: Resetting the standard time of the BMC, returning to the step of synchronizing the RTC time in the user system, and confirming the setting of the impi.

4. The time synchronization method according to claim 3, characterized in that: The synchronizing the RTC time in the user system includes: Send a synchronization request to the ME and synchronize the mainboard time of the ME.

5. The time synchronization method according to claim 4, characterized in that: The sending of a synchronization request to the ME and synchronizing the mainboard time of the ME includes: Send a synchronization request to the ME in an asynchronous manner and synchronize the mainboard time of the ME.

6. A time synchronization device, characterized in that: include: An acquisition module is used to obtain configuration information of the user system and confirm whether the RTC time of the user system includes a time zone; wherein obtaining the configuration information of the user system includes obtaining the OS settings of the user system and obtaining the motherboard time of the ME in the OS; A setting module is used to set the impi bit in the BMC to 1 if the RTC time zone of the user system is in the time zone, otherwise it is set to 0; A synchronization module, configured to synchronize the RTC time in the user system and confirm the setting of impi. If impi is set to 1, a setting module is enabled; if impi is set to 0, a conversion module is enabled. A setting module, configured to set the RTC time to the standard time of the BMC; A conversion module, configured to set the time obtained by converting the RTC time into the preset time zone of the BMC as the standard time of the BMC, so as to obtain the correct time even when the RTC time of the user system has its own time zone; After setting the standard time of the BMC, the method further includes: At preset intervals, the RTC time of the user system is obtained and compared with the standard time of the BMC to determine whether the BMC time meets a preset condition; wherein the preset condition is that if the impi bit is set to 1, the difference between the standard time of the BMC and the RTC time is less than a preset difference; if the impi bit is set to 0, the difference between the standard time of the BMC and the RTC time plus the preset time zone of the BMC is less than the preset difference; If so, end.

7. A time synchronization device, characterized in that: including a memory for storing a computer program; A processor, configured to implement the steps of the time synchronization method according to any one of claims 1 to 5 when executing the computer program.

8. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the time synchronization method according to any one of claims 1 to 5 are implemented.

Citation Information

Patent Citations

  • Method and device for synchronizing BMC and OS time, terminal and storage medium

    CN109445517A

  • Time synchronization method, system and device of computer management subsystem and storage medium

    CN113126694A