Electronic device, clock calibration method, storage medium, and program product

By using switching elements and controllers to perform multiple calibrations when the electronic device is offline, the problems of limited calibration scenarios and high resource utilization are solved, and more efficient resource utilization and time accuracy are achieved, ensuring the stability and consistency of the server system.

CN120335550AActive Publication Date: 2025-07-18INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 9 Cites 0 Cited by

Patent Information

Application Number
CN202510806396.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-17
Publication Date
2025-07-18
Estimated Expiration
2045-06-17

AI Technical Summary

Technical Problem

In the prior art, the calibration scenario of the server clock generator is limited by the working state and depends on the high CPU resource usage, resulting in low resource utilization, affecting the stability and data consistency of the server.

Method used

By using switching elements and controllers to calibrate the clock generator when the electronic device is offline, and performing multiple calibrations with time reference equipment, reducing dependence on processor resources and improving calibration diversity and resource utilization.

Benefits of technology

It realizes effective calibration of the clock generator in offline state, reduces the use of CPU resources, improves resource utilization and time accuracy, and ensures the stability and reliability of the server system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120335550A_ABST
    Figure CN120335550A_ABST
Patent Text Reader

Abstract

The invention provides electronic equipment, a clock calibration method, a storage medium and a program product, which can be applied to the technical field of computers. The electronic equipment comprises a switch element which is electrically connected with a first controller, a processor, a clock generator and a second controller; the second controller is used for controlling the switch element to electrically connect the first controller with the clock generator when the electronic equipment is in an offline state; the first controller is used for performing first calibration on the clock generator by using first reference time acquired from the time reference equipment under the condition that the first controller is electrically connected with the clock generator, so as to obtain the clock generator subjected to the first calibration; and in response to an alarm signal sent by the clock generator subjected to the first calibration at a predetermined moment, based on a first time difference between a first current system moment of the first controller and the predetermined moment, obtaining a second reference time from the time reference device, and performing second calibration on the clock generator subjected to the first calibration by using the second reference time.
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 more particularly to an electronic device, a clock calibration method, a storage medium, and a program product. Background Art

[0002] In the field of computer technology, the accuracy and stability of server operation affect data storage, processing, and transmission. As a component that provides a time reference in a server, a clock generator can provide accurate timestamps for various operations and tasks of the server, and these timestamps can be widely used in multiple aspects such as logging, event sequencing, and data synchronization.

[0003] However, the time provided by the clock generator is prone to deviation due to various factors. The calibration of the clock generator not only has the problem of limited scenarios, but also occupies relevant resources of the operating system, resulting in low resource utilization. Summary of the Invention

[0004] In view of the above problems, the present invention provides an electronic device, a clock calibration method, a storage medium, and a program product that improve the diversity of clock calibration and resource utilization.

[0005] One aspect of the present invention provides an electronic device, including: a switching element, a first controller, a processor, a clock generator, and a second controller; wherein, the switching element is electrically connected to the first controller, the processor, the clock generator, and the second controller; the second controller is configured to control the switching element to electrically connect the first controller to the clock generator when the electronic device is in an offline state; the first controller is configured to, when the first controller is electrically connected to the clock generator, perform a first calibration on the clock generator using a first reference time obtained from a time reference device to obtain a first-calibrated clock generator; and in response to an alarm signal sent by the first-calibrated clock generator at a predetermined time, obtain a second reference time from the time reference device based on a first time difference between a first current system time of the first controller and the predetermined time, and perform a second calibration on the first-calibrated clock generator using the second reference time.

[0006] Another aspect of the present invention further provides a clock calibration method, including: in response to an instruction for calibrating a clock generator, when the electronic device is in an offline state, a second controller controls a switching element to electrically connect a first controller to the clock generator; using a first reference time obtained by the first controller from a time reference device to perform a first calibration on the clock generator to obtain a clock generator after the first calibration; and in response to an alarm signal sent by the clock generator after the first calibration at a predetermined time, based on a first time difference between a first current system time of the first controller and the predetermined time, obtaining a second reference time from the time reference device, and using the second reference time to perform a second calibration on the clock generator after the first calibration.

[0007] Another aspect of the present invention further provides a computer-readable storage medium, on which a computer program or instruction is stored, and when the computer program or instruction is executed by a processor, the steps of the above method are implemented.

[0008] Another aspect of the present invention further provides a computer program product, including a computer program or instruction, and when the computer program or instruction is executed by a processor, the steps of the above method are implemented.

[0009] According to the electronic device provided by the embodiment of the present invention, it is electrically connected to a first controller, a processor, a clock generator, and a second controller through a switching element. The second controller can, when the electronic device is in an offline state, control the switching element to electrically connect the first controller to the clock generator, and enable the first controller to calibrate the clock generator, thereby providing a technical solution for calibrating the clock in an offline scenario of the electronic device, and improving the diversity of clock calibration. On the other hand, in the embodiment of the present invention, a first reference time obtained by the first controller from a time reference device is used to perform a first calibration on the clock generator to obtain a clock generator after the first calibration; in response to an alarm message sent by the clock generator after the first calibration at a predetermined time, based on a first time difference between a first current system time of the first controller and the predetermined time, a second reference time is obtained, and the clock generator after the first calibration is calibrated using the second reference time. That is, the calibration of the clock generator in the embodiment of the present invention can be executed by the first controller and does not depend on the processor for calibration, thereby reducing the occupation of processor resources, and thus achieving the technical effect of improving resource utilization. Description of the Drawings

[0010] Through the following description of the embodiments of the present invention with reference to the drawings, the above content and other objects, features, and advantages of the present invention will become clearer. In the drawings:

[0011] Figure 1 A schematic diagram of calibrating a clock generator is shown;

[0012] Figure 2Shows a block diagram of an electronic device according to an embodiment of the present invention;

[0013] Figure 3 Shows a block diagram of an electronic device according to another embodiment of the present invention;

[0014] Figure 4 Shows a flowchart of a calibration clock generator according to an embodiment of the present invention;

[0015] Figure 5 Shows a flowchart of a calibration clock generator according to another embodiment of the present invention;

[0016] Figure 6 Shows a flowchart of a clock calibration method according to an embodiment of the present invention. Detailed implementation manners

[0017] Hereinafter, embodiments of the present invention will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are merely exemplary and are not intended to limit the scope of the present invention. In the following detailed description, for the sake of explanation, many specific details are set forth in order to provide a thorough understanding of the embodiments of the present invention. However, obviously, one or more embodiments can also be implemented without these specific details. In addition, in the following description, descriptions of well-known structures and technologies are omitted to avoid unnecessarily obscuring the concepts of the present invention.

[0018] The terms used herein are merely for describing specific embodiments and are not intended to limit the present invention. The terms "including", "comprising", etc. used herein indicate the presence of the described features, steps, operations, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, or components.

[0019] All terms used herein (including technical and scientific terms) have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein should be interpreted as having a meaning consistent with the context of this specification and should not be interpreted in an idealized or overly rigid manner.

[0020] In the case of using expressions such as "at least one of A, B, and C, etc.", generally, it should be interpreted according to the meaning commonly understood by those skilled in the art (for example, "a system having at least one of A, B, and C" should include, but is not limited to, a system having only A, only B, only C, having A and B, having A and C, having B and C, and / or having A, B, and C, etc.).

