Abnormality detection method and device, electronic equipment and storage medium

By capturing and monitoring the real-time waveform of the CAN controller, detecting abnormal conditions and controlling interrupts, the abnormal problems that the CAN controller may occur in complex environments are solved, and fast response and normal communication are achieved.

CN119882675APending Publication Date: 2025-04-25QUECLINK WIRELESS SOLUTIONS(SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411998277.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-31
Publication Date
2025-04-25

AI Technical Summary

Technical Problem

Due to the complexity of the vehicle operating environment, CAN controllers may encounter various abnormal situations in actual applications, affecting vehicle performance and posing a threat to safety.

Method used

By capturing the real-time waveform generated by the pin of the CAN controller and monitoring whether the preset abnormal conditions are met, the control data control unit generates an interrupt to detect the abnormal state in real time and respond quickly.

Benefits of technology

Real-time detection of abnormal states is achieved, reducing CPU load, and can quickly detect and respond to abnormalities, ensuring normal communication of the CAN controller.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119882675A_ABST
    Figure CN119882675A_ABST
Patent Text Reader

Abstract

The embodiment of the invention relates to the technical field of vehicle electronics, and discloses an anomaly detection method and device, electronic equipment and a storage medium. The method comprises the following steps: capturing a real-time waveform generated by a pin of a CAN controller; whenever it is monitored that the real-time waveform meets the preset abnormal condition, the data control unit is controlled to generate interruption. The abnormal state can be detected in real time, excessive interference of software is not needed in the whole detection process, the load of a CPU can be reduced, and the abnormity can be detected and responded rapidly.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present invention relate to the field of vehicle electronic technology, and in particular to an abnormality detection method, device, electronic equipment and storage medium. Background Art

[0002] The CAN controller (Controller Area Network Bus Controller) is the core component of the Controller Area Network (CAN) bus communication system, and is mainly responsible for receiving, processing and forwarding CAN bus data. The CAN controller is a digital circuit or microprocessor specially designed to implement the CAN bus communication protocol. It is responsible for converting the data sent by the microprocessor (or CPU) into a format that complies with the CAN bus standard and sending it out through the CAN bus; at the same time, it can also receive data from the CAN bus, convert it into a format that the CPU can recognize, and pass it to the CPU for processing.

[0003] With the rapid development of automotive electronic technology, the number and complexity of electronic control units (ECUs) in vehicles are increasing. As an efficient and reliable serial communication protocol, CAN is widely used in the internal network of automobiles to realize data transmission between various electronic control units.

[0004] The inventors have discovered that there are at least the following problems in the related art: Due to the complexity of the vehicle operating environment, the CAN controller may encounter various abnormal situations in actual applications, which may not only affect the performance of the vehicle but also pose a threat to the safety of the vehicle. Summary of the invention

[0005] The purpose of the embodiments of the present invention is to provide an abnormality detection method, device, electronic device and storage medium, so as to detect abnormal status in real time to respond quickly and restore normal communication of the CAN controller.

[0006] To solve the above technical problems, an embodiment of the present invention provides an abnormality detection method, comprising: capturing the real-time waveform generated by the pin of the CAN controller; whenever the real-time waveform is monitored to meet a preset abnormal condition, controlling the data control unit to generate an interrupt.

[0007] An embodiment of the present invention also provides an abnormality detection device, comprising: a data capture module, used to capture the real-time waveform generated by the pin of the CAN controller; an interrupt processing module, used to control the data control unit to generate an interrupt whenever the real-time waveform is monitored to meet a preset abnormal condition.

[0008] An embodiment of the present invention also provides an electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the above-mentioned abnormality detection method.

[0009] An embodiment of the present invention further provides a computer-readable storage medium storing a computer program, which implements the above-mentioned abnormality detection method when executed by a processor.

[0010] In the embodiment of the present invention, the real-time waveform generated by the pin of the CAN controller is captured; whenever the real-time waveform is monitored to meet the preset abnormal condition, the control data control unit generates an interrupt. Not only can the abnormal state be detected in real time, but the entire detection process does not require excessive software intervention, which can reduce the CPU load and quickly detect and respond to abnormalities. BRIEF DESCRIPTION OF THE DRAWINGS

[0011] One or more embodiments are exemplarily described by pictures in the corresponding drawings, and these exemplified descriptions do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings represent similar elements, and unless otherwise stated, the figures in the drawings do not constitute proportional limitations.

[0012] Figure 1 is a flow chart of an anomaly detection method provided according to an embodiment of the present invention;

[0013] Figure 2 is a schematic diagram of an abnormal waveform state captured in real time according to an embodiment of the present invention;

[0014] Figure 3 is a schematic diagram of the structure of the cooperation principle of each unit provided according to an embodiment of the present invention;

[0015] Figure 4 is a schematic diagram of software judgment logic provided according to an embodiment of the present invention;

[0016] Figure 5 is a schematic structural diagram of an abnormality detection device according to another embodiment of the present invention;

[0017] Figure 6 It is a schematic structural diagram of an electronic device according to another embodiment of the present invention. DETAILED DESCRIPTION

[0018] To make the purpose, technical scheme and advantages of the embodiments of the present invention clearer, the embodiments of the present invention will be described in detail below in conjunction with the accompanying drawings. However, it will be appreciated by those skilled in the art that in the embodiments of the present invention, many technical details are proposed in order to enable the reader to better understand the present application. However, even without these technical details and various changes and modifications based on the following embodiments, the technical scheme claimed in the present application can be implemented. The division of the following embodiments is for the convenience of description, and should not constitute any limitation on the specific implementation of the present invention. The various embodiments can be combined and referenced with each other without contradiction.

[0019] An embodiment of the present invention relates to an abnormality detection method, which can be applied to an electronic control unit inside a vehicle, such as electronic components such as chips, and can also be remotely controlled by electronic devices such as mobile phones and computers through wireless connections. In this embodiment, the real-time waveform generated by the pins of the CAN controller is captured; whenever the real-time waveform is monitored to meet the preset abnormal conditions, the control data control unit generates an interrupt. Not only can the abnormal state be detected in real time, the entire detection process does not require excessive software intervention, which can reduce the CPU load and quickly detect and respond to abnormalities. The implementation details of the abnormality detection method of this embodiment are described in detail below. The following content is only for the convenience of understanding the implementation details provided, and is not necessary for the implementation of this solution.

[0020] like Figure 1 As shown, in step 101, the vehicle control unit will capture the real-time waveform generated by the pin of the CAN controller;

[0021] The CAN controller has multiple functions, including data transmission and data reception. The Controller Area Network Transmit Data (CAN_TXD) is an important pin in the CAN controller, which is used to send data. In the CAN bus system, CAN_TXD is responsible for sending data from the controller to other devices. In an example, capturing the real-time waveform generated by the pin of the CAN controller specifically refers to capturing the waveform obtained by measuring CAN_TXD.

[0022] When the CAN controller is communicating normally, due to the influence of various factors such as the data sent and the frequency of use, the real-time waveform captured from the pin of the CAN controller does not show a regular state, that is, the normal waveform data is in an irregular state. However, when the CAN controller is abnormal, the waveform will show a regular state. The captured abnormal waveform data is as follows: Figure 2By summarizing the rules of the waveforms in abnormal states and obtaining the preset abnormal conditions, it is possible to determine whether the waveform is abnormal based on whether the real-time waveform meets the preset abnormal conditions, and then determine whether the state of the CAN controller is normal.

[0023] In step 102, the vehicle control unit controls the data control unit (DCU) to generate an interrupt whenever the real-time waveform monitored by the vehicle control unit meets a preset abnormal condition.

[0024] For example, Figure 2 As shown in the figure, it is detected that the abnormal waveform shows periodic regular repetition within a period of time. In this example, one cycle contains 6 CAN nominal bits, which are composed of 5 consecutive recessive bits and 1 dominant bit. After that, each cycle repeats, so this 1 dominant bit will be obviously prominent and form a falling edge. From an overall perspective, no matter how many CAN nominal bits a cycle consists of, as long as the CAN controller is in this abnormal state, that is, the detected waveform shows periodic regular repetition, then theoretically, the number of falling edges of that waveform within a unit time t is constant.

[0025] In the actual communication process of the CAN bus, the number of falling edges contained in the normal waveform per unit time is much greater than that of the abnormal waveform. Therefore, if the preset abnormal condition is related to the number of falling edges of the real-time waveform per unit time, it is almost impossible to make a misjudgment. Based on this analysis, in one example, the preset abnormal condition can include one of the following or any combination thereof:

[0026] 1. The number of falling edges of the real-time waveform per unit time is constant.

[0027] 2. The number of falling edges of the real-time waveform per unit time belongs to the preset number range.

[0028] The specific implementation process can be: during the CAN transmission process, a timer is used to count the number of times n when the CAN_TXD pin falls within a unit time t, and the counted number n is transmitted to the DCU of the microcontroller unit (MCU) through direct memory access technology (DMA), and compared with the preset number interval. If the comparison is successful, the DCU will generate an interrupt.

[0029] Regarding the selection of unit time t, due to the different CAN baud rates, the time of each nominal bit at different baud rates is different. This also makes it difficult to specify a unified time standard as the unit time t. Therefore, in one example, the length of the unit time t will abandon the traditional measurement units (such as hours, minutes, seconds, etc.) and instead use the number of nominal bits as the measurement unit for measurement. For example, the unit time t can be set to 180 nominal bits.

[0030] When the real-time waveform is monitored to meet the preset abnormal condition, the data control unit (DCU) generates an interrupt. In one example, the interrupt can be counted, that is, the number of interrupts is accumulated every time the data control unit generates an interrupt.

[0031] In one example, the control data control unit generates interrupts multiple times, that is, if the count number n falls within a preset interval multiple times, it indicates that the CAN controller is abnormal. When the interrupt number reaches a preset value, the CAN controller is reset and the interrupt number is accumulated again.

[0032] In one example, capturing the real-time waveform generated by the pin of the CAN controller can be: periodically capturing the real-time waveform generated by the pin of the CAN controller within a unit time. The unit time can be determined by the number of preset nominal bits. Due to the different CAN baud rates, the time of each nominal bit of different baud rates is different. Therefore, we use the number of nominal bits to measure the time t, such as 180 nominal bits.

[0033] In a specific example, the above embodiment can be implemented by two timers (timer 1 and timer 2), a DCU unit, and a DMA channel, such as Figure 3 As shown, timer 1 is used to record the number of falling edges, timer 2 is used to detect the setting of cycle t, and when timer 2 meets the start condition, when a CAN_TXD falling edge event occurs (i.e., the real-time waveform monitored meets the preset abnormal condition), the counting condition of timer 1 is judged, and the clearing / capturing condition of timer 1 is judged. When the condition is met, the number n of CAN_TXD falling edges within the unit time t is captured under the action of timer 1, and the count value n within the unit time t of timer 1 is transmitted to the DCU unit through DMA. The DCU unit compares the number of falling edges n with the predefined value and generates a corresponding interrupt. The entire detection process does not require excessive software intervention, only the relevant detection parameters need to be configured. This can not only reduce the CPU load, but also quickly detect abnormalities.

[0034] Judging from the software and detection logic, Figure 4As shown, after the process starts, timer 1 is configured to capture the CAN_TXD falling edge event, where timer 1 is used to record the number of falling edges, and timer 2 is used to detect the setting of cycle t. Then set timer 2 to detect cycle t to determine whether timer 2 has counted overflow; if not, return to the step before determining whether timer 2 has counted overflow; if yes, transfer the current capture value n of timer 1 to DCU through DMA for comparison. Then determine whether n is in the set interval, if not, return to the step before determining whether timer 2 has counted overflow; if yes, generate a DCU interrupt, and the interrupt count value +1. Then determine whether the interrupt count value reaches the set condition, if not, return to the step before determining whether timer 2 has counted overflow; if yes, reset the CAN controller and resume communication. At this point, the process of this example ends.

[0035] In this embodiment, the real-time waveform generated by the pin of the CAN controller is captured; whenever the real-time waveform meets the preset abnormal condition, the control data control unit generates an interrupt. Not only can the abnormal state be detected in real time, but the entire detection process does not require excessive software intervention, which can reduce the CPU load and quickly detect and respond to abnormalities.

[0036] The steps of the above method are divided only for clear description. When implemented, they can be combined into one step or some steps can be split and decomposed into multiple steps. As long as they include the same logical relationship, they are all within the scope of protection of this application; adding insignificant modifications to the algorithm or process or introducing insignificant designs without changing the core design of the algorithm and process are all within the scope of protection of this application.

[0037] Another embodiment of the present invention relates to an abnormality detection device, such as Figure 5 As shown, including:

[0038] The data capture module 501 is used to capture the real-time waveform generated by the pins of the CAN controller;

[0039] The interrupt processing module 502 is used to control the data control unit to generate an interrupt whenever the real-time waveform is monitored to meet a preset abnormal condition.

[0040] In one example, the preset abnormal condition includes: the number of falling edges of the real-time waveform per unit time is constant.

[0041] In one example, the preset abnormal condition further includes: the number of falling edges of the real-time waveform per unit time belongs to a preset number range.

[0042] In one example, the device further includes: an interruption accumulation module, configured to accumulate the number of interruptions each time the control data control unit generates an interruption.

[0043] In one example, the interrupt accumulation module is further configured to reset the CAN controller and re-accumulate the interruption times when the interruption times reaches a preset value.

[0044] In one example, capturing the real-time waveform generated by the pin of the CAN controller includes: periodically capturing the real-time waveform generated by the pin of the CAN controller within a unit time.

[0045] In one example, the unit time is determined by the number of preset nominal bits.

[0046] It is not difficult to find that this embodiment is a device embodiment corresponding to the above method embodiment, and this embodiment can be implemented in conjunction with the above method embodiment. The relevant technical details mentioned in the above method embodiment are still valid in this embodiment, and in order to reduce repetition, they are not repeated here. Accordingly, the relevant technical details mentioned in this embodiment can also be applied in the above method embodiment.

[0047] It is worth mentioning that all modules involved in this embodiment are logic modules. In practical applications, a logic unit can be a physical unit, a part of a physical unit, or a combination of multiple physical units. In addition, in order to highlight the innovative part of the present invention, this embodiment does not introduce units that are not closely related to solving the technical problem proposed by the present invention, but this does not mean that there are no other units in this embodiment.

[0048] Another embodiment of the present invention relates to an electronic device, such as Figure 6 As shown, it includes at least one processor 601; and a memory 602 that is communicatively connected to the at least one processor; wherein the memory 602 stores instructions that can be executed by the at least one processor 601, and the instructions are executed by the at least one processor 601 so that the at least one processor 601 can execute the anomaly detection method as described above.

[0049] The memory 602 and the processor 601 are connected in a bus manner, and the bus may include any number of interconnected buses and bridges, and the bus connects various circuits of one or more processors 601 and the memory 602 together. The bus can also connect various other circuits such as peripheral devices, voltage regulators, and power management circuits, which are well known in the art and are therefore not further described herein. The bus interface provides an interface between the bus and the transceiver. The transceiver can be one element or multiple elements, such as multiple receivers and transmitters, providing a unit for communicating with various other devices on a transmission medium. The data processed by the processor 601 is transmitted on a wireless medium via an antenna, and further, the antenna also receives data and transmits the data to the processor 601.

[0050] The processor 601 is responsible for managing the bus and general processing, and can also provide various functions, including timing, peripheral interfaces, voltage regulation, power management and other control functions. The memory 602 can be used to store data used by the processor 601 when performing operations.

[0051] Another embodiment of the present invention relates to a computer-readable storage medium storing a computer program, which implements the above method embodiment when executed by a processor.

[0052] That is, those skilled in the art can understand that all or part of the steps in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a program, and the program is stored in a storage medium, including several instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.

[0053] Those skilled in the art will appreciate that the above-mentioned embodiments are specific examples for implementing the present invention, and in actual applications, various changes may be made thereto in form and detail without departing from the spirit and scope of the present invention.

Claims

1. An anomaly detection method, characterized in that: include: Capture the real-time waveform generated by the pins of the CAN controller; Whenever it is monitored that the real-time waveform meets a preset abnormal condition, the control data control unit generates an interrupt.

2. The anomaly detection method according to claim 1, characterized in that: The preset abnormal conditions include: The number of falling edges of the real-time waveform per unit time is constant.

3. The anomaly detection method according to claim 1, characterized in that: The preset abnormal conditions include: The number of falling edges of the real-time waveform per unit time belongs to a preset number range.

4. The anomaly detection method according to claim 1, characterized in that: The method further comprises: Every time an interrupt is generated in the control data control unit, the number of interrupts is accumulated.

5. The anomaly detection method according to claim 4, characterized in that: The method further comprises: When the number of interruptions reaches a preset value, the CAN controller is reset and the number of interruptions is accumulated again.

6. The anomaly detection method according to claim 1, characterized in that: The real-time waveform generated by the pin of the CAN controller is captured, including: Periodically capture the real-time waveform generated by the CAN controller pin within a unit time.

7. The abnormality detection method according to claim 6, characterized in that: The unit time is determined by the number of preset nominal bits.

8. An abnormality detection device, characterized in that: include: Data capture module, used to capture the real-time waveform generated by the pins of the CAN controller; The interrupt processing module is used to control the data control unit to generate an interrupt whenever the real-time waveform is monitored to meet a preset abnormal condition.

9. An electronic device, characterized in that: include: at least one processor; as well as, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can perform the abnormality detection method according to any one of claims 1 to 7.

10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the abnormality detection method according to any one of claims 1 to 7 is implemented.