LIN bus short earth fault confirmation and processing method, device, equipment and medium

By monitoring the LIN bus interval field status and setting the interrupt count threshold, LIN bus short-ground faults can be quickly identified and handled, solving the problem of complex identification processes in existing technologies, protecting the interrupt detection circuit, extending chip life, and ensuring the reliability of controller functions.

CN121008949APending Publication Date: 2025-11-25BEIJING JINGWEI HIRAIN TECH CO INC
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511164702.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-19
Publication Date
2025-11-25

AI Technical Summary

Technical Problem

In the existing technology, the process of confirming a short-ground fault on the LIN bus is complex and cumbersome, which can easily lead to abnormal function of the slave node controller and may cause additional faults during operation.

Method used

By monitoring the interval field status on the LIN bus, interrupt requests are generated and counted using registers. A short-ground count threshold is set. When the threshold is reached, a short-ground fault is confirmed, the interrupt detection circuit is turned off, and the communication function is restored.

Benefits of technology

It enables rapid identification and handling of LIN bus short-to-ground faults from a purely software perspective, protects the interrupt detection circuit, extends chip lifespan, avoids functional abnormalities, and ensures the reliability of the controller.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121008949A_ABST
    Figure CN121008949A_ABST
Patent Text Reader

Abstract

The invention relates to an LIN (Local Interconnect Network) bus short earth fault confirmation and processing method, device, equipment and medium, which are applied to the technical field of local Internet buses, and the method comprises the following steps: enabling an interrupt detection function and an interrupt character detection sending interrupt function through a control register, and monitoring the state of a spacing field on an LIN bus; when a spacing field on the LIN bus is detected, generating an interrupt request, and adding 1 to the interrupt count of the LIN bus; the initial value of the interrupt count of the LIN bus is 0; when a communication fault is detected, or when the LIN bus is detected to be idle, the interrupt count of the LIN bus is reset; and if the interrupt count of the LIN bus reaches a preset short earth count threshold value, determining that the LIN bus has a short earth fault, closing the interrupt detection circuit, forbidding an interrupt detection sending interrupt function, and closing a slave node LIN communication function. According to the invention, the efficiency of short-ground fault confirmation can be improved, and the reliability of other functions of the controller is ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of local interconnection network bus technology, and in particular to a method, apparatus, device and medium for LIN bus short-ground fault confirmation and handling. Background Technology

[0002] For slave controllers using LIN (Local Interconnect Network) communication, LIN bus status detection and data processing are crucial. If a short-to-ground fault occurs on the LIN bus, no register status bits will show the LIN short-to-ground status. If the slave controller cannot correctly identify and process this fault, it will frequently enter LIN communication receive / process interrupts, causing abnormal MCU (Microcontroller Unit) clock timing and interfering with other logic processing within the slave controller, resulting in malfunctions.

[0003] In related technologies, after the controller is integrated into the vehicle, the operator can only confirm a short-to-ground fault by observing a malfunction of a particular controller, removing the trim panels and other housings, navigating through numerous and complex wiring connections, and then measuring the bus voltage to confirm the fault. This fault confirmation process is complex and tedious, and may cause further damage such as scratches on the interior trim panels or wiring malfunctions during the operation. Summary of the Invention

[0004] To address the aforementioned technical problems, this application provides a method, apparatus, electronic device, and storage medium for LIN bus short-ground fault confirmation and handling.

[0005] According to a first aspect of this application, a method for acknowledging and handling short-ground faults on a LIN bus is provided, applied to a slave node controller, the method comprising:

[0006] The interrupt detection function is enabled by controlling the register, the interrupt character detection and transmission interrupt function is enabled, and the interval field status on the LIN bus is monitored by the register.

[0007] When an interval field is detected on the LIN bus, an interrupt request is generated and the LIN bus interrupt count is incremented by 1; the initial value of the LIN bus interrupt count is 0.

[0008] When a communication failure is detected, or when the LIN bus is detected to be idle, the LIN bus interrupt count is cleared to 0;

[0009] If the LIN bus interrupt count reaches the preset short-ground count threshold, a short-ground fault is confirmed to have occurred on the LIN bus, and the interrupt detection circuit is turned off, the interrupt detection transmission interrupt function is disabled, and the slave node LIN communication function is turned off.

[0010] Optionally, the LIN bus short-ground fault confirmation and handling method further includes:

[0011] If a short-to-ground fault is confirmed to have occurred on the LIN bus, set the short-to-ground fault flag to the specified value.

[0012] When the short-ground fault flag is set, check the IDLE bit of the register;

