Can detection method and can detection device

By automating the identification and switching of CAN network segments through CAN detection equipment, the problems of low efficiency and high error rate in existing technologies are solved, and efficient and accurate CAN bus detection is achieved.

CN120710904BActive Publication Date: 2025-11-18CHONGQING CHANGAN AUTOMOBILE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511190630.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-08-25
Publication Date
2025-11-18
Estimated Expiration
2045-08-25

AI Technical Summary

Technical Problem

Existing CAN bus detection methods are inefficient and prone to errors, especially when manually switching CAN network segments, which can easily lead to pin connection errors, resulting in low detection efficiency and high operational complexity.

Method used

The CAN detection device utilizes a microcontroller (MCU) and multiple data transmission channels to automatically acquire key information about the target network segment, including communication rate and target interface pins. It automatically identifies the communication rate of the target CAN network segment and the pins of the target interface, achieving automatic identification and switching of CAN network segments without manual intervention. Combined with signal scanning and communication rate detection circuits, it automatically identifies and configures data transmission channels.

Benefits of technology

It improves the efficiency and accuracy of CAN bus detection, reduces operational complexity and error probability, and realizes automatic identification of CAN network segments and a detection process that does not require manual intervention.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120710904B_ABST
    Figure CN120710904B_ABST
Patent Text Reader

Abstract

The application discloses a CAN detection method and a CAN detection device, and relates to the technical field of automobile bus. The CAN detection method comprises the following steps: acquiring a first detection instruction, wherein the first detection instruction is used for acquiring message information of a target network segment, and the target network segment is one or more network segments in a plurality of CAN network segments included by a vehicle CAN bus; in response to the first detection instruction, acquiring key information of the target network segment based on a searching configuration file mode; when the key information of the target network segment does not exist in the configuration file, acquiring the key information of the target network segment based on a real-time scanning mode; and controlling a target data transmission channel corresponding to the target network segment to be turned on based on the key information of the target network segment, so as to transmit the message information of the target network segment to an upper computer. According to the scheme, the key information of the target network segment can be automatically acquired, the message collection of the target network segment can be completed without manual intervention, and the detection efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of automotive bus technology, and in particular to a CAN detection method and a CAN detection device. Background Technology

[0002] Controller Area Network (CAN) is a high-performance serial communication protocol widely used in the field of new energy vehicles. In new energy vehicles, information between various control systems is typically transmitted via the CAN bus. However, the CAN bus may encounter problems such as communication loss, frame loss, and fault reports during data transmission.

[0003] To improve the reliability of the CAN bus, it is usually necessary to test the CAN bus. The current testing method is as follows: The CAN bus consists of multiple CAN segments. When testing each CAN segment, the high-level line CANH and the low-level line CANL of the CAN testing device are manually connected to the corresponding pins of that CAN segment. The communication rate of the CAN testing device is then manually configured to obtain the message information of that CAN segment. Then, the high-level line CANH and the low-level line CANL are manually switched to the pins corresponding to the next CAN segment, and the above process is repeated, and so on.

[0004] However, this method of manually switching CAN network segments for detection is not only inefficient but also prone to errors. Summary of the Invention

[0005] This application provides a CAN detection method and CAN detection device, which can improve the detection efficiency of vehicle CAN bus and is less prone to errors.

[0006] The technical solution of this application is implemented as follows:

[0007] In a first aspect, embodiments of this application provide a CAN detection method applied to a CAN detection device. The CAN detection device includes a microcontroller (MCU) and multiple data transmission channels. The first end of each data transmission channel is connected to an interface of an in-vehicle CAN bus, and the second end of each data transmission channel is connected to a host computer bus interface. The MCU is connected to a first switching unit of each data transmission channel. The CAN detection method includes:

[0008] Obtain the first detection command, which indicates that the message information of the target network segment be obtained. The target network segment is one or more of the multiple CAN network segments included in the vehicle CAN bus.

[0009] In response to the first detection command, the key information of the target network segment is obtained by searching the configuration file. If the key information of the target network segment is not found in the configuration file, the key information of the target network segment is obtained by real-time scanning. The key information of the target network segment includes the communication rate of the target network segment and the corresponding pins of the target network segment on the interface of the vehicle CAN bus.

[0010] Based on the pins corresponding to the target network segment on the vehicle CAN bus interface, determine the target data transmission channel corresponding to the target network segment;

[0011] Configure the target data transmission channel based on the communication rate of the target network segment;

[0012] The first switch unit controlling the target data transmission channel is turned on to transmit the message information of the target network segment to the host computer.

[0013] In this embodiment, upon receiving the first detection command, key information of the target network segment can be automatically acquired. This key information includes the communication rate of the target network segment and the corresponding pins. Based on this information, the target data transmission channel is configured, thus completing the packet collection of the target network segment without manual intervention. Compared with existing technologies, this significantly improves detection efficiency and reduces operational complexity and error probability.

[0014] In one embodiment, the CAN detection device further includes a scanning module, which comprises multiple signal scanning circuits and signal detection circuits. The first ends of the multiple signal scanning circuits are connected to the interface of the vehicle CAN bus, and the second ends of the multiple signal scanning circuits are connected to the signal detection circuits. The MCU is connected to the second switching units included in the multiple signal scanning circuits. The device acquires key information of the target network segment based on real-time scanning, including: polling any two pins in the interface of the vehicle CAN bus by controlling the second switching units of each signal scanning circuit to turn on or off; for the currently polled first and second pins, obtaining the voltage difference between the first and second pins through the signal detection circuit; determining the resistance value between the first and second pins based on the voltage difference; if the resistance value is a preset resistance value, determining that a first CAN network segment corresponds to the first and second pins, and recording the correspondence between the first CAN network segment and the first and second pins; determining the target network segment from the identified first CAN network segments, and obtaining the pins corresponding to the target network segment.

[0015] In this embodiment, a signal detection circuit can detect the voltage value between any two pins in the vehicle CAN bus interface, and then calculate the resistance value between the two pins based on the voltage value, thereby determining whether a first CAN network segment exists between the two pins. This process of identifying the first CAN network segment does not rely on pre-configured files or human experience. This method is particularly suitable for scenarios lacking configuration information, realizing the automatic discovery function of CAN network segments and improving the adaptability and intelligence level of the system.

[0016] In one embodiment, the scanning module further includes a communication rate detection circuit. The second terminals of multiple signal scanning circuits are connected to the communication rate detection circuit. The module acquires key information of the target network segment based on real-time scanning, including: for each first CAN network segment, determining the target signal scanning circuit according to the pins corresponding to the first CAN network segment, and controlling the target signal scanning circuit to be turned on; polling and detecting network segment messages within the communication rate range conforming to the CAN standard through the communication rate detection circuit; when valid message information is detected, determining the communication rate at which valid message information is detected as the communication rate of the first CAN network segment; determining the target network segment from each first CAN network segment, and acquiring the communication rate of the target network segment.

[0017] In this embodiment, a communication rate detection circuit polls and detects messages in the first CAN network segment at different communication rates, and locks the communication rate of the first CAN network segment when a valid message is detected. This approach further improves the automation level of detection and the flexibility of the system.

[0018] In one embodiment, the communication rate detection circuit includes a CAN controller and a CAN oscilloscope connected in sequence. The CAN controller is connected to an MCU, and the CAN oscilloscope is connected to the second end of multiple signal scanning circuits. The communication rate detection circuit polls and detects network segment messages within a communication rate range conforming to the CAN standard. This includes: adjusting the communication rate of the CAN oscilloscope within the communication rate range conforming to the CAN standard using the CAN controller; receiving and detecting valid message information using the CAN oscilloscope; and determining the communication rate at which valid message information is detected as the communication rate of the first CAN network segment when valid message information is detected, which includes: obtaining the communication rate of the CAN oscilloscope at the time of receiving valid message information using the CAN controller, and determining the communication rate of the CAN oscilloscope at the time of receiving valid message information as the communication rate of the first CAN network segment.

[0019] In this embodiment, a CAN controller and a CAN oscilloscope work together to perform tests at various communication rates, ensuring accurate capture of valid message information from the first CAN network segment and locking its communication rate. This process requires no operator intervention, improving testing efficiency.

