A time acquisition method and apparatus for a processor-based clock module

By using an externally powered clock powered by an external battery during processor replacement to synchronize the time information of the internal clock, the problem of BIOS options reverting to default values ​​due to power failure of the internal clock is solved, improving the convenience of processor replacement and user experience.

CN120743039BActive Publication Date: 2025-12-16INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511224824.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-08-29
Publication Date
2025-12-16
Estimated Expiration
2045-08-29

AI Technical Summary

Technical Problem

During processor replacement, the power loss of the built-in clock caused the basic input/output system options to revert to their default values, requiring users to manually reset them, resulting in a poor user experience.

Method used

The external clock is powered by an external battery and compares the time information of the internal clock and the external clock when the processor is powered on. If they are inconsistent, the time of the external clock is synchronized to the internal clock to ensure time consistency.

Benefits of technology

This avoids the built-in clock triggering Clear CMOS action upon power-down, reducing the number of manual settings required by the user and improving the convenience of processor replacement and user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120743039B_ABST
    Figure CN120743039B_ABST
Patent Text Reader

Abstract

The application discloses a time acquisition method and device of a processor-based clock module, relates to the technical field of processors, and comprises the following steps: when the processor is replaced, an external battery is used to supply power to an external clock, so that the problem that the basic input / output system option is restored to the default value due to the power-off of the built-in clock is solved, the time cost of server maintenance of a user is reduced, and the technical effect of improving the user perception is achieved; further, when the processor is powered on, the first time information and the second time information of the built-in clock are read by the processor, and the second time information is synchronized to the built-in clock when the first time information and the second time information are inconsistent, so that the problem that the time of the built-in clock is inaccurate after the built-in clock is replaced is solved, and the technical effect of guaranteeing the time consistency of the built-in clock and the external clock is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of processor technology, and in particular to a method and apparatus for acquiring time based on a processor clock module. Background Technology

[0002] With the rapid development of servers, the requirements for servers in all aspects are getting higher and higher. Major server providers are trying to create all-round servers to meet the diverse needs of users. Various problems may occur during server use. The most common of these is that the server will encounter processor errors due to processor problems, or the server will crash during startup due to processor problems. Currently, if a server problem is caused by a processor, it is necessary to replace the processor to solve the problem.

[0003] However, because the processor integrates an internal clock, when the old processor is removed, the internal clock is also removed, and a new internal clock is installed after the new processor is installed. During the processor replacement process, the internal clock is removed and installed, which involves a power outage. The power outage triggers the clearing of the stored Basic Input / Output System (BIOS) settings. In this case, when the server starts up after installing the new processor, it detects that the settings have been cleared and restores the BIOS options to their default values. At this point, the user needs to manually reconfigure the BIOS according to the usage scenario, save, and restart. This process is too time-consuming and prone to errors, resulting in a poor user experience. Summary of the Invention

[0004] This application provides a time acquisition method and apparatus based on a processor clock module, to at least solve the problem in related technologies where the power-off of the built-in clock causes the basic input / output system options to revert to their default values.

[0005] This application provides a time acquisition method based on a processor-driven clock module, applied to a basic input / output system. The basic input / output system is connected to a processor, which includes a built-in clock and is connected to an external clock, which is powered by an external battery. The method includes:

[0006] When the processor is detected to be powered on, the processor reads the first time information of the built-in clock and the second time information of the external clock.

[0007] Compare the first time information and the second time information;

[0008] If the first time information is inconsistent with the second time information, the second time information is synchronized with the built-in clock, and the second time information is returned to the processor.

[0009] This application also provides a time acquisition device based on a processor-driven clock module, operating within a basic input / output system. The basic input / output system is connected to the processor, which includes a built-in clock and is connected to an external clock powered by an external battery. The device includes:

[0010] The time information reading module is used to read the first time information of the built-in clock and the second time information of the external clock through the processor when the processor is detected to be powered on.

[0011] A time information comparison module is used to compare the first time information and the second time information;

[0012] If the first time information is inconsistent with the second time information, the time information synchronization module is activated. The time information synchronization module is used to synchronize the second time information to the built-in clock and to return the second time information to the processor.

[0013] This application also provides an electronic device, including: a memory for storing a computer program; and a processor for implementing the time acquisition method of any of the processor-based clock modules described above when executing the computer program.

[0014] This application also provides a computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, it implements the steps of any of the above-described processor-based clock module time acquisition methods.

[0015] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of any of the above-described processor-based clock module time acquisition methods.

[0016] In this application, an external clock is configured. The processor includes an internal clock and is connected to the external clock, which is powered by an external battery. This configuration prevents the internal clock from triggering Clear CMOS (Clear Complementary Metal Oxide Semiconductor) during processor replacement, thus avoiding the BIOS (Basic Input / Output System) options reverting to default values ​​and eliminating the need for manual BIOS option modifications by the user. This improves the convenience of processor replacement. Furthermore, when the BIOS connected to the processor detects processor power-on, it reads the first time information from the internal clock and the second time information from the external clock. If the first and second time information are inconsistent, the BIOS synchronizes the second time information to the internal clock and returns the second time information to the processor, thereby ensuring the time validity and consistency of the internal and external clocks. Attached Figure Description

[0017] To more clearly illustrate the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0018] Figure 1 A schematic diagram of the hardware environment for a time acquisition method based on a processor clock module provided in an embodiment of this application;

[0019] Figure 2 A flowchart illustrating a time acquisition method for a processor-based clock module provided in an embodiment of this application;

