Chip timer diagnostic method and apparatus

By calculating the processor's operating frequency at different times and utilizing the relationship between the timer and the processor's operating frequency, the problems of hardware complexity and computational complexity in existing technologies are solved, and real-time accurate diagnosis of chip timers is achieved.

CN116149968BActive Publication Date: 2026-05-05SPREADTRUM COMM (TIANJIN) INC
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SPREADTRUM COMM (TIANJIN) INC
Filing Date
2023-03-07
Publication Date
2026-05-05

AI Technical Summary

Technical Problem

Existing chip timer diagnostic methods increase hardware complexity, rely on the accuracy of the reference chip timer, and involve complex calculations, resulting in high diagnostic costs.

Method used

By calculating the processor's operating frequency at different times and utilizing the relationship between the timer and the processor's operating frequency, it is possible to determine whether the timer is running stably and achieve real-time monitoring.

Benefits of technology

Precisely determining whether the timer is running stably reduces hardware complexity and computational costs, and improves the real-time performance and accuracy of diagnostics.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116149968B_ABST
    Figure CN116149968B_ABST
Patent Text Reader

Abstract

This invention relates to the field of computer technology, and more particularly to a chip timer diagnostic method and apparatus. The method involves acquiring a first accumulated value of the timer and a second accumulated value of the processor within the current time period; determining a first duration of the current time period based on the first accumulated value and a first operating frequency of the timer; determining a second operating frequency of the processor within the current time period based on the first duration and the second accumulated value; acquiring a third operating frequency of the processor corresponding to a previous time period; and determining whether the timer is operating normally based on the second and third operating frequencies. By calculating the processor's operating frequency within different time periods based on the correspondence between the timer and the processor's operating frequencies, the method can accurately determine whether the timer is running stably, achieving a real-time monitoring effect.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer technology, and in particular to a chip timer diagnostic method and apparatus. Background Technology

[0002] Currently, many timed tasks executed by chips need to be triggered at predetermined times. Therefore, chips have internal timers to ensure that the tasks processed by the chip can be executed normally. The accuracy of the chip timer has a significant impact on the operation of the chip, and the accuracy of the chip timer often needs to be diagnosed.

[0003] Current diagnostic methods for chip timers include introducing calibration chips such as standard timers or programmable logic devices as references to monitor the chip timers. This method increases the complexity of the hardware structure, is greatly affected by the accuracy of the reference chip timer, and involves complex calculations and processing. Summary of the Invention

[0004] This invention provides a chip timer diagnostic method and apparatus. Based on the correspondence between the timer and the processor's operating frequency, the processor's operating frequency is calculated in different time periods, which can accurately determine whether the timer is running stably and achieve the effect of real-time monitoring.

[0005] In a first aspect, embodiments of the present invention provide a chip timer diagnostic method, comprising:

[0006] Get the first accumulated value of the timer in the current time period and the second accumulated value of the processor in the current time period;

[0007] Based on the first accumulated value and the first operating frequency of the timer, the first duration of the current time period is determined;

[0008] Based on the first duration and the second accumulated value, the processor's second operating frequency within the current time period is determined;

[0009] The third operating frequency of the processor in the previous time period is obtained, and the timer is determined to be in normal working condition based on the second operating frequency and the third operating frequency.

[0010] In one real-time example, acquiring the first accumulated value of the timer within the current time period and the second accumulated value of the processor within the current time period includes:

[0011] Obtain the first count value of the timer and the second count value of the processor;

[0012] Run the delay program;

[0013] After the delay program is detected to have ended, the third count value of the timer and the fourth count value of the processor are obtained.

[0014] The difference between the third count value and the first count value is determined as the first accumulated value, and the difference between the fourth count value and the second count value is determined as the second accumulated value.

[0015] In a real-time example, before acquiring the first accumulated value of the timer within the current time period and the second accumulated value of the processor within the current time period, the method further includes:

[0016] The delay program is run in a loop, and the total running time of the delay program is obtained in real time.

[0017] When the total running time is detected to be greater than the first threshold, the delay program is stopped, and the steps of obtaining the first accumulated value of the timer and the second accumulated value of the processor in the current time period are executed.