[0021] In a cloud computing environment, precise time synchronization is required among multiple servers to ensure the consistency and reliability of distributed systems. If there are deviations in the time provided by the clock generator, it may lead to data inconsistencies among multiple servers and task scheduling errors, thereby affecting the performance and service quality of the entire cloud computing platform. On the other hand, with the rapid development of the Internet of Things (IoT), a large number of intelligent devices are connected and interact with servers through the network, and the coordinated work among these devices also depends on precise time synchronization. As the core hub of the IoT system, the accuracy of the time provided by the clock generator of the server can directly affect the normal operation of the entire IoT system. For example, in an intelligent transportation system, the control of traffic lights, vehicle scheduling, and monitoring all require precise time synchronization. If the time provided by the clock generator of the server is inaccurate, it may lead to traffic chaos and even safety accidents.

[0022] However, the time provided by the clock generator of the server is prone to deviations due to various factors. On the one hand, there may be certain precision errors in the clock generator itself. Over time, these errors will gradually accumulate, resulting in an increasing time deviation. On the other hand, the working environment of the server, such as temperature, humidity, and electromagnetic interference, will also affect the operation of the clock generator, thereby further exacerbating the time deviation. Moreover, the server may experience frequent power-on and power-off, hardware failures, etc. during operation, which may also cause the clock generator to lose time or make errors. Therefore, how to effectively calibrate the time of the clock generator of the server and ensure the accuracy and stability of the clock generator has become an urgent problem to be solved in the server field.

[0023] Figure 1 A schematic diagram of calibrating a clock generator is shown.

[0024] Currently, for the calibration of the clock generator, generally, the central processing unit (hereinafter referred to as CPU) of the operating system (OS) calibrates the clock generator. The Network Time Protocol (hereinafter referred to as NTP) is one of the currently widely used time calibration methods. This calibration method connects to an NTP server through the network, obtains precise time information, and synchronizes the time of the server's clock generator with the precise time information obtained from the NTP server. The NTP protocol has high precision and reliability and can meet the requirements of the server for time accuracy to a certain extent. The specific implementation process can be as Figure 1 shown.

[0025] Figure 1 The CPU 101 shown can act as a client of the NTP server 102. The CPU 101 can periodically send time request messages to the NTP server 102. After receiving the request, the NTP server 102 will return a response message containing accurate time information. The CPU 101 can adjust the time of the local clock generator 103 according to the time information in the response message. In the case where the current clock generator has a real-time clock recording function, the clock generator can have two System Management Buses (hereinafter referred to as SMBUS). The CPU 101 is connected to the first SMBUS interface 104 and has the highest read and write permissions of the clock generator. For example, registers can be operated through the SMB_CPU_RTC signal, and the time of the clock generator can be read and calibrated, etc.; the Baseboard Management Controller (hereinafter referred to as BMC) 105 is connected to the second SMBUS interface 106. For example, the time of the clock generator can be read through the SMB_BMC_RTC. The CPU 101 and the BMC 105 can be connected through an Enhanced Serial Peripheral Interface (hereinafter referred to as eSPI) to achieve data interaction between the CPU 101 and the BMC 105.

[0026] Based on Figure 1 Regarding the schematic diagram of calibrating the clock generator shown, for the calibration of the clock generator, there are problems of limited time calibration scenarios and unreasonable resource occupation. For example, currently for the calibration of the clock generator, it only supports calibrating the clock generator 103 when the server to which the CPU 101 belongs is in a working state. When the server is shut down or in a state where only the power for detecting the pressed power button is reserved, the clock generator 103 cannot be calibrated, so that the calibration of the clock generator is limited to the scenario where the server is working. Another example is that currently the calibration of the clock generator is implemented by the CPU. This method inevitably occupies relevant resources of the CPU. When the CPU needs to process multiple tasks, it is easy to cause resource tension, reduce resource utilization, and affect the stability of the CPU.

[0027] In view of this, the real-time example of the present invention provides an electronic device that can not only be unrestricted in the scenario of calibrating the clock generator in the working state, but also can calibrate the clock generator in the offline state of the electronic device, and can also reduce the occupation of CPU resources and improve resource utilization.

[0028] ‌ Figure 2 Shows a block diagram of an electronic device according to an embodiment of the present invention.

[0029] AsFigure 2 As shown, the electronic device may include a switching element 201, a first controller 202, a processor 203, a clock generator 204, and a second controller 205. The switching element 201 is electrically connected to the first controller 202, the processor 203, the clock generator 204, and the second controller 205.

[0030] In some embodiments, the switching element 201 may be an electronic component capable of implementing a switching function in an analog circuit, such as an analog switch. The switching element 201 completes tasks such as switching, selecting, and processing analog signals in the analog circuit. In some embodiments, the switching element 201 may respond to a signal from the second controller 205 to implement an electrical connection between the first controller 202 and the clock generator 204, or implement an electrical connection between the processor 203 and the clock generator 204.

[0031] In some embodiments, the first controller 202 may be a device for calibrating the clock generator, such as a BMC. The BMC may have its own power supply, and even if the server to which the CPU belongs is shut down, the BMC can still work to calibrate the clock generator 204. In some embodiments, the first controller 202 may be communicatively connected to a time reference device for obtaining a first reference time or a second reference time from the time reference device.

[0032] In some embodiments, the processor 203 may be a CPU for processing data and performing calculations and other tasks. When the server to which the CPU belongs is in an on state, the processor 203 may obtain time information from the clock generator 204.

[0033] In some embodiments, the clock generator 204 may be an independent timing circuit for continuously tracking time and may be powered by an independent power supply unit to ensure that the clock generator maintains accurate time information. The clock generator 204 is, for example, a Real Time Clock (RTC).

[0034] In some embodiments, the second controller 205 may be a logic device for controlling and managing an analog circuit by processing digital signals in the analog circuit, such as a Complex Programmable Logic Device (CPLD).

[0035] In some embodiments, the second controller 205 can be used to control the switching element 201 to electrically connect the first controller 202 to the clock generator 204 when the electronic device is in an offline state. In some embodiments, the second controller 205 can control the switching element to switch back and forth between the state where the processor 203 is electrically connected to the clock generator 204 and the state where the first controller 202 is electrically connected to the clock generator 204 to meet the usage requirements of the processor 203 or the first controller 202 for the clock generator 204.

[0036] In an embodiment of the present invention, the electronic device being in an offline state can be that the server to which the processor 203 belongs is in a shutdown state.

[0037] In some embodiments, when the first controller 202 is electrically connected to the clock generator 204, the first controller 202 can be used to perform a first calibration on the clock generator 204 using the first reference time obtained from the time reference device to obtain the clock generator 204 after the first calibration; and in response to the alarm signal sent by the clock generator 204 after the first calibration at a predetermined moment, based on the first time difference between the first current system time of the first controller 202 and the predetermined moment, obtain a second reference time from the time reference device, and use the second reference time to perform a second calibration on the clock generator 204 after the first calibration.

[0038] In some embodiments, the time reference device can be a device for providing reference time, such as an NTP server. The reference time can be used to calibrate the clock generator 204. Both the first reference time and the second reference time obtained from the time reference device can be moment information. The first reference time can be earlier than the second reference time. The first reference time can be used to perform an initial calibration on the clock generator 204, and the second reference time can be used to perform a re - calibration on the clock generator 204 that has been initially calibrated. In this way, the clock generator 204 can be calibrated twice, thereby improving the time accuracy of the clock generator 204.

