CAN communication devices and CAN communication device connection detection methods

CN122578488APending Publication Date: 2026-08-14JIKE TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-11
Publication Date
2026-08-14

AI Technical Summary

Technical Problem

[0004]本申请提供了一种CAN通信设备及CAN通信设备连接检测方法,用以解决现有技术中通过增加一根专用的信号线进行CAN通信设备连接状态的识别,从而导致线束布置的复杂度,增加线束之间的干扰的问题

Benefits of technology

[0045]本申请提供一种CAN通信设备及CAN通信设备连接检测方法,在CAN通信设备中,控制单元控制CAN通信单元关闭,并向通断单元输出第一控制信号,以使通断单元的第一端与通断单元的第二端之间的通路、通断单元的第三端与通断单元的第四端之间的通路均导通;如果CAN通信设备与第一CAN通信设备连接,则通断单元的第五端的电压为第一电压,比较单元基于第一电压,输出第一检测信号,控制单元接收到第一检测信号后,基于第一检测信号,确定CAN通信设备与第一CAN通信设备连接;控制单元确定CAN通信设备与第一CAN通信设备连接后,输出第二控制信号,以使通断单元的第一端与通断单元的第二端之间的通路、通断单元的第三端与通断单元的第四端之间的通路均断开,并控制CAN通信单元开启;如果CAN通信设备与第一CAN通信设备脱离,则通断单元的第五端的电压为第二电压,比较单元基于第二电压,输出第二检测信号,控制单元接收到第二检测信号后,基于第二检测信号,确定第一CAN通信设备与CAN通信设备脱离,控制单元在确定第一CAN通信设备与CAN通信设备脱离后,维持输出第一控制信号。由于CAN通信设备中增加了通断单元和比较单元,通过通断单元、比较单元和控制单元相结合识别第一CAN通信设备与CAN通信设备之间的连接状态,相比于采用一根单独的信号线,可以节省CAN通信设备内部线束空间,降低线束布置困难,减少线束之间的干扰。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122578488A_ABST
    Figure CN122578488A_ABST
Patent Text Reader

Abstract

This application provides a CAN communication device and a CAN communication device connection detection method. The control unit controls the CAN communication unit to turn off and outputs a first control signal to make the path between the first terminal and the second terminal, and the third terminal and the fourth terminal of the on / off unit open. Based on the first detection signal, the control unit determines that the first CAN communication device is connected and outputs a second control signal to make the path between the first terminal and the second terminal, and the third terminal and the fourth terminal of the on / off unit disconnect, and controls the CAN communication unit to turn on. Alternatively, based on the second detection signal, the control unit determines that the first CAN communication device is disconnected and outputs the first control signal. The comparison unit generates the first and second detection signals based on the voltage of the fifth terminal of the on / off unit. The CAN communication device identifies whether the first CAN communication device is connected through the on / off and comparison units. Compared with using a separate signal line, this method saves internal wiring harness space, reduces wiring difficulty, and reduces interference between wiring harnesses.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of communication equipment technology, and in particular to a CAN communication device and a method for detecting the connection of a CAN communication device. Background Technology

[0002] In CAN communication devices, to achieve low-power management, it is necessary to accurately detect the connection status of other CAN communication devices. When a CAN communication device is connected to other CAN communication devices, the CAN communication device is powered on; when the CAN communication device is disconnected from other CAN communication devices, the power output must be turned off, and it enters a low-power standby mode.

[0003] In existing technologies, an additional dedicated signal line is usually required to identify the connection status of CAN communication devices. However, due to the highly compact wiring harness space inside CAN communication devices, adding an extra physical wiring harness increases the complexity of wiring harness arrangement and increases interference between wiring harnesses. Summary of the Invention

[0004] This application provides a CAN communication device and a CAN communication device connection detection method to solve the problem in the prior art that the identification of the connection status of the CAN communication device is carried out by adding a dedicated signal line, which leads to the complexity of the wiring harness layout and increases the interference between the wiring harnesses.

[0005] In a first aspect, this application provides a CAN communication device for communicating with a first CAN communication device, the CAN communication device comprising: a control unit, an on / off unit, a comparison unit, and a CAN communication unit;

[0006] The control unit is electrically connected to the on / off unit, the comparison unit, and the CAN communication unit. The first terminal of the on / off unit is used to input the power supply voltage. The second terminal of the on / off unit is electrically connected to the first terminal of the CAN communication unit and serves as the first detection terminal of the CAN communication device. The third terminal of the on / off unit is electrically connected to the second terminal of the CAN communication unit and serves as the second detection terminal of the CAN communication device. The fourth terminal of the on / off unit is grounded. The fifth terminal of the on / off unit is electrically connected to the input terminal of the comparison unit. When the CAN communication device is connected to the first CAN communication device, the first detection terminal is electrically connected to the first terminal of the terminating resistor of the CAN bus of the first CAN communication device, and the second detection terminal is electrically connected to the second terminal of the terminating resistor.

[0007] The control unit is used to control the CAN communication unit to turn off and output a first control signal to the on / off unit; receive a first detection signal or a second detection signal output by the comparison unit; based on the first detection signal, after determining that the CAN communication device is connected to the first CAN communication device, output a second control signal and control the CAN communication unit to turn on; based on the second detection signal, after determining that the CAN communication device is disconnected from the first CAN communication device, maintain the output of the first control signal.

[0008] The switching unit is configured to, under the control of the first control signal, open the path between the first end and the second end of the switching unit, and open the path between the third end and the fourth end of the switching unit; or, under the control of the second control signal, disconnect the path between the first end and the second end of the switching unit, and disconnect the path between the third end and the fourth end of the switching unit.

[0009] The comparison unit is configured to output the first detection signal based on the first voltage of the fifth terminal of the on / off unit when the CAN communication device is connected to the first CAN communication device and the path between the first terminal and the second terminal of the on / off unit is open, and the path between the third terminal and the fourth terminal of the on / off unit is open; or when the CAN communication device is disconnected from the first CAN communication device and the path between the first terminal and the second terminal of the on / off unit is open, and the path between the third terminal and the fourth terminal of the on / off unit is open, the comparison unit is configured to output the second detection signal based on the second voltage of the fifth terminal of the on / off unit.

[0010] In one possible implementation, after the CAN communication unit is turned on, it is also used to listen to the CAN heartbeat packets sent by the first CAN communication device and send the listened CAN heartbeat packets to the control unit.

[0011] The control unit is further configured to determine, based on the received CAN heartbeat packet, whether the CAN communication device has become disconnected from the first CAN communication device.

[0012] In one possible implementation, the control unit is specifically used for:

[0013] If no CAN heartbeat packet is received within a preset time period, the CAN communication unit is controlled to shut down and the first control signal is output; if the second detection signal output by the comparison unit is received, it is determined that the CAN communication device is disconnected from the first CAN communication device; if the first detection signal output by the comparison unit is received, it is determined that the CAN communication device is not disconnected from the first CAN communication device.

[0014] In one possible implementation, after the control unit determines that the CAN communication device has disconnected from the first CAN communication device, it is further configured to: maintain the output of the first control signal;

[0015] After determining that the CAN communication device is not disconnected from the first CAN communication device, the control unit is further configured to: output the second control signal and control the CAN communication unit to turn on.

[0016] In one possible implementation, the switching unit includes a first switching unit and a second switching unit;

[0017] The input terminal of the first switching unit is used as the input terminal of the switching unit, the first end of the first switching unit is used as the first end of the switching unit, the second end of the first switching unit is used as the second end of the switching unit, and the third end of the first switching unit is grounded.