[0018] In one real-time example, determining whether the timer is in normal working condition based on the second operating frequency and the third operating frequency includes:

[0019] Determine the frequency difference between the second operating frequency and the third operating frequency;

[0020] If the frequency difference is less than the frequency threshold and the second operating frequency is greater than the preset minimum frequency, then the timer is determined to be in normal working condition.

[0021] In one real-time example, determining whether the timer is in normal working condition based on the second operating frequency and the third operating frequency includes:

[0022] If the second operating frequency is equal to the third operating frequency and the second operating frequency is greater than the preset minimum frequency, then the timer is determined to be in normal working condition.

[0023] In a real-time example, the method further includes:

[0024] If the second operating frequency is not equal to the third operating frequency, then the steps of obtaining the first accumulated value of the timer and the second accumulated value of the processor in the current time period, as well as the subsequent diagnostic process, are executed again in the next time period.

[0025] In a real-time example, the method further includes:

[0026] Set a counter, the initial value of which is zero;

[0027] After each diagnostic process is completed, the counter is incremented by one. If the value of the counter exceeds the second threshold, the next diagnostic process is not performed, and the counter is determined to be in an abnormal working state.

[0028] In a second aspect, embodiments of the present invention provide a chip timer diagnostic device, comprising:

[0029] The acquisition module is used to acquire the first accumulated value of the timer in the current time period and the second accumulated value of the processor in the current time period;

[0030] The determining module is configured to determine the first duration contained in the current time period based on the first accumulated value and the first operating frequency of the timer;

[0031] The determining module is further configured to determine the second operating frequency of the processor within the current time period based on the first duration and the second accumulated value;

[0032] The processing module is used to obtain the third operating frequency of the processor in the previous time period, and determine whether the timer is in normal working state based on the second operating frequency and the third operating frequency.

[0033] Thirdly, embodiments of the present invention provide an electronic chip, comprising:

[0034] At least one processor; and

[0035] At least one memory communicatively connected to the processor, wherein:

[0036] The memory stores program instructions, and the processor can execute the method provided in the first aspect by calling the program instructions.

[0037] Fourthly, embodiments of the present invention provide a computer-readable storage medium comprising a stored program, wherein the program, when executed by a processor, implements the method provided in the first aspect.

[0038] In this embodiment of the invention, a first accumulated value of the timer and a second accumulated value of the processor within the current time period are obtained; a first duration of the current time period is determined based on the first accumulated value and the first operating frequency of the timer; a second operating frequency of the processor within the current time period is determined based on the first duration and the second accumulated value; a third operating frequency of the processor corresponding to the previous time period is obtained, and the timer is judged to be in a normal working state based on the second and third operating frequencies. Based on the correspondence between the timer and the processor's operating frequencies, the processor's operating frequency is calculated in different time periods, which can accurately determine whether the timer is running stably, achieving the effect of real-time monitoring. Attached Figure Description

[0039] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0040] Figure 1 A flowchart of a chip timer diagnostic method provided in an embodiment of the present invention;

[0041] Figure 2 A flowchart of another chip timer diagnostic method provided in an embodiment of the present invention;

[0042] Figure 3 This is a schematic diagram of the structure of a chip timer diagnostic device provided in an embodiment of the present invention;

[0043] Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation

[0044] To better understand the technical solutions in this specification, the embodiments of the present invention will be described in detail below with reference to the accompanying drawings.

[0045] It should be understood that the described embodiments are merely some, not all, of the embodiments in this specification. All other embodiments obtained by those skilled in the art based on the embodiments in this specification without inventive effort are within the scope of protection of this specification.

[0046] The terminology used in the embodiments of this invention is for the purpose of describing particular embodiments only and is not intended to be limiting of this specification. The singular forms “a,” “the,” and “the” as used in the embodiments of this invention and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise.

[0047] To address the problems of existing timer diagnostic methods, such as high cost, complex structure, strong dependency and coupling, significant impact on the accuracy of introduced hardware structures, and complex calculation and processing, this invention provides a chip timer diagnostic method. By calculating the processor's operating frequency through the timer at different time periods, it can accurately determine whether the timer is running stably, achieving the effect of real-time monitoring.