[0039] In some embodiments, the first controller 202 can obtain the first reference time from the time reference device and update its own second current system time using the first reference time. At the same time, the first controller 202 can also obtain the first calibration - to - be moment of the clock generator 204. The first calibration - to - be moment can be the first current clock time of the clock generator 204. When the second time difference between the first reference time and the first calibration - to - be moment is greater than a predetermined value, the first calibration - to - be moment of the clock generator 204 can be calibrated to the first reference time to complete the initial calibration of the clock generator 204.

[0040] In some embodiments, the predetermined value may be a criterion for determining whether the clock generator needs to be calibrated. For example, when the first time difference or the second time difference is less than or equal to the predetermined value, it may indicate that the first time difference or the second time difference can be ignored and the time of the clock generator 204 is accurate; when the first time difference or the second time difference is greater than the predetermined value, it may indicate that the first time difference or the second time difference cannot be ignored and the time of the clock generator 204 is inaccurate and needs to be calibrated. The above circuit can be used to calibrate the clock generator.

[0041] In some embodiments, the predetermined value can be adaptively adjusted according to actual needs. By setting the predetermined value and calibrating the clock generator 204 when the time difference is greater than the predetermined value, frequent calibration of the clock generator 204 can be avoided. This can not only reduce ineffective time calibration, reduce the switching times of the first clock interface of the clock generator 204, reduce the consumption of hardware facilities, but also save resources for the first controller 202 and improve resource utilization.

[0042] In some embodiments, the predetermined moment may be the moment for the clock generator 204 to send an alarm. The clock generator 204 may have a timing function. By starting the timing function of the clock generator 204 and when the clock generator 204 reaches the predetermined moment, an alarm message is actively sent to the first controller 202 so that the first controller 202 can perform a calibration operation on the clock generator 204. The calibration process of this embodiment can trigger the calibration task by the clock generator 204 without the first controller starting the task of actively calibrating the clock generator, thereby reducing the resource consumption of the first controller and improving resource utilization.

[0043] In some embodiments, when the initially calibrated clock generator 204 reaches the predetermined moment, an alarm message can be sent to the first controller 202, indicating that the initially calibrated clock generator 204 has reached the predetermined moment. In response to this alarm message, the first controller 202 can obtain its own first current system moment and compare the first time difference between the first current system moment and the predetermined moment. When the first time difference is less than or equal to the predetermined value, it indicates that the time of the initially calibrated clock generator 204 is accurate; when the first time difference is greater than the predetermined value, it indicates that the time of the initially calibrated clock generator 204 is inaccurate, and in this case, the initially calibrated clock generator 204 can be calibrated again.

[0044] In some embodiments, to recalibrate the initially calibrated clock generator 204, the first controller 202 can obtain the reference time again from the time reference device, that is, obtain the second reference time, and calibrate the second current clock time of the initially calibrated clock generator 204 to the second reference time. The second current clock time is later than the first current clock time. By calibrating the clock generator 204 multiple times, the accuracy of the time information of the time generator 204 can be ensured, thereby providing an accurate basis for the systems that need to use the time generator 204, ensuring the accurate and stable operation of these systems, and improving the reliability of these systems.

[0045] According to the electronic device provided by the embodiments of the present invention, it is electrically connected to the first controller, the processor, the clock generator, and the second controller through a switching element. The second controller can, when the electronic device is in an offline state, control the switching element to electrically connect the first controller to the clock generator, and enable the first controller to calibrate the clock generator, thereby providing a technical solution for calibrating the clock in the offline scenario of the electronic device, and improving the diversity of clock calibration. On the other hand, the embodiments of the present invention use the first reference time obtained by the first controller from the time reference device to perform the first calibration on the clock generator to obtain the clock generator after the first calibration; in response to the alarm information sent by the clock generator after the first calibration at a predetermined time, based on the first time difference between the first current system time of the first controller and the predetermined time, obtain the second reference time, and use the second reference time to calibrate the clock generator after the first calibration. That is, the calibration of the clock generator in the embodiments of the present invention can be executed by the first controller and does not depend on the processor for calibration, thereby reducing the occupation of the processor resources, and thus achieving the technical effect of improving the resource utilization rate.

[0046] Figure 3 The block diagram of an electronic device according to another embodiment of the present invention is shown.

[0047] As Figure 3 shown, the electronic device of this embodiment may include a switching element 201, a first controller 202, a processor 203, a clock generator 204, a second controller 205, a first power supply unit 301, and a second power supply unit 302. The control end 201-1 of the switching element 201 can be electrically connected to the interface of the second controller 205. The first end 201-2 of the switching element 201 can be electrically connected to the first clock interface 204-1 of the clock generator 204. The second end 201-3 of the switching element 201 can be electrically connected to the interface of the first controller 202. The third end 201-4 of the switching element 201 can be electrically connected to the processor 203.

[0048] In Figure 3In the block diagram shown, the switch element 201 can be electrically connected to the first clock interface 204-1 (i.e., the first SMBUS interface) of the clock generator 204 through the SMB_RTC_PRIMARY signal. The first controller 202 can be electrically connected to the second clock interface 204-2 (i.e., the second SMBUS interface) of the clock generator 204 through the SMB_BMC_RTC signal. That is, the first controller 202 can multiplex a group of SMBUS interfaces and connect them to the first clock interface 204-1 and the second clock interface 204-2 of the clock generator 204 at the same time. The first controller 202 can access the clock generator 204 by accessing the Slave address of the clock generator. The processor 203 and the first controller 202 can be connected to the switch element 201 through SMB_CPU_RTC and SMB_BMC_RTC respectively. The second controller 205 can control whether the first controller 202 or the processor 203 is connected to the SMB_RTC_PRIMARY through the FW_SW_SEL signal. The first controller 202 can send a request to the second controller 205 through the FM_SW_SEL_NOTICE signal to switch the switch element 201, for example, to switch the first controller 202 or the processor 203 connected to the clock generator 204. The alarm signal FM_RTC_ALT_N of the clock generator 204 can be connected to the first controller 202 and the processor 203 at the same time, for actively triggering the alarm signal, for example, triggering the alarm signal to the first controller 202 at a predetermined moment.

[0049] Continue to refer to Figure 3 , the first power supply unit 301 can be electrically connected to the first power supply interface 204-3 of the clock generator 204 to supply power to the clock generator 204 when the electronic device is in the powered-on state. The second power supply unit 302 can be electrically connected to the second power supply interface 204-4 of the clock generator 204. The second power supply unit 302 can be an independent power supply unit belonging to the clock generator 204 itself, for supplying power to the clock generator 204 when the electronic device is in the offline state.

[0050] In an embodiment of the present invention, both the powered-on state or the offline state of the electronic device can refer to the powered-on state or the offline state of the server to which the processor 203 belongs. When the server is in the powered-on state, the server can be used to supply power to the clock generator 204 through the first power supply unit 301. When the server is in the powered-off and offline state, the clock generator 204 can be supplied with power through the second power supply unit 302 to ensure the continuous operation of the clock generator 204.

[0051] According to an embodiment of the present invention, a processor and a first controller use a switching element to switch the control right of a first clock interface of a clock generator, and the first controller is connected to different interfaces of the clock generator through the same set of bus interfaces, and can separately operate on two SMBUS bus interfaces of the clock generator by using different SMBUS addresses, which can facilitate the first controller to perform calibration on the clock generator and reduce the resource pressure of the CPU.

[0052] Based on Figure 3 the illustrated electronic device, an embodiment of the present invention provides a process for calibrating a clock generator in an offline state of the electronic device, as Figure 4 shown.

[0053] Figure 4 FIG. shows a flowchart of calibrating a clock generator according to an embodiment of the present invention.