[0018] The first switching unit is configured to, under the control of the first control signal, connect the path between the first terminal and the third terminal of the first switching unit, and then connect the path between the first terminal and the second terminal of the first switching unit; and under the control of the second control signal, disconnect the path between the first terminal and the third terminal of the first switching unit, and then disconnect the path between the first terminal and the second terminal of the first switching unit.

[0019] The input terminal of the second switching unit serves as the input terminal of the switching unit, the first terminal of the second switching unit serves as the third terminal of the switching unit, the second terminal of the second switching unit serves as the fourth terminal of the switching unit, and the third terminal of the second switching unit serves as the fifth terminal of the switching unit.

[0020] The second switching unit is used to, under the control of the first control signal, open the path between the first end of the second switching unit and the second end of the second switching unit; and under the control of the second control signal, disconnect the path between the first end of the second switching unit and the second end of the second switching unit.

[0021] In one possible implementation, the first switching unit includes a first switching transistor, a second switching transistor, a first resistor, a second resistor, a third resistor, a fourth resistor, and a fifth resistor;

[0022] The first end of the first resistor serves as the input terminal of the first switching unit, and the second end of the first resistor is electrically connected to the first end of the second resistor and the control terminal of the first switching transistor.

[0023] The second end of the second resistor is electrically connected to the second end of the first switch and the ground terminal;

[0024] The first terminal of the first switching transistor is electrically connected to the first terminal of the third resistor;

[0025] The second end of the third resistor is electrically connected to the first end of the fourth resistor and the control end of the second switch.

[0026] The second end of the fourth resistor is electrically connected to the first end of the second switching transistor and serves as the first end of the first switching unit.

[0027] The second terminal of the second switching transistor is electrically connected to the first terminal of the fifth resistor;

[0028] The second end of the fifth resistor serves as the second end of the first on / off unit.

[0029] In one possible implementation, the second switching unit includes a third switching transistor, a sixth resistor, and a seventh resistor;

[0030] The first end of the sixth resistor serves as the input end of the second switching unit, and the second end of the sixth resistor is electrically connected to the control end of the third switching transistor.

[0031] The first end of the third switch transistor serves as the first end of the second switching unit, and the second end of the third switch transistor is electrically connected to the first end of the seventh resistor and serves as the third end of the second switching unit.

[0032] The second end of the seventh resistor serves as the second end of the second on / off unit.

[0033] In one possible implementation, the first switching unit further includes a first diode;

[0034] The anode of the first diode is electrically connected to the second terminal of the fifth resistor, and the cathode of the first diode serves as the second terminal of the first switching unit.

[0035] The second switching unit also includes a second diode;

[0036] The anode of the second diode serves as the first terminal of the second switching unit, and the cathode of the second diode is electrically connected to the first terminal of the third switching transistor.

[0037] In one possible implementation, the comparison unit includes a comparator, an eighth resistor, a ninth resistor, a first capacitor, a second capacitor, and a third capacitor;

[0038] The positive input terminal of the comparator is electrically connected to the first terminal of the first capacitor and serves as the input terminal of the comparison unit. The negative input terminal of the comparator is electrically connected to the first terminal of the eighth resistor, the first terminal of the ninth resistor, and the first terminal of the second capacitor. The ground terminal of the comparator is electrically connected to the second terminal of the first capacitor and grounded. The power supply terminal of the comparator is electrically connected to the second terminal of the eighth resistor and the first terminal of the third capacitor and receives the power supply voltage. The output terminal of the comparator serves as the output terminal of the comparison unit.

[0039] The second terminal of the second capacitor is electrically connected to the second terminal of the third capacitor and the second terminal of the ninth resistor, and is grounded.

[0040] Secondly, this application provides a CAN communication device connection detection method, applied to any of the CAN communication devices described in the first aspect, the method comprising:

[0041] The CAN communication unit in the CAN communication device is turned off, and a first control signal is output to the on / off unit in the CAN communication device. Under the control of the first control signal, the on / off unit opens the path between the first end and the second end of the on / off unit, and opens the path between the third end and the fourth end of the on / off unit.

[0042] The system receives a first detection signal or a second detection signal output by the comparison unit in the CAN communication device. Based on the first detection signal, it determines that the CAN communication device is connected to the first CAN communication device. Based on the second detection signal, it determines that the CAN communication device is disconnected from the first CAN communication device. Specifically, when the CAN communication device is connected to the first CAN communication device, and the path between the first and second ends of the on / off unit is open, and the path between the third and fourth ends of the on / off unit is open, the comparison unit outputs the first detection signal. When the CAN communication device is disconnected from the first CAN communication device, and the path between the first and second ends of the on / off unit is open, and the path between the third and fourth ends of the on / off unit is open, the comparison unit outputs the second detection signal.

[0043] After confirming that the CAN communication device is connected to the first CAN communication device, a second control signal is output, and the CAN communication unit is turned on. Under the control of the second control signal, the switching unit disconnects the path between the first end and the second end of the switching unit, and disconnects the path between the third end and the fourth end of the switching unit. After confirming that the CAN communication device is disconnected from the first CAN communication device, the first control signal is maintained.

[0044] The beneficial effects of this application are as follows:

[0045] This application provides a CAN communication device and a CAN communication device connection detection method. In the CAN communication device, the control unit controls the CAN communication unit to turn off and outputs a first control signal to the on / off unit, so that the path between the first terminal and the second terminal of the on / off unit, and the path between the third terminal and the fourth terminal of the on / off unit are both connected. If the CAN communication device is connected to a first CAN communication device, the voltage at the fifth terminal of the on / off unit is a first voltage. Based on the first voltage, the comparison unit outputs a first detection signal. After receiving the first detection signal, the control unit determines that the CAN communication device is connected to the first CAN communication device based on the first detection signal. The control unit determines that the CAN communication device is connected to the first CAN communication device. After the communication device connects to the first CAN communication device, it outputs a second control signal to disconnect the paths between the first and second terminals of the on / off unit, and between the third and fourth terminals of the on / off unit, and controls the CAN communication unit to turn on. If the CAN communication device disconnects from the first CAN communication device, the voltage at the fifth terminal of the on / off unit becomes a second voltage. Based on the second voltage, the comparison unit outputs a second detection signal. After receiving the second detection signal, the control unit determines that the first CAN communication device has disconnected from the first CAN communication device. After determining that the first CAN communication device has disconnected from the first CAN communication device, the control unit continues to output the first control signal. Because the CAN communication device adds an on / off unit and a comparison unit, the connection status between the first CAN communication device and the first CAN communication device is identified by combining the on / off unit, the comparison unit, and the control unit. Compared with using a single signal line, this saves internal wiring space in the CAN communication device, reduces wiring layout difficulties, and reduces interference between wiring harnesses. Attached Figure Description

[0046] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0047] Figure 1 This is a schematic diagram of the structure of a CAN communication device provided in an embodiment of this application;

[0048] Figure 2 A circuit diagram of an on / off unit provided in an embodiment of this application;

[0049] Figure 3 A circuit diagram of another on / off unit provided in an embodiment of this application;

[0050] Figure 4 A circuit diagram of a CAN communication device provided in an embodiment of this application;

[0051] Figure 5 A circuit diagram of another CAN communication device provided in an embodiment of this application;

[0052] Figure 6 This is a flowchart illustrating a CAN communication device provided in an embodiment of this application;