[0020] In one embodiment, the first detection instruction includes target vehicle model information, and the method further includes: determining multiple CAN network segments included in the CAN bus corresponding to the target vehicle model information as target network segments.

[0021] In this embodiment, by inputting the target vehicle model information, the MCU can quickly locate the target network segment to be detected, thereby improving detection efficiency and accuracy.

[0022] In one embodiment, the first detection instruction includes target vehicle information and network segment identifier. The method further includes: determining the CAN network segment in the CAN bus corresponding to the target vehicle information that corresponds to the network segment identifier as the target network segment.

[0023] In this embodiment of the application, when it is necessary to obtain the message information of a specific network segment, the staff can issue the first detection command through the host computer, which has high flexibility and adaptability.

[0024] In one embodiment, the configuration file includes key information of the vehicle CAN bus corresponding to different vehicle models. The key information of the target network segment is obtained by searching the configuration file, including: searching the configuration file according to the target vehicle model information to determine the target key information, which includes key information of each CAN network segment included in the vehicle CAN bus corresponding to the target vehicle model information; and obtaining the key information of the target network segment from the target key information.

[0025] In this embodiment, configuration files support multi-vehicle adaptation, enabling the CAN detection device to flexibly adapt to the on-board CAN bus structure of different vehicle models, thereby improving the versatility and practicality of the CAN detection device.

[0026] Secondly, this application also provides a CAN detection device, which includes a microcontroller (MCU) and multiple data transmission channels. The first end of each data transmission channel is connected to the interface of an in-vehicle CAN bus, and the second end of each data transmission channel is connected to the interface of a host computer bus. The MCU is connected to the first switching unit of each data transmission channel. The MCU is used to acquire a first detection command, which instructs the acquisition of message information of a target network segment. The target network segment is one or more of the multiple CAN network segments included in the in-vehicle CAN bus. In response to the first detection command, the MCU acquires key information of the target network segment by searching a configuration file. If the key information of the target network segment is not found in the configuration file, the MCU acquires the key information of the target network segment by real-time scanning. The key information of the target network segment includes the communication rate of the target network segment and the corresponding pin on the interface of the in-vehicle CAN bus. Based on the corresponding pin on the interface of the in-vehicle CAN bus, the MCU determines the target data transmission channel corresponding to the target network segment, configures the target data transmission channel based on the communication rate of the target network segment, and controls the first switching unit of the target data transmission channel to be turned on, so as to transmit the message information of the target network segment to the host computer.

[0027] In one embodiment, the CAN detection device further includes a scanning module, which includes multiple signal scanning circuits and signal detection circuits. The first end of the multiple signal scanning circuits is connected to the interface of the vehicle CAN bus, the second end of the multiple signal scanning circuits is connected to the signal detection circuit, and the MCU is connected to the second switching unit included in the multiple signal scanning circuits. The MCU is used to control the second switching unit of each signal scanning circuit to be turned on or off, and to poll any two pins in the interface of the vehicle CAN bus.

[0028] A signal detection circuit is used to obtain the voltage difference between the first pin and the second pin when the first pin and the second pin are currently polled.

[0029] The MCU is also used to determine the resistance value between the first pin and the second pin based on the voltage difference; when the resistance value is a preset resistance value, it determines that there is a first CAN network segment between the first pin and the second pin, and records the correspondence between the first CAN network segment and the first pin and the second pin; it determines the target network segment from each identified first CAN network segment, and obtains the pin corresponding to the target network segment.

[0030] In one embodiment, the scanning module further includes a communication rate detection circuit, which comprises a CAN controller and a CAN oscilloscope connected in sequence. The CAN controller is connected to an MCU, and the CAN oscilloscope is connected to the second terminal of multiple signal scanning circuits. The MCU is used to determine the target signal scanning circuit for each first CAN network segment based on the corresponding pin, and control the target signal scanning circuit to be turned on. The CAN controller is used to adjust the communication rate of the CAN oscilloscope within the communication rate range conforming to the CAN standard. The CAN oscilloscope is used to receive and detect valid message information. The CAN controller is also used to obtain the communication rate of the CAN oscilloscope when valid message information is received, and report the communication rate of the CAN oscilloscope when valid message information is received to the MCU. The MCU is also used to determine the communication rate of the CAN oscilloscope when valid message information is received as the communication rate of the first CAN network segment.

[0031] The beneficial effects of the embodiments of this application include:

[0032] (1) Automatic identification of CAN network segments without configuration files is achieved through real-time scanning. It can poll each CAN network segment in the CAN bus.

[0033] (2) By integrating the first ends of multiple data transmission channels into a single first interface, which includes multiple pins, the multiple CAN segments of the vehicle CAN bus are integrated into a single vehicle CAN bus interface. Operators only need to connect the first interface to the vehicle CAN bus interface once to access all CAN segments. This avoids errors caused by manually connecting the CANH and CANL data lines one by one, which could hinder the analysis process and increase troubleshooting time.

[0034] (3) By integrating the second ends of multiple data transmission channels into a single second interface, which includes multiple pins, operators only need to plug the second interface into the host computer bus interface once to complete the connection between the host computer, the CAN detection device, and the vehicle CAN bus. This avoids the need for debugging personnel to repeatedly connect communication data cables, making the process simpler.

[0035] (4) The use of integrated interfaces makes the detection process simpler, and staff do not need to pay attention to the internal detection principle, thus reducing the difficulty of the work and improving the detection efficiency.

[0036] It should be understood that the above general description and the following detailed description are illustrative and explanatory only, and are not intended to limit the technical solutions of this application. Attached Figure Description

[0037] Figure 1This is a structural block diagram of a CAN detection device provided in an embodiment of this application;

[0038] Figure 2 This is a schematic diagram illustrating the connection between a CAN detection device and a host computer and a vehicle, as proposed in an embodiment of this application.

[0039] Figure 3 This is a schematic diagram of a data transmission channel provided in an embodiment of this application;

[0040] Figure 4 This is a schematic diagram of the connection structure of a CAN detection device provided in an embodiment of this application;

[0041] Figure 5 This is a schematic diagram of the circuit structure of a scanning module provided in an embodiment of this application;

[0042] Figure 6 This is a flowchart illustrating a CAN detection method provided in an embodiment of this application. Figure 1 ;

[0043] Figure 7 This is a flowchart illustrating a CAN detection method provided in an embodiment of this application. Figure 2 ;

[0044] Figure 8 This is a flowchart illustrating a CAN detection method provided in an embodiment of this application. Figure 3 . Detailed Implementation

[0045] In order to gain a more detailed understanding of the features and technical content of the embodiments of this application, the implementation of the embodiments of this application will be described in detail below with reference to the accompanying drawings. The accompanying drawings are for reference and illustration only and are not intended to limit the embodiments of this application.

[0046] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit this application.

[0047] In the following description, references are made to “some embodiments,” which describe a subset of all possible embodiments. However, it is understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.

[0048] It should also be noted that the terms "first, second, and third" used in the embodiments of this application are only used to distinguish similar objects and do not represent a specific ordering of objects. It is understood that "first, second, and third" can be interchanged in a specific order or sequence where permitted, so that the embodiments of this application described herein can be implemented in an order other than that illustrated or described herein.

[0049] Furthermore, the reference to "embodiment" herein means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.

[0050] The following is a description of the relevant technologies used in this application.

[0051] Controller Area Network (CAN) is a high-performance serial communication protocol widely used in the new energy vehicle field. The vehicle's CAN bus connects to various control systems within the vehicle, such as the drive system, charging system, battery system, and thermal control system. In this embodiment, the vehicle's CAN bus includes multiple CAN segments, each a physical communication channel consisting of a high-level line (CANH) and a low-level line (CANL). Each CAN segment typically corresponds to a specific functional module or control system (e.g., engine control system, infotainment system), and has an independent communication rate and segment identifier.