[0013] If the IDLE bit of the register is detected to be 1, confirming that the LIN bus short-ground fault has been recovered, the LIN bus interrupt count is cleared to 0.

[0014] The interrupt detection circuit is restored to operation, and the interrupt character detection and transmission interrupt function is enabled to restore the LIN communication function of the slave node.

[0015] Optionally, the short-ground counting threshold is determined based on the short-ground count corresponding to twice the scheduling period.

[0016] Optionally, the communication failure includes one or more of the following: information overload, frame error, and noise error.

[0017] According to a second aspect of this application, a LIN bus short-ground fault confirmation and handling device is provided, applied to a slave node controller, the device comprising:

[0018] The interval field status monitoring module is used to enable the interrupt detection function through the control register, enable the interrupt character detection and transmission interrupt function, and monitor the interval field status on the LIN bus through the register.

[0019] The interrupt handling module is used to generate an interrupt request and increment the LIN bus interrupt count by 1 when an interval field is detected on the LIN bus; the initial value of the LIN bus interrupt count is 0.

[0020] The interrupt counter clearing module is used to clear the LIN bus interrupt counter to 0 when a communication failure is detected, or when the LIN bus is detected to be idle.

[0021] The short-ground fault confirmation and handling module is used to confirm that a short-ground fault has occurred on the LIN bus if the LIN bus interrupt count reaches a preset short-ground count threshold, and to disable the interrupt detection circuit, disable the interrupt detection transmission interrupt function, and disable the slave node LIN communication function.

[0022] Optionally, the LIN bus short-ground fault confirmation and handling device further includes:

[0023] The short-ground fault flag setting module is used to set the short-ground fault flag if a short-ground fault is confirmed to have occurred on the LIN bus.

[0024] The IDLE bit detection module is used to detect the IDLE bit of the register when the short-ground fault flag is set;

[0025] The short-ground fault recovery confirmation and processing module is used to confirm the recovery of the LIN bus short-ground fault if the IDLE bit of the register is detected to be 1, clear the LIN bus interrupt count to 0, control the interrupt detection circuit to resume operation, enable the interrupt character detection and transmission interrupt function, and restore the slave node LIN communication function.

[0026] Optionally, the short-ground counting threshold is determined based on the short-ground count corresponding to twice the scheduling period.

[0027] Optionally, the communication failure includes one or more of the following: information overload, frame error, and noise error.

[0028] According to a third aspect of this application, an electronic device is provided, comprising: a processor configured to execute a computer program stored in a memory, wherein the computer program, when executed by the processor, implements the method described in the first aspect.

[0029] According to a fourth aspect of this application, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the method described in the first aspect.

[0030] According to a fifth aspect of this application, a computer program product is provided that, when the computer program product is run on a computer, causes the computer to perform the method described in the first aspect.

[0031] The technical solution provided in this application has the following advantages compared with the prior art:

[0032] By monitoring the level interval state on the LIN bus through registers, when the number of interrupts reaches the short-ground count threshold, a short-ground fault on the LIN bus is confirmed and handled. This effectively confirms and handles LIN bus short-ground faults from a purely software perspective, providing an interface to prevent LIN bus short-ground faults from affecting other functions. It is applicable to various MCU chips that integrate LIN functionality. This embodiment of the application can protect the interrupt detection circuit from damage caused by prolonged LIN bus short-ground faults, extending the chip's lifespan. Simultaneously, it avoids malfunctions in other functional logic caused by interference from the LIN bus short-ground fault to the MCU clock, ensuring the reliability of other controller functions during a LIN short-ground fault. Attached Figure Description

[0033] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0034] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0035] Figure 1 This is a schematic diagram of an architecture of a LIN bus system in an embodiment of this application;

[0036] Figure 2 This is a flowchart of a LIN bus short-ground fault confirmation and handling method in an embodiment of this application;

[0037] Figure 3 This is a schematic diagram of a LIN bus short-ground fault confirmation and processing device in an embodiment of this application;

[0038] Figure 4 This is a schematic diagram of the structure of an electronic device in an embodiment of this application. Detailed Implementation

[0039] To better understand the above-mentioned objectives, features, and advantages of this application, the solution of this application will be further described below. It should be noted that, unless otherwise specified, the embodiments and features described in these embodiments can be combined with each other.

[0040] Many specific details are set forth in the following description in order to provide a full understanding of this application, but this application may also be implemented in other ways different from those described herein; obviously, the embodiments in the specification are only some embodiments of this application, and not all embodiments.