[0053] Figure 7 This is a flowchart illustrating a CAN communication device connection detection method provided in an embodiment of this application. Detailed Implementation

[0054] To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0055] It should be noted that the terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.

[0056] Traditional methods for detecting whether a CAN communication device is connected to other CAN communication devices use a single signal line. When the CAN communication device is disconnected from other CAN communication devices, the signal line is in a floating state and therefore at a high level. When the CAN communication device is connected to other CAN communication devices, this signal line is pulled low. The CAN communication device determines whether other CAN communication devices are connected by detecting the high-low level change of this signal line.

[0057] However, in CAN communication devices, the internal wiring harness space is very compact. Adding an extra signal line increases the complexity of the wiring harness, makes wiring harness layout difficult, and increases interference between wiring harnesses.

[0058] To address the aforementioned issues, this application provides a CAN communication device and a CAN communication device connection detection method. For ease of understanding, the CAN communication device and CAN communication device connection detection method provided in this application are described in detail below with reference to the accompanying drawings.

[0059] like Figure 1 The diagram shown is a structural schematic of a CAN communication device provided in an embodiment of this application. The CAN communication device is used to communicate with a first CAN communication device 15. The CAN communication device includes: a control unit 11, an on / off unit 12, a comparison unit 13, and a CAN communication unit 14.

[0060] The control unit 11 is electrically connected to the on / off unit 12, the comparison unit 13, and the CAN communication unit 14. The first terminal of the on / off unit 12 is used to input the power supply voltage VCC. The second terminal of the on / off unit 12 is electrically connected to the first terminal of the CAN communication unit 14 and serves as the first detection terminal 1 of the CAN communication device. The third terminal of the on / off unit 12 is electrically connected to the second terminal of the CAN communication unit 14 and serves as the second detection terminal 2 of the CAN communication device. The fourth terminal of the on / off unit 12 is grounded. The fifth terminal of the on / off unit 12 is electrically connected to the input terminal of the comparison unit 13. When the CAN communication device is connected to the first CAN communication device 15, the first detection terminal 1 is electrically connected to the first terminal of the CAN bus termination resistor RA in the first CAN communication device 15, and the second detection terminal 2 is electrically connected to the second terminal of the termination resistor RA. When the CAN communication device is disconnected from the first CAN communication device 15, the first detection terminal 1 is disconnected from the first terminal of the termination resistor RA, and the second detection terminal 2 is disconnected from the second terminal of the termination resistor RA.

[0061] The control unit 11 is used to control the CAN communication unit 14 to turn off and output a first control signal to the on / off unit 12; receive a first detection signal or a second detection signal output by the comparison unit 13; based on the first detection signal, after determining that the CAN communication device is connected to the first CAN communication device 15, output a second control signal and control the CAN communication unit 14 to turn on; based on the second detection signal, after determining that the CAN communication device is disconnected from the first CAN communication device 15, maintain the output of the first control signal.

[0062] The switching unit 12 is used to, under the control of a first control signal, open the path between the first end and the second end of the switching unit 12, and open the path between the third end and the fourth end of the switching unit 12; or, under the control of a second control signal, disconnect the path between the first end and the second end of the switching unit 12, and disconnect the path between the third end and the fourth end of the switching unit 12.

[0063] The comparison unit 13 is configured to output a first detection signal based on a first voltage at the fifth terminal of the on / off unit 12 when the CAN communication device is connected to the first CAN communication device 15 and the path between the first terminal and the second terminal of the on / off unit 12 is open, and the path between the third terminal and the fourth terminal of the on / off unit 12 is open; or when the CAN communication device is disconnected from the first CAN communication device 15 and the path between the first terminal and the second terminal of the on / off unit 12 is open, and the path between the third terminal and the fourth terminal of the on / off unit 12 is open, to output a second detection signal based on a second voltage at the fifth terminal of the on / off unit 12.

[0064] The CAN communication device provided in this application includes a control unit 11, an on / off unit 12, a comparison unit 13, and a CAN communication unit 14. The control unit controls the CAN communication unit 14 to turn off and outputs a first control signal to the on / off unit 12, so that the paths between the first and second terminals of the on / off unit 12 and between the third and fourth terminals of the on / off unit 12 are both open. If the CAN communication device is connected to a first CAN communication device, the voltage at the fifth terminal of the on / off unit 12 is a first voltage. Based on the first voltage, the comparison unit 13 outputs a first detection signal. After receiving the first detection signal, the control unit 11 determines that the CAN communication device is connected to the first CAN communication device based on the first detection signal. After determining that the CAN communication device is connected to the first CAN communication device, Unit 11 outputs a second control signal to disconnect the paths between the first and second terminals of the on / off unit 12, and between the third and fourth terminals of the on / off unit 12, and controls the CAN communication unit to turn on. If the CAN communication device is disconnected from the first CAN communication device, the voltage at the fifth terminal of the on / off unit 12 is a second voltage. Based on the second voltage, the comparison unit 13 outputs a second detection signal. After receiving the second detection signal, the control unit 11 determines that the first CAN communication device is disconnected from the first CAN communication device. After determining that the first CAN communication device is disconnected from the first CAN communication device, the control unit 11 continues to output the first control signal. Since the on / off unit 12 and the comparison unit 13 are added to the CAN communication device, the connection status between the first CAN communication device and the CAN communication device can be identified by combining the on / off unit 12, the comparison unit 13, and the control unit 11. Compared with using a single signal line, this saves internal wiring space in the CAN communication device, reduces wiring layout difficulties, and reduces interference between wiring harnesses.

[0065] In practice, the CAN communication unit 14 is controlled by the control unit 11. When the control unit 11 controls the CAN communication unit 14 to be turned on, the CAN communication device communicates with the first CAN communication device through the CAN communication unit 14. When the control unit 11 controls the CAN communication unit 14 to be turned off, the CAN communication device stops communicating with the first CAN communication device.

[0066] In a specific implementation, the first CAN communication device includes a CAN bus, which includes CANL lines and CANH lines. The first end of the terminating resistor RA is electrically connected to the CANL line, and the second end of the terminating resistor RA is electrically connected to the CANH line. The control unit 11 in the CAN communication device can be a microcontroller unit (MCU) in the CAN communication device.

[0067] In one embodiment, such as Figure 2 The diagram shown is a circuit diagram of a switching unit provided in an embodiment of this application. The switching unit 12 includes a first switching unit 21 and a second switching unit 22.

[0068] The input terminal of the first switching unit 21 is used as the input terminal IN of the switching unit 12 and is connected to the control unit 11. It is used to input the first control signal or the second control signal output by the control unit 11. The first terminal of the first switching unit 21 is used as the first terminal of the switching unit 12 and is used to input the power supply voltage VCC. The second terminal of the first switching unit 21 is used as the second terminal of the switching unit 12, that is, the second terminal of the first switching unit 21 is used as the first detection terminal 1 of the CAN communication device. The third terminal of the first switching unit 21 is grounded.

[0069] The first switching unit 21 includes a first switching transistor Q1, a second switching transistor Q2, a first resistor R1, a second resistor R2, a third resistor R3, a fourth resistor R4, and a fifth resistor R5.

[0070] The first end of the first resistor R1 serves as the input terminal of the first switching unit 21, and the second end of the first resistor R1 is electrically connected to the first end of the second resistor R2 and the control terminal of the first switching transistor Q1.

[0071] The second end of the second resistor R2 is electrically connected to the second end of the first switch Q1 and the ground end, and serves as the third end of the first switching unit 21;