[0020] Figure 3 A flowchart illustrating a time acquisition method based on a processor clock module, applicable to a processor time acquisition scenario, provided in an embodiment of this application;

[0021] Figure 4 A flowchart illustrating a time acquisition method for a processor-based clock module applied in a user time access scenario, provided in an embodiment of this application;

[0022] Figure 5 This is a schematic diagram of the structure of a time acquisition device based on a processor clock module provided in an embodiment of this application. Detailed Implementation

[0023] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the protection scope of this application.

[0024] It should be noted that, in the description of this application, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. The terms "first," "second," etc., in this application are used to distinguish similar objects and are not used to describe a specific order or sequence.

[0025] To enable those skilled in the art to better understand the present application, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0026] The specific application environment architecture or specific hardware architecture on which the execution of the time acquisition method based on the processor clock module depends is described here.

[0027] This embodiment relies on a specific application environment architecture or hardware architecture, including a server, for the time acquisition method based on the processor's clock module. (See also...) Figure 1 As shown, the server includes a processor 110, a built-in clock 120, an external clock 130, an external battery 140, a basic input / output system 150, and a baseboard management controller 160.

[0028] The processor 110 includes a built-in clock 120. The processor 110 is connected to an external clock 130 via I2C (Inter-Integrated Circuit). The external clock 130 is powered by an external battery 140. The processor 110 and the basic input / output system 150 are connected via SPI (Serial Peripheral Interface). The external clock 130 and the board management controller 160 are connected via I2C.

[0029] In this server, when the processor 110 is replaced, the external clock 130 is powered by the external battery 140. This prevents the clock from losing power and triggering the Clear CMOS action, which would cause the Basic Input / Output System (BIOS) 150 options to revert to their default values ​​when the server restarts. This would require the user to manually modify the BIOS 150 options, reducing the time cost for the user to maintain the server and simplifying the process of modifying the options to restore usability after replacing the processor 110, thus improving the user experience.

[0030] Furthermore, when the basic input / output system 150 detects that the processor 110 is powered on, it reads the first time information of the built-in clock 120 and the second time information of the external clock 130 through the processor 110. If the first time information and the second time information are inconsistent, the system synchronizes the second time information to the built-in clock 120 and returns the second time information to the processor 110, thereby ensuring that the time of the built-in clock 120 and the external clock 130 is consistent.

[0031] It should be noted that, in addition to SPI-1 which is connected to the processor 110, the basic input / output system 150 may also include SPI-2 which is connected to the operating system and SPI-3 which provides access to basic input / output system options.

[0032] The embodiments of this application provide a time acquisition method based on a processor clock module. The method is described in detail below in conjunction with the execution flow of the time acquisition method based on a processor clock module.

[0033] Reference Figure 2 As shown, this time acquisition method based on a processor clock module can be applied to a basic input / output system (PIS). The PIS is connected to a processor, which includes a built-in clock and is connected to an external clock powered by an external battery. Specifically, the method includes the following steps S21-S23:

[0034] S21. When the processor is detected to be powered on, the processor reads the first time information of the built-in clock and the second time information of the external clock.

[0035] In this embodiment, an external clock (RTC, Real-Time Clock) is set up, the processor is connected to the external clock, and the external clock is powered by an external battery. This prevents the Clear CMOS action from being triggered when the processor is replaced, and eliminates the need for the user to manually modify the Basic Input / Output Options (PIO) when the server restarts after the processor is replaced. This reduces the time cost for users to maintain the server and the process of modifying the PIO options after replacing the processor, thus improving the user experience. In this embodiment, the external clock includes an external RTC added to the server's motherboard and connected to the processor and the baseboard management controller. The external battery can be a coin cell battery, and the processor can be an AMD (Advanced Micro Devices) processor.

[0036] In practical applications, the processor reads the time information of the built-in clock during power-on. Since an external clock powered by an external battery is also provided in this embodiment, in order to ensure that the processor reads accurate time information and that the external clock is not affected by processor replacement, the processor can read the time information of the external clock during power-on to ensure the validity of the read time information. For example, when the processor detects power-on, it reads the second time information of the external clock.

[0037] In this embodiment, the processor power-on can be either the processor after replacement or the processor without replacement; this embodiment does not limit the specific processor power-on.

[0038] In some scenarios, the processor is a passive device and cannot actively read the second time information of the external clock. Based on this, the basic input / output system connected to the processor can read the second time information of the external clock through the processor and return it to the processor when the processor is powered on, so as to help the processor obtain accurate time information.

[0039] In this embodiment, when the basic input / output system detects that the processor is powered on, it reads the first time information of the built-in clock and the second time information of the external clock through the processor. Specifically, the basic input / output system may include a processor interaction interface, and the basic input / output system and the processor can be connected through the processor interaction interface. The basic input / output system can detect the processor being powered on through the processor interaction interface. The processor interaction interface may be SPI.

[0040] Since the processor contains a built-in clock and is connected to an external clock, and the Elementary Input / Output System (API) is connected to the processor, in order for the API to read the first and second time information even when it is not connected to the built-in and external clocks, the API reads the first time information from the built-in clock and the second time information from the external clock through the processor. This can be achieved in the following way:

[0041] A time reminder is sent to the processor via the processor interaction interface; the processor performs the following operations:

[0042] In response to a time acquisition reminder, the system reads the first time information from the built-in clock through the input / output channel and the second time information from the external clock through the integrated circuit bus channel.

[0043] First and second time information are transmitted to the basic input / output system through the processor interaction interface.