[0052] Information exchange between various control systems within the vehicle is typically transmitted via the vehicle's CAN bus. With the rapid development of vehicle intelligence, the types and number of in-vehicle control systems are constantly increasing, leading to a corresponding increase in the amount of data transmitted via the CAN bus. This results in a high load rate on the CAN bus, potentially causing communication loss, frame dropping, and fault reports. These issues can prevent the vehicle from starting normally, entering high-voltage mode, or malfunctioning, thus threatening the user's driving safety.

[0053] To improve the reliability of the vehicle's CAN bus, it is typically necessary to test it. One testing method involves connecting the high-level line CANH and the low-level line CANL of the testing device to the corresponding interface pin of each CAN segment, thereby acquiring the message information of that CAN segment. After acquiring the message information for that CAN segment, the operator manually disconnects and reconnects the high-level line CANH and the low-level line CANL to the interface pin of the next CAN segment. This process is repeated until message information for all CAN segments has been acquired. However, this method of manually switching CAN segments is inefficient.

[0054] Furthermore, since different CAN network segments correspond to different interface pins, pin connection errors are prone to occur when there are a large number of CAN network segments. In addition, during the vehicle development phase, different vehicle models may use different pin definitions for the CAN bus. Therefore, staff need to memorize the pins corresponding to each CAN network segment in the CAN bus of various vehicle models, which is very easy to cause confusion, leading to pin connection errors and affecting testing efficiency.

[0055] To address this technical problem, this application provides a CAN detection device. The CAN detection device includes a microcontroller unit (MCU) and multiple data transmission channels. The first end of each data transmission channel is connected to the interface of the vehicle's CAN bus, and the second end is connected to the interface of a host computer's bus. The MCU is connected to a first switching unit of each data transmission channel. The MCU can control the on / off state of each data transmission channel through the first switching unit. This solution, by controlling the vehicle's CAN bus connection to the host computer using a high-performance microcontroller, makes the entire vehicle CAN detection and troubleshooting process more intelligent and convenient, breaking through the barriers of manual operation and effectively improving the efficiency of fault diagnosis.

[0056] This application also provides a CAN detection method, applied in a CAN detection device. The method includes: receiving a first detection command, which instructs the acquisition of message information from a target network segment. The target network segment is one or more CAN network segments included in the vehicle CAN bus. In response to the first detection command, key information of the target network segment is acquired based on a configuration file, or key information of the target network segment is acquired through real-time scanning. Then, the data transmission channel between the target network segment and the host computer is controlled according to the key information of the target network segment, enabling the message information of the target network segment to be transmitted to the host computer. This solution automatically acquires the key information of the target network segment after receiving the first detection command and automatically identifies and switches to different CAN network segments accordingly, completing the message acquisition of the target network segment without manual intervention. Compared with the prior art, which requires manual switching of CANH and CANL pins and setting of communication rates, this significantly improves detection efficiency and reduces operational complexity and error probability.

[0057] The embodiments of this application will now be described with reference to the accompanying drawings.

[0058] Please refer to Figure 1 and Figure 2 , Figure 1 This is a structural block diagram of a CAN detection device provided in an embodiment of this application. Figure 2 This is a schematic diagram illustrating the connection between a CAN detection device and a host computer and a vehicle, as proposed in an embodiment of this application. The CAN detection device 100 includes an MCU 101 and multiple data transmission channels 102. Figure 1 In this circuit, MOSFETs are used to represent data transmission channels. The first end of the multiple data transmission channels 102 is connected to each CAN network segment of the vehicle CAN bus 200 through the interface 201 of the vehicle CAN bus. The second end of the multiple data transmission channels is connected to the host computer 300 through the host computer bus interface 301. The MCU 101 is connected to the switching unit of the multiple data transmission channels through the IO interface to control the conduction and shutdown of each data transmission channel.

[0059] In this embodiment of the application, the interface of the vehicle CAN bus may be, for example, a multiplexed OnBoard Diagnostics (OBD) bus interface.

[0060] In one implementation of this application, each data transmission channel includes a first switching unit, and the MCU is connected to the first switching unit via an I / O interface. The MCU 101 can send control signals to the first switching unit to control the first switching unit to turn on or off, thereby controlling the data transmission channel to turn on or off.

[0061] Optionally, in this embodiment, the first switching unit may be a Metal Oxide Semiconductor Field Effect Transistor (MOS), and each first switching unit includes at least one MOS transistor. A MOS transistor is a voltage-controlled semiconductor device that can control its conduction state according to the input level and is commonly used in switching circuits. MOS transistors can achieve millisecond-level switching. In this embodiment, by setting a MOS transistor in the data transmission channel, the MCU can control the switching of the MOS transistor to perform millisecond-level rapid switching of the data transmission channel, thereby enabling rapid scanning of the vehicle CAN bus. Compared with traditional relay switches, MOS transistors have advantages such as fast switching speed and high stability, which can improve the overall flexibility and working efficiency of CAN bus devices.

[0062] In this embodiment, the MCU101 can send level signals to one or more MOSFETs via the I / O interface to control the MOSFETs to turn on or off. When a MOSFET is on, the corresponding data transmission channel is on. When a MOSFET is off, the corresponding data transmission channel is off. The MCU101 can achieve automatic switching between different CAN network segments by controlling the on / off state of the MOSFETs.

[0063] In the embodiments of this application, please refer to Figure 1 As shown, the first ends of multiple data transmission channels are connected to a first interface 103, which is connected to an interface 201 of the vehicle CAN bus. The first interface 103 includes multiple pins, and the first ends of multiple data transmission channels 102 are connected to the pins in the first interface 103. The first interface 103 is connected to the interface 201 of the vehicle CAN bus, meaning that the multiple pins of the first interface 103 are connected one-to-one with the multiple pins of the interface 201 of the vehicle CAN bus.

[0064] Please refer to Figure 1 As shown, the second ends of multiple data transmission channels 102 are connected to a second interface 104, which is connected to a host computer bus interface 301. The second interface 104 includes multiple pins, and the second ends of the multiple data transmission channels 102 are connected to corresponding pins in the second interface 104. The second interface 104 is connected to the host computer bus interface 301, meaning that the multiple pins in the second interface 104 are connected one-to-one with the multiple pins in the host computer bus interface 301.

[0065] like Figure 1As shown in the embodiment of this application, the CAN detection device 100 further includes a communication module 106, a power management module 105, and a scanning module 108. The communication module 106 includes a wireless communication module (Wi-Fi), a serial communication interface (Serial Port), and a Universal Serial Bus (USB) interface. The power management module 105 supplies power to the MCU, the scanning module 108 performs real-time scanning of the vehicle's CAN bus, and the communication module 106 communicates wirelessly with the host computer and transmits data.

[0066] Accordingly, in this embodiment, the MCU 101 further includes an IO interface module 107 with output level control on / off function (level control on / off can be understood as the aforementioned conduction or shutdown function), wherein the number of IO interfaces should be greater than or equal to the number of multiple CAN network segments. Furthermore, in this embodiment, the wireless communication module supports User Datagram Protocol (UDP) / Transmission Control Protocol (TCP) network communication protocols, serial communication protocols, etc.

[0067] In this embodiment, each data transmission channel includes at least one MOS transistor. Please refer to [link / reference]. Figure 2 and Figure 3 As shown, Figure 3 This is a schematic diagram of a data transmission channel provided in an embodiment of this application. Figure 3 In this paper, a MOSFET is used to represent a data transmission channel. It should be noted that each data transmission channel may also include other electronic components, such as resistors. This application does not limit the constituent components of the data transmission channel.

[0068] The first terminal of the MOSFET is connected to the vehicle CAN bus interface 201, the second terminal is connected to the host computer bus interface 301, and the third terminal is connected to the MCU101 via an I / O interface. The MCU101 can send level signals to the MOSFET through the I / O interface.

[0069] The following is combined with Figure 4 The correspondence between the CAN network segment and the host computer provided in the embodiments of this application is explained. Figure 4 This is a schematic diagram of the connection structure of a CAN detection device provided in an embodiment of this application. In this embodiment, the vehicle CAN bus includes multiple CAN segments, and the high-level line and low-level line of each CAN segment correspond to two pins in the interface 201 of the vehicle CAN bus.