[0072] The first terminal of the first switch Q1 is electrically connected to the first terminal of the third resistor R3.

[0073] The second terminal of the third resistor R3 is electrically connected to the first terminal of the fourth resistor R4 and the control terminal of the second switch Q2.

[0074] The second end of the fourth resistor R4 is electrically connected to the first end of the second switch Q2, and serves as the first end of the first switching unit 21;

[0075] The second terminal of the second switch Q2 is electrically connected to the first terminal of the fifth resistor R5;

[0076] The second end of the fifth resistor R5 serves as the second end of the first switching unit 21.

[0077] Specifically, under the control of the first control signal, the first switching unit 21 connects the first terminal and the third terminal of the first switching unit 21 (i.e., the first switch Q1 is turned on), and then connects the first terminal and the second terminal of the first switching unit 21 (i.e., the second switch Q2 is turned on); under the control of the second control signal, the first switching unit 21 disconnects the first terminal and the third terminal of the first switching unit 21 (i.e., the first switch Q1 is turned off), and then disconnects the first terminal and the second terminal of the first switching unit 21 (i.e., the second switch Q2 is turned off).

[0078] The input terminal of the second switching unit 22 serves as the input terminal IN of the switching unit 12, and is used to input the first control signal or the second control signal output by the control unit 11. The first terminal of the second switching unit 22 serves as the third terminal of the switching unit 12, the second terminal of the second switching unit 22 serves as the fourth terminal of the switching unit 12, and the third terminal of the second switching unit 22 serves as the fifth terminal of the switching unit 12, and is connected to the comparison unit 13.

[0079] The second switching unit 22 includes a third switch Q3, a sixth resistor R6 and a seventh resistor R7;

[0080] The first end of the sixth resistor R6 serves as the input terminal of the second switching unit 22, and the second end of the sixth resistor R6 is electrically connected to the control terminal of the third switch Q3.

[0081] The first terminal of the third switch Q3 serves as the first terminal of the second switching unit 22, and the second terminal of the third switch Q3 is electrically connected to the first terminal of the seventh resistor R7, and serves as the third terminal of the second switching unit 22.

[0082] The second terminal of the seventh resistor R7 serves as the second terminal of the second on / off unit 22.

[0083] Specifically, under the control of the first control signal, the second switching unit 22 opens the path between the first end of the second switching unit 22 and the second end of the second switching unit 22 (i.e., the third switch Q3 is turned on); under the control of the second control signal, the second switching unit 22 closes the path between the first end of the second switching unit 22 and the second end of the second switching unit 22 (i.e., the third switch Q3 is turned off).

[0084] In this embodiment, the first switch Q1 can be an NMOS transistor, with its first terminal being the drain (D), its second terminal being the source (S), and its control terminal being the gate (G); the second switch Q2 can be a PMOS transistor, with its first terminal being the source (S), its second terminal being the drain (D), and its control terminal being the gate (G); the third switch Q3 can be an NMOS transistor, with its first terminal being the drain (D), its second terminal being the source (S), and its control terminal being the gate (G).

[0085] In another embodiment, such as Figure 3 The diagram shown is a circuit diagram of another switching unit provided in an embodiment of this application. The first switching unit 21 further includes a first diode D1.

[0086] The anode of the first diode D1 is electrically connected to the second terminal of the fifth resistor R5, and the cathode of the first diode D1 serves as the second terminal of the first switching unit 21.

[0087] The second switching unit 22 also includes a second diode D2;

[0088] The anode of the second diode D2 serves as the first terminal of the second switching unit 22, and the cathode of the second diode D2 is electrically connected to the first terminal of the third switching transistor Q3.

[0089] In this embodiment, the first diode D1 and the second diode D2 can protect the circuit when the voltage of the first CAN communication device is abnormal. For example, when the first CAN communication device is under high or low voltage, the first diode D1 and the second diode D2 can intercept the abnormal voltage, thereby preventing damage to the internal components of the CAN communication device.

[0090] Reference Figure 3 When the CAN communication device is connected to the first CAN communication device, that is, the first detection terminal 1 of the CAN communication device is connected to the first terminal of the terminating resistor RA, and the second detection terminal 2 of the CAN communication device is connected to the second terminal of the terminating resistor RA, if the control unit 11 outputs the first control signal, the first control signal can be a high-level signal. Under the control of the first control signal, the first switch Q1 is turned on. After the first switch Q1 is turned on, the second switch Q2 is turned on. Under the control of the first control signal, the third switch Q3 is turned on. After both the second switch Q2 and the third switch Q3 are turned on, the power supply voltage VCC passes through the second switch Q2, the fifth resistor R5, the first diode D1, the terminating resistor RA, the second diode D2, the third switch Q3, and the seventh resistor R1 to ground. That is, the path between the first terminal and the fourth terminal of the switching unit is turned on. At this time, the voltage of the fifth terminal 3 of the switching unit is the first voltage.

[0091] When the CAN communication device is disconnected from the first CAN communication device, that is, the first detection terminal 1 of the CAN communication device is disconnected from the first terminal of the terminating resistor RA, and the second detection terminal 2 of the CAN communication device is disconnected from the second terminal of the terminating resistor RA, if the control unit 11 outputs the first control signal, the first control signal can be a high-level signal. Under the control of the first control signal, the first switch Q1 is turned on. After the first switch Q1 is turned on, the second switch Q2 is turned on. Under the control of the first control signal, the third switch Q3 is turned on. Both the second switch Q2 and the third switch Q3 are turned on, and the voltage at the fifth terminal of the switching unit is the second voltage.

[0092] In one embodiment, such as Figure 4 The diagram shown is a circuit diagram of a CAN communication device provided in an embodiment of this application. The comparison unit 13 includes a comparator U1, an eighth resistor R8, a ninth resistor R9, a first capacitor C1, a second capacitor C2, and a third capacitor C3.

[0093] The positive input terminal IN+ of comparator U1 is electrically connected to the first terminal of the first capacitor C1 and serves as the input terminal of comparator unit 13. The negative input terminal IN- of comparator U1 is electrically connected to the first terminal of the eighth resistor R8, the first terminal of the ninth resistor R9, and the first terminal of the second capacitor C2. The ground terminal of comparator U1 is electrically connected to the second terminal of the first capacitor C1 and grounded. The power supply terminal VCC of comparator U1 is electrically connected to the second terminal of the eighth resistor R8 and the first terminal of the third capacitor C3 and receives the power supply voltage VCC. The output terminal OUT of comparator U1 serves as the output terminal of comparator unit 13.

[0094] The second terminal of the second capacitor C2 is electrically connected to the second terminal of the third capacitor C3 and the second terminal of the ninth resistor R9, and is grounded.

[0095] In this embodiment of the application, when the positive input terminal IN+ of comparator U1 receives a first voltage, the comparison unit 13 outputs a first detection signal, which can be a high-level signal; when the positive input terminal IN+ of comparator U1 is a second voltage, comparator U1 outputs a second detection signal, which can be a low-level signal.

[0096] Reference Figure 4 The CAN communication unit 14 includes a first CAN transceiver chip U2, a tenth resistor R10, an eleventh resistor R11, a fourth capacitor C4, and a fourth switch Q4.

[0097] The power supply terminal of the first CAN transceiver chip U2 is electrically connected to the first terminal of the fourth switch Q4 and the first terminal of the fourth capacitor C4. The first CAN communication terminal CANL of the first CAN transceiver chip U2 is electrically connected to the first detection terminal 1. The second CAN communication terminal CANH of the first CAN transceiver chip U2 is electrically connected to the second detection terminal 2. The communication transmitting terminal TXD and the communication receiving terminal RXD of the first CAN transceiver chip U2 are both connected to the control unit 11. The ground terminal GND of the first CAN transceiver chip U2 is grounded.