[0044] Specifically, the Basic Input / Output System (PIOS) sends a time acquisition reminder to the processor via a processor interface connected to the processor. In response to the time acquisition reminder, the processor reads the first time information of the built-in clock through the input / output channel when the processor is connected to the built-in clock via the system bus. On the other hand, when the processor is connected to an external clock via the integrated circuit bus, it reads the second time information of the built-in clock through the integrated circuit bus channel and transmits the first and second time information to the PIOS through the processor interface.

[0045] S22. Compare the first time information and the second time information.

[0046] In this embodiment of the application, after the processor reads the first time information of the built-in clock and the second time information of the external clock, it compares the first time information and the second time information; in the specific execution process, it compares whether the first time information and the second time information are consistent.

[0047] During the specific execution process, the built-in clock will also be changed when the processor is replaced. When the replaced processor is powered on, the time of the built-in clock and the time of the external clock will be inconsistent. That is, the first time information and the second time information will be inconsistent after the built-in clock is powered off and when the processor is powered on. In order to ensure the consistency between the built-in clock and the external clock, after reading the first time information and the second time information, the first time information and the second time information are compared to see if they are consistent. If the first time information and the second time information are consistent, the first time information can be returned to the processor. If the first time information and the second time information are inconsistent, the following step S23 is executed: if the first time information and the second time information are inconsistent, the second time information is synchronized to the built-in clock and the second time information is returned to the processor.

[0048] Step S23: If the first time information is inconsistent with the second time information, synchronize the second time information with the built-in clock and return the second time information to the processor.

[0049] In this embodiment of the application, if the first time information and the second time information are inconsistent, in order to ensure the consistency of the built-in time and the external clock, the second time information is synchronized to the built-in time and the second time information is returned to the processor.

[0050] Specifically, the basic input / output system can return second time information to the processor through a processor interaction interface connected to the processor, and can synchronize the second time information with the built-in clock through input / output channels; in addition, the basic input / output system can also return a built-in clock synchronization reminder containing the second time information to the processor through a processor interaction interface connected to the processor, and the processor receives the built-in clock synchronization reminder and synchronizes the second time information with the built-in clock through the input / output channels; wherein, the input / output channels can be implemented using system bus channels.

[0051] It should be noted that during the process of synchronizing the second time information to the built-in clock, the basic input / output system can return a built-in clock synchronization reminder containing the second time information to the processor through the processor interaction interface connected to the processor. The processor receives the built-in clock synchronization reminder and synchronizes the second time information to the built-in clock through the input / output channel. Based on this, if the processor has already obtained the second time information contained in the built-in clock synchronization reminder, there is no need to repeatedly return the second time information to the processor. Therefore, step S31 can be replaced by returning the second time information to the processor to synchronize with the built-in clock if the first time information is inconsistent with the second time information. This can be combined with one or more other processing steps provided in the embodiments of this application to form a new implementation.

[0052] The above describes in detail the time acquisition process of the basic input / output system when the processor is detected to be powered on through the processor interaction interface. In addition, the user can also acquire and modify the time, and the operating system can also acquire and modify the time. Correspondingly, in order to realize the time acquisition and modification of the user and the operating system, the basic input / output system may also include a user interaction interface and an operating system interaction interface, and respond to the time access requests of the user and / or the operating system through the user interaction interface and / or the operating system interaction interface.

[0053] In this embodiment of the application, the basic input / output system disconnects the channel for the user to use the built-in clock and initializes the channel for the external clock so that the user can obtain the time from the external clock when acquiring the time.

[0054] In practice, users can send time access requests through the system settings interface of the Basic Input / Output System (BIOS), i.e., the user interaction interface. For example, users can send time acquisition requests or time modification requests through the BIOS setup interface. In addition, users can also enter time information through the operating system interface, and the operating system can send time access requests to the BIOS. For example, users can submit time acquisition requests or time modification requests through the operating system interface, and the operating system can pass in the time acquisition requests or time modification requests through the operating system interaction interface provided by the BIOS.

[0055] (1) Time access via user interaction interface

[0056] In one optional implementation of this application, a time acquisition request is received from a user. In response to the time acquisition request, the processor reads the third time information of the external clock and returns it to the user. In this way, when the user acquires the time, the time information of the external clock is returned to the user, ensuring the validity and accuracy of the time information returned to the user.

[0057] The function of receiving time acquisition requests from users can be either receiving time acquisition requests from users through the system settings interface of the basic input / output system.

[0058] Specifically, the Basic Input / Output System (PIOS) receives a time acquisition request from the user through the PIOS system settings interface. In response to the time acquisition request, it sends an external time read reminder through the processor interaction interface connected to the processor, so that the processor reads the third time information of the external clock through the integrated circuit bus channel and transmits it through the processor interaction interface. The PIOS receives the third time information transmitted by the processor and displays it to the user through the system settings interface.

[0059] For example, a user sends a time acquisition request through the BIOS setup interface. After receiving the time acquisition request from the user through the BIOS setup interface, the BIOS sends an external time read reminder to the processor through the SPI connected to the processor. In response to the external time read reminder, the processor reads the third time information from the external RTC through the I2C channel and transmits it to the SPI. After receiving the third time information transmitted from the SPI, the BIOS displays the third time information through the BIOS setup interface.

