Real-time clock device and time synchronization method and system

By sending initial time information when the processor is started and sending pulse signals at intervals, the problem of time synchronization error accumulation of processor, BMC and CPLD in the server is solved, and the accuracy and consistency of time synchronization are improved.

CN119065454APending Publication Date: 2024-12-03CHENGDU HAIGUANG INTEGRATED CIRCUIT DESIGN CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411238362.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-04
Publication Date
2024-12-03

AI Technical Summary

Technical Problem

Time synchronization errors between processors, BMCs and CPLDs in the server will gradually accumulate after long runs, resulting in time inconsistencies, especially when NTP services are lacking without access to the Internet.

Method used

When the processor is started, the initial time information is sent to the target semiconductor device, and the pulse signal is sent at a preset time interval, so that the target semiconductor device performs time synchronization based on the initial time information and the pulse signal, and updates the time through the reception frequency of the pulse signal, so as to Reduce the accumulation of time errors.

Benefits of technology

Effectively improves the accuracy of time synchronization between the processor, the substrate management controller and complex programmable logic devices, ensures time consistency, and facilitates the accurate time of system events.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119065454A_ABST
    Figure CN119065454A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a real-time clock device and a time synchronization method and system, relates to the technical field of computers, and can effectively improve the accuracy of time synchronization between a processor and a substrate management controller and / or a complex programmable logic device. The device is arranged in a processor and comprises an initial time sending module which is configured to send initial time information to a target semiconductor device when the processor is started, and the target semiconductor device comprises at least one of a substrate management controller and a complex programmable logic device; the pulse transmitting module is coupled with the initial time transmitting module and is configured to transmit a pulse signal to the target semiconductor device every preset duration after the initial time transmitting module transmits the initial time information to the target semiconductor device, and sending the initial time information and the pulse signal to the target semiconductor device so that the target semiconductor device performs time synchronization with the processor based on the initial time information and the pulse signal.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a real-time clock device, a time synchronization method and a system. Background Art

[0002] The server is usually equipped with a real-time clock RTC (Real Time Clock) that can be continuously powered by a battery. Its main function is to provide services for the BIOS (Basic Input Output System) in the processor (such as CPU).

[0003] For servers that are not connected to the Internet, there is no NTP (Network Time Protocol) service available. Therefore, other hardware in the server, such as BMC (Baseboard Management Controller) or CPLD (Complex Programmable Logic Device), can only rely on time synchronization with BIOS to obtain the current time. This synchronization process is only sent by BIOS to BMC or CPLD through IPMI (Intelligent Platform Management Interface) during each processor operating system startup. After that, the processor, BMC, and CPLD will refresh the timing through their respective RTC modules.

[0004] However, due to the problem of RTC timing accuracy, the processor time is not always completely consistent with the BMC or CPLD time. Especially when the server runs for a long time, the timing error between the processor and the BMC or CPLD will continue to accumulate, resulting in an increasing time difference. Summary of the invention

[0005] In view of this, an embodiment of the present invention provides a real-time clock device, a time synchronization method and system, a processor, a baseboard management controller, a complex programmable logic device, and an electronic device, which can effectively improve the accuracy of time synchronization between the processor and the baseboard management controller and / or the complex programmable logic device.

[0006] In a first aspect, an embodiment of the present invention provides a real-time clock device, which is arranged in a processor, and the device includes: an initial time sending module, which is configured to send initial time information to a target semiconductor device when the processor is started, wherein the target semiconductor device includes at least one of the following: a baseboard management controller, a complex programmable logic device; a pulse transmission module, coupled to the initial time sending module, and configured to transmit a pulse signal to the target semiconductor device at intervals of a preset duration after the initial time sending module sends the initial time information to the target semiconductor device, so that the target semiconductor device is synchronized with the processor based on the initial time information and the pulse signal.

[0007] In one embodiment, the pulse transmission module includes: a duration determination submodule, configured to determine the preset duration through preset hardware, wherein the preset hardware includes at least one of the following: a clock circuit, a first register, wherein the first register includes a register with a fixed update frequency; a transmission submodule, coupled to the duration determination module, configured to transmit one of the pulse signals to the target semiconductor device at every interval of the preset duration determined by the duration determination submodule.

[0008] In one embodiment, the first register includes a real-time clock second register, and the preset duration includes 1 second.

[0009] In one implementation, the pulse transmission module is configured to transmit the pulse signal to the target semiconductor device through a first pin of the processor.

[0010] In one embodiment, the pulse emission module is configured to: when the pulse emission control bit is a first value, emit one pulse signal to the target semiconductor device at every preset time interval; wherein the pulse emission control bit is a bit of a second register; or, when the pulse emission control bit is a second value, refuse to emit the pulse signal to the target semiconductor device.

[0011] In a second aspect, an embodiment of the present invention further provides a real-time clock device, which is arranged in a target semiconductor device, and the device includes: an initial time receiving module, configured to receive initial time information sent by the processor when the processor is started; a pulse receiving module, configured to receive a pulse signal emitted by the processor at every preset time interval after the initial time receiving module receives the initial time information; a time synchronization module, which is coupled to the initial time receiving module and the pulse receiving module, respectively, and is configured to perform time synchronization with the processor based on the initial time information and the pulse signal; wherein the target semiconductor device includes at least one of the following: a baseboard management controller, a complex programmable logic device.

[0012] In one embodiment, the time synchronization module includes: a pulse counting submodule, coupled to the pulse receiving module, and configured to count the pulse signal received by the pulse receiving module to obtain a pulse count value; a synchronization submodule, coupled to the initial time receiving module and the pulse counting submodule, respectively, and configured to perform time synchronization with the processor based on the initial time information and the pulse count value.

[0013] In one embodiment, the pulse counting submodule is configured to: generate an interrupt signal when the pulse count value is a preset count threshold, and set the pulse count value to 0 for recounting; the synchronization submodule is configured to enter the corresponding interrupt service program in response to the generation of the interrupt signal, update the number of times the interrupt signal is generated in the interrupt service program, and synchronize time with the processor based on the updated number of times the interrupt signal is generated, the interval time between adjacent interrupt signals and the initial time information.

[0014] In one embodiment, the synchronization submodule is configured to: in the interrupt service program, obtain the local time of the target semiconductor device and update the number of times the interrupt signal is generated; wherein the local time is refreshed by the target semiconductor device based on the initial time information; determine the current time of the processor according to the updated number of times the interrupt signal is generated, the interval time between adjacent interrupt signals and the initial time information to obtain a first current time; determine whether the local time of the target semiconductor device is consistent with the first current time of the processor; if the local time is inconsistent with the first current time, use the first current time to update the local time.

[0015] In one implementation, the time synchronization module further includes a configuration submodule, and the configuration submodule is configured to configure the preset counting threshold to a third register before the pulse counting submodule performs pulse counting.

[0016] In one embodiment, the configuration submodule is also configured to configure at least one of the following flag bits to the third register before the pulse counting submodule performs pulse counting: a flag bit for whether the pulse counting submodule is allowed to generate an interrupt, and a flag bit for whether the pulse counting submodule is allowed to perform counting.

[0017] In one implementation, the pulse receiving module is configured to receive the pulse signal transmitted by the processor through a second pin of the target semiconductor device.

[0018] In one embodiment, the target semiconductor device includes the baseboard management controller and the complex programmable logic device; the real-time clock device of the baseboard management controller also includes a time request module, and the time request module is configured to: send a time acquisition request to the complex programmable logic device when the baseboard management controller is restarted and the processor is not restarted; the real-time clock device of the complex programmable logic device also includes a time response module, and the time response module is configured to send a second current time to the baseboard management controller in response to the complex programmable logic device receiving the time acquisition request, and the second current time is the current time of the complex programmable logic device; the initial time receiving module in the real-time clock device of the baseboard management controller is also configured to receive the second current time; the pulse receiving module in the real-time clock device of the baseboard management controller is configured to receive a pulse signal emitted by the processor at every preset time interval after the initial time receiving module receives the second current time; the time synchronization module in the real-time clock device of the baseboard management controller is configured to synchronize time with the processor based on the second current time and the pulse signal.

