Electrical parameter monitoring method and system of CAN bus and vehicle
By injecting test current when the CAN bus is idle, electrical parameters are collected and judged in real time. Combined with static and dynamic thresholds, a fault type mapping library is established, which solves the problems of lag and low efficiency in the monitoring of electrical parameters of CAN bus in the existing technology, and realizes fast and accurate fault location and early warning.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-01-06
- Publication Date
- 2026-03-31
AI Technical Summary
Existing technologies cannot monitor the electrical parameters of the CAN bus in real time, resulting in delayed detection of communication faults. Manual troubleshooting is cumbersome and inefficient, and dynamic fluctuation characteristics cannot be captured, failing to meet the reliability requirements of modern automobiles for the CAN bus.
When the CAN bus is idle, a test current is injected to collect electrical characteristic parameters in real time. Anomalies are judged by static and dynamic thresholds, an abnormal parameter and fault type mapping library is established, and fault location suggestions are generated to achieve automated monitoring and rapid fault location.
It enables automated and real-time monitoring of CAN bus electrical parameters, providing early warnings at the initial stage of faults, significantly improving the accuracy and efficiency of fault location, reducing reliance on manual labor, and meeting the reliability requirements of modern automobiles.
Smart Images

Figure CN121762979A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of CAN bus, specifically to a method, system, and vehicle for monitoring electrical parameters of a CAN bus. Background Technology
[0002] As the core network for communication between various electronic control units in a vehicle, the stability of the physical layer electrical parameters of the CAN bus is the cornerstone of ensuring the reliability of vehicle communication. Among them, the resistance value of the terminating resistor (standard value is 60 ohms) and the bus differential voltage (reference value is 2.5V) are two key electrical characteristic parameters that directly reflect the physical connection and operating status of the bus.
[0003] Current technology for monitoring the above two parameters mainly relies on offline, manual testing by maintenance personnel using multimeters, which has the following inherent drawbacks:
[0004] 1) Because real-time monitoring is not possible during vehicle operation, problems only become apparent when a communication failure has already occurred and caused functional abnormalities. For example, the process of resistance slowly increasing from 60 ohms to 70 ohms due to connector oxidation or loosening cannot be detected, missing the opportunity for early warning and intervention in the early stages of communication quality deterioration.
[0005] 2) When a multimeter detects abnormal parameters (such as a resistance deviation of 60 ohms or a voltage deviation of 2.5V), repair personnel still need to rely on experience to check potential fault points such as terminating resistors, wiring harness connectors, and each ECU node. This manual troubleshooting process is tedious and highly dependent on personal experience, with an average fault location time of several hours, which cannot meet the needs of rapid repair.
[0006] 3) A single measurement with a multimeter cannot record the dynamic fluctuation characteristics of parameters under different vehicle operating conditions (such as vibration and temperature changes). These transient or condition-related parameter jumps are often important signs of intermittent faults or early-stage faults, which traditional methods are powerless to detect.
[0007] Therefore, existing offline testing methods based on multimeters are severely lacking in real-time performance, positioning efficiency, and dynamic monitoring capabilities, and cannot meet the growing demand for CAN bus reliability in modern automobiles. Summary of the Invention
[0008] This application provides a method, system, and vehicle for monitoring the electrical parameters of a CAN bus, which can automatically and in real time collect and evaluate the key electrical characteristic parameters of the CAN bus, and can quickly guide fault location when anomalies are detected, thereby fundamentally overcoming the drawbacks of traditional manual testing.
[0009] The technical solution of this invention is as follows:
[0010] In a first aspect, this application provides a method for monitoring electrical parameters of a CAN bus, the method comprising:
[0011] When the CAN bus is idle, a predetermined test current is injected into the CAN bus to collect the electrical characteristic parameters of the CAN bus.
[0012] Determine whether the electrical characteristic parameters are in an abnormal state;
[0013] When an abnormal state is detected in the electrical characteristic parameter, record the abnormal information including the timestamp and the electrical characteristic parameter, and generate an abnormal alarm signal;
[0014] Based on the electrical characteristic parameters in an abnormal state, query the preset abnormal parameter and fault type mapping library to output fault location suggestions;
[0015] Report the abnormal information, the abnormal alarm signal, and the fault location suggestion.
[0016] By injecting test current during the idle period of the CAN bus, automated acquisition of electrical characteristic parameters is achieved without interfering with normal communication. This ensures uninterrupted CAN communication and shifts from reactive post-fault measurement to proactive pre-fault monitoring, thereby capturing the gradual parameter degradation process that traditional methods cannot detect. Furthermore, when abnormal electrical characteristic parameters are detected, a pre-defined mapping library of abnormal parameters and fault types is queried to transform abstract changes in electrical characteristic parameters into specific fault hypotheses, providing clearer troubleshooting directions for later maintenance personnel. The records of abnormal information with timestamps and electrical characteristic parameters form a traceable fault data archive, enabling real-time alarms and providing relevant evidence for later fault investigation, thus realizing the shift from emergency repair to preventative maintenance.
[0017] In some embodiments, the electrical characteristic parameters include resistance and voltage values. The step of injecting a predetermined test current into the CAN bus and acquiring the electrical characteristic parameters of the CAN bus when the CAN bus is idle includes:
[0018] When multiple consecutive recessive bits are detected on the data link layer of the CAN bus, it is determined that the CAN bus is in an idle state. Then, the control switching element is turned on to inject a predetermined test current and continue for a first predetermined duration.
[0019] Measure the voltage drop caused by the injected predetermined test current, and calculate the resistance value according to the formula R=U / I, where U is the voltage drop and I is the predetermined test current;
[0020] The differential voltage between the high-order and low-order signal lines of the CAN bus is measured synchronously and recorded as the voltage value.
[0021] By identifying idle periods (continuous recessive bits) on the bus data link layer, injecting a predetermined test current and measuring the voltage drop during this extremely short idle time, and finally calculating the resistance value based on Ohm's law, the interference of the measurement process on the normal communication messages of the CAN bus is fundamentally avoided, thus resolving the technical contradiction between online measurement and communication stability.
[0022] Furthermore, the bus differential voltage is acquired synchronously under the same time reference as the resistance measurement. This synchronization ensures a strict temporal correspondence between the two parameters, resistance and voltage, providing an accurate and consistent data foundation for subsequent comprehensive analysis of their correlation and joint fault diagnosis.
[0023] In some embodiments, the step of determining whether the electrical characteristic parameter is in an abnormal state includes:
[0024] The electrical characteristic parameters are compared with their corresponding preset static anomaly judgment threshold ranges, and the electrical characteristic parameters are compared with their corresponding preset dynamic anomaly judgment thresholds.
[0025] If the electrical characteristic parameter exceeds its corresponding preset static anomaly judgment threshold range, and / or if the fluctuation of the electrical characteristic parameter exceeds its corresponding preset dynamic anomaly judgment threshold in multiple consecutive samplings, the electrical characteristic parameter is determined to be in an abnormal state.
[0026] By simultaneously setting static and dynamic anomaly detection thresholds, it is possible not only to detect whether parameters deviate from the normal absolute value range (static anomaly), but also to capture abnormal phenomena (dynamic anomaly) where the absolute value is within the normal range but the parameter itself fluctuates drastically. This overcomes the blind spots of single static threshold detection and significantly improves the comprehensiveness of electrical parameter monitoring.
[0027] Furthermore, many faults, in their early stages or due to factors such as vibration or poor contact, do not manifest as stable deviations in parameters, but rather as unstable fluctuations. By analyzing parameter fluctuations in multiple consecutive samples, these early signs of faults and intermittent faults can be sensitively detected, thus shifting fault identification from outcome judgment to process awareness and enabling earlier warnings.
[0028] In some specific implementations, the preset static anomaly determination threshold range includes a preset resistance anomaly threshold range and a preset voltage anomaly threshold range;
[0029] The preset resistance abnormality threshold range is a first range set based on the terminal resistance value of the CAN bus, and the preset voltage abnormality threshold range is a second range set based on the standard common-mode voltage value of the CAN bus in the recessive state.
[0030] The preset dynamic anomaly determination thresholds include preset resistance anomaly thresholds and preset voltage anomaly thresholds;
[0031] The preset resistance abnormality threshold and the preset voltage abnormality threshold are the resistance parameter jump values and voltage parameter jump values caused by vehicle driving vibration, which are pre-calibrated.
[0032] The preset resistance anomaly threshold range is explicitly associated with the CAN bus termination resistor value to ensure that the preset resistance anomaly threshold range can truly reflect the working status of the CAN bus termination matching network, so that the determination of resistance anomalies directly serves the core requirement of bus signal integrity.
[0033] The preset voltage anomaly threshold range is explicitly associated with the standard common-mode voltage value of the CAN bus in the recessive state, ensuring that the preset voltage anomaly threshold range is set in accordance with the level specifications of the CAN bus protocol, so that the determination of voltage anomalies can effectively identify deviations that threaten the communication logic level.
[0034] Furthermore, by defining the preset resistance abnormality threshold and the preset voltage abnormality threshold as parameter jump values caused by vehicle driving vibration, it is possible to effectively distinguish between parameter fluctuations within an acceptable range caused by normal driving vibration and abnormal fluctuations caused by potential faults (such as loose connectors or loose wiring), significantly reducing the false alarm rate under bumpy road conditions.
[0035] In some specific embodiments, the abnormal parameter and fault type mapping library includes at least one of the following mapping relationships:
[0036] The resistance value continues to be higher than the upper limit of its corresponding preset resistance abnormality threshold range and the fluctuation of the resistance value exceeds its corresponding preset dynamic abnormality judgment threshold, which corresponds to the first fault type of poor connection of the CAN bus terminal resistor.
[0037] The resistance value is continuously lower than the lower limit of its corresponding preset resistance abnormality threshold range, which corresponds to the second fault type: the CAN bus terminal resistor is short-circuited or multiple CAN bus terminal resistors are connected in parallel.
[0038] The voltage value is continuously lower than the lower limit of its corresponding preset voltage abnormality threshold range, which corresponds to the third fault type of short circuit between the high-order signal line and the low-order signal line of the CAN bus.
[0039] The voltage value is continuously higher than the upper limit of its corresponding preset voltage abnormality threshold range and the fluctuation of the voltage value exceeds its corresponding preset dynamic abnormality judgment threshold, which corresponds to the fourth fault type of abnormal power supply module supplying power to CAN bus or electromagnetic interference received by CAN bus.
[0040] This mapping library comprehensively considers the static offset and dynamic fluctuation characteristics of parameters, and can accurately distinguish typical fault modes such as poor terminal resistor connection, short circuit, multiple resistors in parallel, line-to-line short circuit, power supply abnormality and electromagnetic interference. Furthermore, it directly maps the abnormal mode to specific faulty components or interference sources, providing maintenance personnel with clear troubleshooting directions. This transforms the traditional experience-based fault analysis process into a standardized intelligent diagnostic process, significantly improving the accuracy and efficiency of fault location.
[0041] In some specific implementations, the abnormal information also includes vehicle driving status parameters, including vehicle speed.
[0042] By synchronously recording the vehicle speed at the time of the anomaly, intermittent or vibration-related faults that only occur under specific driving conditions (such as high speed or bumpy conditions) can be effectively identified. For example, when abnormal resistance fluctuations are frequently observed in the medium-to-high speed range, it strongly suggests a problem with poor wiring contact due to increased vibration, providing crucial diagnostic clues for maintenance personnel. Furthermore, maintenance personnel can quickly eliminate fault types that are unlikely to occur when the vehicle is parked or at low speeds, or focus their analysis on specific operating conditions, thereby avoiding blind troubleshooting and significantly shortening fault location time.
[0043] Secondly, this application also provides an electrical parameter monitoring system for a CAN bus, including: a main controller, a resistance sampling circuit, a voltage sampling circuit, and a communication interface circuit;
[0044] The controlled terminal and the output terminal of the resistor sampling circuit are respectively connected to the control pin and the sampling pin of the main controller; the current injection terminal and the switching terminal of the resistor sampling circuit are connected in series to the CAN bus.
[0045] The input terminal of the voltage sampling circuit is connected to the high-order signal line and the low-order signal line of the CAN bus, respectively, and its output terminal is connected to the sampling pin of the main controller.
[0046] The communication interface circuit is connected between the main controller and the CAN bus;
[0047] The main controller is configured to: when the CAN bus is idle, activate the resistance sampling circuit via the control pin, inject a predetermined test current into the CAN bus, and calculate the resistance value based on the voltage drop collected by the sampling pin; simultaneously, collect the voltage value via the voltage sampling circuit; determine whether the resistance value and / or the voltage value are in an abnormal state; when the resistance value and / or the voltage value are determined to be abnormal, record abnormal information including a timestamp and the electrical characteristic parameters, and generate an abnormal alarm signal; query a preset abnormal parameter and fault type mapping library according to the electrical characteristic parameters in an abnormal state to output a fault location suggestion; and report the abnormal information, the abnormal alarm signal, and the fault location suggestion via the communication interface circuit.
[0048] The resistance sampling circuit includes a constant current source, a switching element, and a first analog-to-digital converter;
[0049] The control terminal of the switching element constitutes the controlled terminal of the resistor sampling circuit and is connected to the control pin of the main controller.
[0050] The constant current source is connected in series to the CAN bus through the switching element, and is used to provide the predetermined test current when the switching element is turned on.
[0051] The first analog-to-digital converter is used to acquire the voltage drop generated by the predetermined test current, and its output terminal constitutes the output terminal of the resistance sampling circuit.
[0052] In some specific embodiments, the voltage sampling circuit includes a differential amplifier and a second analog-to-digital converter;
[0053] The non-inverting and inverting input terminals of the differential amplifier are respectively connected to the high-order signal line and the low-order signal line of the CAN bus, forming the input terminals of the voltage sampling circuit.
[0054] The output terminal of the differential amplifier is connected to the input terminal of the second analog-to-digital converter, and the output terminal of the second analog-to-digital converter constitutes the output terminal of the voltage sampling circuit.
[0055] Thirdly, this application also provides a vehicle including the aforementioned CAN bus electrical parameter monitoring system. Attached Figure Description
[0056] Figure 1 This is a structural block diagram of the vehicle in the embodiments of this application;
[0057] Figure 2 This is a structural block diagram of the CAN bus electrical parameter monitoring system in the embodiments of this application;
[0058] Figure 3This is a flowchart illustrating the electrical parameter monitoring method for the CAN bus in an embodiment of this application. Detailed Implementation
[0059] Reference Figure 1 This application provides a vehicle 10 that includes multiple electronic control units interconnected via a controller area network (CAN bus) 100.
[0060] Among them, the vehicle 10 can be, but is not limited to, a pure electric vehicle (PEV / BEV), a hybrid electric vehicle (HEV), a range-extended electric vehicle (REEV), a plug-in hybrid electric vehicle (PHEV), a new energy vehicle, or a fuel vehicle.
[0061] In some embodiments, multiple electronic control units may be, for example, an engine control unit (ECU), a transmission control unit (TCU), an anti-lock braking system (ABS) control unit, an electronic stability program (ESP) control unit, an airbag control unit, a battery management system (BMS) control unit, a vehicle controller 200, a body controller 300, an instrument panel control unit, a gateway 400, etc.
[0062] To ensure the communication reliability of the CAN bus, the vehicle 10 in this embodiment of the application also includes a CAN bus electrical parameter monitoring system 300, which includes a main controller 310.
[0063] The resistor sampling circuit 320 has its current injection terminal connected to the high-order signal line (CAN_H) of the CAN bus 100, and its switching terminal connected to the low-order signal line (CAN_L) of the CAN bus 100.
[0064] The voltage sampling circuit 330 has its first input terminal connected to the high-order signal line (CAN_H) of the CAN bus 100, and its second input terminal connected to the low-order signal line (CAN_L) of the CAN bus 100.
[0065] The communication interface circuit 340 is connected to the main controller 310, and its bus-side interface is connected to the CAN bus 100.
[0066] The control pin of the main controller 310 is connected to the controlled terminal of the resistance sampling circuit 320, the first sampling pin of the main controller 310 is connected to the output terminal of the resistance sampling circuit, and the second sampling pin of the main controller is connected to the output terminal of the voltage sampling circuit 330.
[0067] Reference Figure 2 In this embodiment, the resistance sampling circuit 320 includes:
[0068] The constant current source 322 has its output terminal as the current injection terminal;
[0069] The electromagnetic relay 321 has a control coil forming the controlled terminal, and its normally open contact is connected in series between the constant current source 321 and the switching terminal.
[0070] The sampling resistor is 323, connected between the switch terminal and ground;
[0071] The first analog-to-digital converter 324 has its input channel connected in parallel across the sampling resistor 323, and its digital output terminal forms the output terminal.
[0072] The voltage sampling circuit 330 includes:
[0073] The differential amplifier 331 has its non-inverting input terminal and its inverting input terminal forming the first input terminal and the second input terminal, respectively.
[0074] The input channel of the low-pass filter 332 is connected to the output of the differential amplifier 331;
[0075] The second analog-to-digital converter 333 has its input channel connected in parallel across the low-pass filter 332, and its digital output terminal forms the output terminal.
[0076] The communication interface circuit 340 is a CAN bus transceiver, and its controller-side interface is directly connected to the serial communication pin of the main controller 310 through the sixth wire.
[0077] In this embodiment, the first analog-to-digital converter 324 and the second analog-to-digital converter 333 can be physically integrated into the same analog-to-digital converter chip, and time-division multiplexing can be achieved by switching different input channels through an internal multiplexer.
[0078] The system 300 operates as follows: When the vehicle is in motion, the main controller 310 monitors the level status on the data link layer of the CAN bus 100 to determine the idle period of the CAN bus. Then, it drives the electromagnetic relay 321 to close via a control pin, causing the constant current source 322 to inject test current into the CAN bus 100. Simultaneously, the first analog-to-digital converter 324 acquires the voltage drop across the sampling resistor 323, calculates the bus resistance value, and the second analog-to-digital converter 333 synchronously acquires the differential voltage value output by the differential amplifier 331. When an abnormal parameter is detected, the main controller 310 sends an abnormal alarm signal to the vehicle's instrument panel via the CAN bus transceiver.
[0079] In this embodiment, the main controller 310 may be a low-cost, automotive-grade 8-bit microcontroller (e.g., STC89C52) with 16KB of integrated Flash memory. This microcontroller, as the brain of the monitoring system, can be located on the circuit board of the gateway 400.
[0080] The constant current source 322, for example, is built using the LM334 chip, and outputs a stable and accurate 3mA constant current as the predetermined test current.
[0081] The main controller 310 monitors the data link layer of the CAN bus 100 in real time. When 11 consecutive recessive bits are detected, the CAN bus 100 is determined to have entered an idle state.
[0082] The main controller 310 immediately outputs a high level through its control pin, driving the electromagnetic relay 321 to close for a first predetermined duration (50μs). During this time, a 3mA constant current source 322 is connected to the CAN bus 100, generating a voltage drop across the equivalent resistance of the CAN bus 100. This voltage drop is converted into a small voltage signal by the sampling resistor 323, acquired by the first analog-to-digital converter 324 (channel 1 of the ADC0832), and the real-time resistance value is calculated according to the formula R = U / 3mA.
[0083] Meanwhile, within the same 100ms sampling period, synchronized with resistor sampling, the main controller 310 switches the input channel of ADC0832 and acquires the signal output by differential amplifier 331 through the second analog-to-digital converter 333 (such as channel 2 of ADC0832) to obtain the differential voltage value between CAN_H and CAN_L.
[0084] The main controller 310 compares the calculated resistance and voltage values with internally preset static anomaly judgment threshold ranges. Specifically, it compares the resistance value with its corresponding preset resistance anomaly threshold range; if the resistance value exceeds the preset resistance anomaly threshold range, it is considered an abnormal resistance value. Similarly, it compares the voltage value with its corresponding preset voltage anomaly threshold range; if the voltage value exceeds the preset voltage anomaly threshold range, it is considered an abnormal voltage value. In this embodiment, the preset resistance anomaly threshold range is a first range set based on the terminal resistance value of the CAN bus 100, and the preset voltage anomaly threshold range is a second range set based on the standard common-mode voltage value of the CAN bus 100 in the recessive state.
[0085] For example, in this embodiment of the application, the terminating resistor of the CAN bus 100 is 60Ω. The preset abnormal resistance threshold range is, for example, within ±10% of the terminating resistor value of the CAN bus 100, which means the preset abnormal resistance threshold range is between 54Ω and 66Ω. Based on the standard common-mode voltage of the CAN bus 100 in the recessive state being 2.5V, and the preset abnormal voltage threshold range being ±0.2V based on the standard common-mode voltage of the CAN bus 100 in the recessive state, the preset abnormal voltage threshold range is between 2.3V and 2.7V.
[0086] The main controller 310 compares the calculated resistance and voltage values with internally preset dynamic anomaly detection thresholds. These preset dynamic anomaly detection thresholds include preset resistance anomaly thresholds and preset voltage anomaly thresholds; these thresholds are pre-calibrated values representing jumps in resistance and voltage parameters caused by vehicle vibration. For example, the preset resistance anomaly threshold is 5Ω, and the preset voltage anomaly threshold is 0.3V.
[0087] In this embodiment, a static anomaly is triggered if the detected resistance value is <54Ω or >66Ω. A static anomaly is triggered if the voltage value is <2.3V or >2.7V. A dynamic anomaly is triggered if the fluctuation of the resistance value in 5 consecutive samples is >5 ohms, or the fluctuation of the voltage value is >0.3V.
[0088] Once an anomaly is detected, the controller 310 records an entry in its internal Flash memory, including a timestamp (accurate to the second), the abnormal resistance and voltage values, and the current vehicle driving status parameters (such as vehicle speed). It then sends a CAN message with a specific identifier to the vehicle's CAN bus 100 via the communication interface circuit 340 (TJA1050), activating the yellow warning light on the instrument panel.
[0089] In this embodiment of the application, the abnormal parameter and fault type mapping library includes at least one of the following mapping relationships:
[0090] If the resistance value continues to be higher than the upper limit of its corresponding preset resistance abnormality threshold range and the fluctuation of the resistance value exceeds its corresponding preset dynamic abnormality judgment threshold, it corresponds to the first fault type of poor terminal resistor connection of CAN bus 100.
[0091] If the resistance value is consistently lower than the lower limit of its corresponding preset resistance abnormality threshold range, it corresponds to the second fault type, which is either a short circuit in the CAN bus 100's terminating resistor or multiple CAN bus 100 terminating resistors connected in parallel.
[0092] If the voltage value remains below the lower limit of its corresponding preset voltage abnormality threshold range, it corresponds to the third fault type of short circuit between the high-order signal line and the low-order signal line of the CAN bus 100.
[0093] If the voltage value is consistently higher than the upper limit of its corresponding preset voltage abnormality threshold range and the voltage value fluctuation exceeds its corresponding preset dynamic abnormality judgment threshold, it corresponds to the fourth fault type, which is an abnormality in the power supply module supplying power to the CAN bus or electromagnetic interference received by the CAN bus 100.
[0094] Specifically, if the resistance value is >66 ohms and the fluctuation is >3 ohms, then the first fault type is a loose or oxidized terminal resistor connector.
[0095] If the resistance value is less than 54 ohms, then the second fault type is a short circuit in the terminating resistor or multiple resistors in parallel.
[0096] If the voltage value is <2.3V and stable, then the third fault type, a short circuit between CAN_H and CAN_L lines, is matched.
[0097] If the voltage value is >2.7V and the fluctuation is >0.2V, then it is the fourth fault type, which is a power supply module malfunction or electromagnetic interference.
[0098] The fault location suggestion is also sent via CAN message and can be read by the diagnostic tool from the OBD interface of vehicle 10, providing engineers with direct troubleshooting directions.
[0099] The aforementioned system can continuously capture the dynamic changes in the electrical characteristic parameters of the CAN bus 100, identify abnormal signs at the incipient stage of a fault, and significantly advance the problem detection time from passive maintenance to proactive early warning, creating a valuable window of opportunity for risk management.
[0100] By establishing a mapping library between abnormal parameters and fault types, abstract electrical characteristic parameter anomalies can be directly transformed into specific maintenance guidelines. Maintenance personnel no longer need to perform tedious point-by-point troubleshooting; they can quickly pinpoint the root cause of the fault simply by following the vehicle's prompts, significantly improving the accuracy of problem location and processing efficiency.
[0101] The system utilizes common components, offering excellent cost control and adaptability. It can be directly embedded into existing vehicle systems without altering the original vehicle architecture, creating favorable conditions for large-scale deployment. The entire monitoring process is fully automated, requiring no professional personnel, effectively lowering the technical threshold and operating costs. This transforms traditional experience-based bus maintenance into a standardized and intelligent monitoring process.
[0102] Reference Figure 3 In this embodiment of the application, a method for monitoring electrical parameters of a CAN bus is also provided, the method comprising:
[0103] S101, when the CAN bus 100 is in an idle state, inject a predetermined test current into the CAN bus 100 and collect the electrical characteristic parameters of the CAN bus 100.
[0104] S102, Determine whether the electrical characteristic parameters are in an abnormal state;
[0105] S103, When an abnormal state of electrical characteristic parameters is detected, record the abnormal information including timestamp and electrical characteristic parameters, and generate an abnormal alarm signal;
[0106] S104. Based on the electrical characteristic parameters in an abnormal state, query the preset abnormal parameter and fault type mapping library to output fault location suggestions.
[0107] S105, report abnormal information, abnormal alarm signals and fault location suggestions.
[0108] Taking the aforementioned electrical parameter monitoring system 300 for the CAN bus 100 as an example, in step S101, the idle period of the CAN bus 100 is identified by monitoring the level status of the data link layer of the CAN bus 100. When multiple consecutive recessive bits are detected, it is determined that the CAN bus 100 has entered an idle state, and then the corresponding switching element is controlled to turn on, injecting a predetermined test current into the CAN bus.
[0109] In practice, the electrical characteristic parameters include resistance and voltage values. A 3mA constant current source 322 is used as the current source for testing, and the current is controlled by an electromagnetic relay 321. The current injection duration is controlled within 50 microseconds to ensure that normal communication is not affected. At the same time, the voltage drop on the bus is collected by a voltage sampling circuit 330, and the resistance value is calculated according to Ohm's law. The differential voltage between the high-order and low-order signal lines of the CAN bus 100 is also collected as the voltage value.
[0110] In step S302, the collected electrical characteristic parameters are compared with preset static anomaly judgment thresholds, including resistance anomaly threshold ranges set based on standard terminal resistance values and voltage anomaly threshold ranges set based on standard common-mode voltage values. Simultaneously, by analyzing the fluctuations in data from multiple consecutive samples, it is determined whether the electrical characteristic parameters exceed preset dynamic anomaly judgment thresholds. This combined static and dynamic judgment method can identify both steady-state deviations of parameters and capture dynamic anomalies caused by vibration, poor contact, etc.
[0111] In step S302, the electrical characteristic parameters are compared with their corresponding preset static anomaly judgment threshold range, and the electrical characteristic parameters are compared with their corresponding preset dynamic anomaly judgment threshold.
[0112] If the electrical characteristic parameter exceeds its corresponding preset static anomaly judgment threshold range, and / or if the fluctuation of the electrical characteristic parameter exceeds its corresponding preset dynamic anomaly judgment threshold in multiple consecutive samplings, the electrical characteristic parameter is determined to be in an abnormal state.
[0113] Among them, the preset static anomaly judgment threshold range includes the preset resistance anomaly threshold range and the preset voltage anomaly threshold range;
[0114] The preset resistance abnormality threshold range is a first range set based on the terminal resistance value of the CAN bus 100, and the preset voltage abnormality threshold range is a second range set based on the standard common-mode voltage value of the CAN bus 100 in the recessive state.
[0115] The preset dynamic anomaly detection thresholds include preset resistance anomaly thresholds and preset voltage anomaly thresholds;
[0116] The preset resistance abnormality threshold and preset voltage abnormality threshold are the resistance parameter jump values and voltage parameter jump values caused by vehicle driving vibration, which are pre-calibrated.
[0117] When step S102 determines that the parameter is in an abnormal state, step S103 is executed to record the abnormal information containing a precise timestamp and generate an abnormal alarm signal. In addition to electrical parameters, the abnormal information also includes vehicle operating status parameters, such as vehicle speed. This operating condition data provides important information for subsequent fault analysis.
[0118] In step S104, based on the characteristics of the abnormal parameters, a preset mapping library of abnormal parameters and fault types is queried, and targeted fault location suggestions are output. This mapping library is established based on a large amount of experimental data and fault cases, and contains identification rules for various typical fault modes. For example, when a resistance value is detected to be continuously high and accompanied by fluctuations, it can indicate a poor connection of the terminating resistor; when a voltage value is continuously low and stable, it can indicate a short circuit fault between lines.
[0119] The abnormal parameter and fault type mapping library contains at least one of the following mapping relationships:
[0120] If the resistance value continues to be higher than the upper limit of its corresponding preset resistance abnormality threshold range and the fluctuation of the resistance value exceeds its corresponding preset dynamic abnormality judgment threshold, it corresponds to the first fault type of poor terminal resistor connection of CAN bus 100.
[0121] If the resistance value is consistently lower than the lower limit of its corresponding preset resistance abnormality threshold range, it corresponds to the second fault type, which is either a short circuit in the CAN bus 100's terminating resistor or multiple CAN bus 100 terminating resistors connected in parallel.
[0122] If the voltage value remains below the lower limit of its corresponding preset voltage abnormality threshold range, it corresponds to the third fault type of short circuit between the high-order signal line and the low-order signal line of the CAN bus 100.
[0123] If the voltage value is consistently higher than the upper limit of its corresponding preset voltage abnormality threshold range and the voltage value fluctuation exceeds its corresponding preset dynamic abnormality judgment threshold, it corresponds to the fourth fault type, which is either a power supply module malfunction that powers the CAN bus 100 or electromagnetic interference received by the CAN bus 100.
[0124] In step S105, abnormal information, abnormal alarm signals, and fault location suggestions are reported via the vehicle communication bus. This information can be sent to the instrument panel for displaying warning messages via the CAN bus 100, and simultaneously stored in the diagnostic system for maintenance personnel to read detailed data via the OBD interface. The entire monitoring process is executed in a 100ms cycle to ensure continuous monitoring of the status of the CAN bus 100.
[0125] It should be understood that the application of this application is not limited to the examples above. Those skilled in the art can make improvements or modifications based on the above description, and all such improvements and modifications should fall within the protection scope of the appended claims. Those skilled in the art can understand that implementing all or part of the processes of the above embodiments and making equivalent changes according to the claims of this application still fall within the scope of this application.
Claims
1. A method of monitoring electrical parameters of a CAN bus, characterized in that, The method comprises: injecting a predetermined test current into the CAN bus when the CAN bus is in an idle state, collecting an electrical characteristic parameter of the CAN bus; determining whether the electrical characteristic parameter is in an abnormal state; when it is identified that the electrical characteristic parameter is in an abnormal state, recording abnormal information containing a time stamp and the electrical characteristic parameter, and generating an abnormal alarm signal; querying a preset abnormal parameter and fault type mapping library according to the electrical characteristic parameter in the abnormal state to output a fault positioning suggestion; reporting the abnormal information, the abnormal alarm signal and the fault positioning suggestion.
2. The method of monitoring electrical parameters of a CAN bus according to claim 1, characterized in that, The electrical characteristic parameter comprises a resistance value and a voltage value, and the step of injecting a predetermined test current into the CAN bus when the CAN bus is in an idle state, collecting an electrical characteristic parameter of the CAN bus comprises: when a plurality of consecutive recessive bits are detected on the data link layer of the CAN bus, it is determined that the CAN bus is in an idle state, and then a switch element is controlled to be turned on to inject a predetermined test current for a first predetermined time length; measuring a voltage drop generated due to the injection of the predetermined test current, and calculating the resistance value according to the formula R=U / I, wherein U is the voltage drop and I is the predetermined test current; synchronously measuring the differential voltage between the high bit signal line and the low bit signal line of the CAN bus as the voltage value.
3. The method of monitoring electrical parameters of a CAN bus according to claim 1, characterized in that, The step of determining whether the electrical characteristic parameter is in an abnormal state comprises: comparing the electrical characteristic parameter with a corresponding preset static abnormality determination threshold range, and comparing the electrical characteristic parameter with a corresponding preset dynamic abnormality determination threshold; if the electrical characteristic parameter exceeds the corresponding preset static abnormality determination threshold range, and / or if the fluctuation of the electrical characteristic parameter exceeds the corresponding preset dynamic abnormality determination threshold in a plurality of consecutive samplings, it is determined that the electrical characteristic parameter is in an abnormal state.
4. The method of monitoring electrical parameters of a CAN bus according to claim 3, characterized in that, The preset static abnormality determination threshold range comprises a preset resistance abnormality threshold range and a preset voltage abnormality threshold range; The preset resistance abnormality threshold range is a first range set based on the terminal resistance value of the CAN bus, and the preset voltage abnormality threshold range is a second range set based on the standard common mode voltage value of the CAN bus in the recessive state; The preset dynamic abnormality determination threshold comprises a preset resistance abnormality threshold and a preset voltage abnormality threshold; The preset resistance abnormality threshold and the preset voltage abnormality threshold are the resistance parameter jump value and the voltage parameter jump value caused by vehicle driving vibration, which are calibrated in advance.
5. The method of monitoring electrical parameters of a CAN bus according to claim 4, characterized in that, The abnormal parameter and fault type mapping library contains at least one of the following mapping relationships: If the resistance value is continuously higher than the upper limit of the corresponding preset resistance abnormality threshold range and the fluctuation of the resistance value exceeds the corresponding preset dynamic abnormality determination threshold, it corresponds to a first fault type of poor connection of the terminal resistance of the CAN bus; If the resistance value is continuously lower than the lower limit of the corresponding preset resistance abnormality threshold range, it corresponds to a second fault type of short circuit of the terminal resistance of the CAN bus or parallel connection of a plurality of terminal resistances of the CAN bus. the voltage value continuously being lower than the lower limit of the corresponding preset voltage abnormal threshold range, corresponding to a third fault type of short circuit between the high signal line and the low signal line of the CAN bus; the voltage value continuously being higher than the upper limit of the corresponding preset voltage abnormal threshold range and the fluctuation of the voltage value exceeding the corresponding preset dynamic abnormality determination threshold, corresponding to a fourth fault type of abnormality of a power supply module supplying power to the CAN bus or electromagnetic interference received by the CAN bus.
6. The method of monitoring electrical parameters of a CAN bus according to claim 1, characterized in that, The abnormal information further includes a driving state parameter of the vehicle, and the driving state parameter includes a vehicle speed.
7. A system for monitoring electrical parameters of a CAN bus, characterized in that The system comprises: a main controller, a resistance sampling circuit, a voltage sampling circuit, and a communication interface circuit; a controlled end and an output end of the resistance sampling circuit are connected to a control pin and a sampling pin of the main controller, respectively; a current injection end and a switch end of the resistance sampling circuit are used to be connected in series to the CAN bus; input ends of the voltage sampling circuit are connected to the high signal line and the low signal line of the CAN bus, respectively, and an output end of the voltage sampling circuit is connected to the sampling pin of the main controller; the communication interface circuit is connected between the main controller and the CAN bus; the main controller is configured to: when the CAN bus is in an idle state, start the resistance sampling circuit through the control pin, inject a predetermined test current into the CAN bus, and calculate a resistance value based on a voltage drop collected by the sampling pin; at the same time, collect a voltage value through the voltage sampling circuit; determine whether the resistance value and / or the voltage value are in an abnormal state, record abnormal information containing a time stamp and the electrical characteristic parameter, and generate an abnormal alarm signal when it is determined that the resistance value and / or the voltage value are abnormal; query a preset abnormal parameter and fault type mapping library according to the electrical characteristic parameter in the abnormal state to output a fault positioning suggestion; and report the abnormal information, the abnormal alarm signal, and the fault positioning suggestion through the communication interface circuit.
8. The CAN bus electrical parameter monitoring system of claim 7, wherein, The resistance sampling circuit comprises a constant current source, a switch element, and a first analog-to-digital converter; a control end of the switch element constitutes a controlled end of the resistance sampling circuit and is connected to a control pin of the main controller; the constant current source is connected in series to the CAN bus through the switch element and is used to provide the predetermined test current when the switch element is turned on; the first analog-to-digital converter is used to collect a voltage drop caused by the predetermined test current, and an output end of the first analog-to-digital converter constitutes an output end of the resistance sampling circuit.
9. The CAN bus electrical parameter monitoring system as claimed in claim 7, wherein, The voltage sampling circuit comprises a differential amplifier and a second analog-to-digital converter; the differential amplifier comprises a non-inverting input end and an inverting input end, and the non-inverting input end and the inverting input end are connected to the high signal line and the low signal line of the CAN bus, respectively, constituting input ends of the voltage sampling circuit; an output end of the differential amplifier is connected to an input end of the second analog-to-digital converter, and an output end of the second analog-to-digital converter constitutes an output end of the voltage sampling circuit.
10. A vehicle characterized by comprising: The system comprises the CAN bus of any one of claims 7-9.