[0060] It should be noted that after the user sends a time acquisition request, in addition to reading the third time information from the external clock through the processor, the fourth time information from the built-in clock can also be read through the processor. That is, after receiving the user's time acquisition request, the processor reads the fourth time information from the built-in clock and the third time information from the external clock, compares the third time information and the fourth time information. If the third time information and the fourth time information are consistent, the third time information is returned to the user. If the third time information and the fourth time information are inconsistent, the third time information is synchronized with the built-in clock and the third time information is returned to the user. The specific synchronization process is similar to the above-mentioned related content, and this embodiment does not limit it here.

[0061] In addition to obtaining the time, users can also modify the time. Since there is a built-in clock and an external clock, during the time modification process, the consistency of the built-in clock and the external clock is ensured by synchronizing the modified time to the built-in clock and the external clock. In one optional implementation of this embodiment, a time modification request is received from the user, the time modification information carried in the time modification request is read, and the time information is synchronized to the external clock and the built-in clock to modify the clock time according to the modified time information.

[0062] The function of receiving time modification requests from users can be implemented by receiving time modification requests from users through the system settings interface of the basic input / output system.

[0063] Specifically, the basic input / output system receives time modification requests from users through the system settings interface of the basic input / output system, reads the time modification information carried in the time modification request, and synchronizes the time information with the external clock and the internal clock to modify the clock time according to the modified time information;

[0064] In the specific execution process of synchronously modifying time information to both the external and internal clocks, based on the connection method with the external and internal clocks, the time information is synchronously modified to the external clock via the integrated circuit bus channel, and to the internal clock via the input / output channel. Since the internal clock is located within the processor, and the external clock is connected to the processor, synchronous modification of time information to both the internal and external clocks requires synchronization by the processor. To improve synchronization efficiency and avoid sending multiple synchronization reminders to the processor, in this embodiment, during the process of synchronously modifying time information to both the external and internal clocks, the time information is synchronously modified to the processor via the processor interaction interface. This allows the processor to write the modified time information to the external clock via the integrated circuit bus channel and to write the modified time information to the internal clock via the input / output channel.

[0065] For example, a user sends a time modification request through the BIOS setup interface. After the user sends the time modification request through the BIOS setup interface, the modified time information carried in the time modification request is read, and a time synchronization reminder is sent to the processor through the SPI that is connected to the processor. In response to the time synchronization reminder, the processor writes the modified time information to the built-in RTC through the I / O channel and writes the modified time information to the external RTC through the I2C channel.

[0066] It should be noted that, in the embodiments of this application, the channel between the processor and the built-in clock can be an input / output channel, a system bus channel, or a serial peripheral interface channel, and this embodiment of the application does not limit it.

[0067] In this embodiment, both time acquisition requests and time modification requests can be passed through the system settings interface. Based on this, after receiving a time access request passed through the system settings interface, i.e., the user interaction interface, in order to accurately determine the user's purpose for accessing the time and to determine the subsequent processing method, if a time access request is received from the user, i.e., if a time access request is received through the user interaction interface, it is checked whether the time access request carries time modification information; if so, the time access request is determined to be a time modification request; if not, the time access request is determined to be a time acquisition request.

[0068] (2) Time access via operating system interaction interface

[0069] In addition to submitting time access requests through the system settings interface, users can also submit them through the operating system interface, and the operating system will then receive the time access requests. For example, the basic input / output system receives time acquisition requests or time modification requests submitted by the user through the operating system interface and received by the operating system. In other words, the basic input / output system receives time access requests submitted by the user through the operating system interface and received by the operating system. In this embodiment of the application, the time access request can be a time acquisition request, a time modification request, or other time-related access requests. This embodiment of the application does not limit the scope of the request.

[0070] In the actual execution process, in order to improve the processing efficiency of time access requests from the operating system, after receiving the time access request from the operating system, the processing function corresponding to the access type of the time access request can be executed in response to the time access request.

[0071] Specifically, after receiving a time access request from the operating system, the system identifies the access type of the time access request and executes the corresponding processing function; the access types include time acquisition type and time modification type.

[0072] For example, after identifying the access type of the time access request as time retrieval, the GetTime function is executed; after identifying the access type of the time access request as time modification, the SetTime function is executed.

[0073] It should be noted that the specific execution of the processing function can be implemented using the aforementioned time access methods through the user interface. For example, during the execution of the GetTime function, an external time reading reminder is sent through the processor interaction interface connected to the processor, so that the processor reads the third time information of the external clock through the integrated circuit bus channel and passes it through the processor interaction interface. The basic input / output system receives the third time information passed by the processor and returns it through the operating system interaction interface. In another example, during the execution of the SetTime function, the time modification information carried in the time modification request is read, and the time information is synchronously modified to the processor through the processor interaction interface, so that the processor writes the modified time information to the external clock based on the integrated circuit bus channel, and writes the modified time information to the internal clock based on the input / output channel or the system bus channel.

[0074] In practical applications, the baseboard management controller cannot directly access the processor's built-in clock to obtain the time. Only when the server starts up can the basic input / output system first obtain the time from the processor's built-in clock, and then send the obtained time to the baseboard management controller via IPMI (Intelligent Platform Management Interface) commands to ensure time consistency between the basic input / output system and the baseboard management controller in the server. Based on this, in this embodiment, an external clock can be connected to the baseboard management controller, so that the baseboard management controller can obtain the time from the external clock, and the basic input / output system also obtains the time from the external clock, ensuring time consistency between the basic input / output system and the baseboard management controller.