[0098] The second terminal of the fourth switch Q4 is electrically connected to the first terminal of the tenth resistor R10 to input the supply voltage VCC. The control terminal of the fourth switch Q4 is electrically connected to the second terminal of the tenth resistor R10 and the first terminal of the eleventh resistor R11.

[0099] The second terminal of the eleventh resistor R11 is electrically connected to the control unit 11;

[0100] The second terminal of the fourth capacitor C4 is grounded.

[0101] In this embodiment, under the control of the control unit 11, the CAN communication unit 14 communicates with the first CAN communication device through the first CAN transceiver chip U2. Specifically, the communication transmitting end TXD and the communication receiving end RXD of the first CAN transceiver chip U2 are both used to communicate with the CAN controller integrated inside the control unit.

[0102] In another embodiment, such as Figure 5 The diagram shown is a circuit diagram of another CAN communication device provided in an embodiment of this application, wherein the CAN communication unit 14 includes a second CAN transceiver chip U3 and a fifth capacitor C5;

[0103] The power supply terminal of the second CAN transceiver chip U3 is electrically connected to the first terminal of the fifth capacitor C5 for input power supply voltage VCC. The first CAN communication terminal CANL of the second CAN transceiver chip U3 is electrically connected to the first detection terminal 1. The second CAN communication terminal CANH of the second CAN transceiver chip U3 is electrically connected to the second detection terminal 2. The first control terminal STB and the second control terminal SHDH of the second CAN transceiver chip U3 are both connected to the control unit 11. The communication transmitting terminal TXD and the communication receiving terminal RXD of the second CAN transceiver chip U3 are both connected to the control unit 11. The ground terminal GND of the second CAN transceiver chip U3 is grounded.

[0104] The second terminal of the fourth capacitor C5 is grounded.

[0105] In this embodiment, the CAN communication unit 14 communicates with the first CAN communication device through the second CAN transceiver chip U3 under the control of the control unit 11. Specifically, the communication transmitting end TXD of the second CAN transceiver chip U3 and the communication receiving end RXD of the second CAN transceiver chip U3 are both used to communicate with the CAN controller integrated inside the control unit 11.

[0106] The CAN communication unit 14 in the above embodiment can also, after being turned on, listen to the CAN heartbeat packets sent by the first CAN communication device and send the listened CAN heartbeat packets to the control unit 11;

[0107] Based on the received CAN heartbeat packet, the control unit 11 determines whether the CAN communication device is disconnected from the first CAN communication device; if the control unit 11 does not receive the CAN heartbeat packet within a preset time period, it controls the CAN communication unit 14 to shut down and outputs the first control signal; after receiving the first control signal, the on / off unit 12 opens the path between the first end and the second end of the on / off unit 12, and opens the path between the third end and the fourth end of the on / off unit 12.

[0108] After outputting the first control signal, if the control unit 11 receives the second detection signal output by the comparison unit 13, it determines that the CAN communication device is disconnected from the first CAN communication device; if it receives the first detection signal output by the comparison unit 13, it determines that the CAN communication device is not disconnected from the first CAN communication device.

[0109] In one embodiment, after the control unit 11 determines that the CAN communication device has disconnected from the first CAN communication device, it continues to output the first control signal.

[0110] After determining that the CAN communication device and the first CAN communication device are not disconnected, the control unit 11 outputs a second control signal and controls the CAN communication unit to start.

[0111] The following is combined Figure 4 and Figure 5 The process of the CAN communication device disclosed in the embodiments of this application will be described in detail, such as... Figure 6 The diagram shown is a flowchart of a CAN communication device provided in an embodiment of this application.

[0112] S601: CAN communication device power-on initialization;

[0113] S602: Control unit 11 controls CAN communication unit 14 to turn off and outputs first control signal to on / off unit 12;

[0114] Specifically, the control unit 11 can control the CAN communication unit 14 to turn off and on in the following ways:

[0115] refer to Figure 4 When the control unit 11 outputs a high-level control signal to the CAN communication unit 14, the fourth switch Q4 is turned off, and the first CAN transceiver chip U2 cannot receive the power supply voltage VCC, so the CAN communication unit 14 is turned off. When the control unit 11 outputs a low-level control signal to the CAN communication unit 14, the fourth switch Q4 is turned on, and the first CAN transceiver chip U2 receives the power supply voltage VCC, so the CAN communication unit 14 is turned on.

[0116] In this embodiment, the control unit 11 controls the CAN communication unit 14 to be turned off, which can prevent the CAN communication unit 14 from interfering with the on / off unit 12.

[0117] The control unit 11 can also control the CAN communication unit 14 to be turned off and on in the following ways:

[0118] refer to Figure 5 The control unit 11 outputs a high-level control signal to the first control terminal STB of the second CAN transceiver chip U3. This control signal can also be called a standby signal, so as to put the CAN communication unit 14 into standby mode, that is, to control the CAN communication unit to turn off. When the CAN communication unit 14 is in standby mode, the control unit 11 outputs a low-level control signal to the first control terminal STB of the second CAN transceiver chip U3. This control signal can also be called a first turn-on signal, so as to turn on the CAN communication unit 14.

[0119] In addition, the control unit 11 can also output a high-level control signal to the second control terminal SHDH of the second CAN transceiver chip U3. This control signal can be called a sleep signal, so that the CAN communication unit 14 enters sleep mode. When the CAN communication unit 14 is in sleep mode, the control unit 11 outputs a low-level control signal to the second control terminal SHDH of the second CAN transceiver chip U3. This control signal can be called a second enable signal, so that the CAN communication unit 14 is enabled.

[0120] In this embodiment, the control unit 11 controls the CAN communication unit 14 to enter standby mode or sleep mode to avoid the CAN communication unit 14 interfering with the on / off unit 12.

[0121] S603: Under the control of the first control signal, the switching unit 12 opens the path between the first end of the switching unit 12 and the second end of the switching unit 12, and opens the path between the third end of the switching unit 12 and the fourth end of the switching unit 12.

[0122] Specifically, under the control of the first control signal, the first switch Q1 is turned on, and after the first switch Q1 is turned on, the second switch Q2 is turned on, that is, the path between the first end of the switching unit 12 and the second end of the switching unit 12 is turned on. Under the control of the first control signal, the third switch Q3 is turned on, that is, the path between the third end of the switching unit 12 and the fourth end of the switching unit 12 is turned on.

[0123] When the first switch Q1, the second switch Q2, and the third switch Q3 are all turned on, if the CAN communication device is connected to the first CAN communication device, the comparator U1 outputs a first detection signal; if the CAN communication device is disconnected from the first CAN communication device, the comparator U1 outputs a second detection signal.

[0124] S604: Control unit 11 receives the first detection signal sent by comparison unit 13 and determines that the CAN communication device is connected to the first CAN communication device;

[0125] Specifically, after the first switch Q1, the second switch Q2, and the third switch Q3 are all turned on, the supply voltage VCC flows through the second switch Q2, the fifth resistor R5, the first diode D1, the CAN bus termination resistor RA, the second diode D2, the third switch Q3, and the seventh resistor R7, and then flows into ground. At this time, the voltage at the fifth terminal of the switching unit 12 is the first voltage, that is, the voltage at the connection point of the seventh resistor R7 and the second terminal of the third switch Q3 is the first voltage. At this time, the positive input terminal IN+ of the comparator U1 receives the first voltage. The first voltage is greater than the threshold voltage of the comparator U1, and the comparison unit 13 outputs a high-level detection signal, that is, the first detection signal.