[0048] Figure 1 This is a flowchart illustrating a chip timer diagnostic method provided in an embodiment of the present invention. This method can be applied to electronic devices configured with timers, such as personal computers and smartphones. Figure 1 As shown, the method may include:

[0049] Step 101: Obtain the first accumulated value of the timer and the second accumulated value of the processor in the current time period.

[0050] In this embodiment of the invention, the electronic device needs to monitor the timer and processor in real time and repeatedly execute a diagnostic process to determine whether the timer is in normal working condition. The time occupied by each execution of the diagnostic process can be regarded as a time period. Except for the two time periods at the beginning and end, each time period has a preceding time period and a following time period corresponding to the current time period. The timer and processor of the electronic device have their own fixed operating frequency and count value. The count value increases by one each time it operates. Therefore, the electronic device can obtain the first accumulated value of the timer and the second accumulated value of the processor in the current time period, which may include: obtaining the first count value of the timer and the second count value of the processor, then running a delay program. When the delay program is detected to have ended, the third count value of the timer and the fourth count value of the processor are obtained. The difference between the third count value and the first count value is determined as the first accumulated value, and the difference between the fourth count value and the second count value is determined as the second accumulated value. The running time of the above delay program is a fixed value and can be set in advance. The electronic device can determine the start of the current time period by the time when the first count value of the timer and the second count value of the processor are obtained, and determine the end of the current time period by the time when the delay program is detected to have ended. To make the timer's diagnosis more accurate, the duration of each run of the delay program can be reasonably set, so that the timer and processor run for a sufficiently long time to reduce the impact of random errors.

[0051] Step 102: Determine the first duration of the current time period based on the first accumulated value and the first operating frequency of the timer.

[0052] The first operating frequency of the timer is a known quantity. The electronic device divides the first accumulated value of the timer in the current time period by the first operating frequency of the timer to obtain the first duration of the current time period.

[0053] Step 103: Determine the second operating frequency of the processor in the current time period based on the first duration and the second accumulated value.

[0054] The electronic device can obtain the processor's second operating frequency within the current time period by dividing the processor's second accumulated value corresponding to the current time period by the first duration.

[0055] Step 104: Obtain the third operating frequency of the processor in the previous period, and determine whether the timer is in normal working state based on the second and third operating frequencies.

[0056] In one embodiment, the electronic device can compare the processor's second operating frequency in the current time period with the processor's third operating frequency in the previous time period. If the second operating frequency is equal to the third operating frequency and the second operating frequency is greater than a preset minimum frequency, then the timer is determined to be in a normal working state. The normal working state defined in this embodiment is that the timer can maintain stable frequency operation for a long period. If the electronic device detects that the second operating frequency and the third operating frequency are not equal, it will again execute the steps of obtaining the timer's first accumulated value and the processor's second accumulated value in the current time period, as well as the subsequent diagnostic process, in the next time period. Using the next time period as a reference point, the current time period becomes the previous time period, and the diagnostic process is repeated. If the processor's operating frequency in the next time period is still not equal to the second operating frequency in the current time period, the diagnostic process is repeated again. To avoid infinite single measurements, a maximum monitoring duration is set to limit the single detection duration. If the single detection duration exceeds the maximum detection duration, the entire diagnostic process is exited, and the timer is determined to be in an abnormal working state. Specifically, the electronic device can be set with a counter. The initial value of the counter is zero. After each diagnostic process is completed, the counter is incremented by one. If the value of the counter exceeds the second threshold, the electronic device will not perform the next diagnostic process and will determine that the counter is in an abnormal working state.

[0057] In one embodiment, considering that the processor is not yet in a stable operating state immediately after the electronic device is powered on, executing the above diagnostic process immediately may result in significant errors. To address this issue, the electronic device can run a delay program for a certain period after power-on (before acquiring the first and second accumulated values), and then execute the diagnostic process after a preset duration. Specifically, the electronic device can run the delay program cyclically and acquire the total running time of the delay program in real time. When the total running time is detected to be greater than a first threshold, the delay program is stopped, and the steps of acquiring the first accumulated value of the timer and the second accumulated value of the processor in the current time period are executed. The electronic device can run the delay program at any time before executing the diagnostic process, and this time is determined as the starting point. After each run of the delay program, the difference between the current time and the starting point is determined as the total running time. If the total running time is greater than the first threshold, the loop is exited and the diagnostic process is executed; otherwise, the delay program continues to run. After the total running time exceeds the first threshold, the processor has usually passed the boot-up phase and its operating frequency is relatively stable. This step will only be performed once before the diagnostic process is executed to ensure that the processor is in a stable working state when the electronic device performs the diagnostic process.