[0041] Figure 1 This is a schematic diagram of an architecture of a LIN bus system in an embodiment of this application. The controllers on the LIN bus include a master controller (i.e., master node controller) and slave controllers (i.e., slave node controllers). The master controller is connected to the CAN bus and controls other slave controllers on the LIN bus.

[0042] A LIN bus short-to-ground fault refers to a short circuit between the LIN bus and the vehicle body ground, causing the LIN bus voltage to drop to 0V, thus preventing the bus from functioning properly. This fault leads to the LIN network failing to communicate normally, affecting the normal operation of multiple modules within the vehicle. Related technologies determine whether a short-to-ground fault has occurred by directly measuring the LIN bus voltage level after an error frame is generated during LIN bus communication. From a purely software perspective, there is no mature solution for confirming and handling LIN bus short-to-ground faults, nor is there a corresponding method for confirming LIN bus short-to-ground fault recovery.

[0043] Based on this, embodiments of this application provide a method, apparatus, device, and medium for confirming and handling LIN bus short-ground faults. By confirming and handling LIN bus short-ground faults from a purely software perspective, it provides an interface that avoids LIN bus short-ground faults affecting other functions. When a LIN bus short-ground fault occurs, the LIN bus voltage remains low, and an interval field is continuously detected, triggering an interrupt. Therefore, in embodiments of this application, a new variable, the LIN bus interrupt count ShortGndCnt, is added, and logical processing is used to assist in determining the short-ground status of slave nodes on the LIN bus.

[0044] See Figure 2 , Figure 2 This is a flowchart of a LIN bus short-ground fault confirmation and handling method in an embodiment of this application, applied to a slave node controller, and may include the following steps:

[0045] Step S202: Enable the interrupt detection function through the control register, enable the interrupt character detection and transmission interrupt function, and monitor the interval field status on the LIN bus through the register.

[0046] In this embodiment of the application, the interrupt detection function can be enabled by operating the relevant registers in the software underlying code configuration, and the interrupt character detection and transmission interrupt function can be enabled.

[0047] Step S204: When an interval field is detected on the LIN bus, an interrupt request is generated and the LIN bus interrupt count is incremented by 1.

[0048] When an interval field is detected on the LIN bus, the MCU chip receives an interrupt handling request. At this time, other programs are paused, and the interrupt is handled first. That is, a new variable, LIN bus interrupt count ShortGndCnt, is added. The initial value of LIN bus interrupt count ShortGndCnt is 0. If the LIN bus interrupt count ShortGndCnt is less than a preset short-ground counting threshold, the LIN bus interrupt count is incremented by 1.

[0049] Optionally, the short-ground counting threshold can be determined based on the short-ground count corresponding to twice the scheduling cycle. This threshold can be modified according to the actual application, and using it provides higher accuracy in detecting short-ground faults on the LIN bus. For example, the short-ground counting threshold can be the short-ground count corresponding to twice the scheduling cycle. That is, the short-ground count when an interrupt occurs continuously within twice the scheduling cycle without receiving a message. When the LIN bus interrupt count ShortGndCnt reaches the short-ground counting threshold, it is considered that the interrupt was caused by a short-ground fault.

[0050] Step S206: When a communication failure is detected, or when the LIN bus is detected to be idle, the LIN bus interrupt count is cleared to 0.

[0051] When a communication failure is detected, or when the LIN bus is detected to be idle, it indicates that communication is still possible and a short-to-ground fault is unlikely to occur on the LIN bus. Therefore, the LIN bus interrupt count ShortGndCnt is cleared to 0. Optionally, communication failures include, but are not limited to, one or more of the following: information overload, frame error, and noise error.

[0052] Step S208: If the LIN bus interrupt count reaches the preset short-ground count threshold, a short-ground fault is confirmed to have occurred on the LIN bus. The interrupt detection circuit is then turned off, the interrupt detection transmission interrupt function is disabled, and the slave node LIN communication function is turned off.

[0053] Optionally, in the event of a short-ground fault on the LIN bus, it can be determined whether the bus level has returned to normal. If it has, the LIN communication function is re-enabled. Specifically, in the above steps, if a short-ground fault is confirmed on the LIN bus, the short-ground fault flag is set. While the short-ground fault flag is set, it is determined whether the bus level has returned to normal. That is, the IDLE bit of the register is checked. If the IDLE bit of the register is detected as 1, it indicates that the LIN bus is idle, confirming that the LIN bus short-ground fault has been resolved. The LIN bus interrupt count is then cleared to 0; the interrupt detection circuit is restarted, and the interrupt character detection and transmission interrupt function is enabled, restoring the slave node LIN communication function.