[0126] S605: Control unit 11 outputs a second control signal so that, under the control of the second control signal, switching unit 12 disconnects the path between the first end and the second end of switching unit 12, as well as the path between the third end and the fourth end of switching unit 12, and controls CAN communication unit 14 to turn on.

[0127] Specifically, since the CAN communication device is connected to the first CAN communication device, the first detection terminal 1 of the CAN communication device is electrically connected to the first terminal of the terminating resistor RA of the first CAN communication device, and the second detection terminal 2 of the CAN communication device is electrically connected to the second terminal of the terminating resistor RA of the first CAN communication device. After determining that the CAN communication device is connected to the first CAN communication device, the control unit 11 controls the on / off unit 12 to disconnect and controls the CAN communication unit 14 to turn on, so as to determine the connection status between the CAN communication device and the first CAN communication device through the CAN communication unit 14.

[0128] In this embodiment of the application, after the control unit 11 determines that the CAN communication device is connected to the first CAN communication device, it outputs a second control signal. Under the control of the second control signal, the first switch Q1 is turned off, the second switch Q2 is turned off, and the third switch Q3 is turned off, that is, the path between the first end and the second end of the on / off unit 12 is disconnected, and the path between the third end and the fourth end of the on / off unit 12 is disconnected, that is, the on / off unit 12 is turned off.

[0129] S606: CAN communication unit 14 listens to the CAN heartbeat packet sent by the first CAN communication device and sends the listened CAN heartbeat packet to control unit 11;

[0130] S607: Control unit 11 determines whether a CAN heartbeat packet has been received within a preset time period; if no CAN heartbeat packet is received, step S602 is executed; if a CAN heartbeat packet is received, step S606 is executed.

[0131] In practice, during the monitoring of the CAN heartbeat packet of the first CAN communication device, if the control unit 11 does not receive the CAN heartbeat packet within a preset time period, it may be due to the CAN communication device becoming disconnected from the first CAN communication device, or it may be due to a communication failure between the CAN communication device and the first CAN communication device. Therefore, it is not possible to determine whether the CAN communication device has become disconnected from the first CAN communication device simply by the control unit 11 not receiving the CAN heartbeat packet within the preset time period. The control unit 11 needs to make further determinations.

[0132] If the control unit 11 does not receive a CAN heartbeat packet within a preset time period, the control unit 11 controls the CAN communication unit 14 to shut down and outputs a first control signal to the on / off unit 12. Under the control of the first control signal, the first switch Q1, the second switch Q2, and the third switch Q3 are all turned on. In this case, if the control unit 11 receives the first detection signal, it determines that the CAN communication device is not disconnected from the first CAN communication device. That is, the CAN communication device's failure to receive a heartbeat packet within the preset time period is due to a communication failure between the CAN communication device and the first CAN communication device. If the control unit 11 receives the second detection signal, it determines that the CAN communication device is disconnected from the first CAN communication device. That is, the CAN communication device's failure to receive a heartbeat packet within the preset time period is due to a disconnection between the CAN communication device and the first CAN communication device.

[0133] In one embodiment, after determining that the CAN communication device is not disconnected from the first CAN communication device, the control unit 11 outputs a second control signal to control the first switch Q1, the second switch Q2 and the third switch Q3 to be disconnected, and continues to listen to the CAN heartbeat packet through the CAN communication unit 14.

[0134] After the control unit 11 determines that the CAN communication device is disconnected from the first CAN communication device, it will control the CAN communication device to enter a low-power mode and maintain the output of the first control signal to wait for the next determination of whether the CAN communication device is connected to the first CAN communication device.

[0135] It should be noted that the CAN heartbeat packet can be customized arbitrarily. For example, the first CAN communication device sends 10 heartbeats per second by default, and these 10 heartbeats are considered as one CAN heartbeat packet. The CAN communication device will receive one CAN heartbeat packet per second. If no CAN heartbeat packet is received for more than 3 seconds, it is determined that the first CAN communication device has lost connection. The loss of connection of the first CAN communication device may be due to a communication failure between the two CAN communication devices, such as a program failure of the first CAN communication device, or it may be that the first CAN communication device has become disconnected from the CAN communication device.

[0136] S608: Control unit 11 receives the second detection signal sent by comparison unit 13 and determines that the CAN communication device is disconnected from the first CAN communication device;

[0137] Specifically, when the CAN communication device is disconnected from the first CAN communication device, the first switch Q1, the second switch Q2, and the third switch Q3 are all turned on under the control of the first control signal.

[0138] Although the first switch Q1, the second switch Q2, and the third switch Q3 are all turned on, the voltage at the connection point between the first detection terminal 1 and the second detection terminal 2 is 0V, i.e., the second voltage, because the first detection terminal 1 and the second detection terminal 2 are floating.

[0139] At this time, the positive input terminal IN+ of comparator U1 receives the second voltage. The second voltage is less than the threshold voltage of comparator U1, and the comparison unit 13 outputs a low-level detection signal, which is the second detection signal.

[0140] After receiving the second detection signal, the control unit 11 determines that the CAN communication device has disconnected from the first CAN communication device.

[0141] S609: Control unit 11 maintains the output of the first control signal.

[0142] In this embodiment of the application, when the CAN communication device is disconnected from the first CAN communication device, the CAN bus of the first CAN communication device is not powered on. The CAN bus has no high or low level by default, and the bus presents a resistance of 120 ohms or 60 ohms, that is, the resistance value of the terminating resistor RA. At this time, the first detection terminal 1 and the second detection terminal 2 of the CAN communication device are floating. When the control unit 11 outputs a high-level control signal, the non-inverting input terminal of the comparator U1 is at a low level, and the comparator U1 outputs a low level.

[0143] After the CAN communication device is connected to the first CAN communication device, the terminating resistor of the first CAN communication device is connected to the first detection terminal 1 and the second detection terminal 2 of the CAN communication device. When the control unit 11 outputs a high-level control signal (first control signal), both the second switch Q2 and the third switch Q3 are turned on. The supply voltage VCC flows into ground (GND) through the path of the second switch Q2, the fifth resistor R5, the first diode D1, the terminating resistor RA, the second diode D2, the third switch Q3, and the seventh resistor R7. The fifth resistor R5 and the seventh resistor R7 are both voltage divider resistors. The voltage signal collected by the seventh resistor R7 is input to the non-inverting input terminal of the comparator U1. If the voltage signal exceeds the threshold voltage of the comparator U1, the comparator U1 outputs a high-level signal. That is, in this case, the control unit 11 receives a high-level signal and determines that the CAN communication device is connected to the first CAN communication device.

[0144] In this embodiment, the CAN communication device can be a battery pack, the first CAN communication device can be a robot, the CAN communication device can also be a CAN analyzer or a diagnostic tool, and the first CAN communication device can also be the CAN device being diagnosed. For example, the CAN communication device is a CAN analyzer, the first CAN communication device is an automotive electronic control unit (ECU), the CAN analyzer is in standby mode by default, and if the CAN analyzer recognizes that the automotive ECU is connected, it exits the standby mode and starts the diagnostic process.

[0145] It should be noted that the above-mentioned CAN communication device and the first CAN communication device are merely illustrative examples, and the embodiments of this application do not impose any limitations on them.