[0058] In one embodiment, considering the impact of errors, the specific steps for the electronic device to determine whether the timer is in normal working condition based on the second operating frequency and the third operating frequency may further include: determining the frequency difference between the second operating frequency and the third operating frequency; if the frequency difference is detected to be less than a frequency threshold and the second operating frequency is greater than a preset minimum frequency, then the timer is determined to be in normal working condition. If the difference in the processor's operating frequency between two adjacent time periods is very small, it can also be determined that the timer is in normal working condition.

[0059] In this embodiment of the invention, the electronic device calculates the processor's operating frequency through a timer at different time periods, which can accurately determine whether the timer is running stably and achieve the effect of real-time monitoring.

[0060] Figure 2 A flowchart illustrating another chip timer diagnostic method provided in an embodiment of the present invention. Figure 2 As shown, the method may include:

[0061] Step 201: Obtain the first count value and the second count value, and obtain the number of loops in real time.

[0062] The electronic device acquires a first count value from a timer and a second count value from a processor; these two values ​​are the initial values ​​for the timer and the processor, respectively. The electronic device can use the moment when the first and second count values ​​are acquired as the starting point of the current time period.

[0063] Step 202: Run the delay program.

[0064] Step 203: Obtain the third and fourth count values.

[0065] After the delay program finishes running, the count values ​​inside the timer and processor have changed. The electronic device obtains the third count value of the timer at the current moment and the fourth count value of the processor at the current moment. The current moment is the end of the current time period.

[0066] Step 204: Calculate the processor's second operating frequency for the current time period.

[0067] The electronic device subtracts the third count value from the first count value to obtain the first accumulated value, and subtracts the fourth count value from the second count value to obtain the second accumulated value. Dividing the first accumulated value by the first operating frequency of the timer yields the first duration, and dividing the second accumulated value by the first duration yields the second operating frequency of the processor in the current time period.

[0068] Step 205: Determine whether the second operating frequency is equal to the third operating frequency.

[0069] The third operating frequency is the processor's operating frequency in the previous period. The two are compared. If they are equal, proceed to step 206; otherwise, proceed to step 207.

[0070] Step 206: Confirm that the timer is in normal working condition.

[0071] If the processor's operating frequency calculated based on the timer is equal in two adjacent time periods, it can be determined that the timer is working stably for a long time and is in normal working condition.

[0072] Step 207: Determine whether the value of the counter exceeds the second threshold.

[0073] To avoid infinite single measurements, electronic devices can be set to use a counter, which increments by one each time period during a diagnostic process.

[0074] Step 208: Determine that the timer is in an abnormal operating state.

[0075] If the counter value exceeds the second threshold, it indicates that after multiple diagnostic processes, the conditions for the timer to be in normal working condition cannot be met, and the electronic device can determine that the timer is in an abnormal working condition.

[0076] Step 209, update the third operating frequency.

[0077] If the counter value does not exceed the second threshold, the electronic device needs to update the third operating frequency, that is, replace the third operating frequency with the second operating frequency of the current time period, return to step 201, and execute the diagnostic process again in the next time period. In specific calculations, the electronic device can use the third and fourth count values ​​of the current time period as the initial values ​​of the next time period, that is, the first count value and the second count value, respectively, and the end of the current time period is the start of the next time period.

[0078] Figure 3 This is a schematic diagram of a chip timer diagnostic device provided in an embodiment of the present invention. This device can be used as a specific equipment to implement the chip timer diagnostic method provided in the embodiment of the present invention, such as… Figure 3 As shown, the device may include: an acquisition module 310, a determination module 320, and a processing module 330.

[0079] The acquisition module 310 is used to acquire the first accumulated value of the timer in the current time period and the second accumulated value of the processor in the current time period.