[0019] In a third aspect, an embodiment of the present invention further provides a time synchronization method, which is applied to a processor, and the method comprises: when the processor starts, sending initial time information to a target semiconductor device, wherein the target semiconductor device comprises at least one of the following: a baseboard management controller, a complex programmable logic device; after sending the initial time information to the target semiconductor device, transmitting a pulse signal to the target semiconductor device at intervals of a preset duration, so that the target semiconductor device is time synchronized with the processor based on the initial time information and the pulse signal.

[0020] In one embodiment, transmitting a pulse signal to the target semiconductor device at every interval of the preset time length includes: determining the preset time length through preset hardware, wherein the preset hardware includes at least one of the following: a clock circuit, a first register, wherein the first register includes a register with a fixed update frequency; transmitting one of the pulse signals to the target semiconductor device at every interval of the preset time length.

[0021] In one embodiment, the first register includes a real-time clock second register, and the preset duration includes 1 second.

[0022] In one embodiment, transmitting a pulse signal to the target semiconductor device at intervals of a preset duration includes: transmitting the pulse signal to the target semiconductor device at intervals of a preset duration via a first pin of the processor.

[0023] In one embodiment, transmitting a pulse signal to the target semiconductor device at every preset time interval includes: when the pulse emission control bit is a first value, transmitting the pulse signal to the target semiconductor device at every preset time interval; wherein the pulse emission control bit is a bit of a second register; or, when the pulse emission control bit is a second value, refusing to transmit the pulse signal to the target semiconductor device.

[0024] In a fourth aspect, an embodiment of the present invention further provides a time synchronization method, which is applied to a target semiconductor device, and the method comprises: when the processor starts, receiving initial time information sent by the processor; after receiving the initial time information, receiving a pulse signal emitted by the processor at every preset time interval; based on the initial time information and the pulse signal, performing time synchronization with the processor; wherein the target semiconductor device comprises at least one of the following: a baseboard management controller, a complex programmable logic device.

[0025] In one embodiment, the time synchronization with the processor based on the initial time information and the pulse signal includes: counting the pulse signal to obtain a pulse count value; and time synchronization with the processor based on the initial time information and the pulse count value.

[0026] In one embodiment, after counting the pulse signal and obtaining the pulse count value, the method further includes: generating an interrupt signal when the pulse count value is a preset count threshold, and setting the pulse count value to 0 for recounting; based on the initial time information and the pulse count value, performing time synchronization with the processor includes: in response to the generation of the interrupt signal, entering a corresponding interrupt service program, updating the number of times the interrupt signal is generated in the interrupt service program, and performing time synchronization with the processor based on the updated number of times the interrupt signal is generated, the interval time between adjacent interrupt signals, and the initial time information.

[0027] In one embodiment, updating the number of times the interrupt signal is generated in the interrupt service program, and performing time synchronization with the processor based on the updated number of times the interrupt signal is generated, the interval time between adjacent interrupt signals, and the initial time information includes: in the interrupt service program, obtaining the local time of the target semiconductor device, and updating the number of times the interrupt signal is generated; wherein the local time is refreshed by the target semiconductor device based on the initial time information; determining the current time of the processor based on the updated number of times the interrupt signal is generated, the interval time between adjacent interrupt signals, and the initial time information to obtain a first current time; determining whether the local time of the target semiconductor device is consistent with the first current time of the processor; and when the local time is inconsistent with the first current time, using the first current time to update the local time.

[0028] In one implementation, before counting the pulse signal, the method further includes: configuring the preset counting threshold to a third register.

[0029] In one embodiment, before counting the pulse signal, the method further includes: configuring at least one of the following flag bits to the third register: a flag bit for whether pulse counting is allowed to generate an interrupt, and a flag bit for whether pulse counting is allowed.

[0030] In one embodiment, receiving a pulse signal transmitted by the processor at intervals of a preset duration includes: receiving the pulse signal transmitted by the processor at intervals of a preset duration through a second pin of the target semiconductor device.

[0031] In one embodiment, the target semiconductor device includes: the baseboard management controller and the complex programmable logic device; the method further includes: when the baseboard management controller is restarted and the processor is not restarted, the baseboard management controller sends a time acquisition request to the complex programmable logic device; in response to the complex programmable logic device receiving the time acquisition request, the complex programmable logic device sends a second current time to the baseboard management controller, and the second current time is the current time of the complex programmable logic device; the baseboard management controller receives the second current time; after receiving the second current time, the baseboard management controller receives a pulse signal emitted by the processor at every preset time interval; the baseboard management controller synchronizes time with the processor based on the second current time and the pulse signal.

[0032] In a fifth aspect, an embodiment of the present invention further provides a processor, wherein the processor comprises any real-time clock device provided in the first aspect of the embodiment of the present invention.

[0033] In a sixth aspect, an embodiment of the present invention further provides a baseboard management controller, the baseboard management controller comprising any real-time clock device provided in the second aspect of the embodiment of the present invention.

[0034] In a seventh aspect, an embodiment of the present invention further provides a complex programmable logic device, wherein the complex programmable logic device comprises any real-time clock device provided in the second aspect of the embodiment of the present invention.

[0035] In an eighth aspect, an embodiment of the present invention further provides a time synchronization system, comprising any real-time clock device provided in the first aspect of the embodiment of the present invention and any real-time clock device provided in the second aspect of the embodiment of the present invention.

[0036] In the ninth aspect, an embodiment of the present invention further provides an electronic device, characterized in that it includes: a circuit board, a processor and a target semiconductor device, wherein the processor and the target semiconductor device are arranged on the circuit board, and the processor is coupled to the target semiconductor device, wherein the processor is any one of the processors provided in the embodiments of the present invention, and the target semiconductor device includes any one of the baseboard management controllers provided in the embodiments of the present invention and / or any one of the complex programmable logic devices provided in the embodiments of the present invention.

[0037] The embodiments of the present invention provide a real-time clock device, a time synchronization method and system, a processor, a baseboard management controller, a complex programmable logic device, and an electronic device. On the one hand, when the processor is started, the initial time sending module can send initial time information to the target semiconductor device, so that the baseboard management controller, the complex programmable logic device and other target semiconductor devices can be initially synchronized with the processor. On the other hand, after the initial time sending module sends the initial time information to the target semiconductor device, the pulse transmission module can transmit a pulse signal to the target semiconductor device at every preset time interval. Since the preset time is based on the time of the processor where the pulse transmission module is located, the target semiconductor device can determine the update status of the time in the processor through the receiving frequency of the pulse signal, so that on the basis of the initial time being synchronized, it continues to maintain time synchronization with the processor, effectively reducing or eliminating the accumulation of time errors between the processor and the baseboard management controller and / or the complex programmable logic device, thereby effectively improving the accuracy of time synchronization between the processor and the baseboard management controller and / or the complex programmable logic device. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0039] Figure 1 A schematic diagram of a hardware environment in which a real-time clock device provided by an embodiment of the present invention is located; Figure 2 A structural diagram of a real-time clock device provided by an embodiment of the present invention; Figure 3 A schematic diagram of the transmission relationship of pulse signals in an embodiment of the present invention; Figure 4 A schematic diagram of the structure of a pulse transmission module according to an embodiment of the present invention; Figure 5 Another structural schematic diagram of a real-time device provided by an embodiment of the present invention; Figure 6 A schematic diagram of another structure of a real-time device provided by an embodiment of the present invention; Figure 7 A schematic diagram of another structure of a real-time device provided by an embodiment of the present invention; Figure 8 A flow chart of a time synchronization method provided by an embodiment of the present invention; Fig. 9Another flow chart of a time synchronization method provided by an embodiment of the present invention; Fig.10 Another flow chart of a time synchronization method provided by an embodiment of the present invention; Fig.11 Another flow chart of the time synchronization method provided by the embodiment of the present invention; Fig.12 A schematic diagram of the structure of a processor provided by an embodiment of the present invention; Fig.13 A schematic diagram of the structure of a baseboard management controller provided by an embodiment of the present invention; Fig.14 A schematic diagram of the structure of a complex programmable logic device provided by an embodiment of the present invention; Fig.15 A schematic diagram of the structure of a time synchronization system provided by an embodiment of the present invention; Fig.16 A schematic structural diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0040] The embodiments of the present invention are described in detail below with reference to the accompanying drawings.