[0146] The following explanation uses a CAN communication device as the battery pack and a robot as the first CAN communication device.

[0147] After the battery pack is connected to the robot, under normal circumstances, the battery pack powers the robot and establishes CAN communication with the robot. However, since the first detection terminal 1 and the second detection terminal 2 of the battery pack are connected to the terminating resistor RA at this time, in order not to affect the normal communication between the battery pack and the robot, before powering the robot, the control unit 11 pulls the control signal low, that is, outputs a low-level control signal (second control signal). After the control unit 11 outputs the low-level control signal, the second switch Q2 and the third switch Q3 are both turned off, the switching unit in the battery pack disconnects from the CAN bus, and then the battery pack turns on the power supply to the robot, and the robot is powered on.

[0148] After the robot is powered on and starts working, a periodic CAN heartbeat packet is designed. The battery pack monitors the connection status between the battery pack and the robot by monitoring the CAN heartbeat packets sent by the robot.

[0149] If the battery pack detects a CAN heartbeat packet disconnection timeout, it re-controls the on / off unit to monitor the connection status of the terminating resistor. If the battery pack remains connected to the robot, the CAN heartbeat packet disconnection timeout is merely a CAN communication timeout. Since the robot has a terminating resistor connected to the on / off unit, regardless of whether the CAN bus is at a dominant, recessive, or other level, the voltage at the connection point of the seventh resistor R7 and the third switch Q3 will exceed the threshold voltage of comparator U1. Comparator U1 outputs a high level, the battery pack continues to power the robot, and the control unit outputs a low-level control signal to disconnect the on / off unit and the terminating resistor. After disconnecting the on / off unit and the terminating resistor, monitoring of the CAN heartbeat packet resumes. If the battery pack is disconnected from the robot, comparator U1 outputs a low-level signal, the battery pack shuts off power to the robot, and control unit 11 maintains a high-level control signal output, entering a low-power mode to monitor and wait for the robot to reconnect to the battery pack.

[0150] The CAN communication device provided in this application embodiment determines whether the CAN communication device is connected to the first CAN communication device by reusing the CAN bus and terminating resistor of the first CAN communication device. At the same time, it does not depend on the power-on and power-off status of the first CAN communication device and does not affect the normal communication after the first CAN communication device is powered on.

[0151] Based on the same inventive concept, this invention also provides a CAN communication device connection detection method. The implementation principle of this CAN communication device connection detection method is similar to that of the aforementioned CAN communication device. The specific implementation of this CAN communication device connection detection method can be found in the aforementioned CAN communication device embodiments, and repeated details will not be described again.

[0152] like Figure 7The diagram shown is a flowchart illustrating a CAN communication device connection detection method provided in an embodiment of this application. This CAN communication device connection detection method is applied to any of the CAN communication devices described above, as follows:

[0153] S701: Control the CAN communication unit in the CAN communication device to turn off, and output a first control signal to the on / off unit in the CAN communication device. Under the control of the first control signal, the on / off unit opens the path between the first end and the second end of the on / off unit, and opens the path between the third end and the fourth end of the on / off unit.

[0154] S702: Receive a first detection signal or a second detection signal output by the comparison unit in the CAN communication device; based on the first detection signal, determine that the CAN communication device is connected to the first CAN communication device; based on the second detection signal, determine that the CAN communication device is disconnected from the first CAN communication device. Specifically, when the CAN communication device is connected to the first CAN communication device, and the path between the first end and the second end of the on / off unit is open, and the path between the third end and the fourth end of the on / off unit is open, the comparison unit outputs the first detection signal. When the CAN communication device is disconnected from the first CAN communication device, and the path between the first end and the second end of the on / off unit is open, and the path between the third end and the fourth end of the on / off unit is open, the comparison unit outputs the second detection signal.

[0155] S703: After determining that the CAN communication device is connected to the first CAN communication device, a second control signal is output, and the CAN communication unit is turned on. Under the control of the second control signal, the switching unit disconnects the path between the first end and the second end of the switching unit, and disconnects the path between the third end and the fourth end of the switching unit. After determining that the CAN communication device is disconnected from the first CAN communication device, the first control signal is maintained.

[0156] In one embodiment, after controlling the CAN communication unit to be turned on, the method further includes:

[0157] Listen for the CAN heartbeat packets sent by the first CAN communication device;

[0158] Based on the CAN heartbeat packet, it is determined whether the CAN communication device has become disconnected from the first CAN communication device.

[0159] In one embodiment, determining whether the CAN communication device has disconnected from the first CAN communication device based on the CAN heartbeat packet includes:

[0160] If no CAN heartbeat packet is received within a preset time period, the CAN communication unit is controlled to shut down and the first control signal is output; if the second detection signal output by the comparison unit is received, it is determined that the CAN communication device is disconnected from the first CAN communication device; if the first detection signal output by the comparison unit is received, it is determined that the CAN communication device is not disconnected from the first CAN communication device.

[0161] In one embodiment, after determining that the CAN communication device has disconnected from the first CAN communication device, the method further includes: maintaining the output of the first control signal;

[0162] After confirming that the CAN communication device is not disconnected from the first CAN communication device, the method further includes: outputting the second control signal and controlling the CAN communication unit to start.

[0163] This application provides a CAN communication device and a CAN communication device connection detection method. In the CAN communication device, the control unit controls the CAN communication unit to turn off and outputs a first control signal to the on / off unit, so that the path between the first end and the second end of the on / off unit, and the path between the third end and the fourth end of the on / off unit are both connected. Based on the first detection signal, the control unit determines that the first CAN communication device is connected and outputs a second control signal to disconnect the path between the first end and the second end, and between the third end and the fourth end of the on / off unit, and controls the CAN communication unit to turn on. Alternatively, based on the second detection signal, after determining that the first CAN communication device is disconnected, the control unit maintains the output of the first control signal. The comparison unit generates the first and second detection signals based on the voltage of the fifth end of the on / off unit. Since the CAN communication device identifies the connection status between the first CAN communication device and the CAN communication device through the on / off unit and the comparison unit, compared with using a separate signal line, it saves internal wiring harness space, reduces wiring harness layout difficulties, and reduces interference between wiring harnesses.

[0164] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0165] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0166] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0167] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0168] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the spirit and scope of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.

Claims

1. A CAN communication device, characterized in that, The CAN communication device is used to communicate with the first CAN communication device, and the CAN communication device includes: a control unit, an on / off unit, a comparison unit, and a CAN communication unit; The control unit is electrically connected to the on / off unit, the comparison unit, and the CAN communication unit. The first terminal of the on / off unit is used to input the power supply voltage. The second terminal of the on / off unit is electrically connected to the first terminal of the CAN communication unit and serves as the first detection terminal of the CAN communication device. The third terminal of the on / off unit is electrically connected to the second terminal of the CAN communication unit and serves as the second detection terminal of the CAN communication device. The fourth terminal of the on / off unit is grounded. The fifth terminal of the on / off unit is electrically connected to the input terminal of the comparison unit. When the CAN communication device is connected to the first CAN communication device, the first detection terminal is electrically connected to the first terminal of the terminating resistor of the CAN bus of the first CAN communication device, and the second detection terminal is electrically connected to the second terminal of the terminating resistor. The control unit is used to control the CAN communication unit to turn off and output a first control signal to the on / off unit; receive a first detection signal or a second detection signal output by the comparison unit; based on the first detection signal, after determining that the CAN communication device is connected to the first CAN communication device, output a second control signal and control the CAN communication unit to turn on; based on the second detection signal, after determining that the CAN communication device is disconnected from the first CAN communication device, maintain the output of the first control signal. The switching unit is configured to, under the control of the first control signal, open the path between the first end and the second end of the switching unit, and open the path between the third end and the fourth end of the switching unit; or, under the control of the second control signal, disconnect the path between the first end and the second end of the switching unit, and disconnect the path between the third end and the fourth end of the switching unit. The comparison unit is configured to output the first detection signal based on the first voltage of the fifth terminal of the on / off unit when the CAN communication device is connected to the first CAN communication device and the path between the first terminal and the second terminal of the on / off unit is open, and the path between the third terminal and the fourth terminal of the on / off unit is open; or when the CAN communication device is disconnected from the first CAN communication device and the path between the first terminal and the second terminal of the on / off unit is open, and the path between the third terminal and the fourth terminal of the on / off unit is open, the comparison unit is configured to output the second detection signal based on the second voltage of the fifth terminal of the on / off unit.