[0070] like Figure 4 As shown, Figure 4 The pin array corresponding to the interface 201 of the vehicle CAN bus is represented by an array of black dots. Figure 4 The diagram also exemplarily illustrates the pin arrays corresponding to the first interface 103, the second interface 104, and the host computer bus interface 301. It should be noted that... Figure 4 The pin arrays shown are merely illustrative for ease of understanding and do not constitute a limitation on the structure of the vehicle CAN bus interface 201, the first interface 103, the second interface 104, and the host computer bus interface 301 in the embodiments of this application.

[0071] The following example uses the first CAN network segment. The high-level and low-level lines of the first CAN network segment are connected to pin pair I1 in the interface 201 of the vehicle CAN bus. Pin pair I1 includes two pins. For simplicity, Figure 4 A black dot represents a pin pair, and a pin pair consists of two pins.

[0072] In this embodiment, the CAN detection device includes multiple data transmission channels. Figure 4 The diagram exemplarily illustrates data transmission channels A1, A2, A3, ..., An, each including at least one first switching unit, such as a MOSFET. For example, data transmission channel A1 includes a first switching unit M1, data transmission channel A2 includes a first switching unit M2, data transmission channel A3 includes a first switching unit M3, ..., and data transmission channel An includes a first switching unit Mn. Figure 4 As shown, MCU101 is connected to the first switch unit of each data transmission channel and is used to send level signals to the first switch unit to control the conduction or disconnection of each data transmission channel.

[0073] The vehicle-mounted CAN bus interface 201 is connected to the first interface 103 of the CAN detection device. Pin pair I1 in the vehicle-mounted CAN bus interface 201 is connected to pin pair P4 in the first interface 103. Pin pair P4 in the first interface 103 corresponds to data transmission channel A3 in multiple data transmission channels 102. Data transmission channel A3 includes a first switching unit (MOS transistor) M3. The second end of data transmission channel A3 is connected to pin pair M4 in the second interface 104. When the second interface 104 is connected to the host computer bus interface 301, pin pair M4 in the second interface 104 is connected to pin pair H4 in the host computer bus interface 301. Thus, the first CAN network segment is connected to the host computer 300 through pin pair I1, pin pair P4, data transmission channel A3 (including M3), pin pair M4, and pin pair H4.

[0074] It should be noted that in the embodiments of this application, the first switching unit is usually in the normally open state.

[0075] It should be noted that, Figure 4 The diagram illustrates only one possible connection method for the first CAN network segment, and the connection method is not limited to this. Figure 4 The form shown in the figure. Furthermore, the connection method of the data transmission channel between the remaining CAN network segments and the host computer in this embodiment is the same as... Figure 4 The connection method shown in the figure is based on the same principle, and will not be elaborated here.

[0076] In this embodiment of the application, following the example above, when it is necessary to obtain the message information of the first CAN network segment, the MCU101 can send a level signal to M3 to make M3 conduct, that is, the data transmission channel A3 conducts. In this way, the message information of the first CAN network segment can be sent to the host computer 300 through the data transmission channel A3.

[0077] Based on the above embodiments, this application also provides a CAN detection device, please refer to... Figure 1 As shown, the CAN detection device includes a scanning module 108, which is connected to the interface 201 of the vehicle's CAN bus. Please refer to... Figure 5 , Figure 5 This is a schematic diagram of the circuit structure of a scanning module provided in an embodiment of this application. The scanning module 108 includes multiple signal scanning circuits 1081, signal detection circuits 1082, and communication rate detection circuits 1083. Figure 5 In the diagram, multiple signal scanning circuits 1081 are represented by a MOS transistor array. It should be noted that each signal scanning circuit may also include other electronic components, and this application does not limit the configuration of the signal scanning circuits.

[0078] The first end of the multiple signal scanning circuits 1081 is connected to the interface 201 of the vehicle CAN bus, the second end of the multiple signal scanning circuits is connected to the signal detection circuit 1082 and the communication rate detection circuit 1083, and the MCU 101 is connected to the second switching unit included in the multiple signal scanning circuits 1081.

[0079] Optionally, the second switching unit includes at least one MOSFET.

[0080] In this embodiment of the application, as shown in Figure 5, the signal detection circuit 1082 includes a first signal line and a second signal line connected in parallel. The first signal line includes a first variable resistor R1, and the second signal line includes a second variable resistor R2 and a fixed resistor R3 connected in series. The fixed resistor R3 is, for example, 60 ohms. The first and second signal lines are connected to multiple signal scanning circuits 1081. The first signal line is a high-level line, and the second signal line is a low-level line. Alternatively, the first signal line is a low-level line, and the second signal line is a high-level line. The signals in the two signal lines have equal amplitudes and opposite phases.

[0081] In this embodiment, the MCU 101 can send level signals to any two MOS transistors in the multiple signal scanning circuits 1081, and then control the signal detection circuit 1082 to be turned on with the corresponding signal scanning circuit. In this way, the high-level lines and low-level lines of the CAN network segment included in the vehicle CAN bus can be turned on with the signal detection circuit 1082, thereby enabling the acquisition of the differential signals of the CAN network segment.

[0082] In this embodiment, the MCU101 can turn on any two pins in the polling interface of the vehicle CAN bus by controlling the second switching unit (MOS transistor) of each signal scanning circuit to turn on or off, so as to collect the differential signal between the two pins. For the currently polled first and second pins, the voltage signal can be collected by the signal detection circuit and sent to the MCU. The MCU can calculate the voltage difference between the first and second pins based on the two voltage signals and determine the resistance value between the first and second pins based on the voltage difference. If the resistance value is a preset resistance value, it is determined that there is a first CAN network segment between the first and second pins, and the correspondence between the first CAN network segment and the first and second pins is recorded. The target network segment is determined from each identified first CAN network segment, and the pin corresponding to the target network segment is obtained. If the resistance value between the first and second pins is not a preset resistance value, it is determined that there is no association between the first and second pins. Then, new pin pairs are polled to determine new first and second pins, and so on, until all pin combinations are traversed.

[0083] In this embodiment, the microcontroller outputs high and low level signals to control the on / off state of the MOSFET in the signal scanning circuit, thereby realizing polling operations between any two pins in the vehicle CAN bus interface. This polling method can automatically traverse all possible pin combinations without manual intervention, improving detection efficiency and accuracy.

[0084] In some implementations, the MCU can sequentially activate the second switching units in each signal scanning circuit according to a preset logical sequence, thereby enabling each pair of signal pins to enter a detectable state. For example, in a CAN bus interface with 16 signal pins, the microcontroller can sequentially activate all combinations of the first pin and the second pin, the first pin and the third pin, and so on up to the fifteenth pin and the sixteenth pin, thus ensuring that no possible CAN network segment configuration is missed.

[0085] In this embodiment, the signal detection circuit 1082 can send the voltage difference between two pins to the MCU, and the MCU can also determine the resistance value between the two pins based on the voltage difference. When the resistance value between the two pins is the same as a preset resistance value, it indicates that there is a first CAN network segment between the two pins. For example, the preset resistance value is 60 ohms. If the resistance value between the two pins is 60 ohms, it means that the two pins form a CAN network segment; if the resistance value between the two pins is infinite, it means that the two pins are unrelated. The MCU can record the pin numbers and then continue polling other pins. This method can automatically identify the first CAN network segment, and by polling, all first CAN network segments included in the vehicle CAN bus can be identified.

[0086] In this embodiment, to improve scanning efficiency, the CAN detection device can employ a parallel scanning strategy, simultaneously detecting the resistance values ​​between multiple pins to quickly eliminate invalid combinations and retain only CANH / CANL pin pairs that meet the 60-ohm characteristic. This allows for rapid determination of which pins on the CAN bus interface constitute valid segments, thereby reducing manual configuration workload. This improves detection efficiency and reduces operational complexity, ultimately enhancing the intelligence level of automotive fault diagnosis.