[0041] It should be clear that the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0042] To facilitate understanding, firstly, a brief introduction is given to the hardware environment in which the real-time clock device provided by the embodiment of the present invention is located.

[0043] like Figure 1As shown, in an embodiment of the present invention, the processor 1 and the target semiconductor device 2 are both arranged on the circuit board of the electronic device, and the processor 1 is coupled to the target semiconductor device 2. The target semiconductor device 2 may include a BMC (Baseboard Management Controller) 2-1 and / or a CPLD (Complex Programmable Logic Device) 2-2. Among them, the processor 1 is the core of the electronic device for computing and processing operations, and the BMC is a dedicated controller for monitoring and managing various hardware on the circuit board, such as equipment information management, status monitoring management, remote control management, maintenance management, etc. The CPLD can be used to assist the processor 1 in starting up, powering on, shutting down, and other operations. A real-time clock device 10 is provided in the processor 1, which can provide a time reference for the operation of the processor 1. The real-time clock device 10 can be powered by an independent battery, and even if the processor 1 is not running, the real-time clock device 10 can still accurately time.

[0044] A real-time clock device 20 may be provided in the target semiconductor device 2 such as BMC and CPLD. The real-time clock device 20 may include a real-time clock device 201 in the BMC and / or a real-time device 202 in the CPLD. Since there is no dedicated battery to power the real-time clock device 20, the real-time clock device 20 will not be able to count after the target semiconductor device 2 is powered off.

[0045] Based on the above hardware environment, in a first aspect, an embodiment of the present invention provides a real-time clock device 10, which can effectively improve the accuracy of time synchronization between the processor 1 and the baseboard management controller and / or the complex programmable logic device.

[0046] like Figure 2 As shown, the real-time clock device 10 provided in the embodiment of the present invention is arranged in the processor 1, and the device 10 may include: The initial time sending module 11 is configured to send initial time information to the target semiconductor device 2 when the processor is started, wherein the target semiconductor device 2 includes at least one of the following: a baseboard management controller, a complex programmable logic device; The pulse transmission module 12 is coupled to the initial time sending module 11, and is configured to transmit a pulse signal to the target semiconductor device 2 at intervals of a preset duration after the initial time sending module 11 sends the initial time information to the target semiconductor device 2, so that the target semiconductor device 2 is synchronized with the processor 1 based on the initial time information and the pulse signal.

[0047] The real-time clock device 10 provided by the embodiment of the present invention, on the one hand, when the processor 1 is started, the initial time sending module 11 can send the initial time information to the target semiconductor device 2, so that the target semiconductor device 2 such as the baseboard management controller and the complex programmable logic device is synchronized with the processor 1 at the initial time. On the other hand, after the initial time sending module 11 sends the initial time information to the target semiconductor device 2, the pulse transmission module 12 can transmit a pulse signal to the target semiconductor device 2 at every preset time interval. Since the preset time is based on the time of the processor 1 where the pulse transmission module 12 is located, the target semiconductor device 2 can determine the update status of the time in the processor 1 through the receiving frequency of the pulse signal, so that on the basis of the initial time being synchronized, it continues to maintain time synchronization with the processor 1, effectively reducing or eliminating the accumulation of time errors between the processor and the baseboard management controller and / or the complex programmable logic device, and thus can effectively improve the accuracy of time synchronization between the processor and the baseboard management controller and / or the complex programmable logic device.

[0048] After adopting the technical solution provided by the embodiments of the present invention, the time of the target semiconductor device 2 such as the baseboard management controller and the complex programmable logic device can be kept consistent with the time of the processor 1 to a high degree. Correspondingly, the time when the baseboard management controller records the SEL (System Event Log) will also be highly consistent with the time of the processor 1, thus facilitating the determination of the exact time when each event in the log occurs.

[0049] Specifically, in one embodiment of the present invention, during the process of operating system startup by processor 1, BIOS of processor 1 can read the time of real-time clock device 10 to obtain initial time information, and initial time sending module 11 can send the initial time information to target semiconductor device 2 via IPMI (Intelligent Platform Management Interface), and target semiconductor device 2 can use this as the timing starting point to refresh timing by itself. For example, in one example, target semiconductor device 2 can set the initial time information to its own real-time clock device 20, and refresh the time according to the crystal oscillator source in target semiconductor device 2.

[0050] After the initial time sending module 11 sends the initial time information to the target semiconductor device 2, the pulse transmitting module 12 may transmit a pulse signal to the target semiconductor device 2 at every preset time interval, so that the target semiconductor device 2 performs time synchronization with the processor 1 based on the initial time information and the pulse signal. In this embodiment, the pulse transmitting module 12 may be coupled with the initial time sending module 11, and the coupling may refer to a direct or indirect signal connection between the pulse transmitting module 12 and the initial time sending module 11. The direct signal connection may be, for example, that after the initial time sending module 11 sends the initial time information to the target semiconductor device 2, the pulse transmitting module 12 is directly triggered to transmit a pulse signal to the target semiconductor device 2 at every preset time interval. The indirect signal connection may be, for example, that after the initial time sending module 11 sends the initial time information to the target semiconductor device 2, the preset control bit in the preset register may be modified so that the pulse transmitting module 12 is in an enabled state, thereby transmitting a pulse signal to the target semiconductor device 2 at every preset time interval.

[0051] In a specific implementation, the pulse transmitting module 12 can be configured to transmit a pulse signal to the target semiconductor device 2 through the first pin of the processor 1. The first pin can be a redundant pin of the processor 1, or a pin multiplexed with other functions in the processor 1, or a newly added pin of the processor 1, which is not limited in the embodiment of the present invention. For example, the transmission diagram of the pulse signal between the processor 1, the baseboard management controller 2-1, and the complex programmable logic device 2-2 can be as follows: Figure 3 shown.

[0052] Furthermore, in an embodiment of the present invention, the emission of the pulse signal can be further controlled. For example, in one embodiment of the present invention, the pulse emission module 12 can be configured to: when the pulse emission control bit is a first value, emit a pulse signal to the target semiconductor device 2 at every preset time interval; wherein the pulse emission control bit is a bit of the second register; or, when the pulse emission control bit is a second value, refuse to emit a pulse signal to the target semiconductor device 2. Optionally, the second register can be an existing register in the processor 1, or a newly added register in the processor 1. In one example, the second register is an existing register in the processor 1, in which case the pulse emission control bit can be a reserved bit in the register, and in another example, the second register is a newly added register in the processor 1, in which case the pulse emission control bit can be any bit in the register.

[0053] For example, in one example, before the initial time sending module 11 sends the initial time information to the target semiconductor device 2, the pulse transmission control bit can be set to the second value (for example, 0) to refuse to transmit the pulse signal to the target semiconductor device 2; after the initial time sending module 11 sends the initial time information to the target semiconductor device 2, the pulse transmission control bit is set to the first value (for example, 1) to transmit one of the pulse signals to the target semiconductor device 2 at every preset time interval. In this way, whether to transmit the pulse signal to the target semiconductor device 2 can be controlled by the pulse transmission control bit, so that the time synchronization operation of the clock device 10 is more controllable and reliable.