[0080] The determining module 320 is used to determine the first duration of the current time period based on the first accumulated value and the first operating frequency of the timer.

[0081] The determining module 320 is also used to determine the second operating frequency of the processor in the current time period based on the first duration and the second accumulated value.

[0082] The processing module 330 is used to obtain the third operating frequency of the processor in the previous period and determine whether the timer is in normal working state based on the second operating frequency and the third operating frequency.

[0083] Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Figure 4 The electronic device shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of the present invention.

[0084] like Figure 4 As shown, the electronic device is represented in the form of a general-purpose computing device. The components of the electronic device may include, but are not limited to: one or more processors 410, memory 430, and communication bus 440 connecting different system components (including memory 430 and processor 410).

[0085] Communication bus 440 represents one or more of several bus architectures, including a memory bus or memory controller, peripheral bus, graphics acceleration port, processor, or local bus using any of the various bus architectures. Examples of these architectures include, but are not limited to, Industry Standard Architecture (ISA) buses, Micro Channel Architecture (MAC) buses, Enhanced ISA buses, Video Electronics Standards Association (VESA) local buses, and Peripheral Component Interconnect (PCI) buses.

[0086] Electronic devices typically include a variety of computer-readable media. These media can be any available media that can be accessed by the electronic device, including volatile and non-volatile media, and removable and non-removable media.

[0087] Memory 430 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) and / or cache memory. The electronic device may further include other removable / non-removable, volatile / non-volatile computer system storage media. Although Figure 4Not shown, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk") and an optical disc drive for reading and writing to a removable non-volatile optical disc (e.g., a compact disc read-only memory (CD-ROM), a digital video disc read-only memory (DVD-ROM), or other optical media) may be provided. In these cases, each drive may be connected to the communication bus 440 via one or more data media interfaces. The memory 430 may include at least one program product having a set (e.g., at least one) of program modules configured to perform the functions of the embodiments of the present invention.

[0088] A program / utility having a set (at least one) of program modules can be stored in memory 430. Such program modules include—but are not limited to—an operating system, one or more application programs, other program modules, and program data. Each or some combination of these examples may include an implementation of a network environment. The program modules typically perform the functions and / or methods described in the embodiments of the present invention.

[0089] The electronic device can also communicate with one or more external devices, one or more devices that enable a user to interact with the electronic device, or any device that enables the electronic device to communicate with one or more other computing devices (e.g., network interface card, modem, etc.). This communication can be performed through communication interface 420. Furthermore, the electronic device can also communicate through a network adapter (…). Figure 4 (Not shown) communicates with one or more networks (e.g., Local Area Network (LAN), Wide Area Network (WAN), and / or public networks, such as the Internet). The aforementioned network adapter can communicate with other modules of the electronic device via communication bus 440. It should be understood that, although... Figure 4 Not shown, other hardware and / or software modules can be used in conjunction with electronic devices, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, disk arrays (Redundant Arrays of Independent Drives; hereinafter referred to as RAID) systems, tape drives, and data backup storage systems.

[0090] The processor 410 executes various functional applications and data processing by running programs stored in the memory 430, such as implementing the chip timer diagnostic method provided in the embodiments of the present invention.

[0091] This invention also provides a computer-readable storage medium storing computer instructions that cause the computer to execute the chip timer diagnostic method provided in this invention.

[0092] The aforementioned computer-readable storage medium may be any combination of one or more computer-readable media. A computer-readable medium may be a computer-readable signal medium or a computer-readable storage medium. A computer-readable storage medium may be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of computer-readable storage media (a non-exhaustive list) include: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), or flash memory, optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this document, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in connection with an instruction execution system, apparatus, or device.

[0093] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals may take various forms, including—but not limited to—electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, capable of transmitting, propagating, or transmitting programs for use by or in connection with an instruction execution system, apparatus, or device.

[0094] The program code contained on a computer-readable medium may be transmitted using any suitable medium, including—but not limited to—wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.

[0095] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the present invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.

[0096] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this invention, "a plurality of" means at least two, such as two, three, etc., unless otherwise explicitly specified.