[0054] As Figure 4 shown, in one embodiment, the process of calibrating a clock generator in an offline state of the electronic device may include operation S410 to operation S440.

[0055] In operation S410, the first controller performs an initial time calibration on the clock generator to obtain a first-calibrated clock generator. The first calibration record corresponding to the first-calibrated clock generator may be stored in a log.

[0056] In operation S420, the first controller enables the timing function of the clock generator and configures a predetermined time.

[0057] In operation S430, the clock generator times and sends an alarm signal when the predetermined time is reached.

[0058] In operation S440, the first controller performs a time comparison to calibrate the first-calibrated clock generator to obtain a second-calibrated clock generator. The second calibration record corresponding to the second-calibrated clock generator may be stored in the log.

[0059] In some embodiments, when the electronic device is in an offline state, that is, in response to the server shutting down, the second controller can control FM_SW_SEL to select SMB_BMC_RTC and SMB_RTC_PRIMARY, that is, the first controller is connected to the first clock interface of the clock generator. At this time, the first controller has the highest control right of the clock generator. In one example, the clock generator can be calibrated at a predetermined time (such as Time1) every day, and the calibration accuracy is a predetermined value (such as T0). That is, when the second time difference between the first current clock time of the clock generator and the second current system time of the first controller is greater than T0, or when the first time difference between the second current clock time of the clock generator and the first current system time of the first controller is greater than T0, it indicates that the time of the clock generator is inaccurate, and the time of the clock generator is updated; if the first current clock time of the clock generator is less than or equal to T0 compared with the second current system time of the first controller, or if the second current clock time of the clock generator is less than or equal to T0 compared with the first current system time of the first controller, it indicates that the time of the clock generator is accurate, and the clock generator may not be calibrated.

[0060] In some embodiments, in the above operation S410, the first controller can read the accurate network time from a time reference device (such as an NTP server) and update its own second current system time (such as Time0), and at the same time read the first current clock time (such as Time2) of the clock generator. If |Time2 - Time0| ≤ T0, the clock generator is not calibrated; if |Time2 - Time0| > T0, Time0 is written into the clock generator for a clock calibration to obtain a first-calibrated clock generator, which represents the initial calibration of the clock generator. The first calibration record based on this operation can be stored in the log.

[0061] In some embodiments, in the above operation S420, the first controller can enable the timing alarm function of the clock generator through the first clock interface and configure Time1 as the predetermined time of the alarm.

[0062] In some embodiments, in the above operation S430, when the time of the clock generator reaches the predetermined time (such as Time1), the alarm function of the clock generator is triggered. At this time, the clock generator can pull down the level of the electrical signal between the first controller and the clock generator, such as pulling down the level of the FM_RTC_ALT_N signal, to obtain an alarm signal to trigger the timing mechanism.

[0063] In some embodiments, in the above operation S440, at the moment when the first controller detects that FM_RTC_ALT_N is pulled low, the first current system time of the first controller at this time (for example, Time3) can be recorded. If |Time3 - Time1| ≤ T0, the clock generator is not calibrated; if |Time3 - Time1| > T0, the clock generator can be calibrated.

[0064] In some embodiments, when calibrating the clock generator, the second calibration of the clock generator that has been first calibrated can be performed using the first current system time. For example, Time3 can be written into the clock generator for re-calibration.

[0065] In some embodiments, the second reference time (for example, Time4) can also be retrieved from the time reference device again, and the second reference time can be written into the clock generator to re-calibrate the clock generator that has been first calibrated. The second calibration record based on this operation can also be stored in the log.

[0066] According to the embodiments of the present invention, the above process can calibrate the clock generator in the server shutdown state, increasing the diversity of calibration scenarios. Moreover, in the above calibration process, the first controller does not need to actively initiate the calibration task. It is when the clock generator reaches a predetermined time and alerts the first controller that the first controller calibrates the clock generator, which can reduce the resource occupancy of the first controller and improve resource utilization.

[0067] According to the embodiments of the present invention, by storing the first calibration record and the second calibration record in the log, it is not only convenient to determine whether the calibration of the clock generator is successful based on the first calibration record and the second calibration record, but also the working state of the clock generator can be determined based on the first calibration record and the second calibration record. For example, it can be determined whether the clock generator has aged or been affected by temperature according to the time deviation in the calibration record. Furthermore, the predetermined time or accuracy value can be adjusted according to the time deviation to compensate for the time of the clock generator in advance, reducing the number of times of adjusting the clock generator and saving resources.

[0068] In some embodiments, the time reference device mentioned in the above operation can be any one of the time reference device clusters. For example, the first controller is communicatively connected to the time reference device cluster, the time reference device cluster includes multiple time reference devices, and the time reference devices are configured with priority information; the first controller is further configured to: in response to an instruction for obtaining a reference time, arrange the time reference devices according to the priority information of the time reference devices to obtain an arrangement result, and the instruction for obtaining a reference time includes an instruction for obtaining a first reference time or an instruction for obtaining a second reference time; based on the arrangement result and the operating state of the time reference device, obtain the first reference time or the second reference time.

[0069] In some embodiments, the time reference devices in the time reference device cluster may include an NTP server for providing reference time information, a first time server equipped with a global positioning system, a second time server equipped with a time synchronization protocol system, and the like. These time reference devices may have priority information. For example, the NTP server has a higher priority than the first time server, and the first time server has a higher priority than the second time server.

[0070] The arrangement result obtained by arranging the NTP server, the first time server, and the second time server according to the priority may be NTP server > first time server > second time server. When the first controller needs to obtain the first reference time or the second reference time from the time reference device, the working state of the NTP server may be determined according to the communication signal between the first controller and the NTP server. When there is a communication signal between the first controller and the NTP server, it can be determined that the NTP server is in the running state, and the first reference time or the second reference time is obtained from the NTP server. When there is no communication signal between the first controller and the NTP server, it can be determined that the NTP server is in the non-running state, and then the first reference time or the second reference time can be obtained from the first time server according to the sorting result.

[0071] According to the embodiments of the present invention, by configuring multiple time reference devices, multiple time sources are provided for the first controller. By obtaining the first reference time or the second reference time according to the priority information of the multiple time sources, the availability of the first reference time or the second reference time can be guaranteed, and the reliability of the calibration clock generator can be improved.

[0072] In some embodiments, the above description is about the calibration of the clock generator in the offline state of the electronic device. In the powered-on state of the electronic device, the electronic device according to the embodiments of the present invention can also calibrate the clock generator and also reduce the occupation of CPU resources.

[0073] In some embodiments, the second controller is further configured to control the switch element to electrically connect the processor to the clock generator when the electronic device is in the powered-on state; the first controller is further configured to: when the processor is electrically connected to the clock generator, send a first control signal to the second controller, so that the second controller controls the switch element to electrically connect the first controller to the first clock interface of the clock generator according to the first control signal, and configure a predetermined moment for the clock generator through the first clock interface; send a second control signal to the second controller, so that the second controller controls the switch element to electrically connect the processor to the first clock interface according to the second control signal.

[0074] In some embodiments, the first controller is further configured to: when the processor is electrically connected to the clock generator, in response to an alarm signal sent by the first-calibrated clock generator at a predetermined time, send a first control signal to the second controller, so that the second controller controls the switching element to electrically connect the first controller to the first clock interface; perform a second calibration on the first-calibrated clock generator using a second reference time; and send a second control signal to the second controller, so that the second controller responds to the second control signal.

[0075] In some embodiments, the first control signal may be a signal indicating conduction between the first controller and the clock generator, and the second control signal may be a signal indicating conduction between the processor and the clock generator.