2. The CAN communication device according to claim 1, characterized in that, After the CAN communication unit is turned on, it is also used to listen to the CAN heartbeat packets sent by the first CAN communication device and send the listened CAN heartbeat packets to the control unit. The control unit is further configured to determine, based on the received CAN heartbeat packet, whether the CAN communication device has become disconnected from the first CAN communication device.

3. The CAN communication device according to claim 2, characterized in that, The control unit is specifically used for: If no CAN heartbeat packet is received within a preset time period, the CAN communication unit is controlled to shut down and the first control signal is output; if the second detection signal output by the comparison unit is received, it is determined that the CAN communication device is disconnected from the first CAN communication device; if the first detection signal output by the comparison unit is received, it is determined that the CAN communication device is not disconnected from the first CAN communication device.

4. The CAN communication device according to claim 3, characterized in that, After the control unit determines that the CAN communication device has disconnected from the first CAN communication device, it is also used to: maintain the output of the first control signal; After determining that the CAN communication device is not disconnected from the first CAN communication device, the control unit is further configured to: output the second control signal and control the CAN communication unit to turn on.

5. The CAN communication device according to claim 1, characterized in that, The switching unit includes a first switching unit and a second switching unit; The input terminal of the first switching unit is used as the input terminal of the switching unit, the first end of the first switching unit is used as the first end of the switching unit, the second end of the first switching unit is used as the second end of the switching unit, and the third end of the first switching unit is grounded. The first switching unit is used to, under the control of the first control signal, to connect the path between the first terminal of the first switching unit and the third terminal of the first switching unit, and then to connect the path between the first terminal of the first switching unit and the second terminal of the first switching unit. Under the control of the second control signal, after disconnecting the path between the first end of the first switching unit and the third end of the first switching unit, the path between the first end of the first switching unit and the second end of the first switching unit is disconnected. The input terminal of the second switching unit serves as the input terminal of the switching unit, the first terminal of the second switching unit serves as the third terminal of the switching unit, the second terminal of the second switching unit serves as the fourth terminal of the switching unit, and the third terminal of the second switching unit serves as the fifth terminal of the switching unit. The second switching unit is used to open the passage between the first end of the second switching unit and the second end of the second switching unit under the control of the first control signal; Under the control of the second control signal, the path between the first end of the second switching unit and the second end of the second switching unit is disconnected.

6. The CAN communication device according to claim 5, characterized in that, The first switching unit includes a first switching transistor, a second switching transistor, a first resistor, a second resistor, a third resistor, a fourth resistor, and a fifth resistor; The first end of the first resistor serves as the input terminal of the first switching unit, and the second end of the first resistor is electrically connected to the first end of the second resistor and the control terminal of the first switching transistor. The second end of the second resistor is electrically connected to the second end of the first switch and the ground terminal; The first terminal of the first switching transistor is electrically connected to the first terminal of the third resistor; The second end of the third resistor is electrically connected to the first end of the fourth resistor and the control end of the second switch. The second end of the fourth resistor is electrically connected to the first end of the second switching transistor and serves as the first end of the first switching unit. The second terminal of the second switching transistor is electrically connected to the first terminal of the fifth resistor; The second end of the fifth resistor serves as the second end of the first on / off unit.

7. The CAN communication device according to claim 6, characterized in that, The second switching unit includes a third switch, a sixth resistor, and a seventh resistor; The first end of the sixth resistor serves as the input end of the second switching unit, and the second end of the sixth resistor is electrically connected to the control end of the third switching transistor. The first end of the third switch transistor serves as the first end of the second switching unit, and the second end of the third switch transistor is electrically connected to the first end of the seventh resistor and serves as the third end of the second switching unit. The second end of the seventh resistor serves as the second end of the second on / off unit.

8. The CAN communication device according to claim 7, characterized in that, The first switching unit also includes a first diode; The anode of the first diode is electrically connected to the second terminal of the fifth resistor, and the cathode of the first diode serves as the second terminal of the first switching unit. The second switching unit also includes a second diode; The anode of the second diode serves as the first terminal of the second switching unit, and the cathode of the second diode is electrically connected to the first terminal of the third switching transistor.

9. The CAN communication device according to any one of claims 1 to 8, characterized in that, The comparison unit includes a comparator, an eighth resistor, a ninth resistor, a first capacitor, a second capacitor, and a third capacitor; The positive input terminal of the comparator is electrically connected to the first terminal of the first capacitor and serves as the input terminal of the comparison unit. The negative input terminal of the comparator is electrically connected to the first terminal of the eighth resistor, the first terminal of the ninth resistor, and the first terminal of the second capacitor. The ground terminal of the comparator is electrically connected to the second terminal of the first capacitor and grounded. The power supply terminal of the comparator is electrically connected to the second terminal of the eighth resistor and the first terminal of the third capacitor and receives the power supply voltage. The output terminal of the comparator serves as the output terminal of the comparison unit. The second terminal of the second capacitor is electrically connected to the second terminal of the third capacitor and the second terminal of the ninth resistor, and is grounded.

10. A method for detecting the connection of a CAN communication device, characterized in that, Applied to any one of the CAN communication devices as described in claims 1 to 9, the method includes: The CAN communication unit in the CAN communication device is turned off, and a first control signal is output to the on / off unit in the CAN communication device. Under the control of the first control signal, the on / off unit opens the path between the first end and the second end of the on / off unit, and opens the path between the third end and the fourth end of the on / off unit. The system receives a first detection signal or a second detection signal output by the comparison unit in the CAN communication device. Based on the first detection signal, it determines that the CAN communication device is connected to the first CAN communication device. Based on the second detection signal, it determines that the CAN communication device is disconnected from the first CAN communication device. Specifically, when the CAN communication device is connected to the first CAN communication device, and the path between the first and second ends of the on / off unit is open, and the path between the third and fourth ends of the on / off unit is open, the comparison unit outputs the first detection signal. When the CAN communication device is disconnected from the first CAN communication device, and the path between the first and second ends of the on / off unit is open, and the path between the third and fourth ends of the on / off unit is open, the comparison unit outputs the second detection signal. After confirming that the CAN communication device is connected to the first CAN communication device, a second control signal is output, and the CAN communication unit is turned on. Under the control of the second control signal, the switching unit disconnects the path between the first end and the second end of the switching unit, and disconnects the path between the third end and the fourth end of the switching unit. After confirming that the CAN communication device is disconnected from the first CAN communication device, the first control signal is maintained.