[0054] like Figure 4 As shown, in one embodiment of the present invention, the pulse transmission module 12 may further include a duration determination submodule 121 and a transmission submodule 122. The duration determination submodule 121 may be configured to determine the preset duration by preset hardware, wherein the preset hardware may include one or more of the following: a clock circuit, a first register, wherein the first register includes a register with a fixed update frequency; the transmission submodule 122, coupled with the duration determination module 121, may be configured to transmit a pulse signal to the target semiconductor device 2 at each interval of the preset duration determined by the duration determination submodule 121. That is to say, in this embodiment, the preset duration is determined by hardware, and therefore, it is more accurate and sensitive than the preset duration determined by software.

[0055] Optionally, in an embodiment of the present invention, the preset hardware for determining the preset duration can be various. For example, in one example, the preset hardware can be a clock circuit, that is, the preset duration can be determined by the clock circuit. Specifically, in the clock circuit, the clock generated by the crystal oscillator can be divided to different degrees to obtain clocks of different frequencies and different periods. Based on this, the preset duration can be set to be equal to the clock period of a certain clock, so that a pulse signal is sent every time a clock period passes. That is to say, in this embodiment, the preset duration can be different according to the selected clock period, for example, the preset duration can be 0.1 seconds to 10 seconds. In another example, the preset hardware can also be a first register, that is, the preset duration can be determined by the first register. Among them, the first register can be a register with a fixed update frequency, so that a pulse signal is sent to the target semiconductor device 2 every time the first register is updated. For example, the first register can include a real-time clock second register (RTCsecond), which is updated once every second, so the preset duration can be determined according to the update of the real-time clock second register. Here, the preset duration is equal to 1 second.

[0056] After the duration determination submodule 121 determines the preset duration, the transmitting submodule 122 can transmit a pulse signal to the target semiconductor device 2 at every preset duration determined by the preset duration determination submodule 121, for example, transmit a pulse signal to the target semiconductor device 2 every 1 second.

[0057] In a second aspect, an embodiment of the present invention further provides a real-time clock device 20, which can effectively improve the accuracy of time synchronization between a processor and a baseboard management controller and / or a complex programmable logic device.

[0058] like Figure 5 As shown, the real-time clock device 20 provided by the embodiment of the present invention is arranged in the target semiconductor device 2, and the real-time clock device 20 may include: The initial time receiving module 21 is configured to receive the initial time information sent by the processor 1 when the processor 1 is started; The pulse receiving module 22 is configured to receive a pulse signal transmitted by the processor 1 at a preset time interval after the initial time receiving module 21 receives the initial time information; The time synchronization module 23 is coupled to the initial time receiving module 21 and the pulse receiving module 22 respectively, and is configured to perform time synchronization with the processor 1 based on the initial time information and the pulse signal; The target semiconductor device 2 includes at least one of the following: a baseboard management controller and a complex programmable logic device.

[0059] The real-time clock device 20 provided by an embodiment of the present invention is arranged in the target semiconductor device 2, and its initial time receiving module 21 can receive the initial time information sent by the processor 1 when the processor 1 is started. The pulse receiving module 22 can receive a pulse signal emitted by the processor 1 at every preset time interval after the initial time receiving module 21 receives the initial time information. The time synchronization module 23 can synchronize time with the processor 1 based on the initial time information and the pulse signal. In this way, on the one hand, when the processor 1 is started, the real-time clock device 20 can receive the initial time information from the processor 1 through the initial time receiving module 21, so that the target semiconductor devices 2 such as the baseboard management controller and the complex programmable logic device can be synchronized with the processor 1 at the initial time. On the other hand, after the initial time receiving module 21 receives the initial time information, the pulse receiving module 22 receives a pulse signal transmitted by the processor 1 at every preset time interval, and the preset time is based on the time of the processor 1. Therefore, the real-time clock device 20 can determine the update status of the time in the processor 1 through the receiving frequency of the pulse signal, so as to continue to maintain time synchronization with the processor 1 on the basis of the initial time synchronization, effectively reducing or eliminating the accumulation of time errors between the processor and the baseboard management controller and / or the complex programmable logic device, thereby effectively improving the accuracy of time synchronization between the processor and the baseboard management controller and / or the complex programmable logic device.

[0060] Specifically, in one embodiment of the present invention, the initial time receiving module 21 can receive the initial time information sent by the processor 1 through IPMI, and the target semiconductor device 2 can use this as the timing starting point to refresh the timing by itself. For example, in one example, the target semiconductor device 2 can set the initial time information to its own real-time clock device 20, and refresh the time according to the crystal oscillator source in the target semiconductor device 2.

[0061] After the initial time receiving module 21 receives the initial time information, the pulse receiving module 22 can receive a pulse signal emitted by the processor 1 at every preset time interval. It should be noted that the time interval for the pulse receiving module 22 to receive the pulse signal is determined by the time interval for the pulse signal transmitting end (i.e., the processor 1 end) to transmit the pulse signal. Since the transmission paths of the pulse signals transmitted successively are the same, the delay time of each pulse signal is equal. Based on this, if the time interval for the processor 1 to transmit the pulse signal is a preset time interval, the time interval for the real-time clock device 20 to receive the pulse signal is also a preset time interval. For example, if the processor 1 transmits a pulse signal every 1 second, the real-time clock device 20 also receives a pulse signal every 1 second.

[0062] In a specific implementation, the pulse receiving module 22 can receive the pulse signal transmitted by the processor 1 through the second pin of the target semiconductor device 2. The second pin can be a redundant pin of the target semiconductor device 2, or a pin multiplexed with other functions in the target semiconductor device 2, or a newly added pin of the target semiconductor device 2, which is not limited in the embodiment of the present invention.

[0063] After receiving the initial time information and the pulse signal, the time synchronization module 23 can perform time synchronization with the processor according to the initial time information and the pulse information. Figure 6 As shown, in one embodiment of the present invention, the time synchronization module 23 may include: a pulse counting submodule 231, coupled with the pulse receiving module 22, configured to count the pulse signal received by the pulse receiving module 22 to obtain a pulse count value; a synchronization submodule 232, coupled with the initial time receiving module 21 and the pulse counting submodule 22, respectively, configured to perform time synchronization with the processor 1 based on the initial time information and the pulse count value. Specifically, the current time of the processor 1 can be determined according to the initial time information and the pulse count value, and then the real-time clock device 20 of the target semiconductor device 2 can be synchronized with the processor 1 using the current time of the processor 1.

[0064] For example, in one embodiment of the present invention, if the initial time information is T0, the pulse count value is N, and the time interval between two adjacent pulses is M seconds, then the current time T1 of the processor 1 is established by the following formula: T1=T0+M×N (1) Wherein, M is a positive real number, and N is a positive integer.

[0065] In this embodiment, the initial time information and the pulse count value are directly used to determine the current time of the processor 1, so that the target semiconductor device is synchronized with the processor 1 according to the current time of the processor 1, but the embodiments of the present invention are not limited to this. In other embodiments of the present invention, the initial time information and the pulse count value can also be used in other ways to determine the current time of the processor.

[0066] Specifically, in one embodiment of the present invention, the pulse counting submodule 231 can be configured to: generate an interrupt signal when the pulse counting value is a preset counting threshold, and set the pulse counting value to 0 for recounting; the synchronization submodule 232 can be configured to enter the corresponding interrupt service program in response to the generation of the interrupt signal, update the number of times the interrupt signal is generated in the interrupt service program, and synchronize time with the processor based on the updated number of times the interrupt signal is generated, the interval time between adjacent interrupt signals and the initial time information.

