CN108958092B - Singlechip clock anomaly detection method and device, computer readable storage medium and equipment - Google Patents
Singlechip clock anomaly detection method and device, computer readable storage medium and equipment Download PDFInfo
- Publication number
- CN108958092B CN108958092B CN201710382047.2A CN201710382047A CN108958092B CN 108958092 B CN108958092 B CN 108958092B CN 201710382047 A CN201710382047 A CN 201710382047A CN 108958092 B CN108958092 B CN 108958092B
- Authority
- CN
- China
- Prior art keywords
- clock
- preset
- single chip
- chip microcomputer
- communication signal
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000001514 detection method Methods 0.000 title claims description 16
- 238000004891 communication Methods 0.000 claims abstract description 73
- 238000005070 sampling Methods 0.000 claims abstract description 71
- 238000000034 method Methods 0.000 claims abstract description 44
- 230000005856 abnormality Effects 0.000 claims abstract description 35
- 230000002159 abnormal effect Effects 0.000 claims abstract description 29
- 230000010355 oscillation Effects 0.000 claims description 39
- 238000004590 computer program Methods 0.000 claims description 10
- 230000000630 rising effect Effects 0.000 claims description 6
- 230000005540 biological transmission Effects 0.000 claims description 5
- 238000004364 calculation method Methods 0.000 claims description 5
- 238000010586 diagram Methods 0.000 description 6
- 238000009413 insulation Methods 0.000 description 4
- 230000000694 effects Effects 0.000 description 2
- 238000006467 substitution reaction Methods 0.000 description 2
- 230000002547 anomalous effect Effects 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 239000000919 ceramic Substances 0.000 description 1
- 238000006243 chemical reaction Methods 0.000 description 1
- 239000013078 crystal Substances 0.000 description 1
- 230000006870 function Effects 0.000 description 1
- 238000005259 measurement Methods 0.000 description 1
- 230000002093 peripheral effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G05—CONTROLLING; REGULATING
- G05B—CONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
- G05B19/00—Programme-control systems
- G05B19/02—Programme-control systems electric
- G05B19/04—Programme control other than numerical control, i.e. in sequence controllers or logic controllers
- G05B19/042—Programme control other than numerical control, i.e. in sequence controllers or logic controllers using digital processors
- G05B19/0428—Safety, monitoring
-
- G—PHYSICS
- G05—CONTROLLING; REGULATING
- G05B—CONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
- G05B19/00—Programme-control systems
- G05B19/02—Programme-control systems electric
- G05B19/04—Programme control other than numerical control, i.e. in sequence controllers or logic controllers
- G05B19/048—Monitoring; Safety
-
- G—PHYSICS
- G05—CONTROLLING; REGULATING
- G05B—CONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
- G05B2219/00—Program-control systems
- G05B2219/20—Pc systems
- G05B2219/24—Pc safety
- G05B2219/24002—Clock failing, adaptive to clock
-
- G—PHYSICS
- G05—CONTROLLING; REGULATING
- G05B—CONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
- G05B2219/00—Program-control systems
- G05B2219/20—Pc systems
- G05B2219/25—Pc structure of the system
- G05B2219/25039—Clock
Landscapes
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Engineering & Computer Science (AREA)
- Automation & Control Theory (AREA)
- Manipulation Of Pulses (AREA)
Abstract
The invention relates to a method and a device for detecting clock abnormality of a single chip microcomputer, a computer readable storage medium and equipment, wherein the method comprises the steps of obtaining a communication signal between the single chip microcomputer and preset equipment; judging whether the deviation of the time interval of the adjacent sampling points in the acquired communication signal and a preset sampling period is greater than a preset threshold value: if the clock frequency is larger than the preset frequency, the clock of the single chip microcomputer is abnormal; the apparatus, computer readable storage medium, device may perform the steps of the above method. Compared with the prior art, the method and the device for detecting the clock abnormity of the single chip microcomputer, the computer readable storage medium and the computer equipment can accurately detect whether the clock of the single chip microcomputer is abnormal or not, meanwhile, external circuits such as an independent clock reference circuit and the like are not needed to be arranged, and the cost of the single chip microcomputer is reduced.
Description
Technical Field
The invention relates to the technical field of single chip microcomputer control, in particular to a method and a device for detecting clock abnormity of a single chip microcomputer, a computer readable storage medium and computer readable storage equipment.
Background
The single chip microcomputer needs clock support in operation, and if a clock circuit is not used for generating a clock to drive the single chip microcomputer, the single chip microcomputer cannot execute programs, so that the single chip microcomputer can be regarded as a sequential logic circuit under the clock drive. At present, the following two methods can be adopted to detect whether the clock circuit of the single chip microcomputer is abnormal, specifically: the first is that: an external clock circuit, such as a crystal oscillator or a ceramic oscillator, is used for comparing with the clock circuit in the single chip microcomputer, and when the error between the two exceeds a certain range, the abnormality of the clock circuit in the single chip microcomputer can be judged. Secondly, the method comprises the following steps: and comparing the singlechip clock circuit with the commercial power frequency, and judging that the clock circuit in the singlechip is abnormal when the error between the singlechip clock circuit and the commercial power frequency exceeds a certain range. However, the two detection modes both need to be provided with additional circuit structures, such as an external clock circuit and a mains supply detection circuit, so that the design cost and the application cost of the single chip microcomputer are increased. Meanwhile, insulation protection is needed when the second detection mode is adopted.
Disclosure of Invention
In order to solve the above problems in the prior art, that is, to solve the technical problem that the single chip microcomputer needs to rely on a peripheral circuit to detect whether the clock is abnormal, the invention provides a method and an apparatus for detecting the clock abnormality of the single chip microcomputer, a computer-readable storage medium, and a computer-readable device.
In a first aspect, the invention provides a method for detecting clock abnormality of a single chip microcomputer, which comprises the following steps:
the method comprises the following steps:
acquiring a communication signal between the singlechip and preset equipment;
judging whether the deviation of the time interval of the adjacent sampling points in the acquired communication signal and a preset sampling period is greater than a preset threshold value: if the clock value is larger than the preset value, the clock of the single chip microcomputer is abnormal.
Further, a preferred technical solution provided by the present invention is:
the communication signal is a signal based on clock synchronization or a signal not based on clock synchronization.
Further, a preferred technical solution provided by the present invention is:
the method further comprises the following steps:
acquiring oscillation deviation of the clock of the single chip microcomputer;
comparing the obtained oscillation deviation with a preset oscillation deviation threshold: and if the obtained oscillation deviation is larger than the preset oscillation deviation threshold value, the clock of the single chip microcomputer is abnormal.
Further, a preferred technical solution provided by the present invention is:
the preset oscillation deviation threshold k is as follows:
wherein, terr is the clock error time, and Tbyte is the preset transmission time of one byte in the communication signal;
the method for determining the clock error time Terr comprises the following steps:
and when the deviation between the time interval of adjacent sampling points in the acquired communication signal and the preset sampling period is greater than a preset threshold value, setting the clock error time as the time length between the rising edge of the sampling level in the communication signal and the preset sampling point.
In a second aspect, the invention provides a technical solution of a device for detecting clock abnormality of a single chip microcomputer, comprising:
the device comprises:
the first signal acquisition module is configured to acquire a communication signal between the single chip microcomputer and preset equipment;
the first signal judgment module is configured to judge whether the deviation between the time interval of adjacent sampling points in the acquired communication signal and a preset sampling period is greater than a preset threshold value: if the clock value is larger than the preset value, the clock of the single chip microcomputer is abnormal.
Further, a preferred technical solution provided by the present invention is:
the communication signal is a signal based on clock synchronization or a signal not based on clock synchronization.
Further, a preferred technical solution provided by the present invention is:
the device further comprises:
the second signal acquisition module is configured to acquire the oscillation deviation of the clock of the single chip microcomputer;
a second signal determination module configured to compare the obtained oscillation deviation with a preset oscillation deviation threshold: and if the obtained oscillation deviation is larger than the preset oscillation deviation threshold value, the clock of the single chip microcomputer is abnormal.
Further, a preferred technical scheme provided by the invention is as follows:
the second signal judgment module comprises a preset oscillation deviation threshold model k shown as the following formula:
wherein, terr is the clock error time, and Tbyte is the preset transmission time of one byte in the communication signal;
the second signal judgment module also comprises a clock error time calculation module; the clock error time calculation module is configured to set the clock error time as a time length between a rising edge of a sampling level in the communication signal and a preset sampling point when a deviation between a time interval of adjacent sampling points in the acquired communication signal and a preset sampling period is larger than a preset threshold value.
In a third aspect, a technical solution of a computer-readable storage medium in the present invention is:
the computer readable storage medium stores a computer program, and the program is suitable for being loaded and executed by a processor to realize each step in the method for detecting the clock abnormality of the single chip microcomputer.
In a fourth aspect, a technical solution of a computer device in the present invention is:
the computer device comprises a memory, a processor and a computer program which is stored on the memory and can run on the processor, and when the processor executes the program, each step in the singlechip clock abnormity detection method in the technical scheme is realized.
Compared with the prior art, the technical scheme at least has the following beneficial effects:
1. according to the method for detecting the clock abnormity of the single chip microcomputer, whether the clock of the single chip microcomputer is abnormal or not can be judged according to the communication signals of the single chip microcomputer and the preset equipment, a separate external clock circuit or detection circuit is not required to be arranged, and the cost of the single chip microcomputer is reduced.
2. According to the method for detecting the clock abnormity of the single chip microcomputer, the first signal judgment module can judge whether the clock of the single chip microcomputer is abnormal or not according to the communication signals of the single chip microcomputer and the preset equipment, a separate external clock circuit or detection circuit is not required to be arranged, and the cost of the single chip microcomputer is reduced.
3. The computer readable storage medium stores a computer program, and the program can be applied to be loaded and executed by a processor to realize each step in the single chip microcomputer clock abnormality detection method according to the technical scheme.
4. When the processor of the computer device provided by the invention executes the computer program stored in the memory, the steps of the method for detecting the clock abnormality of the single chip microcomputer in the technical scheme can be realized.
Drawings
FIG. 1 is a flow chart of an embodiment of a method for detecting clock abnormality of a single chip microcomputer;
FIG. 2 is a schematic structural diagram of a device for detecting clock abnormality of a single chip microcomputer according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of the communication of the single chip microcomputer in the embodiment of the invention;
FIG. 4 is a schematic diagram of sampling points of communication signals according to an embodiment of the present invention;
FIG. 5 is a diagram illustrating a normal sampling of a byte in a communication signal according to an embodiment of the present invention;
FIG. 6 is a schematic diagram illustrating an anomalous sampling of a byte in a communication signal according to an embodiment of the present invention;
FIG. 7 is a schematic diagram illustrating an abnormal sampling of a byte in another communication signal according to an embodiment of the present invention;
wherein, 11: a first signal acquisition module; 12: a first signal judgment module; 21: a first single chip microcomputer; 22: and the second singlechip is connected with the first singlechip.
Detailed Description
Preferred embodiments of the present invention are described below with reference to the accompanying drawings. It should be understood by those skilled in the art that these embodiments are only for explaining the technical principle of the present invention, and are not intended to limit the scope of the present invention.
The singlechip can adopt an external clock circuit as a reference clock, and the external clock circuit has higher calibration precision, but the cost of the singlechip is correspondingly increased. Furthermore, the single chip microcomputer can also perform clock calibration by comparing with the commercial power frequency, but the calibration method needs to arrange commercial power detection circuits, such as a zero-crossing detection circuit, an a/D conversion circuit, a voltage measurement circuit and the like, in a control board of the single chip microcomputer, so that not only is the cost of the single chip microcomputer increased, but also the non-isolated sampling circuit needs to be reinforced for insulation or double insulation protection. Based on the clock detection method, the clock detection method using the communication signal of the single chip microcomputer as the criterion does not need to be provided with an independent external clock circuit and a mains supply detection circuit, and meanwhile, because the voltage of the communication signal is the same as the power supply property of the single chip microcomputer, insulation protection is not needed.
The following describes a method for detecting clock abnormality of a single chip according to the present invention with reference to the accompanying drawings.
Fig. 1 exemplarily shows an implementation flow of a method for detecting a clock abnormality of a single chip microcomputer in this embodiment, as shown in the figure, the method for detecting a clock abnormality of a single chip microcomputer in this embodiment may include the following steps:
step S101: and acquiring a communication signal between the singlechip and the preset equipment.
The preset device in this embodiment refers to a device that can be configured to communicate with a single chip, and the device may be a single chip or other configurable electronic device. Meanwhile, the communication mode between the single chip microcomputer and the preset device can be a communication mode adopting a clock synchronization signal line, such as an I2C bus communication mode, or a communication mode not adopting a clock synchronization signal line, such as a serial asynchronous communication mode. Correspondingly, the acquired communication signal between the single chip microcomputer and the preset device can be a signal based on clock synchronization or a signal not based on clock synchronization.
Step S102: judging whether the deviation of the time interval of the adjacent sampling points in the acquired communication signal and the preset sampling period is greater than a preset threshold value: if the clock value is larger than the preset value, the clock of the single chip microcomputer is abnormal.
In this embodiment, the sampling points refer to sampling points of each bit included in one byte of the communication signal, and the bits included in one byte may be a start bit, a data bit, and a stop bit. When the clock of the single chip microcomputer is normal, the deviation between the time interval between two adjacent sampling points in the communication signal and the preset sampling period is smaller than a preset threshold value, and when the deviation between the time interval between the adjacent sampling points and the preset sampling period is larger than the preset threshold value, the sampling points exceed corresponding bits or do not reach the corresponding bits, so that mis-sampling is caused, and data acquisition errors occur to bytes where the mis-sampled bits are located, namely, communication is abnormal. Meanwhile, the sampling point in the communication signal takes the singlechip clock as a time reference, so that the singlechip clock can be judged to be abnormal under the condition of abnormal communication.
The following describes a method for detecting clock abnormality of a single chip microcomputer in this embodiment by taking a communication signal between two single chip microcomputers as an example.
Fig. 3 exemplarily shows two singlechips in a communication state in this embodiment, as shown in the figure, in this embodiment, the first singlechip 21 and the second singlechip 22 adopt UART serial communication, and the baud rate of the UART serial communication is 9600, and the level width Tm of one bit of one byte in the communication signal is as shown in the following equation (1):
meanwhile, if a byte in the communication signal is set to include a start bit, 8 data bits and a stop bit, the transmission time Tbyte of a byte in the communication signal is as shown in the following formula (2):
Tbyte=Tm×10≈1.04ms (2)
fig. 4 exemplarily shows sampling points of the communication signal in the present embodiment, as shown in the figure, the level width Tm =104 μ s of one bit of one byte of the communication signal in the present embodiment, and the sampling points are middle time points of the level width Tm.
Fig. 5 illustrates a normal sampling of one byte in the communication signal in the present embodiment, and as shown in the figure, each sampling point in the present embodiment is an intermediate time of the level width Tm of each bit in the byte.
Fig. 6 exemplarily shows abnormal sampling of one byte in a communication signal in this embodiment, as shown in the figure, it is set in this embodiment that an abnormality occurs when a clock of a single chip microcomputer at a fourth sampling point of the byte, the fourth sampling point is not a middle time of a level width Tm of a corresponding bit thereof and exceeds the middle time, so that a deviation of a time interval between the third sampling point and the fourth sampling point from a preset sampling period is greater than a preset threshold, which causes a tenth sampling point of the byte to exceed the corresponding bit, and as shown in an area marked by a coil in fig. 6, the bit cannot be correctly sampled, that is, communication abnormality.
Fig. 7 exemplarily shows abnormal sampling of a byte in another communication signal in this embodiment, as shown in the figure, in this embodiment, it is set that an abnormality occurs when a single chip microcomputer clock is at a fourth sampling point of the byte, the fourth sampling point is not a middle time of a level width Tm of a corresponding bit thereof and is smaller than the middle time, so that a deviation between a time interval between the third sampling point and the fourth sampling point and a preset sampling period is greater than a preset threshold, which causes that a tenth sampling point of the byte does not reach the corresponding bit thereof, and as an area marked by a coil in fig. 7, the bit cannot be correctly sampled, that is, communication is abnormal.
Further, based on the communication signal determination condition described in the foregoing embodiment of the method for detecting a clock abnormality of a single chip microcomputer, this embodiment further provides an embodiment of a preferable method for detecting a clock abnormality of a single chip microcomputer, which specifically includes:
step S201: and acquiring the oscillation deviation of the clock of the singlechip.
Step S202: comparing the obtained oscillation deviation with a preset oscillation deviation threshold: and if the obtained oscillation deviation is larger than a preset oscillation deviation threshold value, the clock of the single chip microcomputer is abnormal.
The preset oscillation deviation threshold k in this embodiment is shown in the following formula (3):
the meaning of the parameter Terr in the formula (3) is the clock error time, and specifically, the clock error time Terr may be determined according to the following method in this embodiment:
and when the deviation between the time interval of adjacent sampling points in the acquired communication signal and the preset sampling period is greater than a preset threshold value, setting the clock error time as the time length between the rising edge of the sampling level in the communication signal and the preset sampling point. For example, the preset sampling point in the communication signal of the first and second singlechips 21 and 22 shown in fig. 3 is the middle time of the level width Tm of one bit of one byte of the communication signal, so that the clock error time Terr =52 μ s can be obtained.
Further, it can be obtained that the oscillation deviation threshold k =5% preset in the present embodiment is when the communication signal is abnormal. Therefore, when the oscillation deviation of the singlechip clock exceeds 5%, the singlechip clock can be judged to be abnormal.
In the embodiment, the oscillation deviation of the single chip microcomputer clock is taken as a criterion, so that the operability of the abnormal detection of the single chip microcomputer clock is improved.
Although the foregoing embodiments describe the steps in the above sequential order, those skilled in the art will understand that, in order to achieve the effect of the present embodiments, the steps may not be executed in such an order, and may be executed simultaneously (in parallel) or in an inverse order, and these simple variations are within the scope of the present invention.
Based on the same technical concept as the method embodiment, the embodiment of the invention also provides a device for detecting the clock abnormity of the single chip microcomputer. The following describes the device for detecting clock abnormality of a single chip microcomputer in detail with reference to the accompanying drawings.
Fig. 2 exemplarily shows a structure of the apparatus for detecting a clock abnormality of a single chip in the present embodiment, and as shown in the figure, the apparatus for detecting a clock abnormality of a single chip in the present embodiment may include a first signal acquiring module 11 and a first signal judging module 12. The first signal obtaining module 11 may be configured to obtain a communication signal between the single chip microcomputer and a preset device. The first signal determining module 12 may be configured to determine whether a deviation between a time interval of adjacent sampling points in the acquired communication signal and a preset sampling period is greater than a preset threshold: if the clock value is larger than the preset value, the clock of the single chip microcomputer is abnormal.
Specifically, the communication signal in this embodiment is a signal based on clock synchronization or a signal not based on clock synchronization.
Further, the apparatus for detecting clock abnormality of a chip in this embodiment may further include the following structure, specifically:
the apparatus for detecting clock abnormality of a chip computer in this embodiment may further include a second signal acquiring module and a second signal determining module. The second signal acquisition module can be configured to acquire oscillation deviation of the clock of the single chip microcomputer. The second signal determination module may be configured to compare the obtained oscillation deviation with a preset oscillation deviation threshold: and if the obtained oscillation deviation is larger than the preset oscillation deviation threshold value, the clock of the single chip microcomputer is abnormal.
Meanwhile, the second signal determining module in this embodiment further includes a preset oscillation deviation threshold model k as shown in formula (3), and a clock error time calculating module. The clock error time calculation module may be configured to set the clock error time as a time length between a rising edge of a sampling level in the communication signal and a preset sampling point when a deviation of a time interval of adjacent sampling points in the acquired communication signal from the preset sampling period is greater than a preset threshold.
The above-mentioned embodiment of the apparatus for detecting clock abnormality of a single chip microcomputer can be used to implement the above-mentioned embodiment of the method for detecting clock abnormality of a single chip microcomputer, and the technical principle, the technical problems solved and the technical effects produced are similar, and it can be clearly understood by those skilled in the art that for convenience and conciseness of description, the specific working process and the related description of the above-mentioned described embodiment of the method for detecting clock abnormality of a single chip microcomputer can refer to the corresponding process in the above-mentioned embodiment of the method for detecting clock abnormality of a single chip microcomputer, and will not be described herein again.
Those skilled in the art will appreciate that the above-mentioned apparatus for detecting clock abnormality of a single chip microcomputer further includes some other known structures, such as a processor, a controller, a memory, etc., wherein the memory includes, but is not limited to, a random access memory, a flash memory, a read only memory, a programmable read only memory, a volatile memory, a non-volatile memory, a serial memory, a parallel memory or a register, etc., and the processor includes, but is not limited to, a CPLD/FPGA, a DSP, an ARM processor, a MIPS processor, etc., and these known structures are not shown in fig. 2 in order to unnecessarily obscure the embodiments of the present disclosure.
It should be understood that the number of individual modules in fig. 2 is merely illustrative. The number of modules may be any according to actual needs.
Those skilled in the art will appreciate that the modules in the device in an embodiment may be adaptively changed and disposed in one or more devices different from the embodiment. The modules or units or components of the embodiments may be combined into one module or unit or component, and furthermore they may be divided into a plurality of sub-modules or sub-units or sub-components. All of the features disclosed in this specification (including any accompanying claims, abstract and drawings), and all of the processes or elements of any method or apparatus so disclosed, may be combined in any combination, except combinations where at least some of such features and/or processes or elements are mutually exclusive. Each feature disclosed in this specification (including any accompanying claims, abstract and drawings) may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise.
Various component embodiments of the invention may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. Those skilled in the art will appreciate that a microprocessor or Digital Signal Processor (DSP) may be used in practice to implement some or all of the functions of some or all of the components in a server, client, or the like, in accordance with embodiments of the present invention. The present invention may also be embodied as an apparatus or device program (e.g., PC program and PC program product) for carrying out a portion or all of the methods described herein. Such a program implementing the invention may be stored on a PC readable medium or may be in the form of one or more signals. Such a signal may be downloaded from an internet website, or provided on a carrier signal, or provided in any other form.
Based on the above embodiment of the method for detecting clock abnormality of a single chip, the present invention further provides a computer readable storage medium, in which a computer program may be stored. Meanwhile, the computer program can be suitable for being loaded and executed by a processor to realize the steps in the method for detecting the clock abnormality of the single chip microcomputer.
Based on the above embodiment of the method for detecting clock abnormality of a single chip, the present invention further provides a computer device, which may include a memory, a processor, and a computer program stored in the memory and operable on the processor. Meanwhile, when the processor executes a computer program, the steps in the method for detecting the clock abnormality of the single chip microcomputer can be realized.
Furthermore, those skilled in the art will appreciate that while some embodiments described herein include some features included in other embodiments, rather than other features, combinations of features of different embodiments are meant to be within the scope of the invention and form different embodiments. For example, in the claims of the present invention, any of the claimed embodiments may be used in any combination.
It should be noted that the above-mentioned embodiments illustrate rather than limit the invention, and that those skilled in the art will be able to design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention may be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed PC. In the unit claims enumerating several means, several of these means may be embodied by one and the same item of hardware. The usage of the words first, second and third, etcetera do not indicate any ordering. These words may be interpreted as names.
So far, the technical solutions of the present invention have been described in connection with the preferred embodiments shown in the drawings, but it is easily understood by those skilled in the art that the scope of the present invention is obviously not limited to these specific embodiments. Equivalent changes or substitutions of related technical features can be made by those skilled in the art without departing from the principle of the invention, and the technical scheme after the changes or substitutions can fall into the protection scope of the invention.
Claims (4)
1. A method for detecting clock abnormity of a single chip microcomputer is characterized by comprising the following steps:
acquiring a communication signal between the singlechip and preset equipment; the communication signal is a signal based on clock synchronization or a signal not based on clock synchronization;
judging whether the deviation of the time interval of the adjacent sampling points in the acquired communication signal and the preset sampling period is greater than a preset threshold value: if the clock frequency is larger than the preset frequency, the clock of the single chip microcomputer is abnormal;
the method further comprises the following steps:
acquiring oscillation deviation of the clock of the single chip microcomputer;
comparing the obtained oscillation deviation with a preset oscillation deviation threshold: if the obtained oscillation deviation is larger than the preset oscillation deviation threshold value, the clock of the single chip microcomputer is abnormal;
the preset oscillation deviation threshold k is as follows:
wherein Terr is the clock error time, and Tbyte is the preset transmission time of one byte in the communication signal;
the method for determining the clock error time Terr comprises the following steps:
and when the deviation between the time interval of adjacent sampling points in the acquired communication signal and the preset sampling period is greater than a preset threshold value, setting the clock error time as the time length between the rising edge of the sampling level in the communication signal and the preset sampling point.
2. A singlechip clock anomaly detection device is characterized by comprising:
the first signal acquisition module is configured to acquire a communication signal between the single chip microcomputer and preset equipment; the communication signal is a signal based on clock synchronization or a signal not based on clock synchronization;
the first signal judgment module is configured to judge whether the deviation between the time interval of the adjacent sampling points in the acquired communication signal and a preset sampling period is greater than a preset threshold value: if the clock value is larger than the preset value, the clock of the single chip microcomputer is abnormal;
the device further comprises:
the second signal acquisition module is configured to acquire the oscillation deviation of the clock of the single chip microcomputer;
a second signal determination module configured to compare the obtained oscillation deviation with a preset oscillation deviation threshold: if the obtained oscillation deviation is larger than the preset oscillation deviation threshold value, the clock of the single chip microcomputer is abnormal;
the second signal judgment module comprises a preset oscillation deviation threshold model k shown as the following formula:
wherein, terr is the clock error time, and Tbyte is the preset transmission time of one byte in the communication signal;
the second signal judgment module also comprises a clock error time calculation module; the clock error time calculation module is configured to set the clock error time as a time length between a rising edge of a sampling level in the communication signal and a preset sampling point when a deviation between a time interval of adjacent sampling points in the acquired communication signal and a preset sampling period is greater than a preset threshold value.
3. A computer-readable storage medium, in which a computer program is stored, wherein the program is adapted to be loaded and executed by a processor to implement the steps of the method for detecting clock abnormality of a single chip microcomputer according to claim 1.
4. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor executes the program to implement the steps of the method for detecting clock abnormality of a single chip microcomputer according to claim 1.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710382047.2A CN108958092B (en) | 2017-05-23 | 2017-05-23 | Singlechip clock anomaly detection method and device, computer readable storage medium and equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710382047.2A CN108958092B (en) | 2017-05-23 | 2017-05-23 | Singlechip clock anomaly detection method and device, computer readable storage medium and equipment |
Publications (2)
Publication Number | Publication Date |
---|---|
CN108958092A CN108958092A (en) | 2018-12-07 |
CN108958092B true CN108958092B (en) | 2022-11-04 |
Family
ID=64494506
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710382047.2A Active CN108958092B (en) | 2017-05-23 | 2017-05-23 | Singlechip clock anomaly detection method and device, computer readable storage medium and equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108958092B (en) |
Families Citing this family (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111856916A (en) * | 2019-04-30 | 2020-10-30 | 联合汽车电子有限公司 | External clock diagnosis method |
CN111860164B (en) * | 2020-06-17 | 2024-02-06 | 深圳星康医疗科技有限公司 | Low-speed pacing detection method, device and storage medium |
CN112104341B (en) * | 2020-08-10 | 2024-06-14 | 华帝股份有限公司 | System clock calibration method based on self-adaptive power grid power frequency |
CN112731049B (en) * | 2020-12-08 | 2023-07-07 | 深圳供电局有限公司 | Clock synchronization abnormality monitoring method, device and computer readable storage medium |
CN113757932B (en) * | 2021-08-27 | 2022-12-13 | Tcl空调器(中山)有限公司 | Air conditioner communication fault processing method and device, computer equipment and storage medium |
Citations (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1272003A (en) * | 1999-04-23 | 2000-11-01 | 朗迅科技公司 | Information channel estimation and compensation method based on channel estimation |
CN101247123A (en) * | 2007-10-24 | 2008-08-20 | 吴明星 | Single-chip system clock calibration method |
CN101841322A (en) * | 2009-03-20 | 2010-09-22 | 华为技术有限公司 | Method for detecting clock signal and device thereof |
CN102820900A (en) * | 2011-06-08 | 2012-12-12 | 株式会社电装 | Transceiver for communicating signal encoded to include clock information |
CN103955257A (en) * | 2014-03-27 | 2014-07-30 | 美的集团股份有限公司 | Method and device for calibrating system clocks of single chip microcomputers, and air conditioner control system |
WO2015026166A1 (en) * | 2013-08-22 | 2015-02-26 | 비앤에프테크놀로지 주식회사 | Unusual data predicting method and computer-readable storage medium in which program for executing said method is stored |
CN105183686A (en) * | 2015-07-30 | 2015-12-23 | 深圳市振邦智能科技有限公司 | Method and apparatus for starting simulated serial port communication |
CN105391448A (en) * | 2015-12-07 | 2016-03-09 | 中国航空工业集团公司西安航空计算技术研究所 | Method for detecting correctness of differential clock frequency in real time |
CN105790756A (en) * | 2016-03-17 | 2016-07-20 | 杭州晟元数据安全技术股份有限公司 | Method and device for calibrating clock by utilizing UART communication |
CN106681127A (en) * | 2016-12-22 | 2017-05-17 | 建荣半导体(深圳)有限公司 | Shifting register circuit, phase difference computing method and time-digital converter |
Family Cites Families (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101499797B (en) * | 2009-02-24 | 2012-06-27 | 华为技术有限公司 | Method and apparatus for controlling phase changing |
EP2533423B1 (en) * | 2011-06-06 | 2015-03-04 | Thales Italia S.p.A. | Method for detecting with a high temporal accuracy a threshold crossing instant by a signal |
CN103138863A (en) * | 2011-12-01 | 2013-06-05 | 中兴通讯股份有限公司 | Time synchronization method and device |
CN104564641B (en) * | 2014-12-22 | 2018-01-02 | 广东美的制冷设备有限公司 | The method for diagnosing faults of frequency-changeable compressor, device and system in household electrical appliance |
CN105044652B (en) * | 2015-06-25 | 2018-01-30 | 广东电网有限责任公司电力科学研究院 | Data fault-tolerant aptitude tests device and method during intelligent electric energy meter data interaction exceptional reset |
CN105450454B (en) * | 2015-12-03 | 2018-11-23 | 广州华多网络科技有限公司 | A kind of service monitoring alarm method and device |
-
2017
- 2017-05-23 CN CN201710382047.2A patent/CN108958092B/en active Active
Patent Citations (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1272003A (en) * | 1999-04-23 | 2000-11-01 | 朗迅科技公司 | Information channel estimation and compensation method based on channel estimation |
CN101247123A (en) * | 2007-10-24 | 2008-08-20 | 吴明星 | Single-chip system clock calibration method |
CN101841322A (en) * | 2009-03-20 | 2010-09-22 | 华为技术有限公司 | Method for detecting clock signal and device thereof |
CN102820900A (en) * | 2011-06-08 | 2012-12-12 | 株式会社电装 | Transceiver for communicating signal encoded to include clock information |
WO2015026166A1 (en) * | 2013-08-22 | 2015-02-26 | 비앤에프테크놀로지 주식회사 | Unusual data predicting method and computer-readable storage medium in which program for executing said method is stored |
CN103955257A (en) * | 2014-03-27 | 2014-07-30 | 美的集团股份有限公司 | Method and device for calibrating system clocks of single chip microcomputers, and air conditioner control system |
CN105183686A (en) * | 2015-07-30 | 2015-12-23 | 深圳市振邦智能科技有限公司 | Method and apparatus for starting simulated serial port communication |
CN105391448A (en) * | 2015-12-07 | 2016-03-09 | 中国航空工业集团公司西安航空计算技术研究所 | Method for detecting correctness of differential clock frequency in real time |
CN105790756A (en) * | 2016-03-17 | 2016-07-20 | 杭州晟元数据安全技术股份有限公司 | Method and device for calibrating clock by utilizing UART communication |
CN106681127A (en) * | 2016-12-22 | 2017-05-17 | 建荣半导体(深圳)有限公司 | Shifting register circuit, phase difference computing method and time-digital converter |
Also Published As
Publication number | Publication date |
---|---|
CN108958092A (en) | 2018-12-07 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108958092B (en) | Singlechip clock anomaly detection method and device, computer readable storage medium and equipment | |
CN108541363B (en) | Method for managing sensor abnormality and computer system | |
JP6821436B2 (en) | Calibration of power supply using power supply monitor | |
CN107807323B (en) | Circuit board health condition monitoring method, detection device and detection system | |
CN110999086B (en) | Fault tolerant clock monitor system | |
US20160147545A1 (en) | Real-Time Optimization of Many-Core Systems | |
JP2022137251A (en) | Belt drive monitoring system | |
US11119876B2 (en) | Device and method for testing computer system | |
US20160254872A1 (en) | Systems and methods for measurement of electrical channel loss | |
US9319030B2 (en) | Integrated circuit failure prediction using clock duty cycle recording and analysis | |
CN104408000A (en) | Method for preventing conflict in health information read of BIOS (Basic Input Output System) and BMC (Baseboard Management Controller) on Feiteng server | |
US20170199838A1 (en) | Communication interface circuit and semiconductor integrated circuit | |
US9606616B2 (en) | Device and method for reconfigurable power conversion | |
US20170082687A1 (en) | De-bugging environment with smart card | |
CN104065341B (en) | Crystal oscillator clock compensation method and device | |
Lian et al. | Cloud-based PVT monitoring system for IoT devices | |
GB2488631A (en) | Dynamic power and performance calibration of data processing systems | |
US10288496B1 (en) | Ring oscillator for temperature or voltage sensing | |
KR100894228B1 (en) | Electronic type watt hour meter using NAND flash memory and method for saving wave data thereof | |
US20140019093A1 (en) | Incrementally increasing system test workload | |
US10534023B1 (en) | Data center energy monitoring | |
EP3480608B1 (en) | Method and system for measuring power-on reset time | |
US20190179721A1 (en) | Utilizing non-volatile phase change memory in offline status and error debugging methodologies | |
US20130268221A1 (en) | On-chip integrated circuit power measurement cell | |
KR102078383B1 (en) | Power observe apparatus and power observe system using thereof |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
TA01 | Transfer of patent application right | ||
TA01 | Transfer of patent application right |
Effective date of registration: 20220921 Address after: 528306 huatianbei 16, Ronggui high tech Zone, Shunde District, Foshan City, Guangdong Province Applicant after: FOSHAN SHUNDE HAIER ELECTRIC Co.,Ltd. Applicant after: Haier Smart Home Co., Ltd. Address before: 266101 Haier Industrial Park, 1 Haier Road, Laoshan District, Shandong, Qingdao Applicant before: QINGDAO HAIER WASHING MACHINE Co.,Ltd. |
|
GR01 | Patent grant | ||
GR01 | Patent grant |