[0054] The LIN bus short-ground fault confirmation and recovery method based on a slave node controller in this application can effectively confirm LIN bus short-ground faults from a purely software perspective and complete autonomous confirmation and recovery. It provides an interface to avoid short-ground faults affecting other functions and is applicable to various MCU chips integrating LIN functionality. This method can protect the interrupt detection circuit from damage caused by prolonged LIN bus short-ground faults, extending the chip's lifespan. Simultaneously, it avoids malfunctions in other functional logic caused by interference from LIN short-ground faults to the MCU clock, ensuring the reliability of other controller functions during LIN short-ground faults.

[0055] It should be noted that although the steps of the method in this disclosure are described in a specific order in the accompanying drawings, this does not require or imply that the steps must be performed in that specific order, or that all the steps shown must be performed to achieve the desired result. Additional or alternative steps may be omitted, multiple steps may be combined into one step, and / or a step may be broken down into multiple steps.

[0056] Corresponding to the above method embodiments, this application also provides a LIN bus short-ground fault confirmation and processing device, applied to a slave node controller, participating in... Figure 3 The LIN bus short-ground fault confirmation and handling device 300 includes:

[0057] The interval field status monitoring module 302 is used to enable the interrupt detection function through the control register, enable the interrupt character detection and transmission interrupt function, and monitor the interval field status on the LIN bus through the register.

[0058] Interrupt handling module 304 is used to generate an interrupt request and increment the LIN bus interrupt count by 1 when an interval field is detected on the LIN bus; wherein the initial value of the LIN bus interrupt count is 0.

[0059] The interrupt counter clearing module 306 is used to clear the LIN bus interrupt counter to 0 when a communication failure is detected, or when the LIN bus is detected to be idle.

[0060] The short-ground fault confirmation and handling module 308 is used to confirm that a short-ground fault has occurred on the LIN bus if the LIN bus interrupt count reaches a preset short-ground count threshold, and to disable the interrupt detection circuit, disable the interrupt detection transmission interrupt function, and disable the slave node LIN communication function.

[0061] Optionally, the LIN bus short-ground fault confirmation and handling device 300 further includes:

[0062] The short-ground fault flag setting module is used to set the short-ground fault flag if a short-ground fault is confirmed to have occurred on the LIN bus.

[0063] The IDLE bit detection module is used to detect the IDLE bit of the register when the short-ground fault flag is set;

[0064] The short-ground fault recovery confirmation and processing module is used to confirm the recovery of the LIN bus short-ground fault if the IDLE bit of the register is detected to be 1, clear the LIN bus interrupt count to 0, control the interrupt detection circuit to resume operation, enable the interrupt character detection and transmission interrupt function, and restore the slave node LIN communication function.

[0065] Optionally, the short-ground counting threshold is determined based on the short-ground count corresponding to twice the scheduling period.

[0066] Alternatively, communication failures may include one or more of the following: information overload, frame error, and noise error.

[0067] The specific details of each module or unit in the above-mentioned device have been described in detail in the corresponding methods, so they will not be repeated here.

[0068] It should be noted that although several modules or units for the device used to perform actions have been mentioned in the detailed description above, this division is not mandatory. In fact, according to the embodiments of this application, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.

[0069] This application also provides an electronic device, including: a processor; a memory for storing processor-executable instructions; wherein the processor is configured to execute the LIN bus short-ground fault confirmation and handling method described in this example embodiment.

[0070] Reference Figure 4 , Figure 4 This is a schematic diagram of the structure of an electronic device in an embodiment of this application. The specific embodiments of this application do not limit the specific implementation of the electronic device.

[0071] like Figure 4 As shown, the electronic device may include: a processor 402, a communication interface 404, a memory 406, and a communication bus 408.

[0072] The processor 402, communication interface 404, and memory 406 communicate with each other via communication bus 408.

[0073] Communication interface 404 is used to communicate with other electronic devices or servers.

[0074] The processor 402 is used to execute program 410, specifically the relevant steps in the above method embodiments.

[0075] Specifically, program 410 may include program code that includes computer operation instructions.

[0076] Processor 402 may be a central processing unit, a specific integrated circuit, or one or more integrated circuits configured to implement the embodiments of this application. The smart device includes one or more processors, which may be processors of the same type, such as one or more CPUs; or processors of different types, such as one or more CPUs and one or more ASICs.

[0077] Memory 406 is used to store program 410. Memory 406 may include high-speed RAM memory, and may also include non-volatile memory, such as at least one disk storage device.