[0067] For example, in one example, the initial value of the pulse counting submodule 231 is 0, and the preset counting threshold is 999. The pulse counting submodule 231 performs an increment operation for each pulse signal received, and when the count reaches 999, an interrupt signal is generated, and the pulse counting value is set to the initial value 0, and the received pulse signals are counted again. After the pulse counting submodule 231 generates an interrupt signal, in response to the generation of the interrupt signal, the synchronization submodule 232 can enter the corresponding interrupt service program, update the number of times the interrupt signal is generated in the interrupt service program, and synchronize with the processor according to the updated number of times the interrupt signal is generated, the interval time between adjacent interrupt signals, and the initial time information.

[0068] Among them, the initial value of the number of times the interrupt signal is generated can be 0, and the number of times the interrupt signal is generated can be increased by 1 each time an interrupt is generated. The interval time between adjacent interrupt signals is related to the preset counting threshold of the pulse counting submodule 231. The larger the preset counting threshold, the longer the interval time between adjacent interrupt signals under the same conditions. For example, in one example, the pulse counting submodule 231 adds 1 every 1 second, and the preset counting threshold is 999. Then the pulse counting submodule 231 adds from 0 to 999 for a total of 1000 seconds, that is, an interrupt signal is generated every 1000 seconds and a time synchronization is performed with the processor 1. In another example, the pulse counting submodule 231 adds 1 every 1 second, and the preset counting threshold is 499. Then the pulse counting submodule 231 generates an interrupt signal every 500 seconds and a time synchronization is performed with the processor 1. In this way, on the one hand, considering that the time error accumulates gradually, there is no need to synchronize the time with the processor 1 too frequently. On the other hand, since the pulse counting submodule 231 is periodically cleared to 0, the pulse counting submodule 231 does not need to count to a very large value, thereby effectively saving counter resources.

[0069] Specifically, when performing time synchronization, the synchronization submodule 232 can be configured as follows: in the interrupt service program, obtaining the local time of the target semiconductor device 2 and updating the number of times the interrupt signal is generated; wherein the local time is refreshed by the target semiconductor device 2 based on the initial time information; determining the current time of the processor 1 according to the updated number of times the interrupt signal is generated, the interval time between adjacent interrupt signals and the initial time information, and obtaining the first current time; determining whether the local time of the target semiconductor device 2 is consistent with the first current time of the processor 1; and when the local time is inconsistent with the first current time, using the first current time to update the local time.

[0070] As described above, the initial time receiving module 21 can receive the initial time information sent by the processor 1 through IPMI, and the target semiconductor device 2 can use this as the timing starting point and use the real-time clock device 20 to refresh the timing by itself. The time formed by the self-refresh timing is the local time of the target semiconductor device 2. In the embodiment of the present invention, after entering the interrupt service program in response to the generation of an interrupt signal, on the one hand, the local time of the target semiconductor device 2 can be obtained by reading the value of the real-time clock device 20, and on the other hand, the current time of the processor 1 can be determined according to the updated number of interrupt signal generation, the interval time between adjacent interrupt signals and the initial time information to obtain the first current time. Specifically, the first current time t1, the updated number of interrupt signal generation Nint, the time interval Tint between adjacent interrupt signals, and the initial time information t0 satisfy the following relationship: t1=t0+Nint×Tint (2) The time interval Tint between adjacent interrupt signals is related to the specific setting of the pulse counting submodule 231. Specifically, the time interval Tint, the clock cycle Tclk of the pulse counting submodule 231, and the preset counting threshold Nth of the pulse counting submodule 231 satisfy the following relationship: Tint=Tclk×(Nth+1) (3) In formulas (2) and (3), the specific values ​​of the clock period Tclk of the pulse counting submodule 231 and the preset counting threshold Nth of the pulse counting submodule 231 can be set and adjusted as needed, and the embodiments of the present invention do not limit this. For example, in one embodiment of the present invention, in addition to the pulse counting submodule 231 and the synchronization submodule 232, the time synchronization module 23 may also include a configuration submodule 233, and the configuration submodule 233 may be configured to configure the preset counting threshold Nth to the third register before the pulse counting submodule 231 performs pulse counting.

[0071] Further, in addition to configuring the preset counting threshold Nth, in another embodiment of the present invention, the configuration submodule 233 can also configure the following one or more flags to the third register before the pulse counting submodule 231 performs pulse counting: an interrupt enable flag of whether the pulse counting submodule 231 is allowed to generate an interrupt, and a count enable flag of whether the pulse counting submodule 231 is allowed to perform counting. For example, if the pulse counting submodule 231 is allowed to generate an interrupt flag, the flag can be set to 1, and if the pulse counting submodule 231 is not allowed to generate an interrupt flag, the flag can be set to 0; if the pulse counting submodule 231 is allowed to count, the flag can be set to 1, and if the pulse counting submodule 231 is not allowed to count, the flag can be set to 0. In this way, the pulse counting submodule 231 can be counted and controlled by the configuration submodule 233, thereby effectively improving the controllability and reliability of the real-time clock device 20. Exemplarily, a definition of a third register can be shown in Table 1.

[0072]

[0073] In the embodiment of the present invention, after obtaining the local time and the first current time, it can be determined whether the local time of the target semiconductor device 2 is consistent with the first current time of the processor 1; if they are consistent, it means that there is no significant time difference between the target semiconductor device 2 and the processor, that is, the local time is relatively accurate and does not need to be corrected; if they are inconsistent, it means that there is a significant time difference between the target semiconductor device 2 and the processor, that is, the local time is inaccurate, and therefore the local time needs to be corrected. Specifically, in the case where the local time is inconsistent with the first current time, the first current time can be used to update the local time. For example, the first current time can be used to replace the local time and set in the real-time clock device 20 of the target semiconductor device 2. The real-time clock device 20 will continue to refresh the timing based on the crystal oscillator source in the target semiconductor device 2 on the basis of the first current time.

[0074] For example, if the local time is 21:08:39 on April 5, 2019, and the first current time is 21:10:04 on April 5, 2019, that is, the local time is inconsistent with the first current time, the local time can be updated to the first current time 21:10:04 on April 5, 2019.

[0075] In the above embodiment, how to achieve time synchronization between the processor 1 and the target semiconductor device 2 is described in detail, wherein the target semiconductor device 2 may include a baseboard management controller or a complex programmable logic device. However, the embodiments of the present invention are not limited thereto, and in other embodiments of the present invention, time synchronization between the baseboard management controller and the complex programmable logic device may also exist.

[0076] Specifically, if Figure 7 As shown, in one embodiment of the present invention, the target semiconductor device 2 includes a baseboard management controller 2-1 and a complex programmable logic device 2-2; the real-time clock device 201 of the baseboard management controller 2-1 also includes a time request module 24, and the time request module 24 can be configured to: when the baseboard management controller 2-1 is restarted and the processor 1 is not restarted, send a time acquisition request to the complex programmable logic device 2-2; the real-time clock device 202 of the complex programmable logic device 2-2 can also include a time response module 25, and the time response module 25 can be configured to respond to the complex programmable logic device 2-2 receiving the time acquisition request, send a time acquisition request to the baseboard management controller 2- 1 sends a second current time, where the second current time is the current time of the complex programmable logic device 2-2; the initial time receiving module 21 in the real-time clock device 201 of the baseboard management controller 2-1 is also configured to receive the second current time; the pulse receiving module 22 in the real-time clock device 201 of the baseboard management controller 2-1 is configured to receive a pulse signal emitted by the processor 1 at intervals of a preset duration after the initial time receiving module 21 receives the second current time; the time synchronization module 23 in the real-time clock device 201 of the baseboard management controller 2-1 is configured to perform time synchronization with the processor 1 based on the second current time and the pulse signal.