[0075] After the user modifies the time, the external clock updates its time accordingly and, based on its connection to the baseboard management controller, synchronizes the time information with the controller. This ensures timely time synchronization with the baseboard management controller even after a user time change, eliminating the need to restart the server and effectively guaranteeing time consistency between the baseboard management controller and the basic input / output system. The external clock can be connected to the baseboard management controller via an integrated circuit bus. In this embodiment, the external clock is connected to the baseboard management controller, and upon detecting a time modification, it synchronizes the updated time information with the controller.

[0076] For example, after the external RTC modifies the clock time according to the modified time information, it synchronizes the modified time information with the BMC through the I2C channel.

[0077] When an external clock establishes a connection with the substrate management controller, in addition to the external clock modifying its own clock time and then synchronizing the time information with the substrate manager, the substrate management controller can also read the time from the external clock according to a reading cycle to further ensure the accuracy and validity of the controller's time information. In this embodiment, the substrate management controller can perform the following operations:

[0078] After detecting the arrival of the preset reading period, the fourth time information of the external clock is read through the connection with the external clock;

[0079] The controller's time information is updated based on the fourth time information.

[0080] Specifically, after detecting the arrival of the preset read cycle, the baseboard management controller reads the fourth time information from the external clock through the integrated circuit bus channel with the external clock and updates the controller's time information according to the fourth time information.

[0081] For example, the BMC reads fourth time information from an external RTC every 30 minutes via the I2C channel.

[0082] The built-in clock also includes storage space to store specific functions. In order to avoid the loss of stored data in the storage space after the built-in clock is replaced, in this embodiment of the application, storage space can also be configured for the external clock, and the stored data of the built-in clock's storage space can be migrated to the storage space of the external clock. Optionally, the built-in clock includes a first storage space, the external clock includes a second storage space, and the stored data of the first storage space is migrated to the second storage space.

[0083] The above describes in detail the processes of processor power-on and user access in a basic input / output system. The basic input / output system can perform these processes using the corresponding interfaces. In addition, the basic input / output system can also perform the following operations:

[0084] When a time access request is detected, check whether the corresponding processor is powered on.

[0085] If so, the processor reads the first time information from the built-in clock and the second time information from the external clock; compares whether the first time information and the second time information are consistent; if so, returns the first time information to the processor; if not, synchronizes the second time information with the built-in clock and returns the second time information to the processor.

[0086] If not, identify the access type of the time access request; if the access type is time acquisition, read the third time information from the external clock through the processor and return it to the user or operating system; if the access type is time modification, read the modification time carried in the time access request, and synchronize the time information with the external clock and the internal clock to modify the clock time according to the modification time information.

[0087] It should be noted that the above-mentioned user time access can be performed after the processor is powered on or before the processor is powered on. That is, steps S21 to S23 can be omitted, and only the relevant content of user time access can be performed. This application embodiment does not limit this.

[0088] It should also be noted that the time acquisition method for the processor-based clock module of the basic input / output system provided in this application embodiment can also be applied to the processor. The process executed by the basic input / output system can be transferred to the processor for execution. For example, when the processor is detected to be powered on, the first time information of the built-in clock and the second time information of the external clock are read and compared. If the first time information and the second time information are inconsistent, the second time information is synchronized to the built-in clock. In addition, other contents can also be transferred to the processor for execution, which will not be described in detail in this application embodiment.

[0089] In summary, the time acquisition method of one or more processor-based clock modules provided in this application provides a time acquisition method by setting an external clock and connecting the external clock to the processor and the baseboard management controller via I2C, thereby ensuring that both the processor and the baseboard management controller can use the I2C channel to access the external clock to acquire the time or the stored data stored in the storage space of the external clock.

[0090] In order to use the time information of the external clock as the reference, the basic input / output system can cut off the input / output channel of the user using the built-in clock, and initialize the I2C channel of the external clock. Then, it constructs the underlying code interface for obtaining and modifying the RTC time. Specifically, it can provide processor interaction interface, user interaction interface and operating system interaction interface to enable the processor, user and operating system to obtain and / or modify the time.

[0091] Specifically, when the processor is detected to be powered on via the processor interaction interface, the processor reads the first time information of the built-in clock and the second time information of the external clock, compares whether the first time information and the second time information are consistent. If they are consistent, the first time information is returned to the processor; if not, the built-in time is returned to the processor, so as to respond to the processor power-on and synchronize the second time information with the built-in clock through the processor.

[0092] It can acquire or receive time access requests from users through the user interaction interface, detect whether the time access request carries time modification information, and if so, determine the time access request as a time modification request. In response to the time modification request, read the time modification information carried in the time modification request, and synchronize the time information with the external clock and the internal clock through the processor to modify the clock time according to the modified time information. Furthermore, in order to synchronize the modified time information of the external clock to the board management controller, the external clock modifies the clock time according to the modified time and then synchronizes the modified time information with the board management controller. If not, the time access request is determined as a time acquisition request. In response to the time acquisition request, the processor reads the third time information of the external clock and returns it to the user.

[0093] It can acquire or receive time access requests passed through the operating system interaction interface, identify the access type of the time access request, and execute the processing function corresponding to the access type to respond to the time access request. In addition, the operating system interaction interface can also be similar to the user interaction interface mentioned above. After acquiring or receiving the time access request passed through the operating system interaction interface, it can also process it according to the subsequent processing operations of acquiring or receiving the time access request passed by the user through the user interaction interface mentioned above. The embodiments of this application will not be described in detail here.