[0087] Based on the above embodiments, in this embodiment, the scanning module 108 further includes a communication rate detection circuit 1083. Please refer to... Figure 5 The MCU101 controls the signal scanning circuit and the communication rate detection circuit 1083 to be turned on. After identifying the pins corresponding to each first CAN network segment, for each first CAN network segment, the MCU101 can determine the target signal scanning circuit according to the pins corresponding to the first CAN network segment, and control the target signal scanning circuit to be turned on. Then, the communication rate detection circuit 1083 polls and receives network segment messages within the communication rate range that conforms to the CAN standard. When a valid message is received, the communication rate at which the valid message is received is determined as the communication rate of the first CAN network segment.

[0088] like Figure 5As shown, the communication rate detection circuit 1083 includes a CAN controller and a CAN oscilloscope. The CAN controller can adjust the signal receiving rate of the CAN oscilloscope, which is used to receive and parse network segment messages. When parsing is successful, it is determined that valid message information has been received. When parsing fails, it is determined that no valid message information has been received. The CAN controller can also report the communication rate corresponding to the identified first CAN network segment to the MCU 101, so that the MCU 101 can determine the key information of each first CAN network segment.

[0089] In this embodiment, the receiving rate of the CAN oscilloscope is continuously adjusted to attempt to receive network segment messages, thereby detecting the communication rate corresponding to each first CAN network segment.

[0090] It should be noted that in this embodiment, since the communication timeliness requirements of each first CAN network segment are different, their corresponding communication rates are also different. Therefore, it is necessary to detect the communication rate of each first CAN network segment one by one.

[0091] In this embodiment, after parsing valid message information, the CAN oscilloscope can obtain the message characteristics in the message information, wherein the message characteristics include the segment identifier of the first CAN segment. The segment identifier is a unique identifier for each CAN segment included in a CAN bus.

[0092] In this embodiment, after the MCU101 obtains the communication rate, segment identifier, and corresponding pin of each first CAN segment, it can determine the key information of each CAN segment in the CAN bus.

[0093] In some implementations, CAN detection devices can also record performance indicators such as communication stability, frame loss rate, and bit error rate for each network segment, and generate visual reports for technicians to refer to. For example, if a network segment has a high frame loss rate, it may indicate that there is a physical connection problem or electromagnetic interference in that network segment, requiring further inspection of wiring or shielding measures.

[0094] In this embodiment, the CAN detection device mainly uses an MCU to control MOSFETs to switch different signal scanning circuits, sequentially accessing each CAN network segment and collecting its message information. For example, when detecting the CAN network segment corresponding to the body control system of a certain vehicle model, the MCU first activates the IO port corresponding to that CAN network segment, turns on the corresponding MOSFET, and enables the corresponding data transmission channel to be turned on. Then, it uploads key parameters such as the communication rate, frame format, and message ID of that CAN network segment to the host computer for display and analysis.

[0095] The CAN detection device provided in this application supports both manual and automatic detection modes. In automatic mode, the MCU switches between CAN network segments sequentially according to a preset order to achieve unattended continuous detection. In manual mode, technicians can select the target network segment through the host computer interface to achieve flexible detection of a specific target network segment.

[0096] Based on the above embodiments, please refer to Figure 6 , Figure 6 This is a flowchart illustrating a CAN detection method provided in an embodiment of this application. Figure 1 The method described above, in the CAN detection device provided, includes a microcontroller (MCU) and multiple data transmission channels. The first end of each data transmission channel is connected to the interface of the vehicle's CAN bus, and the second end of each data transmission channel is connected to the interface of a host computer bus. The MCU is connected to the switching unit of each data transmission channel. The method includes the following steps:

[0097] Step 601: The microcontroller receives the first detection command.

[0098] The first detection command instructs the acquisition of message information from the target network segment. The target network segment is one or more of the multiple CAN network segments included in the vehicle CAN bus.

[0099] In one implementation, the first detection command is generated automatically by the CAN detection device based on pre-defined rules. For example, the CAN detection device can periodically generate the first detection command to initiate the detection process for a specific CAN network segment or the entire vehicle CAN bus.

[0100] In another implementation, the first detection command is issued by the host computer to initiate the detection process for a specific CAN network segment or the entire vehicle's CAN bus. For example, in a vehicle testing scenario, the operator can select the CAN network segment corresponding to the engine control module through the host computer interface and send the first detection command, thereby triggering the CAN detection equipment to obtain the message information of that CAN network segment.

[0101] In one implementation, the first detection command includes vehicle model information, such as a vehicle model identifier. Upon receiving the first detection command, the microcontroller can identify all CAN bus segments corresponding to the vehicle model information as the target segments. In this case, the first detection command essentially instructs the acquisition of message information from all CAN bus segments of the vehicle.

[0102] In another implementation, the first detection command includes vehicle model information and a CAN segment identifier. The CAN segment identifier is a unique identifier for a CAN segment. The CAN segment identifiers for each CAN segment in the vehicle's CAN bus corresponding to each vehicle model are pre-designed and assigned. Upon receiving the first detection command, the microcontroller can determine the vehicle's CAN bus based on the vehicle model information, and then identify the CAN segment in the vehicle's CAN bus corresponding to the CAN segment identifier as the target CAN segment. In this case, the first detection command essentially instructs the acquisition of the message information of the CAN segment corresponding to the CAN segment identifier.

[0103] In this embodiment of the application, the first detection instruction may include one or more network segment identifiers.

[0104] Step 602: The microcontroller responds to the first detection command and obtains key information of the target network segment by searching the configuration file.

[0105] In this embodiment, the CAN detection device pre-stores a configuration file, which includes key information about the vehicle's CAN bus corresponding to various vehicle models. The configuration file includes, but is not limited to, the number of CAN segments, communication rates, and corresponding pin definitions for each vehicle model's CAN bus. Based on the configuration file, key information about the target network segment can be quickly obtained, improving detection efficiency.

[0106] Based on this, the microcontroller can find the target key information from the configuration file based on the vehicle model information contained in the first detection instruction. The target key information is the key information of the vehicle CAN bus corresponding to the vehicle model information contained in the first detection instruction. Among them, the key information of the vehicle CAN bus includes the number of multiple CAN network segments included in the vehicle CAN bus and the key information of each CAN network segment. The key information of the CAN network segment includes the communication rate of the CAN network segment and the corresponding pins of the CAN network segment on the interface of the vehicle CAN bus.

[0107] In this embodiment, when the first detection command includes vehicle model information, the microcontroller can determine all CAN network segments included in the vehicle CAN bus corresponding to the vehicle model information as the target network segment. Obtaining the key information of the target network segment is equivalent to obtaining the key information of the entire vehicle CAN bus.

[0108] When the first detection command contains vehicle model information and network segment identifier, the microcontroller can determine the vehicle CAN bus based on the vehicle model information and identify the CAN network segment in the vehicle CAN bus that corresponds to the network segment identifier as the target network segment.

[0109] In this embodiment, obtaining key target information is a prerequisite for completing CAN testing, as it determines the accuracy and efficiency of subsequent testing. When the CAN testing equipment has a configuration file for a specific vehicle model, it can directly extract the number of network segments, communication rates, and pin definitions from the configuration file without additional scanning, significantly shortening the testing preparation time. For example, given the known pin definitions of the vehicle CAN bus array interface for a certain vehicle model, the CAN testing equipment can directly identify the eight CAN network segments included in the vehicle CAN bus and their corresponding communication rates (such as 500kbps, 250kbps, etc.), and determine the physical pin locations connected to the high-level line CANH and the low-level line CANL of each CAN network segment.

[0110] Step 603: The microcontroller determines the target data transmission channel corresponding to the target network segment based on the pins on the interface of the vehicle CAN bus, configures the target data transmission channel based on the communication rate of the target network segment, and controls the switching unit of the target data transmission channel to be turned on so as to transmit the message information of the target network segment to the host computer.

[0111] In this embodiment of the application, following the example above, for example, the target network segment is... Figure 4 The first CAN network segment shown can be activated by the MCU when it needs to obtain message information from the target network segment. The MCU can send a level signal to M3 to turn on M3, which means that the data transmission channel A3 is turned on. The communication rate of the target network segment is configured for the data transmission channel A3. In this way, the message information of the target network segment can be sent to the host computer through the configured data transmission channel A3.