[0077] This embodiment describes in detail the situation that the baseboard management controller 2-1 is restarted for some reason, but the processor 1 is not restarted. As can be seen from the above, the real-time clock device 201 in the baseboard management controller 2-1 is not powered by an independent battery. Therefore, after the baseboard management controller 2-1 is restarted, the original timing information in the real-time clock device 201 no longer exists. And the processor 1 will not send the initial time information to the baseboard management controller 2-1 if it is not restarted. Therefore, how the baseboard management controller 2-1 knows the current time after restarting is a problem that needs to be solved.

[0078] To this end, in an embodiment of the present invention, when the baseboard management controller 2-1 is restarted and the processor 1 is not restarted, the real-time clock device 201 in the baseboard management controller 2-1 can obtain the current time, that is, the second current time, with the help of the complex programmable logic device 2-2. Since the function of the complex programmable logic device 2-2 is relatively simple, it is rare for errors to occur and restarts. Therefore, the real-time clock device 202 of the complex programmable logic device 2-2 can maintain time synchronization with the processor 1 for a long time. Based on this, the baseboard management controller 2-1 can obtain the second current time maintained by the complex programmable logic device 2-2 by communicating with the complex programmable logic device 2-2. Subsequently, the real-time clock device 201 can continue to receive the pulse signal sent by the processor 1, so as to synchronize the time with the processor 1 according to the second current time and the pulse signal. The specific principle has been described in detail in the previous text and will not be repeated here.

[0079] In a third aspect, an embodiment of the present invention further provides a time synchronization method, which is applied to a processor and can effectively improve the accuracy of time synchronization between the processor and a baseboard management controller and / or a complex programmable logic device.

[0080] like Figure 8 As shown, the time synchronization method provided by the embodiment of the present invention is applied to a processor, and the method may include: S31, when the processor is started, sending initial time information to a target semiconductor device, wherein the target semiconductor device includes at least one of the following: a baseboard management controller, a complex programmable logic device; S32. After sending the initial time information to the target semiconductor device, transmit a pulse signal to the target semiconductor device at intervals of a preset duration, so that the target semiconductor device performs time synchronization with the processor based on the initial time information and the pulse signal.

[0081] The time synchronization method provided by the embodiment of the present invention can, on the one hand, send initial time information to the target semiconductor device when the processor is started, so that the target semiconductor devices such as the baseboard management controller and the complex programmable logic device can perform initial time synchronization with the processor. On the other hand, after sending the initial time information to the target semiconductor device, a pulse signal can be transmitted to the target semiconductor device at every preset time interval. Since the preset time length is based on the processor time, the target semiconductor device can determine the time update status of the processor through the receiving frequency of the pulse signal, so as to continue to maintain time synchronization with the processor on the basis of the initial time synchronization, effectively reducing or eliminating the accumulation of time errors between the processor and the baseboard management controller and / or the complex programmable logic device, and thus can effectively improve the accuracy of time synchronization between the processor and the baseboard management controller and / or the complex programmable logic device.

[0082] After adopting the technical solution provided by the embodiments of the present invention, the time of target semiconductor devices such as baseboard management controllers and complex programmable logic devices can be kept consistent with the time of the processor to a high degree. Correspondingly, the time when the baseboard management controller records the system event log will also be highly consistent with the time of the processor, making it easy to determine the exact time when each event in the log occurred.

[0083] Specifically, in one embodiment of the present invention, step S32 of transmitting a pulse signal to the target semiconductor device at intervals of a preset duration may include: determining the preset duration by preset hardware, wherein the preset hardware includes at least one of the following: a clock circuit, a first register, wherein the first register includes a register with a fixed update frequency; transmitting one of the pulse signals to the target semiconductor device at intervals of the preset duration.

[0084] In one implementation, the first register may include a real-time clock second register, and the preset duration may include 1 second.

[0085] In one implementation, step S32 of transmitting a pulse signal to the target semiconductor device at intervals of a preset duration may include: transmitting the pulse signal to the target semiconductor device at intervals of a preset duration via a first pin of the processor.

[0086] In one embodiment, step S32 may include: transmitting a pulse signal to the target semiconductor device at intervals of a preset duration when the pulse emission control bit is a first value, transmitting a pulse signal to the target semiconductor device at intervals of the preset duration; wherein the pulse emission control bit is a bit of a second register; or, when the pulse emission control bit is a second value, refusing to transmit the pulse signal to the target semiconductor device. Optionally, the specific value of the pulse emission control bit may be set as needed. For example, Fig. 9 As shown, in one embodiment of the present invention, when the processor is just powered on, the pulse emission control bit can be defaulted to the second value. Since the processor has not yet sent the initial time information to the target semiconductor device at this time, that is, the processor has not yet synchronized the initial time with the target semiconductor device, and the basis for the target semiconductor device to synchronize time does not exist, the pulse emission control bit can be set to the second value to temporarily not allow the pulse signal to be sent. Furthermore, after the processor sends the initial time information to the target semiconductor device, the pulse emission control bit can be set to the first value. At this time, since the initial time information has been sent, sending the pulse signal can enable the target semiconductor device to synchronize time based on the initial time information and the pulse signal.

[0087] In a fourth aspect, an embodiment of the present invention further provides a time synchronization method, which is applied to a target semiconductor device and can effectively improve the accuracy of time synchronization between a processor and a target semiconductor device such as a baseboard management controller and / or a complex programmable logic device.

[0088] like Fig.10 As shown, the time synchronization method provided by the embodiment of the present invention is applied to a target semiconductor device, and the method may include: S41, when the processor is started, receiving initial time information sent by the processor; S42, after receiving the initial time information, receiving a pulse signal transmitted by the processor at intervals of a preset duration; S43, performing time synchronization with the processor based on the initial time information and the pulse signal; Wherein, the target semiconductor device includes at least one of the following: a baseboard management controller, a complex programmable logic device.

[0089] The time synchronization method provided by the embodiment of the present invention can receive the initial time information sent by the processor when the processor is started, and after receiving the initial time information, receive a pulse signal emitted by the processor at every preset time interval, and perform time synchronization with the processor based on the initial time information and the pulse signal. In this way, on the one hand, when the processor is started, the initial time information from the processor can be received, so that the target semiconductor devices such as the baseboard management controller and the complex programmable logic device can be initially synchronized with the processor. On the other hand, after receiving the initial time information, a pulse signal emitted by the processor is received at every preset time interval, and the preset time interval is based on the processor time. Therefore, the update of the time in the processor can be determined by the receiving frequency of the pulse signal, so that the time synchronization with the processor can be continued on the basis of the initial time synchronization, effectively reducing or eliminating the accumulation of time errors between the processor and the baseboard controller and / or the complex programmable logic device, so that the accuracy of time synchronization between the processor and the baseboard management controller and / or the complex programmable logic device can be effectively improved.

[0090] After adopting the technical solution provided by the embodiments of the present invention, the time of target semiconductor devices such as baseboard management controllers and complex programmable logic devices can be kept consistent with the time of the processor to a high degree. Correspondingly, the time when the baseboard management controller records the system event log will also be highly consistent with the time of the processor, making it easy to determine the exact time when each event in the log occurred.

[0091] Specifically, in one embodiment of the present invention, step S43, based on the initial time information and the pulse signal, performing time synchronization with the processor may include: counting the pulse signal to obtain a pulse count value; and performing time synchronization with the processor based on the initial time information and the pulse count value.

[0092] In one embodiment, after counting the pulse signal and obtaining the pulse count value, the time synchronization method provided by an embodiment of the present invention may further include: generating an interrupt signal when the pulse count value is a preset count threshold, and setting the pulse count value to 0 for recounting; then in step S43, based on the initial time information and the pulse count value, time synchronization with the processor may include: in response to the generation of the interrupt signal, entering a corresponding interrupt service program, updating the number of times the interrupt signal is generated in the interrupt service program, and performing time synchronization with the processor based on the updated number of times the interrupt signal is generated, the interval time between adjacent interrupt signals and the initial time information.