[0094] Based on this, in this embodiment, firstly, a new hardware topology is adopted, and an external clock powered by an external battery is set up so that the external battery still supplies power to the external clock when the processor is replaced. This solves the problem of the clock losing power and triggering Clear CMOS action due to processor replacement, reducing the steps required for users to modify the Basic Input / Output System (PIOS) options to restore operation after replacing the processor (i.e., the CPU), thus improving user satisfaction. On this basis, since the processor still uses the built-in clock to implement other functions, in the case that the built-in clock cannot be removed, in order to ensure the time consistency between the built-in clock and the external clock, the PIOS ensures the time consistency between the built-in clock and the external clock. When the PIOS detects that the processor is powered on, i.e., the server restarts, it compares the first time information and the second time information. If the first time information and the second time information are inconsistent, it synchronizes the second time information to the built-in clock to synchronize the second time information of the external clock to the built-in clock, thereby ensuring the time consistency between the built-in clock and the external clock.

[0095] Furthermore, in order to ensure time consistency between the basic input / output system and the baseboard management controller, in this embodiment of the application, an external clock is connected to the baseboard management controller so that after the external clock modifies the clock time, the server does not need to be restarted. The external clock can synchronize the modified time information to the baseboard management controller, thereby further improving user satisfaction.

[0096] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method.

[0097] The following description uses an embodiment of this application to illustrate the application of a processor-based clock module time acquisition method in a processor time acquisition scenario, further explaining the processor-based clock module time acquisition method provided by the embodiment of this application. (Refer to...) Figure 3 As shown, the time acquisition method based on the processor clock module, applied to the processor time acquisition scenario, specifically includes the following steps.

[0098] S31. When the basic input / output system detects that the processor is powered on through the processor interaction interface, it sends a time acquisition reminder to the processor through the processor interaction interface.

[0099] S32. In response to the time acquisition reminder, the processor reads the first time information of the built-in clock through the system bus channel and the second time information of the external clock through the integrated circuit bus channel.

[0100] S33, the processor transmits first time information and second time information through the processor interaction interface.

[0101] S34. The basic input / output system receives first and second time information transmitted by the processor through the processor interaction interface.

[0102] S35. The basic input / output system compares the first time information and the second time information.

[0103] S36. If the first time information is consistent with the second time information, the basic input / output system returns the first time information to the processor through the processor interaction interface.

[0104] S37. If the first time information is inconsistent with the second time information, the basic input / output system synchronizes the second time information with the built-in clock and returns the second time information to the processor.

[0105] In addition, S37 can be replaced by returning a built-in clock synchronization reminder containing the second time information to the processor if the first time information is inconsistent with the second time information. The processor will then use the second time information as response time information and write the second time information into the built-in clock through the system bus channel.

[0106] It should be noted that any one or more of steps S31 to S37 can be combined with any one or more of steps S21 to S23 to form a new implementation method according to the needs of implementation and deployment. In addition, according to the actual deployment needs, any one or more technical features can be selected in steps S31 to S37 and combined with any one or more technical features provided in steps S21 to S23 to form a new implementation method. Alternatively, any one or more technical features in steps S31 to S37 can be replaced with any one or more technical features provided in steps S21 to S23 to form a new implementation method according to the actual deployment needs. These will not be elaborated on here.

[0107] The following description uses an embodiment of this application to illustrate the application of a processor-based clock module time acquisition method in a user time access scenario, further explaining the processor-based clock module time acquisition method provided by the embodiment of this application. (Refer to...) Figure 4 As shown, the time acquisition method of the processor-based clock module applied to user time access scenarios includes the following steps.

[0108] S41. The basic input / output system receives a time access request from the user and identifies the access type of the time access request.

[0109] Optionally, receiving a time access request from a user can be done by receiving a time access request from a user through a user interaction interface, or by receiving a time access request submitted by a user through an operating system interface and then received by the operating system through an operating system interaction interface.

[0110] S42. If the access type is time acquisition type, the basic input / output system reads the third time information of the external clock connected to the processor through the processor.

[0111] S43. The basic input / output system returns third-time information to the user.

[0112] Optionally, in response to a received time access request, third-party time information is returned to the user. This can be done either through a user interaction interface or through an operating system interaction interface, whereby the operating system displays the third-party time information. The user interaction interface can be the system settings interface of the basic input / output system.

[0113] S44. If the access type is time modification type, the basic input / output system reads the time modification information carried in the time access request.

[0114] S45. The basic input / output system synchronizes and modifies time information with the processor through the processor interaction interface.

[0115] S46. The processor will synchronize the modified time information to the external clock and the internal clock.

[0116] Optionally, during the process of the processor modifying time information to synchronize with the external clock and the internal clock, it can synchronize the time information to the external clock through the integrated circuit bus channel and synchronize the time information to the internal clock through the input / output channel provided by the system bus.

[0117] S47. After the external clock modifies the clock time according to the modified time information, it synchronizes the modified time information with the baseboard management controller.

[0118] Optionally, after the external clock modifies the clock time according to the modified time information, it synchronizes the modified time information with the board management controller via the integrated circuit bus.

[0119] It should be noted that any one or more of steps S41 to S47 can be combined with any one or more of steps S21 to S23 to form a new implementation method according to the needs of implementation and deployment. In addition, any one or more technical features can be selected in steps S41 to S47 and combined with any one or more technical features provided in steps S21 to S23 to form a new implementation method according to the actual deployment needs. Alternatively, any one or more technical features in steps S41 to S47 can be replaced with any one or more technical features provided in steps S21 to S23 to form a new implementation method according to the actual deployment needs. These will not be elaborated on here.