[0112] In this embodiment, key information of the target network segment can be directly obtained from the configuration file. Based on this, the data transmission channel is configured according to the key information of the target network segment, which enables the rapid and efficient acquisition of message information of the target network segment and significantly shortens the detection preparation time.

[0113] It should be noted that when there are multiple target network segments, the MCU needs to determine the polling order of the target network segments based on the number of target network segments, and then obtain the packet information of each target network segment in turn according to the polling order. The method of obtaining the packet information of each target network segment is the same.

[0114] In summary, this embodiment provides a CAN bus detection method based on a combination of pre-configured information query and real-time scanning. By controlling the MOSFET with an MCU to automatically switch data transmission channels, it significantly improves detection efficiency and reliability. Compared to traditional manual switching methods, this method not only reduces operational complexity but also lowers the risk of human error, making it particularly suitable for highly intelligent modern automotive diagnostic scenarios.

[0115] Based on the above embodiments, this application also provides another CAN detection method. For example... Figure 7 As shown, Figure 7 This is a flowchart illustrating a CAN detection method provided in an embodiment of this application. Figure 2 The method includes the following steps:

[0116] Step 701: The microcontroller receives the first detection command.

[0117] The content of the first detection instruction can be found in step 601 of the above embodiments, and will not be repeated here.

[0118] Step 702: The microcontroller responds to the first detection command and acquires key information of the target network segment based on real-time scanning.

[0119] In this embodiment of the application, the process of the microcontroller scanning and acquiring key information of the target network segment in real time includes:

[0120] The microcontroller control signal detection circuit is connected to the signal scanning circuit. The microcontroller calls the signal detection circuit to collect the voltage difference between the two currently conducting pins and determines the resistance value between the two pins based on the voltage difference. If the resistance value between the two pins is the same as the preset resistance value, it indicates that there is a first CAN network segment between the two pins.

[0121] In one implementation, the MCU can uniformly identify all the first CAN network segments, and then detect the communication rate of each first CAN network segment through a communication rate detection circuit.

[0122] In another implementation, each time the MCU identifies a first CAN network segment, it switches the target signal scanning circuit corresponding to the first CAN network segment to be connected to the communication rate detection circuit, and then directly detects the communication rate of the first CAN network segment.

[0123] In this embodiment, the communication rate detection circuit adjusts the signal receiving rate of the CAN oscilloscope within the communication rate range conforming to the CAN standard. When the signal receiving rate of the CAN oscilloscope matches the communication rate of the first CAN network segment, the CAN oscilloscope can receive valid message information. When valid message information is received, the communication rate at which valid message information is received is determined as the communication rate of the first CAN network segment.

[0124] In this way, through real-time scanning, all first CAN segments in the vehicle CAN bus can be traversed, and the pins and communication rates of each first CAN segment can be obtained. The target segment is one or more of the traversed first CAN segments, so the key information of the target segment can be obtained from the key information of multiple first CAN segments.

[0125] Step 703: The microcontroller determines the target data transmission channel corresponding to the target network segment based on the pins on the interface of the vehicle CAN bus, configures the target data transmission channel based on the communication rate of the target network segment, and controls the switching unit of the target data transmission channel to be turned on so as to transmit the message information of the target network segment to the host computer.

[0126] In this embodiment, key information of the target network segment is obtained through real-time scanning, and the packet information of the target network segment is obtained based on this. The real-time scanning method is suitable for situations where there is no configuration file or the configuration information is incomplete. The real-time scanning method has high flexibility and adaptability, and can automatically identify and establish communication links.

[0127] Based on the above embodiments, this application also provides another CAN detection method. For example... Figure 8 As shown, Figure 8 This is a flowchart illustrating a CAN detection method provided in an embodiment of this application. Figure 3 The method includes the following steps:

[0128] Step 801: The microcontroller receives the first detection command.

[0129] Step 802: The microcontroller responds to the first detection command and obtains key information of the target network segment by searching the configuration file.

[0130] Step 803: If the process fails to retrieve information from the configuration file, obtain key information about the target network segment using a real-time scanning method.

[0131] In this case, if the key information of the target network segment is not found in the configuration file, the retrieval from the configuration file will fail.

[0132] Step 804: The microcontroller uploads the message information of the target network segment to the host computer based on the key information of the target network segment.

[0133] The key information of the target network segment may include the number of target network segments, the communication rate of each target network segment, and the pins corresponding to each target network segment.

[0134] The microcontroller can determine the polling order based on the number of target network segments, then determine the target data transmission channel based on the pins corresponding to the target network segments, configure the communication rate of the target data transmission channel using the communication rate of the target network segments, and then connect the target data transmission channel. This enables the target network segment to connect with the host computer, allowing the target network segment's message information to be uploaded to the host computer.

[0135] In this embodiment, after the microcontroller (MCU) receives the first detection command, the processor (MCU) first determines whether the key information of the target network segment can be obtained through the configuration file. If a corresponding configuration file exists, the processor (MCU) directly reads the communication rate and pin information from the configuration file; if the configuration file cannot be obtained, the processor (MCU) starts a real-time scanning mechanism and automatically identifies the parameters of the target network segment through the signal detection circuit and the communication rate detection circuit.

[0136] Based on the above embodiments, this application also provides a CAN detection system, which includes a host computer and multiple CAN detection devices. Each CAN detection device is connected to the interface of the vehicle's CAN bus. The host computer and the multiple CAN detection devices are connected to each other, and the connection method can be wired or wireless. This application does not limit this connection.

[0137] The host computer can send a first detection command to each CAN detection device. The first detection command is used to instruct the acquisition of the pin information of the vehicle's CAN bus. The pin information includes the definition relationship between each CAN segment and the pins in the interface pins of the vehicle CAN bus, CANH and CANL of each CAN segment, and the communication rate of each CAN segment.

[0138] Each CAN detection device responds to the first detection command, scans the connected vehicle CAN bus, and reports the scan results to the host computer.

[0139] The host computer pre-stores pin information for various standard states, and different vehicle models have different standard state pin information. Vehicle models of the same type usually have the same standard state pin information.

[0140] Based on this, the host computer can find the corresponding standard state pin information according to the vehicle model to which the CAN detection device is connected. Then, it compares the pin information scanned and reported by the CAN detection device with the standard state pin information corresponding to the vehicle model, and determines whether there is an abnormality in the vehicle's CAN bus based on the comparison result.

[0141] For example, if the pin information scanned and reported by the CAN detection device matches the pin information in the standard state, it is determined that the vehicle's CAN bus connected to the CAN detection device is normal. If the comparison fails, it is determined that the vehicle's CAN bus connected to the CAN detection device is abnormal, and an error is reported.

[0142] Since the pre-stored pin information for various standard states in the host computer may not cover all vehicle models, some models may lack standard state pin information. To address this, in this embodiment, the host computer can compare the pin information scanned from models lacking standard state pin information one by one, identifying and extracting the differences. And then...

[0143] For example, if 100 vehicles lack standard pin information, the pin information of these 100 vehicles will be compared one by one to identify the differences between the pin information of any one of these 100 vehicles and the pin information of the other 99 vehicles. Assuming that the pin information of 80 vehicles is consistent, then the CAN bus of these 80 vehicles is determined to be normal. If the pin information of the other 20 vehicles is inconsistent with the pin information of the 80 vehicles, then the CAN bus of these other 20 vehicles is determined to be abnormal.

[0144] In the CAN inspection system provided in this application embodiment, the host computer can control multiple CAN inspection devices to scan multiple vehicles in batches and compare the scanned pin information with standardized pin information. For vehicles without standardized pin information, rapid identification can be achieved by finding commonalities and differences, thus improving inspection efficiency. In vehicle factory inspection scenarios, vehicles about to leave the factory can be rapidly inspected in batches to ensure vehicle quality.

[0145] The technical concept of the CAN detection device and CAN detection method provided in the embodiments of this application will be described below.