[0093] In one implementation, updating the number of times the interrupt signal is generated in the interrupt service program, and performing time synchronization with the processor according to the updated number of times the interrupt signal is generated, the interval time between adjacent interrupt signals, and the initial time information may include: In the interrupt service program, the local time of the target semiconductor device is obtained, and the number of times the interrupt signal is generated is updated; wherein the local time is refreshed by the target semiconductor device based on the initial time information; Determine the current time of the processor according to the updated number of times the interrupt signal is generated, the interval time between adjacent interrupt signals and the initial time information, and obtain a first current time; determining whether a local time of the target semiconductor device is consistent with a first current time of the processor; When the local time is inconsistent with the first current time, the local time is updated using the first current time.

[0094] In one implementation, before counting the pulse signal, the time synchronization method provided by the embodiment of the present invention may further include: configuring the preset counting threshold to a third register.

[0095] In one implementation, before counting the pulse signal, the time synchronization method provided by an embodiment of the present invention may further include: configuring at least one of the following flag bits to a third register: a flag bit for whether pulse counting is allowed to generate an interrupt, and a flag bit for whether pulse counting is allowed.

[0096] In one implementation, receiving a pulse signal transmitted by the processor at intervals of a preset duration may include: receiving the pulse signal transmitted by the processor at intervals of a preset duration through a second pin of the target semiconductor device.

[0097] Exemplarily, a flow chart for time synchronization of a target semiconductor device may be as follows: Fig.11 shown.

[0098] In one implementation, the target semiconductor device includes: the baseboard management controller and the complex programmable logic device; the time synchronization method provided by the embodiment of the present invention may also include: When the baseboard management controller is restarted and the processor is not restarted, the baseboard management controller sends a time acquisition request to the complex programmable logic device; In response to the complex programmable logic device receiving the time acquisition request, the complex programmable logic device sends a second current time to the baseboard management controller, where the second current time is the current time of the complex programmable logic device; The baseboard management controller receives the second current time; After receiving the second current time, the baseboard management controller receives a pulse signal transmitted by the processor at intervals of a preset time length; The baseboard management controller performs time synchronization with the processor based on the second current time and the pulse signal.

[0099] Fifthly, Fig.12 As shown, an embodiment of the present invention further provides a processor 1, which includes any real-time clock device 10 provided in the aforementioned embodiments, and thus can also achieve corresponding beneficial technical effects, which have been described in detail above and will not be repeated here.

[0100] Sixth, such as Fig.13 As shown, an embodiment of the present invention further provides a baseboard management controller 2-1, which includes any real-time clock device 201 provided in the aforementioned embodiments, and thus can also achieve corresponding beneficial technical effects, which have been described in detail above and will not be repeated here.

[0101] Seventh, such as Fig.14 As shown, an embodiment of the present invention further provides a complex programmable logic device 2-2, and the complex programmable logic device 2-2 includes any real-time clock device 202 provided in the aforementioned embodiments, and thus can also achieve corresponding beneficial technical effects, which have been described in detail above and will not be repeated here.

[0102] Eighth aspect, such as Fig.15 As shown, an embodiment of the present invention further provides a time synchronization system 5, which may include any real-time clock device 10 provided in the aforementioned embodiment and any real-time clock device 20 provided in the aforementioned embodiment, thereby also being able to achieve corresponding beneficial technical effects, which have been described in detail above and will not be repeated here.

[0103] Ninth aspect, such as Fig.16 As shown, an embodiment of the present invention further provides an electronic device 7, which may include: a circuit board 6, a processor 1 and a target semiconductor device 2, wherein the processor 1 and the target semiconductor device 2 are arranged on the circuit board 6, and the processor 1 is coupled to the target semiconductor device 2, wherein the processor 1 is any one of the processors 1 provided in the aforementioned embodiments, and the target semiconductor device 2 includes any one of the baseboard management controllers provided in the aforementioned embodiments and / or any one of the complex programmable logic devices provided in the aforementioned embodiments.

[0104] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0105] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referenced to each other, and each embodiment focuses on the differences from other embodiments.

[0106] In particular, for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0107] For the convenience of description, the above device is described by dividing the functions into various units / modules. Of course, when implementing the present invention, the functions of each unit / module can be implemented in the same or multiple software and / or hardware.

[0108] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. The storage medium can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc.

[0109] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed by the present invention should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims

1. A real-time clock device, characterized in that: Set in a processor, the device includes: an initial time sending module, configured to send initial time information to a target semiconductor device when the processor is started, wherein the target semiconductor device includes at least one of the following: a baseboard management controller, a complex programmable logic device; A pulse transmission module is coupled to the initial time transmission module and is configured to transmit a pulse signal to the target semiconductor device at intervals of a preset duration after the initial time transmission module sends the initial time information to the target semiconductor device, so that the target semiconductor device is synchronized with the processor based on the initial time information and the pulse signal.

2. The real-time clock device according to claim 1, characterized in that: The pulse transmission module comprises: The duration determination submodule is configured to determine the preset duration by preset hardware, wherein the preset hardware includes at least one of the following: a clock circuit, a first register, wherein the first register includes a register with a fixed update frequency; The transmitting submodule is coupled to the duration determining module and is configured to transmit one of the pulse signals to the target semiconductor device at intervals of the preset duration determined by the duration determining submodule.

3. The real-time clock device according to claim 2, characterized in that: The first register includes a real-time clock second register, and the preset duration includes 1 second.

4. The real-time clock device according to claim 1, characterized in that: The pulse transmission module is configured to transmit the pulse signal to the target semiconductor device through a first pin of the processor.

5. The real-time clock device according to any one of claims 1 to 4, characterized in that: The pulse transmission module is configured as follows: When the pulse emission control bit is a first value, one pulse signal is emitted to the target semiconductor device at every preset time interval; wherein the pulse emission control bit is a bit of the second register; or, When the pulse emission control bit is at a second value, emission of the pulse signal to the target semiconductor device is rejected.

6. A real-time clock device, characterized in that: Arranged in a target semiconductor device, the apparatus comprises: An initial time receiving module, configured to receive initial time information sent by the processor when the processor is started; A pulse receiving module, configured to receive a pulse signal transmitted by the processor at intervals of a preset time length after the initial time receiving module receives the initial time information; A time synchronization module, coupled to the initial time receiving module and the pulse receiving module respectively, and configured to perform time synchronization with the processor based on the initial time information and the pulse signal; Wherein, the target semiconductor device includes at least one of the following: a baseboard management controller, a complex programmable logic device.

7. The real-time clock device according to claim 6, characterized in that: The time synchronization module comprises: a pulse counting submodule, coupled to the pulse receiving module, and configured to count the pulse signals received by the pulse receiving module to obtain a pulse counting value; The synchronization submodule is coupled to the initial time receiving module and the pulse counting submodule respectively, and is configured to perform time synchronization with the processor based on the initial time information and the pulse counting value.

8. The real-time clock device according to claim 7, characterized in that: The pulse counting submodule is configured to: generate an interrupt signal when the pulse counting value reaches a preset counting threshold, and set the pulse counting value to 0 to restart counting; The synchronization submodule is configured to enter a corresponding interrupt service program in response to the generation of the interrupt signal, update the number of times the interrupt signal is generated in the interrupt service program, and perform time synchronization with the processor based on the updated number of times the interrupt signal is generated, the interval time between adjacent interrupt signals and the initial time information.