[0078] Specifically, program 410 can be used to cause processor 402 to execute the steps in the above-described embodiment of the LIN bus short-ground fault confirmation and handling method.

[0079] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working process of the devices and modules described above can be referred to the corresponding process descriptions in the foregoing method embodiments, and will not be repeated here.

[0080] This application also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the above-described LIN bus short-ground fault confirmation and handling method.

[0081] It should be noted that the computer-readable storage medium shown in this application can 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 may include, but are not limited to: electrical connections having one or more wires, portable computer disks, hard disks, random access memory, read-only memory, erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this application, the computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer-readable storage medium can be transmitted using any suitable medium, including but not limited to: wireless, wire, optical fiber, radio frequency, etc., or any suitable combination thereof.

[0082] In this embodiment of the application, a computer program product is also provided, which, when running on a computer, causes the computer to execute the above-described LIN bus short-ground fault confirmation and handling method.

[0083] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0084] The above description is merely a specific embodiment of this application, enabling those skilled in the art to understand or implement this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments described herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for diagnosing and handling short-ground faults on a LIN bus, characterized in that, Applied to a slave node controller, the method includes: The interrupt detection function is enabled by controlling the register, the interrupt character detection and transmission interrupt function is enabled, and the interval field status on the LIN bus is monitored by the register. When an interval field is detected on the LIN bus, an interrupt request is generated and the LIN bus interrupt count is incremented by 1; the initial value of the LIN bus interrupt count is 0. When a communication failure is detected, or when the LIN bus is detected to be idle, the LIN bus interrupt count is cleared to 0; If the LIN bus interrupt count reaches the preset short-ground count threshold, a short-ground fault is confirmed to have occurred on the LIN bus, and the interrupt detection circuit is turned off, the interrupt detection transmission interrupt function is disabled, and the slave node LIN communication function is turned off.

2. The method according to claim 1, characterized in that, The method further includes: If a short-to-ground fault is confirmed to have occurred on the LIN bus, set the short-to-ground fault flag to the specified value. When the short-ground fault flag is set, check the IDLE bit of the register; If the IDLE bit of the register is detected to be 1, confirming that the LIN bus short-ground fault has been recovered, the LIN bus interrupt count is cleared to 0. The interrupt detection circuit is restored to operation, and the interrupt character detection and transmission interrupt function is enabled to restore the LIN communication function of the slave node.

3. The method according to claim 1 or 2, characterized in that, The short-ground counting threshold is determined based on the short-ground count corresponding to twice the scheduling cycle.

4. The method according to claim 1 or 2, characterized in that, The communication failures include one or more of the following: information overload, frame error, and noise error.

5. A LIN bus short-ground fault confirmation and handling device, characterized in that, Applied to a slave node controller, the device includes: The interval field status monitoring module is used to enable the interrupt detection function through the control register, enable the interrupt character detection and transmission interrupt function, and monitor the interval field status on the LIN bus through the register. The interrupt handling module is used to generate an interrupt request and increment the LIN bus interrupt count by 1 when an interval field is detected on the LIN bus; the initial value of the LIN bus interrupt count is 0. The interrupt counter clearing module is used to clear the LIN bus interrupt counter to 0 when a communication failure is detected, or when the LIN bus is detected to be idle. The short-ground fault confirmation and handling module is used to confirm that a short-ground fault has occurred on the LIN bus if the LIN bus interrupt count reaches a preset short-ground count threshold, and to disable the interrupt detection circuit, disable the interrupt detection transmission interrupt function, and disable the slave node LIN communication function.

6. The apparatus according to claim 5, characterized in that, The device further includes: The short-ground fault flag setting module is used to set the short-ground fault flag if a short-ground fault is confirmed to have occurred on the LIN bus. The IDLE bit detection module is used to detect the IDLE bit of the register when the short-ground fault flag is set; The short-ground fault recovery confirmation and processing module is used to confirm the recovery of the LIN bus short-ground fault if the IDLE bit of the register is detected to be 1, clear the LIN bus interrupt count to 0, control the interrupt detection circuit to resume operation, enable the interrupt character detection and transmission interrupt function, and restore the slave node LIN communication function.

7. The apparatus according to claim 5 or 6, characterized in that, The short-ground counting threshold is determined based on the short-ground count corresponding to twice the scheduling cycle.

8. The apparatus according to claim 5 or 6, characterized in that, The communication failures include one or more of the following: information overload, frame error, and noise error.

9. An electronic device, characterized in that, include: A processor for executing a computer program stored in a memory, wherein the computer program, when executed by the processor, implements the method of any one of claims 1-4.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method described in any one of claims 1-4.