[0146] This application provides a vehicle CAN network polling device (i.e., the CAN detection device in the previous embodiment) and software (i.e., the software program corresponding to the CAN detection method in the previous embodiment). The structure of the vehicle CAN network polling device is as follows: Figure 1 As shown, it mainly includes an MCU (i.e., the MCU in the previous embodiment), a MOS transistor array (i.e., multiple data transmission channels in the previous embodiment), and a CAN bus array (i.e., the first interface and the second interface in the previous embodiment), which realizes automated switching and communication interconnection between the host computer (i.e., the host computer in the previous embodiment) and the vehicle end (i.e., the vehicle CAN bus in the previous embodiment), effectively shortening the time of manual operation, and avoiding CAN network communication failures caused by human operation errors.

[0147] In practical applications, due to the inconsistent CAN network communication architecture across different vehicle models, it is necessary to compile key information such as the pin definitions (i.e., the pins and their correspondence with CAN segments), the number of CAN segments (i.e., the number of CAN segments included in the vehicle CAN bus), and the communication rate of each CAN segment for the different vehicle models (i.e., the vehicle model information in the previous embodiments). This information serves as the configuration file for different vehicle models (i.e., the configuration file in the previous embodiments). Alternatively, when the above information is unavailable, automatic scanning of the vehicle CAN bus can be implemented (i.e., activating the scanning module in the previous embodiments). In practical applications, users can also choose the method for obtaining key information according to their needs.

[0148] Based on the CAN network segment switching process, we can see that: First, the MCU needs to obtain the information of the target network segment that the host computer needs to detect and diagnose (corresponding to obtaining the first detection command in the previous embodiment, which includes vehicle model information, or includes vehicle model information and network segment identifier). Existing general data exchange channels generally include serial ports, Wi-Fi, etc., so the selected MCU should support these general data exchange channels and protocols. Second, CAN network segment switching involves CANH and CANL hard channel switching, so MOSFETs are required to achieve hard channel switching through high and low levels. Third, the MCU should have a corresponding number of IO pins to control the high and low levels of the corresponding MOSFET IO pins. Finally, an interface that can merge all CANH and CANL hard channels in the CAN bus array should be designed.

[0149] When CAN segment switching information cannot be obtained, a CAN bus differential signal pre-detection circuit (i.e., the signal detection circuit in the previous embodiment) and a communication rate detection circuit (i.e., the communication rate detection circuit in the previous embodiment) are designed to detect the resistance between each pair of detection pins. If the resistance between each pair of detection pins is 60 ohms, it means that the two pins form a CAN segment; if it is infinite, it means that the two pins are unrelated.

[0150] Design a circuit to test the bus communication rate (i.e., the communication rate detection circuit in the previous embodiment) to control the communication rate of the CAN controller. If the communication rate conforms to the CAN network segment standard, CAN messages (i.e., valid message information in the previous embodiment) can be received from the CAN R&S (i.e., the CAN oscilloscope). Based on the pre-acquired message characteristics (the preset message ID on the CAN network segment, i.e., the network segment identifier in the previous embodiment), the CAN network segment connected to the two pins can be accurately located. Completing the above steps enables automatic scanning of the CAN bus array. With the above completed, the hardware design of the device is finished.

[0151] After the hardware is completed, the software architecture needs to be designed. First, the general data exchange channels include serial ports, I / O ports, and Wi-Fi. The serial port hardware driver should configure the corresponding I / O pin numbers and serial communication speed, write initialization code, and complete the serial port driver. Configure the I / O port numbers that need to output high and low levels, write initialization code, and complete the I / O port driver. The Wi-Fi hardware driver can call the Software Development Kit (SDK) library, configure the Wi-Fi Service Set Identifier (SSID) and wireless network password (PWD) parameters, write initialization code, and complete the Wi-Fi driver.

[0152] After completing the hardware driver code, the configuration variables are further written. Based on the key information of the vehicle model's CAN bus array interface (i.e., the key information of the target network segment in the previous embodiment), the mapping relationship variables between the CAN network segment and the IO port are written. When the CAN network segment switching information cannot be obtained (i.e., the key information in the previous embodiment), the CAN bus differential signal pre-detection (i.e., the working logic of the signal detection circuit in the previous embodiment) and communication rate detection code (i.e., the working logic of the communication rate detection circuit in the previous embodiment) are designed to realize the automatic scanning of the CAN bus array. When the host computer software needs to switch the CAN network segment instantaneously (millisecond level), the corresponding IO port will quickly and automatically switch the output state.

[0153] The software architecture should include a main loop that continuously monitors the CAN segment switching signal in UDP / TCP network communication or serial communication, i.e., the signal controlling the lower-level device to switch CAN segments. It should import relevant general libraries for code execution, compile the source code to obtain an executable binary ROM package for the MCU, and then write the binary ROM package into the storage chip via serial port. A hard reboot will put the lower-level device into a monitoring and running state.

[0154] When troubleshooting vehicle faults: First, power on the host computer (the host computer in the previous embodiment) and the slave computer (the CAN detection device in the previous embodiment). Then, connect the host computer and the slave computer via a wired serial port or wireless Wi-Fi. Simultaneously connect the CANH and CANL ports of the host computer and the slave computer, and the CAN bus array interface of the slave computer and the vehicle (the interface of the vehicle CAN bus in the previous embodiment). After completing the hardware connection, the host computer can select the CAN network segment (i.e., the first detection command in the previous embodiment includes the network segment identifier). After receiving the switching signal, the slave computer (the CAN detection device in the previous embodiment) can activate the corresponding IO port, output a high level, and conduct the required CANH and CANL. Alternatively, the host computer can also automatically switch CAN network segments, and the synchronized slave computer can automatically poll all CAN network segments.

[0155] In this embodiment, by designing a CAN bus differential signal pre-detection and communication rate detection circuit (i.e., the signal detection circuit and communication rate detection circuit in the previous embodiment), the CAN bus array definition can be automatically scanned, and the CAN message ID obtained during the pin arrangement process (i.e., scanning any two pins in the vehicle CAN bus interface) can be used to lock the CAN network segment and communication rate (i.e., the communication rate when a valid message information is detected is determined as the communication rate of the first CAN network segment in the previous embodiment).

[0156] In this embodiment, the software architecture of the CAN detection device should include: CAN bus differential signal pre-detection logic (i.e., the working logic of the signal detection circuit in the previous embodiment), CAN bus communication rate detection (i.e., the communication rate detection circuit in the previous embodiment) and CAN network segment judgment logic, control command data transmission channel (i.e., the data transmission channel in the previous embodiment) (wired and wireless), the number of IO ports that can output level control on / off is greater than or equal to the number of CAN network segments, and support for UDP / TCP network communication protocol, serial communication protocol, etc.

[0157] In this application embodiment, the hardware architecture of the control unit (i.e., the CAN detection device in the previous embodiment) should include: a microcontroller MCU, an I / O port with a number of output levels that can control the on / off state greater than or equal to the number of CAN network segments, a MOSFET, Wi-Fi, a serial port, a USB interface, power management, a resistance detection circuit, a CAN controller, and a CAN R&S, etc.

[0158] In this embodiment of the application, hardware initialization delay and startup sequence can also be designed, and startup code can be written according to the delay and sequence.

[0159] In this embodiment of the application, in the automatic implementation scheme: based on the defined relationship between the CAN network segment and the pins locked by automatic scanning, and the communication rate (i.e., the content involved in the real-time scanning to obtain the key information of the target network segment in the previous embodiment), it is connected to the host computer software and hardware as needed.

[0160] In the embodiments of this application, in the automatic implementation scheme: automatic switching CAN network segment logic code (i.e., in the previous embodiment, the MCU controls the MOS transistor to switch the CAN network segment) and logic code for establishing a communication channel with the host computer software can also be designed;

[0161] In this embodiment, communication logic code between the host computer software and the slave computer software is embedded in the host computer software (i.e., the host computer sends a first detection command to the CAN detection device in the previous embodiment).

[0162] In this embodiment, the upper and lower computer hardware are connected (i.e., in the previous embodiment, the first interface in the CAN detection device is connected to the interface of the vehicle CAN bus, and the second interface in the CAN detection device is connected to the upper computer bus interface), and the upper computer software is run. At this time, the upper and lower computers will automatically complete communication wirelessly, and then control the MOS transistor through the IO port of the control unit to finally realize the automation of CAN network segment switching (wired connection communication can also be manually selected).