9. The real-time clock device according to claim 8, characterized in that: The synchronization submodule is configured as follows: In the interrupt service program, the local time of the target semiconductor device is obtained, and the number of times the interrupt signal is generated is updated; wherein the local time is refreshed by the target semiconductor device based on the initial time information; Determine the current time of the processor according to the updated number of times the interrupt signal is generated, the interval time between adjacent interrupt signals and the initial time information, and obtain a first current time; determining whether a local time of the target semiconductor device is consistent with a first current time of the processor; When the local time is inconsistent with the first current time, the local time is updated using the first current time.

10. The real-time clock device according to claim 8, characterized in that: The time synchronization module further includes a configuration submodule, which is configured to configure the preset counting threshold to a third register before the pulse counting submodule performs pulse counting.

11. The real-time clock device according to claim 10, characterized in that: The configuration submodule is also configured to configure at least one of the following flags to the third register before the pulse counting submodule performs pulse counting: a flag indicating whether the pulse counting submodule is allowed to generate an interrupt, and a flag indicating whether the pulse counting submodule is allowed to perform counting.

12. The real-time clock device according to claim 6, characterized in that: The pulse receiving module is configured to receive the pulse signal transmitted by the processor through a second pin of the target semiconductor device.

13. The real-time clock device according to any one of claims 6 to 12, characterized in that: The target semiconductor device includes the baseboard management controller and the complex programmable logic device; The real-time clock device of the baseboard management controller further comprises a time request module, wherein the time request module is configured to: send a time acquisition request to the complex programmable logic device when the baseboard management controller is restarted and the processor is not restarted; The real-time clock device of the complex programmable logic device further comprises a time response module, wherein the time response module is configured to send a second current time to the baseboard management controller in response to the complex programmable logic device receiving the time acquisition request, wherein the second current time is the current time of the complex programmable logic device; The initial time receiving module in the real-time clock device of the baseboard management controller is further configured to receive the second current time; The pulse receiving module in the real-time clock device of the baseboard management controller is configured to receive a pulse signal transmitted by the processor at intervals of a preset time length after the initial time receiving module receives the second current time; The time synchronization module in the real-time clock device of the baseboard management controller is configured to perform time synchronization with the processor based on the second current time and the pulse signal.

14. A time synchronization method, characterized in that: Applied in a processor, the method comprises: When the processor is started, initial time information is sent to a target semiconductor device, wherein the target semiconductor device includes at least one of the following: a baseboard management controller, a complex programmable logic device; After sending the initial time information to the target semiconductor device, a pulse signal is transmitted to the target semiconductor device at intervals of a preset duration, so that the target semiconductor device performs time synchronization with the processor based on the initial time information and the pulse signal.

15. The method according to claim 14, characterized in that The transmitting a pulse signal to the target semiconductor device at intervals of a preset duration comprises: The preset duration is determined by preset hardware, wherein the preset hardware includes at least one of the following: a clock circuit, a first register, wherein the first register includes a register with a fixed update frequency; The pulse signal is transmitted to the target semiconductor device at intervals of the preset time length.

16. The method according to claim 15, characterized in that The first register includes a real-time clock second register, and the preset duration includes 1 second.

17. The method according to claim 14, characterized in that The transmitting a pulse signal to the target semiconductor device at intervals of a preset duration includes: transmitting the pulse signal to the target semiconductor device at intervals of a preset duration through a first pin of the processor.

18. The method according to any one of claims 14 to 17, characterized in that The transmitting a pulse signal to the target semiconductor device at intervals of a preset duration comprises: When the pulse emission control bit is a first value, one pulse signal is emitted to the target semiconductor device at every preset time interval; wherein the pulse emission control bit is a bit of the second register; or, When the pulse emission control bit is at a second value, emission of the pulse signal to the target semiconductor device is rejected.

19. A time synchronization method, characterized in that: Applied to a target semiconductor device, the method comprises: When the processor is started, receiving initial time information sent by the processor; After receiving the initial time information, receiving a pulse signal transmitted by the processor at every preset time interval; Based on the initial time information and the pulse signal, performing time synchronization with the processor; Wherein, the target semiconductor device includes at least one of the following: a baseboard management controller, a complex programmable logic device.

20. The method according to claim 19, characterized in that The performing time synchronization with the processor based on the initial time information and the pulse signal comprises: Counting the pulse signal to obtain a pulse count value; Based on the initial time information and the pulse count value, time synchronization is performed with the processor.

21. The method according to claim 20, characterized in that After counting the pulse signal to obtain the pulse count value, the method further includes: When the pulse count value reaches a preset count threshold, an interrupt signal is generated, and the pulse count value is set to 0 to restart counting; The performing time synchronization with the processor based on the initial time information and the pulse count value comprises: In response to the generation of the interrupt signal, a corresponding interrupt service program is entered, the number of times the interrupt signal is generated is updated in the interrupt service program, and time synchronization is performed with the processor based on the updated number of times the interrupt signal is generated, the interval time between adjacent interrupt signals and the initial time information.

22. The method according to claim 21, characterized in that The updating of the number of times the interrupt signal is generated in the interrupt service program, and performing time synchronization with the processor according to the updated number of times the interrupt signal is generated, the interval time between adjacent interrupt signals and the initial time information comprises: In the interrupt service program, the local time of the target semiconductor device is obtained, and the number of times the interrupt signal is generated is updated; wherein the local time is refreshed by the target semiconductor device based on the initial time information; Determine the current time of the processor according to the updated number of times the interrupt signal is generated, the interval time between adjacent interrupt signals and the initial time information, and obtain a first current time; determining whether a local time of the target semiconductor device is consistent with a first current time of the processor; When the local time is inconsistent with the first current time, the local time is updated using the first current time.

23. The method according to claim 21, characterized in that Before counting the pulse signal, the method further includes: configuring the preset counting threshold to a third register.

24. The method according to claim 23, characterized in that Before counting the pulse signal, the method further includes: configuring at least one of the following flag bits to the third register: a flag bit indicating whether pulse counting is allowed to generate an interrupt, and a flag bit indicating whether pulse counting is allowed.

25. The method according to claim 19, characterized in that The step of receiving a pulse signal emitted by the processor at intervals of a preset duration includes: receiving the pulse signal emitted by the processor at intervals of a preset duration through a second pin of the target semiconductor device.

26. The method according to any one of claims 19 to 25, characterized in that The target semiconductor device includes: the baseboard management controller and the complex programmable logic device; The method further comprises: When the baseboard management controller is restarted and the processor is not restarted, the baseboard management controller sends a time acquisition request to the complex programmable logic device; In response to the complex programmable logic device receiving the time acquisition request, the complex programmable logic device sends a second current time to the baseboard management controller, where the second current time is the current time of the complex programmable logic device; The baseboard management controller receives the second current time; After receiving the second current time, the baseboard management controller receives a pulse signal transmitted by the processor at intervals of a preset time length; The baseboard management controller performs time synchronization with the processor based on the second current time and the pulse signal.

27. A processor, characterized in that: The processor comprises the real-time clock device according to any one of claims 1-5.

28. A baseboard management controller, characterized in that: The baseboard management controller comprises the real-time clock device according to any one of claims 6-13.

29. A complex programmable logic device, characterized in that: The complex programmable logic device comprises the real-time clock device according to any one of claims 6-13.

30. A time synchronization system, characterized in that: The invention comprises the real-time clock device according to any one of claims 1 to 5 and the real-time clock device according to any one of claims 6 to 13.

31. An electronic device, characterized in that: include: A circuit board, a processor and a target semiconductor device, wherein the processor and the target semiconductor device are arranged on the circuit board, and the processor is coupled to the target semiconductor device, wherein the processor is any processor described in claim 27, and the target semiconductor device includes any baseboard management controller described in claim 28 and / or any complex programmable logic device described in claim 29.

Citation Information

Cited By

  • Server startup operation method

    WO2026199859A1