[0120] Figure 5 This is a schematic diagram of the structure of a time acquisition device 500 based on a processor clock module provided in this disclosure, as shown below. Figure 5 As shown, the device 500 of this embodiment operates on a basic input / output system, which is connected to a processor. The processor includes a built-in clock and is connected to an external clock, which is powered by an external battery. The device includes:

[0121] The time information reading module 510 is used to read the first time information of the built-in clock and the second time information of the external clock through the processor when the processor is detected to be powered on.

[0122] The time information comparison module 520 is used to compare the first time information and the second time information;

[0123] If the first time information is inconsistent with the second time information, the time information synchronization module 530 is run. The time information synchronization module 530 is used to synchronize the second time information with the built-in clock and return the second time information to the processor.

[0124] As an optional implementation of this application, the device is further configured to receive a time acquisition request from a user; in response to the time acquisition request, read the third time information of the external clock through the processor and return it to the user.

[0125] As an optional implementation of this application, when the device receives a time acquisition request from a user, it is specifically used to receive the time acquisition request from the user through the system settings interface of the basic input / output system; or, to receive the time acquisition request submitted by the user through the operating system interface and transmitted by the operating system.

[0126] As an optional implementation of this application, the device is further configured to receive a time modification request from a user and read the modified time information carried in the time modification request; synchronize the modified time information with the external clock and the internal clock to modify the clock time according to the modified time information.

[0127] As an optional implementation of this application, the external clock is connected to the baseboard management controller; after the external clock modifies the clock time according to the modified time information, it synchronizes the modified time information to the baseboard management controller based on the connection with the baseboard management controller.

[0128] As an optional implementation of this application, the external clock is connected to the baseboard management controller via an integrated circuit bus.

[0129] As an optional implementation of this application, when the device synchronizes the modified time information to the external clock and the internal clock, it is specifically used to synchronize the modified time information to the external clock through an integrated circuit bus channel, and to synchronize the modified time information to the internal clock through an input / output channel.

[0130] As an optional implementation of this application, when the device synchronizes the modified time information to the external clock through the integrated circuit bus channel, it is specifically used to synchronize the modified time information to the processor through the processor interaction interface, so that the processor writes the modified time information to the external clock based on the integrated circuit bus channel.

[0131] As an optional implementation of this application, the basic input / output system includes a processor interaction interface, a user interaction interface, and an operating system interaction interface; the basic input / output system detects the processor power-on through the processor interaction interface, and responds to time access requests from users and / or the operating system through the user interaction interface and the operating system interaction interface.

[0132] As an optional implementation of this application, the device is further configured to receive a time access request from the operating system; and in response to the time access request, execute a processing function corresponding to the access type of the time access request.

[0133] As an optional implementation of this application, the device is further configured to receive a time access request from a user, and detect whether the time access request carries time modification information; if so, determine the time access request as a time modification request; if not, determine the time access request as a time acquisition request.

[0134] As an optional implementation of this application, the first time information and the second time information are inconsistent after the built-in clock is powered off and when the processor is powered on.

[0135] As an optional implementation of this application, the built-in clock includes a first storage space, and the external clock includes a second storage space; the stored data in the first storage space is migrated to the second storage space for storage.

[0136] As an optional implementation of this application, the baseboard management controller performs the following operations: after detecting the arrival of a preset reading cycle, it reads the fourth time information of the external clock through the connection with the external clock; and updates the controller time information according to the fourth time information.

[0137] As an optional implementation of this application, when the time information reading module 510 reads the first time information of the built-in clock and the second time information of the external clock through the processor, it is specifically used to send a time acquisition reminder to the processor through the processor interaction interface; the processor performs the following operations: in response to the time acquisition reminder, it reads the first time information of the built-in clock through the system bus channel, and reads the second time information of the external clock through the integrated circuit bus channel; it transmits the first time information and the second time information to the basic input / output system through the processor interaction interface.

[0138] As an optional implementation of this application, the device is further configured to return the first time information to the processor if the first time information is consistent with the second time information.

[0139] For a description of the features in the embodiment of the time acquisition device based on the processor clock module, please refer to the relevant description of the embodiment of the time acquisition method based on the processor clock module, which will not be repeated here.

[0140] Embodiments of this application also provide an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to perform the steps in any of the above embodiments of the time acquisition method for a processor-based clock module.

[0141] Embodiments of this application also provide a computer-readable storage medium storing a computer program, wherein the computer program is configured to execute the steps in any of the above embodiments of the time acquisition method based on a processor-based clock module when it runs.

[0142] In one exemplary embodiment, the aforementioned computer-readable storage medium may include, but is not limited to, various media capable of storing computer programs, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard disk, magnetic disk, or optical disk.

[0143] The embodiments of this application also provide a computer program product, which includes a computer program that, when executed by a processor, implements the steps in any of the above embodiments of the time acquisition method based on a processor clock module.

[0144] Embodiments of this application also provide another computer program product, including a non-volatile computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps in any of the above embodiments of the time acquisition method based on a processor clock module.

[0145] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0146] The above provides a detailed description of a time acquisition method and apparatus based on a processor clock module provided in this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the embodiments above are only intended to help understand the method and core ideas of this application. It should be noted that those skilled in the art can make various improvements and modifications to this application without departing from its principles, and these improvements and modifications also fall within the protection scope of the claims of this application.

Claims