[0097] Any process or method description in the flowchart or otherwise herein can be understood as representing a module, segment, or portion of code comprising one or more executable instructions for implementing custom logic functions or processes, and the scope of preferred embodiments of the invention includes additional implementations in which functions may be performed not in the order shown or discussed, including substantially simultaneously or in reverse order depending on the functions involved, as should be understood by those skilled in the art to which embodiments of the invention pertain.

[0098] In the embodiments provided by this invention, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.

[0099] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or in the form of hardware plus software functional units.

[0100] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A chip timer diagnostic method, characterized in that, include: Get the first accumulated value of the timer in the current time period and the second accumulated value of the processor in the current time period; Based on the first accumulated value and the first operating frequency of the timer, the first duration of the current time period is determined; Based on the first duration and the second accumulated value, the processor's second operating frequency within the current time period is determined; Obtain the third operating frequency of the processor in the previous time period, and determine whether the timer is in normal working state based on the second operating frequency and the third operating frequency; The acquisition of the first accumulated value of the timer and the second accumulated value of the processor within the current time period includes: Obtain the first count value of the timer and the second count value of the processor; Run the delay program; After the delay program is detected to have ended, the third count value of the timer and the fourth count value of the processor are obtained. The difference between the third count value and the first count value is determined as the first accumulated value, and the difference between the fourth count value and the second count value is determined as the second accumulated value.

2. The method according to claim 1, characterized in that, Before acquiring the first accumulated value of the timer within the current time period and the second accumulated value of the processor within the current time period, the method further includes: The delay program is run in a loop, and the total running time of the delay program is obtained in real time. When the total running time is detected to be greater than the first threshold, the delay program is stopped, and the steps of obtaining the first accumulated value of the timer and the second accumulated value of the processor in the current time period are executed.

3. The method according to claim 1, characterized in that, The step of determining whether the timer is in normal working condition based on the second operating frequency and the third operating frequency includes: Determine the frequency difference between the second operating frequency and the third operating frequency; If the frequency difference is less than the frequency threshold and the second operating frequency is greater than the preset minimum frequency, then the timer is determined to be in normal working condition.

4. The method according to claim 1, characterized in that, The step of determining whether the timer is in normal working condition based on the second operating frequency and the third operating frequency includes: If the second operating frequency is equal to the third operating frequency and the second operating frequency is greater than the preset minimum frequency, then the timer is determined to be in normal working condition.

5. The method according to claim 4, characterized in that, The method further includes: If the second operating frequency is not equal to the third operating frequency, then the steps of obtaining the first accumulated value of the timer and the second accumulated value of the processor in the current time period, as well as the subsequent diagnostic process, are executed again in the next time period.

6. The method according to claim 5, characterized in that, The method further includes: Set a counter, the initial value of which is zero; After each diagnostic process is completed, the counter is incremented by one. If the value of the counter exceeds the second threshold, the next diagnostic process is not performed, and the counter is determined to be in an abnormal working state.

7. A chip timer diagnostic device, characterized in that, include: The acquisition module is used to acquire the first accumulated value of the timer in the current time period and the second accumulated value of the processor in the current time period; The determining module is configured to determine the first duration contained in the current time period based on the first accumulated value and the first operating frequency of the timer; The determining module is further configured to determine the second operating frequency of the processor within the current time period based on the first duration and the second accumulated value; The processing module is used to obtain the third operating frequency of the processor in the previous period, and to determine whether the timer is in normal working state based on the second operating frequency and the third operating frequency. The acquisition module is used to acquire the first count value of the timer and the second count value of the processor; The processing module is used to run a delay program; after detecting that the delay program has ended, it obtains the third count value of the timer and the fourth count value of the processor; the difference between the third count value and the first count value is determined as the first accumulated value, and the difference between the fourth count value and the second count value is determined as the second accumulated value.

8. An electronic device, characterized in that, include: At least one processor; as well as At least one memory communicatively connected to the processor, wherein: The memory stores program instructions, and the processor invokes the program instructions to execute the method as described in any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored program, wherein the program, when executed by a processor, implements the method as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Clock backup method and clock backup device

    CN101840357A

  • Controller clock frequency detection method and device, computer equipment and storage medium

    CN111736570A