[0163] It should be noted that, in this application, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.

[0164] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

[0165] The features disclosed in the several product embodiments provided in this application can be arbitrarily combined without conflict to obtain new product embodiments.

[0166] The features disclosed in the several method or device embodiments provided in this application can be arbitrarily combined without conflict to obtain new method or device embodiments.

[0167] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application.

Claims

1. A CAN detection method, characterized in that, This is applied to CAN detection equipment, which includes a microcontroller (MCU), multiple data transmission channels, and a scanning module. The first end of the plurality of data transmission channels is connected to the interface of the vehicle CAN bus, the second end of the plurality of data transmission channels is connected to the host computer bus interface, and the MCU is connected to the first switching unit of each of the data transmission channels; the scanning module includes a plurality of signal scanning circuits and a signal detection circuit, wherein the first end of the plurality of signal scanning circuits is connected to the interface of the vehicle CAN bus, the second end of the plurality of signal scanning circuits is connected to the signal detection circuit, and the MCU is connected to the second switching unit included in the plurality of signal scanning circuits; The CAN detection method includes: Obtain a first detection command, which indicates that message information of a target network segment be obtained, wherein the target network segment is one or more of the multiple CAN network segments included in the vehicle CAN bus; In response to the first detection command, key information of the target network segment is obtained by searching the configuration file. If the key information of the target network segment is not found in the configuration file, the key information of the target network segment is obtained by real-time scanning. The second switching unit of each signal scanning circuit is controlled to turn on or off, polling any two pins in the interface of the vehicle CAN bus. For the currently polled first and second pins, the voltage difference between the first and second pins is obtained through the signal detection circuit. The resistance value between the first and second pins is determined based on the voltage difference. If the resistance value is a preset resistance value, a first CAN network segment is determined to correspond to the first and second pins, and the correspondence between the first CAN network segment and the first and second pins is recorded. The target network segment is determined from the identified first CAN network segments, and the pins corresponding to the target network segment are obtained. The key information of the target network segment includes the communication rate of the target network segment and the pins corresponding to the target network segment on the interface of the vehicle CAN bus. Based on the pins corresponding to the target network segment on the interface of the vehicle CAN bus, the target data transmission channel corresponding to the target network segment is determined; Configure the target data transmission channel based on the communication rate of the target network segment; The first switch unit controlling the target data transmission channel is turned on to transmit the message information of the target network segment to the host computer.

2. The CAN detection method according to claim 1, characterized in that, The scanning module also includes a communication rate detection circuit; The second terminal of the plurality of signal scanning circuits is connected to the communication rate detection circuit; The method of obtaining key information about the target network segment based on real-time scanning includes: For each of the first CAN network segments, the target signal scanning circuit is determined according to the pins corresponding to the first CAN network segment, and the target signal scanning circuit is controlled to be turned on. The communication rate detection circuit polls and detects network segment messages within the communication rate range that conforms to the CAN standard. If a valid message is detected, the communication rate at which the valid message is detected is determined as the communication rate of the first CAN network segment. The target network segment is determined from each of the first CAN network segments, and the communication rate of the target network segment is obtained.

3. The CAN detection method according to claim 2, characterized in that, The communication rate detection circuit includes a CAN controller and a CAN oscilloscope connected in sequence. The CAN controller is connected to the MCU, and the CAN oscilloscope is connected to the second end of the plurality of signal scanning circuits. The step of polling and detecting network segment messages within the communication rate range conforming to the CAN standard through the communication rate detection circuit includes: The communication rate of the CAN oscilloscope can be adjusted within the CAN standard-compliant communication rate range using the CAN controller. The valid message information is received and detected by the CAN oscilloscope. The step of determining the communication rate at which valid message information is detected as the communication rate of the first CAN network segment includes: When the valid message information is detected, the CAN controller obtains the communication rate of the CAN oscilloscope when the valid message information is received, and determines the communication rate of the CAN oscilloscope when the valid message information is received as the communication rate of the first CAN network segment.

4. The CAN detection method according to any one of claims 1-3, characterized in that, The first detection command includes target vehicle model information, and the CAN detection method further includes: The multiple CAN bus segments included in the target vehicle model information are identified as the target network segments.

5. The CAN detection method according to any one of claims 1-3, characterized in that, The first detection command includes target vehicle model information and network segment identifier, and the CAN detection method further includes: The CAN segment in the CAN bus corresponding to the target vehicle model information that corresponds to the segment identifier is determined as the target segment.

6. The CAN detection method according to claim 4, characterized in that, The configuration file includes key information about the vehicle's CAN bus corresponding to different vehicle models. The method of obtaining the key information of the target network segment based on searching the configuration file includes: Based on the target vehicle information, the configuration file is searched to determine the target key information, which includes key information of each CAN network segment of the vehicle CAN bus corresponding to the target vehicle information; Obtain the key information of the target network segment from the target key information.

7. A CAN detection device, characterized in that, The CAN detection device includes a microcontroller (MCU), multiple data transmission channels, and a scanning module. The first end of each data transmission channel is connected to the interface of the vehicle's CAN bus, and the second end of each data transmission channel is connected to the interface of a host computer bus. The MCU is connected to the first switching unit of each data transmission channel. The scanning module includes multiple signal scanning circuits and signal detection circuits. The first end of each signal scanning circuit is connected to the interface of the vehicle's CAN bus, and the second end of each signal scanning circuit is connected to the signal detection circuit. The MCU is connected to the second switching unit included in each signal scanning circuit. The MCU is used to acquire a first detection instruction, which indicates the acquisition of message information of a target network segment. The target network segment is one or more of the multiple CAN network segments included in the vehicle CAN bus. In response to the first detection command, key information of the target network segment is obtained by searching the configuration file. If the key information of the target network segment is not found in the configuration file, the key information of the target network segment is obtained by real-time scanning. The second switching unit of each signal scanning circuit is controlled to turn on or off to poll any two pins in the interface of the vehicle CAN bus. For the currently polled first and second pins, the voltage difference between the first and second pins is obtained through the signal detection circuit. The resistance value between the first and second pins is determined based on the voltage difference. If the resistance value is a preset resistance value, it is determined that there is a first CAN network segment between the first and second pins, and the correspondence between the first CAN network segment and the first and second pins is recorded. The target network segment is determined from the identified first CAN network segments, and the pins corresponding to the target network segment are obtained. The key information of the target network segment includes the communication rate of the target network segment and the pins corresponding to the target network segment on the interface of the vehicle CAN bus. Based on the pins corresponding to the target network segment on the interface of the vehicle CAN bus, the target data transmission channel corresponding to the target network segment is determined; Configure the target data transmission channel based on the communication rate of the target network segment; The first switch unit controlling the target data transmission channel is turned on to transmit the message information of the target network segment to the host computer.

8. The CAN detection device according to claim 7, characterized in that, The scanning module further includes a communication rate detection circuit, which comprises a CAN controller and a CAN oscilloscope connected in sequence. The CAN controller is connected to the MCU, and the CAN oscilloscope is connected to the second terminal of the plurality of signal scanning circuits, wherein: The MCU is used to determine the target signal scanning circuit according to the pins corresponding to each of the first CAN network segments, and control the target signal scanning circuit to be turned on. The CAN controller is used to adjust the communication rate of the CAN oscilloscope within the communication rate range conforming to the CAN standard. The CAN oscilloscope is used to receive and detect valid message information; The CAN controller is further configured to, upon detecting the valid message information, acquire the communication rate of the CAN oscilloscope when the valid message information is received, and report the communication rate of the CAN oscilloscope when the valid message information is received to the MCU; The MCU is also used to determine the communication rate of the CAN oscilloscope when the valid message information is received as the communication rate of the first CAN network segment.

Citation Information

Patent Citations

  • Scanning device and method based on multiple channels and multiple network segments

    CN103685261A

  • Scanning method and device and network forwarding equipment

    CN109981344A