1. A time acquisition method based on a processor-based clock module, characterized in that, An application is made in a basic input / output system (PIS), wherein the PIS is connected to a processor, the processor includes a built-in clock and is connected to an external clock, the external clock is powered by an external battery, and the external clock is connected to a board management controller; the method includes: When a time access request is detected, it is checked whether the time access request corresponds to the processor being powered on; If so, the processor reads the first time information of the built-in clock and the second time information of the external clock; compares the first time information and the second time information; if the first time information and the second time information are inconsistent, the processor synchronizes the second time information to the built-in clock and returns the second time information to the processor. If not, identify the access type of the time access request; if the access type is a time acquisition type, read the third time information of the external clock and the fourth time information of the built-in clock through the processor, compare the third time information and the fourth time information, if the third time information and the fourth time information are inconsistent, synchronize the third time information to the built-in clock and return the third time information to the user; if the access type is a time modification type, read the modified time information carried by the time access request; synchronize the modified time information to the built-in clock and the external clock; after the external clock modifies the clock time according to the modified time information, synchronize the modified time information to the baseboard management controller.

2. The time acquisition method based on a processor-driven clock module according to claim 1, characterized in that, The time access request includes: The time access request passed by the user through the system settings interface of the basic input / output system; or, The user submits the time access request through the operating system interface, and the request is transmitted by the operating system.

3. The time acquisition method based on a processor-driven clock module according to claim 1, characterized in that, The external clock is connected to the baseboard management controller via an integrated circuit bus.

4. The time acquisition method based on a processor-driven clock module according to claim 1, characterized in that, The step of synchronizing the modified time information to the built-in clock and the external clock includes: The modified time information is synchronized to the external clock via the integrated circuit bus channel, and the modified time information is synchronized to the internal clock via the input / output channel.

5. The time acquisition method based on a processor-driven clock module according to claim 4, characterized in that, The step of synchronizing the modified time information to the external clock via the integrated circuit bus channel includes: The modified time information is synchronized to the processor via the processor interaction interface, so that the processor writes the modified time information to the external clock based on the integrated circuit bus channel.

6. The time acquisition method based on a processor-driven clock module according to claim 1, characterized in that, The basic input / output system includes a processor interaction interface, a user interaction interface, and an operating system interaction interface; The basic input / output system detects the processor power-on through the processor interaction interface and responds to time access requests from users and / or the operating system through the user interaction interface and the operating system interaction interface.

7. The time acquisition method based on a processor-driven clock module according to claim 1, characterized in that, Identify the access type of the time access request, including: Detect whether the time access request carries time modification information; If so, the time access request is identified as a time modification type; If not, the time access request will be classified as a time acquisition type.

8. The time acquisition method based on a processor-driven clock module according to claim 1, characterized in that, The first time information and the second time information are inconsistent after the built-in clock is powered off and when the processor is powered on.

9. The time acquisition method for a processor-based clock module according to claim 1, characterized in that, The built-in clock includes a first storage space, and the external clock includes a second storage space; the stored data in the first storage space is migrated to the second storage space for storage.

10. The time acquisition method for a processor-based clock module according to claim 1, characterized in that, The baseboard management controller performs the following operations: After detecting that the preset reading period has arrived, the fourth time information of the external clock is read through the connection with the external clock; The controller time information is updated based on the fourth time information.

11. The time acquisition method based on a processor-driven clock module according to claim 1, characterized in that, The step of reading the first time information of the built-in clock and the second time information of the external clock through the processor includes: A time acquisition reminder is sent to the processor via the processor interaction interface; the processor performs the following operations: In response to the time acquisition reminder, the first time information of the built-in clock is read through the input / output channel, and the second time information of the external clock is read through the integrated circuit bus channel; The processor interaction interface transmits the first time information and the second time information to the basic input / output system.

12. The time acquisition method based on a processor-driven clock module according to claim 1, characterized in that, The method further includes: If the first time information is consistent with the second time information, the first time information is returned to the processor.

13. A time acquisition device based on a processor-driven clock module, characterized in that, Operating on a basic input / output system, the basic input / output system being connected to a processor, the processor including a built-in clock and connected to an external clock, the external clock being powered by an external battery and connected to a board management controller, the device comprising: A time information reading module is used to detect whether a time access request corresponds to the processor being powered on when a time access request is detected; if so, it reads the first time information of the built-in clock and the second time information of the external clock through the processor; and runs a time information comparison module, which compares the first time information and the second time information; if the first time information and the second time information are inconsistent, it runs a time information synchronization module, which synchronizes the second time information to the built-in clock and returns the second time information to the processor; if not, it identifies the access type of the time access request; if... The access type is time acquisition. The processor reads the third time information of the external clock and the fourth time information of the built-in clock, compares the third time information and the fourth time information. If the third time information and the fourth time information are inconsistent, the third time information is synchronized to the built-in clock and the third time information is returned to the user. If the access type is time modification, the modified time information carried in the time access request is read. The modified time information is synchronized to the built-in clock and the external clock. After the external clock modifies the clock time according to the modified time information, it synchronizes the modified time information to the baseboard management controller.

14. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor, configured to implement the steps of the time acquisition method of the processor-based clock module as described in any one of claims 1 to 12 when executing the computer program.

15. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, wherein when the computer program is executed by a processor, it implements the steps of the time acquisition method of the processor-based clock module as described in any one of claims 1 to 12.

16. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the steps of the time acquisition method of the processor-based clock module as described in any one of claims 1 to 12.

Citation Information

Patent Citations

  • Clock synchronization method and computing device

    CN119179372A

  • Time modification method, device and equipment and readable storage medium

    CN119966562A