[0076] In some embodiments, the process of calibrating the clock generator in the powered-on state of the electronic device is different from the process of calibrating the clock generator in the powered-off state of the electronic device in that, in the powered-on state of the electronic device, the processor is in conduction with the clock generator, and only when it is necessary to calibrate the clock generator, the conduction state between the processor and the clock generator is switched to the conduction state between the first controller and the clock generator, and when the first controller configures a predetermined time for alarm or performs a re-calibration on the clock generator, the conduction state between the first controller and the clock generator is switched back to the conduction state between the processor and the clock generator.

[0077] Figure 5 The flowchart of calibrating the clock generator according to another embodiment of the present invention is shown.

[0078] In some embodiments, when the electronic device is in the powered-on state, the second controller may control FM_SW_SEL to gate SMB_CPU_RTC and SMB_RTC_PRIMARY, that is, the processor is connected to the first clock interface of the clock generator. In one example, the clock generator may be calibrated at a predetermined time (e.g., Time1') every day, and the calibration accuracy is a predetermined value (e.g., T0'). The process of calibrating the clock generator when the electronic device is in the powered-on state may be as Figure 5 shown, including operations S510 to S560.

[0079] As Figure 5 shown, the process of calibrating the clock generator in this embodiment may include operations S510 to S560.

[0080] In operation S510, switch the channel to electrically connect the first controller to the clock generator.

[0081] In operation S520, the first controller performs initial time calibration on the clock generator to obtain a first-calibrated clock generator. The first calibration record corresponding to the first-calibrated clock generator can be stored in the log.

[0082] In operation S530, the first controller enables the timing function of the clock generator and configures a predetermined time.

[0083] In operation S540, the channel is switched to electrically connect the first controller to the clock generator.

[0084] In operation S550, the clock generator counts time and sends an alarm signal when the predetermined time is reached.

[0085] In operation S560, the first controller performs time comparison and calibrates the first-calibrated clock generator to obtain a second-calibrated clock generator. The second calibration record corresponding to the second-calibrated clock generator can be stored in the log.

[0086] In some embodiments, in the above operation S510, the first controller can notify the second controller to control FM_SW_SEL to select SMB_BMC_RTC and SMB_RTC_PRIMARY through a first control signal (such as the FM_SW_SEL_NOTICE signal), that is, the first controller is connected to the first clock interface of the clock generator.

[0087] In some embodiments, in the above operation S520, the first controller can read the accurate network time from a time reference device (such as an NTP server) and update its own second current system time (such as Time0'), and at the same time read the first current clock time (such as Time2') of the clock generator. If |Time2'-Time0'|≤T0', it indicates that the time of the clock generator is accurate, and the clock generator is not calibrated; if |Time2'-Time0'|>T0', it indicates that the time of the clock generator is inaccurate, and Time0' can be written into the clock generator for a clock calibration, which represents the initial calibration of the clock generator. The first calibration record based on this operation can be stored in the log.

[0088] In some embodiments, in the above operation S530, the first controller can enable the timing alarm function of the clock generator through the first clock interface and configure Time1' as the predetermined time for the alarm.

[0089] In some embodiments, in the above operation S540, after the predetermined time is configured, the first controller can immediately change the FM_SW_SEL_NOTICE signal at the configured time, switch the first clock interface back to the processor, and make the connection between the processor and the clock generator conductive.

[0090] In some embodiments, in the above operation S550, when the time of the clock generator reaches a predetermined moment (e.g., Time1'), the alarm function of the clock generator is triggered. At this time, the clock generator can pull down the level of the electrical signal between the first controller and the clock generator, for example, pull down the level of the FM_RTC_ALT_N signal, to obtain an alarm signal to trigger the timing mechanism.

[0091] In some embodiments, in the above operation S560, at the moment when the first controller detects that FM_RTC_ALT_N is pulled down, the second current system time of the first controller at this time (e.g., Time3') is recorded. If |Time3' - Time1'| ≤ T0', the clock generator is not calibrated; if |Time3' - Time1'| > T0', the first controller takes the lead in performing clock calibration.

[0092] The first controller can notify the second controller to control FM_SW_SEL to select SMB_BMC_RTC and SMB_RTC_PRIMARY through the first control signal (e.g., the FM_SW_SEL_NOTICE signal). The first controller can read the accurate network time Time4' from the time reference device (e.g., the NTP server) and write it into the clock generator. After the writing of Time4' is completed, the first controller can immediately change the first control signal (e.g., the FM_SW_SEL_NOTICE signal) at the moment of completion of the writing to obtain a second control signal. The second control signal can be used to control the switching element to switch the first controller connected to the first clock interface back to the processor, so that the clock generator is connected to the processor.

[0093] According to an embodiment of the present invention, when the electronic device is in the powered-on state, it is not necessary for the first controller to start an active calibration task. The timing function of the clock generator can be utilized to trigger an alarm signal to notify the first controller to perform time calibration when a predetermined moment is reached. This not only gets rid of the dependence on the CPU for calibrating the clock generator but also saves the resource occupancy under the CPU and the first controller system.

[0094] According to an embodiment of the present invention, during the process of calibrating the clock generator, the time calibration accuracy of the clock generator is configured, such as T0 in the offline state of the electronic device and T0' in the powered-on state of the electronic device. The clock generator is calibrated only when the first time difference or the second time difference exceeds the time calibration accuracy, reducing ineffective time calibration and resource occupancy; in the powered-on state of the electronic device, the switching times of switching the first clock interface of the clock generator to connect to the processor or the first controller can be reduced.

[0095] In some embodiments, before the second controller switches the processor connected to the first clock interface of the clock generator to the first controller, it is possible to detect whether there is a clock pulse signal between the processor and the clock generator, and in the case where there is no clock pulse signal between the processor and the clock generator, switch the processor connected to the first clock interface of the clock generator to the first controller; in the case where there is a clock pulse signal between the processor and the clock generator, stop the switching of the first clock interface.

[0096] Detecting that there is a pulse signal between the processor and the clock generator can indicate that data interaction is taking place between the processor and the clock generator. In this case, it is possible to stop the switching of the first clock interface. Detecting that there is no pulse signal between the processor and the clock generator can indicate that there is no data interaction between the processor and the clock generator. In this case, it is possible to switch to the first controller, which can avoid switching the first controller during the interaction process between the processor and the clock generator, and avoid the scenario where the first controller forcibly reads and writes the clock generator when the processor is reading and writing the clock generator, thereby ensuring the stable operation of the processor and the clock generator.

[0097] Based on the above electronic device, an embodiment of the present invention further provides a clock calibration method for the above electronic device. The flow of the clock calibration method can be as Figure 6 shown.

[0098] Figure 6 Fig. shows a flowchart of a clock calibration method according to an embodiment of the present invention.

[0099] As Figure 6 shown, the clock calibration method may include operation S610 to operation S630.

[0100] In operation S610, in response to an instruction to calibrate the clock of the clock generator, when the electronic device is in an offline state, the second controller controls the switching element to electrically connect the first controller to the clock generator.

[0101] In operation S620, the first controller uses the first reference time obtained from the time reference device to perform a first calibration on the clock generator to obtain a first calibrated clock generator. In one example, operation S610 to operation S620 can refer to operation S410, and the first calibrated clock generator can be the initially calibrated clock generator.

[0102] In operation S630, in response to an alarm signal sent by the first calibrated clock generator at a predetermined time, based on the first time difference between the first current system time of the first controller and the predetermined time, a second reference time is obtained from the time reference device, and the first calibrated clock generator is second-calibrated using the second reference time. In an example, operation S630 may refer to operations S430 to S440.

[0103] According to an embodiment of the present invention, by calibrating the clock generator in the server shutdown state, not only the diversity of the calibration scenario is increased, but also the calibration task is started when the clock generator reaches a predetermined time, which can reduce the resource occupancy of the first controller and improve the resource utilization rate.

[0104] In some embodiments, when the electronic device is in the powered-on state, in response to an instruction to calibrate the clock of the clock generator, the second controller controls the switching element to electrically connect the processor to the clock generator. In response to the alarm signal, a first control signal is sent to the second controller so that the second controller controls the switching element to electrically connect the first controller to the first clock interface. The first calibrated clock generator is second-calibrated using the second reference time, and a second control signal is sent to the second controller so that the second controller responds to the second control signal. In an example, this process may refer to operations S510 to S560.

[0105] According to an embodiment of the present invention, in the powered-on state, in response to the alarm signal, the processor connected to the first clock interface can be switched to the first controller, and after the first controller completes the calibration, the first controller connected to the first clock interface can be switched back to the processor. This process can eliminate the need for the first controller to actively initiate the calibration task, reducing the resource occupancy of the first controller; and in the powered-on state, using the first controller to calibrate the clock generator also reduces the dependence of the clock generator calibration on the processor.

[0106] In some embodiments, whether the electronic device is in the offline state or the powered-on state, the first reference time obtained by the first controller from the time reference device can be used to first-calibrate the clock generator to obtain the first-calibrated clock generator. In one embodiment, the process of obtaining the first-calibrated clock generator may include the following operations: updating the second current system time of the first controller to the first reference time, where the second current system time is earlier than the first current system time; and based on the relationship between the first reference time and the first to-be-calibrated time of the clock generator, first-calibrating the clock generator to obtain the first-calibrated clock generator.

[0107] In some embodiments, the process of performing a first calibration on a clock generator based on the relationship between the first reference time and the first calibration moment of the clock generator to obtain a first-calibrated clock generator may include the following operations: in response to the second time difference between the first reference time and the first calibration moment being less than or equal to a predetermined value, stop calibrating the clock generator; in response to the second time difference being greater than the predetermined value, calibrate the first calibration moment to the first reference time.

[0108] According to an embodiment of the present invention, by performing an initial calibration on the clock generator to ensure that the initial moment information is consistent, the time deviation can be reduced, and the frequent calibration of the clock generator can be reduced.

[0109] In some embodiments, whether the electronic device is in an offline state or a powered-on state, a second calibration can be performed on the clock generator using a second reference time obtained by a first controller from a time reference device to obtain a second-calibrated clock generator. The process of obtaining the second reference time may include the following operations: obtain the first current system moment of the first controller; in the case where the first time difference between the first current system moment and a predetermined moment is greater than a predetermined value, obtain the second reference time from the time reference device; in the case where the first time difference between the first current system moment and the predetermined moment is less than or equal to the predetermined value, it indicates that the time information of the clock generator is accurate, and it may not be necessary to obtain the second reference time.

[0110] According to an embodiment of the present invention, by obtaining the second reference time when the first time difference is greater than a predetermined value, the number of times of obtaining the second reference time invalidly can be reduced, and the obtained second reference time can be used to perform a secondary calibration on the clock generator, improving the time accuracy of the clock generator.

[0111] In some embodiments, the above clock calibration method may further include the following operations: in response to an alarm signal sent by the first-calibrated clock generator at a predetermined moment, based on the first time difference between the first current system moment and the predetermined moment, and use the first current system moment to perform a second calibration on the first-calibrated clock generator.

[0112] In some embodiments, the process of performing a second calibration on the first-calibrated clock generator based on the first time difference between the first current system moment and the predetermined moment and using the first current system moment may include the following operations: at the moment when it is responded that the first time difference is greater than a predetermined value, obtain the second calibration moment of the clock generator; calibrate the second calibration moment to the first current system moment to obtain a second-calibrated clock generator.

[0113] In some embodiments, the second calibration moment may be the second current clock moment of the clock generator.

[0114] In some embodiments, when the electronic device is in an offline state, if it is detected that the first time difference between the first current system time and a predetermined time is greater than a predetermined value, it may indicate that the clock generator is inaccurate. Therefore, at the moment when it is detected that the first time difference is greater than the predetermined value, the second calibration time of the clock generator can be obtained. The second calibration time can be later than the predetermined time, and the second calibration time can be calibrated to the first current system time.

[0115] According to an embodiment of the present invention, by calibrating the second calibration time to the first current system time, the number of times the first controller obtains the second reference time can be reduced, that is, the number of interactions between the first controller and the time reference device can be reduced. Furthermore, the resource consumption of the first controller caused by the interaction operations can be reduced, thereby saving resources and improving resource utilization.

[0116] In some embodiments, the above clock calibration method may further include the following operations: determining the historical trigger error of the predetermined time according to the distribution characteristic value of the first time difference; and adjusting the predetermined time by using the historical trigger error to obtain an updated predetermined time.

[0117] In some embodiments, the first calibration record of the first calibration of the clock generator by the first controller and the second calibration record of the second calibration of the clock generator can be stored in a log. Both the first calibration record and the second calibration record may include information such as the first current clock time, the second current clock time, the first current system time, the second current system time, the predetermined time, the record of calibration success or failure, and the number of calibrations.

[0118] In some embodiments, according to the historical first time difference between the first current system time and the predetermined time in the case of triggering calibration in the second calibration record, the distribution characteristic value of the historical first time difference can be obtained, such as information about the mean value or standard deviation of the first time difference. According to these distribution characteristic values, the historical trigger error of the predetermined time can be obtained. In one example, if the mean value of the first time difference between the first current system time and the predetermined time is less than 0, it indicates that the predetermined time is delayed. In this case, the predetermined time can be advanced to obtain an updated predetermined time. For example, the predetermined time is added to the average value of the first time difference to obtain the updated predetermined time.

[0119] According to an embodiment of the present invention, by continuously updating the predetermined time, the number of times of calibrating the clock generator can be reduced, unnecessary calibration of the clock generator can be reduced, thereby reducing the resources required for calibrating the clock generator and improving resource utilization.

[0120] In some embodiments, the clock generator is affected by temperature during operation, which in turn affects the timing information of the clock generator. For example, it affects the predetermined time of the clock generator, and further affects the alarm of the clock generator at the predetermined time, which may lead to frequent calibration of the clock generator, increasing the resources required for calibrating the clock generator and reducing the resource utilization rate.

[0121] In some embodiments, a temperature sensor may be installed on the clock generator, or a sphere may be drawn with the clock generator as the center and a predetermined radius, and a temperature sensor may be installed on a component other than the clock generator within the spherical region. The temperature sensor can be used to detect the ambient temperature around the clock generator in real time. As a preferred embodiment, since the temperature sensor may generate heat during operation, and this heat may accumulate and accelerate the impact of temperature on the performance of the clock generator, a temperature sensor can be selected to be installed on a component other than the clock generator within the spherical region to reduce the impact of temperature on the clock generator, improve the performance of the clock generator, reduce the number of calibrations of the clock generator, reduce the occupation of calibration resources, and improve the resource utilization rate.

[0122] In some embodiments, different time calibration accuracies may be available under different ambient temperatures. For example, different ambient temperatures may have different T0 or different T0'. Before the first controller compares the second current system time with the first current clock time, or before comparing the first current system time with the second current clock time, the ambient temperature can be obtained from the temperature sensor, and based on the temperature range in which the ambient temperature is located, the T0 or T0' corresponding to the temperature range can be determined, and the T0 or T0' corresponding to the temperature range can be used as the criterion for whether to calibrate the clock generator to calibrate the clock generator.

[0123] According to the embodiments of the present invention, by calibrating the clock generator using the T0 or T0' corresponding to the ambient temperature range, the T0 or T0' can be dynamically adjusted, avoiding frequent calibration of the clock generator and reducing the consumption of calibration resources.

[0124] In some embodiments, the above temperature sensor is an externally attachable component. In order to accurately detect the temperature of the clock generator itself, the clock generator can be configured with its own temperature sensor for detecting the temperature of the clock generator. Different clock generators may have different T0 or different T0'. By calibrating the clock generator according to the T0 or T0' corresponding to the temperature of the clock generator, the timing information of the clock generator can be made accurate, unnecessary calibration of the clock generator can be reduced, the consumption of calibration resources can be reduced, and the resource utilization rate can be improved.

[0125] In some embodiments, the above clock calibration method may further include the following operations: determining the calibration result of the clock generator according to the calibration record, where the calibration record includes a first calibration record and a second calibration record; repeating the operation of calibrating the clock generator when the calibration result indicates calibration failure; and pushing information about calibration failure to the target object when the repeated calibration record obtained after repeating the operation of calibrating the clock generator a predetermined number of times still indicates calibration failure.

[0126] In some embodiments, both the first calibration record and the second calibration record may record an identifier indicating calibration success or failure, such as a field for calibration success or a field for calibration failure.

[0127] In some embodiments, the predetermined number of times may be used to determine whether to continue calibrating the clock generator. If the number of times of calibrating the clock generator has not reached the predetermined number of times, the operation of calibrating the clock generator may be repeated until there is a field for calibration success in the repeated calibration record obtained by repeating the calibration of the clock generator. If the number of times of calibrating the clock generator reaches the predetermined number of times, but there is still no field for calibration success in the repeated calibration record, in this case, the calibration of the clock generator may be stopped and information about calibration failure may be pushed to the target object.

[0128] In some embodiments, the target object may be an object capable of processing information about calibration failure, such as an operation and maintenance personnel, an operation and maintenance robot, and an intelligent operation and maintenance device, etc.

[0129] In some embodiments, pushing information about calibration failure to the target object may include the following operations: calling a template for pushing information, where different description areas may be divided in the template according to the attributes of the information, such as an area for describing the identifier of the target object, an area for describing the identifier of the failed calibration record, an area for describing the identifier of the first controller where calibration failure occurs, and an area for describing the identifier of the clock generator where calibration failure occurs, etc. Filling the above description areas according to the information recorded in the first calibration record or the second calibration record having a field for calibration failure may obtain the information about calibration failure.

[0130] According to the embodiments of the present invention, by calling a template for pushing information and automatically filling the template for pushing information according to the information in the first calibration record or the second calibration record, the efficiency of generating information about calibration failure can be improved, so that it can be convenient for the template object to maintain the electronic device in a timely manner according to the information about calibration failure, such as maintaining the first controller or the clock generator, ensuring the operation reliability of the electronic device, and ensuring that the electronic device can provide reliable time information in a timely manner.

[0131] According to an embodiment of the present invention, by automatically pushing calibration failure information to a target object, it is possible to reduce resource consumption without the need for the target object to actively and continuously monitor the calibration process of the clock generator by the first controller. On the other hand, by automatically pushing calibration failure information to a target object, it can help the target object to promptly discover the fault of the clock generator and perform maintenance, thereby improving the reliability of the electronic device.

[0132] It should be noted that, unless it is explicitly stated that there is a sequence of execution between different operations shown in the flowchart in the embodiments of the present invention, or different operations have a sequence of execution in technical implementation, otherwise, the execution order of multiple operations may not be particular, and multiple operations may also be executed simultaneously.

[0133] The present invention also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiment; or may exist independently without being assembled into the device / apparatus / system. The above computer-readable storage medium carries one or more programs, and when the above one or more programs are executed, the method according to the embodiment of the present invention is implemented.

[0134] According to an embodiment of the present invention, a computer-readable storage medium may be a non-volatile computer-readable storage medium, for example, may include but is not limited to: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, an apparatus or a device. For example, according to an embodiment of the present invention, a computer-readable storage medium may include the ROM and / or RAM described above and / or one or more memories other than ROM and RAM.

[0135] The embodiment of the present invention also includes a computer program product, which includes a computer program, and the computer program contains program code for executing the method shown in the flowchart. When the computer program product is run in a computer system, the program code is used to enable the computer system to implement the clock calibration method provided by the embodiment of the present invention.

[0136] When the computer program is executed by the processor, the above functions defined in the system / device of the embodiment of the present invention are performed. According to the embodiment of the present invention, the system, device, module, unit, etc. described above can be implemented by a computer program module.

[0137] In one embodiment, the computer program may rely on tangible storage media such as optical storage devices and magnetic storage devices. In another embodiment, the computer program may also be transmitted and distributed in the form of signals on a network medium, and downloaded and installed through the communication part, and / or installed from a removable medium. The program code included in the computer program may be transmitted using any suitable network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.

[0138] In such an embodiment, the computer program may be downloaded and installed from the network through the communication part, and / or installed from a removable medium. When the computer program is executed by a processor, the above functions defined in the system of the embodiments of the present invention are executed. According to the embodiments of the present invention, the systems, devices, apparatuses, modules, units, etc. described above may be implemented by computer program modules.

[0139] According to the embodiments of the present invention, the program code for executing the computer program provided in the embodiments of the present invention may be written in any combination of one or more programming languages. Specifically, these computing programs may be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages include but are not limited to, for example, Java, C++, Python, the "C" language, or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, partially on a remote computing device, or entirely on a remote computing device or server. In cases involving a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (for example, by using an Internet service provider to connect through the Internet).

[0140] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of systems, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagram may represent a module, a program segment, or a part of code, and the above module, program segment, or part of code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than marked in the accompanying drawings. For example, two consecutive blocks shown may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram or flowchart, and the combination of blocks in the block diagram or flowchart, may be implemented by a dedicated hardware-based system for performing the specified functions or operations, or may be implemented by a combination of dedicated hardware and computer instructions.

[0141] Those skilled in the art can understand that the features described in the various embodiments of the present invention can be combined and / or combined in various ways, even if such combinations or combinations are not explicitly described in the present invention. In particular, without departing from the spirit and teachings of the present invention, the features described in the various embodiments of the present invention can be combined and / or combined in various ways. All such combinations and / or combinations fall within the scope of the present invention.

[0142] The above describes the embodiments of the present invention. However, these embodiments are only for illustrative purposes and not for limiting the scope of the present invention. Although the embodiments are described separately above, this does not mean that the measures in the respective embodiments cannot be used advantageously in combination. Without departing from the scope of the present invention, those skilled in the art can make various substitutions and modifications, and all such substitutions and modifications should fall within the scope of the present invention.

Claims

1. An electronic device, characterized in that, Comprising: a switching element, a first controller, a processor, a clock generator, and a second controller; wherein the switching element is electrically connected to the first controller, the processor, the clock generator, and the second controller; the second controller is configured to control the switching element to electrically connect the first controller to the clock generator when the electronic device is in an offline state; the first controller is configured to, when the first controller is electrically connected to the clock generator, perform a first calibration on the clock generator using a first reference time obtained from a time reference device to obtain a first calibrated clock generator; and in response to an alarm signal sent by the first calibrated clock generator at a predetermined time, obtain a second reference time from the time reference device based on a first time difference between a first current system time of the first controller and the predetermined time, and perform a second calibration on the first calibrated clock generator using the second reference time.

2. The electronic device according to claim 1, characterized in that, The second controller is further configured to control the switching element to electrically connect the processor to the clock generator when the electronic device is in a powered-on state; the first controller is further configured to: when the processor is electrically connected to the clock generator, send a first control signal to the second controller so that the second controller controls the switching element to electrically connect the first controller to a first clock interface of the clock generator according to the first control signal, and configure the predetermined time for the clock generator through the first clock interface; send a second control signal to the second controller so that the second controller controls the switching element to electrically connect the processor to the first clock interface according to the second control signal.

3. The electronic device according to claim 2, wherein The first controller is further configured to: when the processor is electrically connected to the clock generator, in response to the alarm signal sent by the first calibrated clock generator at the predetermined time, send the first control signal to the second controller so that the second controller controls the switching element to electrically connect the first controller to the first clock interface; perform the second calibration on the first calibrated clock generator using the second reference time; send the second control signal to the second controller so that the second controller responds to the second control signal.

4. The electronic device according to any one of claims 1 to 3, characterized in that, Further comprising: a first power supply unit, electrically connected to a first power supply interface of the clock generator, for supplying power to the clock generator when the electronic device is in a powered-on state; a second power supply unit, electrically connected to a second power supply interface of the clock generator, for supplying power to the clock generator when the electronic device is in an offline state.

5. The electronic device according to claim 4, wherein When the clock generator reaches the predetermined time, pull down the level of the electrical signal between the first controller and the clock generator to obtain the alarm signal.

6. The electronic device according to claim 1, wherein The control terminal of the switching element is electrically connected to the interface of the second controller. The first end of the switching element is electrically connected to the first clock interface of the clock generator. The second end of the switching element is electrically connected to the interface of the first controller. The third end of the switching element is electrically connected to the processor.

7. The electronic device according to claim 4, wherein The first controller is further configured to: Store a first calibration record for performing a first calibration on the clock generator using the first reference time, and a second calibration record for performing a second calibration on the first-calibrated clock generator using the second reference time, into a log.

8. The electronic device according to claim 1, wherein The first controller is further configured to: In response to an alarm signal sent by the first-calibrated clock generator at a predetermined time, based on a first time difference between the first current system time and the predetermined time, perform a second calibration on the first-calibrated clock generator using the first current system time.

9. The electronic device according to claim 1, characterized in that, The first controller is communicatively connected to a time reference device cluster, the time reference device cluster includes a plurality of the time reference devices, and the time reference devices are configured with priority information; The first controller is further configured to: In response to an instruction for obtaining a reference time, according to the priority information of the time reference devices, arrange the time reference devices to obtain an arrangement result, where the instruction for obtaining a reference time includes an instruction for obtaining the first reference time or an instruction for obtaining the second reference time; Based on the arrangement result and the operating states of the time reference devices, obtain the first reference time or the second reference time.

10. A clock calibration method applied to the electronic device according to any one of claims 1 to 9, characterized in that, The method includes: In response to an instruction for performing clock calibration on a clock generator, when the electronic device is in an offline state, the second controller controls the switching element to electrically connect the first controller to the clock generator; Perform a first calibration on the clock generator using the first reference time obtained by the first controller from a time reference device to obtain a first-calibrated clock generator; and In response to an alarm signal sent by the first-calibrated clock generator at a predetermined time, based on a first time difference between the first current system time of the first controller and the predetermined time, obtain a second reference time from the time reference device, and perform a second calibration on the first-calibrated clock generator using the second reference time.

11. The method according to claim 10, wherein It further includes: When the electronic device is in a powered-on state, in response to an instruction for performing clock calibration on the clock generator, the second controller controls the switching element to electrically connect the processor to the clock generator; In response to the alarm signal, send a first control signal to the second controller so that the second controller controls the switching element to electrically connect the first controller to the first clock interface of the clock generator; Perform the second calibration on the first-calibrated clock generator using the second reference time, and send a second control signal to the second controller so that the second controller responds to the second control signal.

12. The method according to claim 10, characterized in that, Performing a first calibration on the clock generator using the first reference time obtained by the first controller from the time reference device to obtain a first-calibrated clock generator includes: Updating the second current system time of the first controller to the first reference time, where the second current system time is earlier than the first current system time; Based on the relationship between the first reference time and the first time to be calibrated of the clock generator, performing a first calibration on the clock generator to obtain the first-calibrated clock generator.

13. The method according to claim 12, characterized in that The performing a first calibration on the clock generator based on the relationship between the first reference time and the first time to be calibrated of the clock generator to obtain the first-calibrated clock generator includes: In response to the second time difference between the first reference time and the first time to be calibrated being less than or equal to a predetermined value, stopping calibrating the clock generator; In response to the second time difference being greater than the predetermined value, calibrating the first time to be calibrated to the first reference time.

14. The method according to claim 10, characterized in that, The obtaining a second reference time from the time reference device based on the first time difference between the first current system time of the first controller and the predetermined time in response to an alarm signal sent by the first-calibrated clock generator at the predetermined time includes: Obtaining the first current system time; In the case where the first time difference between the first current system time and the predetermined time is greater than a predetermined value, obtaining the second reference time from the time reference device.

15. The method according to claim 10, wherein The method further includes: In response to an alarm signal sent by the first-calibrated clock generator at a predetermined time, based on the first time difference between the first current system time and the predetermined time, and using the first current system time to perform a second calibration on the first-calibrated clock generator.

16. The method according to claim 15, characterized in that, The performing a second calibration on the first-calibrated clock generator based on the first time difference between the first current system time and the predetermined time and using the first current system time includes: At the moment when it is responded that the first time difference is greater than a predetermined value, obtaining the second time to be calibrated of the clock generator; Calibrating the second time to be calibrated to the first current system time to obtain a second-calibrated clock generator.

17. The method according to claim 10, wherein The method further includes: Determining the historical trigger error of the predetermined time according to the distribution characteristic value of the first time difference; Adjusting the predetermined time using the historical trigger error to obtain an updated predetermined time.

18. The method according to claim 10, wherein The method further includes: Determining the calibration result of the clock generator according to the calibration record, where the calibration record includes a first calibration record and a second calibration record; In the case where the calibration result indicates calibration failure, repeating the operation of calibrating the clock generator; In the case where the repeated calibration record obtained after repeating the operation of calibrating the clock generator a predetermined number of times still indicates calibration failure, pushing information of calibration failure to a target object.

19. A computer-readable storage medium having a computer program or instructions stored thereon, characterized in that, When the computer program or instruction is executed by a processor, it implements the steps of the method according to any one of claims 10 to 18.

20. A computer program product, comprising a computer program or instructions, characterized in that, When the computer program or instruction is executed by a processor, it implements the steps of the method according to any one of claims 10 to 18.

Citation Information

Patent Citations

  • Electronic device, communication device, time calibration system and calibration method thereof

    CN103376738A

  • System and method for synchronizing system hardware time and BMC hardware time

    CN110362152A

  • BMC clustering management time synchronization method and system

    CN111769896A

  • Time management method and device, electronic equipment and storage medium

    CN115454204A

  • Log time correction method and device, electronic equipment and storage medium

    CN116701338A