Grid dividing and connecting device and method of CAN (Controller Area Network) bus

By designing the grid-connected device of the CAN bus, the main control module and the terminal resistor connection module are used to automatically control the access and disconnection of the terminal resistor, which solves the problems of manual operation time and errors, and improves the efficiency and reliability of bus communication.

CN120017439APending Publication Date: 2025-05-16BEIJING JINGWEI HIRAIN TECH CO INC
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510174265.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-17
Publication Date
2025-05-16

AI Technical Summary

Technical Problem

During the network separation and grid connection of the CAN bus, it takes a lot of time to access and disconnect the terminal resistor manually, and there are problems of manual operation errors, resulting in communication failure.

Method used

A CAN bus split-connection device is designed, including a bus, a terminal resistor connection module and a split-connection switch. The main control module sends network-separated and grid-connected commands, and the terminal resistor connection module is automatically connected or disconnected, thereby realizing switching between the bus and the bus segment.

Benefits of technology

There is no need to manually control the access and disconnection of the terminal resistor, saving manpower, avoiding manual operation errors, and ensuring the quality of bus communication.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120017439A_ABST
    Figure CN120017439A_ABST
Patent Text Reader

Abstract

The invention relates to a grid-dividing and grid-connecting device and method for a CAN bus. The grid-dividing and grid-connecting device comprises a bus, two bus segments, n terminal resistor connecting modules and m grid-dividing and grid-connecting switches. The n terminal resistor connection modules are connected in parallel to the bus; the grid-dividing and grid-connecting switches are arranged between the adjacent terminal resistor connecting modules; the m sub-grid-connected switches are used for switching between the bus and the two bus segments; and the terminal resistor connection modules are used for controlling the terminal resistor connection modules located at the two ends of the bus segment to connect the terminal resistors to the bus segment according to the network division instruction, and controlling the terminal resistor connection modules located between the two ends of the bus to disconnect the terminal resistors from the bus according to the grid connection instruction. According to the method and the device, the position of each terminal resistor connection module on the bus is detected, so that only the terminal resistors at the two ends of the bus or the bus segment are automatically accessed, the problem of manual operation errors is avoided while manpower is saved, and the communication quality of the bus is further ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the technical field of bus communication, and in particular to a CAN bus network connection device and method. Background Art

[0002] CAN (Controller Area Network) bus is a serial communication bus that has been widely used in the transmission of data and control signals between various controllers of automotive electronics. The CAN bus consists of two signal transmission lines. During the signal transmission process, there is a communication failure between the two signal transmission lines due to impedance mismatch.

[0003] To solve the above problems, terminal resistors are usually set at both ends of the CAN bus. However, during the network division and grid connection of the CAN bus, manually connecting and disconnecting the terminal resistors at both ends of the bus takes a lot of time and there is a problem of manual operation errors. Summary of the invention

[0004] In order to solve the above technical problems or at least partially solve the above technical problems, the present disclosure provides a CAN bus grid-connected device and method.

[0005] The present disclosure provides a CAN bus grid-connected device, comprising: a bus, two bus segments; n terminal resistor connection modules, the n terminal resistor connection modules are connected in parallel to the bus; and m grid-connected switches, the grid-connected switches are arranged between adjacent terminal resistor connection modules; the m grid-connected switches are all used to switch between the bus and the two bus segments; based on the terminal resistor connection module being connected to one end of the bus or the bus segment, a main control module is determined, the main control module is used to send a grid-connected instruction and a grid-connected instruction; the terminal resistor connection module is used to control the terminal resistor connection modules located at both ends of the bus segment to connect the terminal resistor to the bus segment according to the grid-connected instruction, and is used to control the terminal resistor connection module located between the two ends of the bus to disconnect the terminal resistor from the bus according to the grid-connected instruction; wherein n is an integer greater than or equal to 4, and m is a positive integer not exceeding n-3.

[0006] Optionally, the terminal resistance connection module includes: a switching unit, a storage unit, a control unit, a bus signal transceiver unit, and a terminal resistance unit; the first end of the bus signal transceiver unit is electrically connected to the bus through a first signal line, and the second end of the bus signal transceiver unit is electrically connected to the bus through a second signal line; the bus signal transceiver unit communicates with other terminal resistance connection modules through the first signal line and the second signal line; the control unit is electrically connected to the storage unit, the bus signal transceiver unit and the switching unit, respectively, and the terminal resistance unit is electrically connected to the first signal line and the second signal line through the switching unit; the storage unit stores position information of the terminal resistance connection module in the bus, and the control unit is used to control the switch unit to be turned on or off according to a comparison result between the position information stored in the storage unit and the position information of other terminal resistance connection modules; wherein the first signal line and the second signal line are two signal transmission lines in the bus.

[0007] Optionally, the switch unit includes a first pull-down resistor, a second pull-down resistor, a first NMOS tube, a second NMOS tube, a first PMOS tube, a second PMOS tube, a first pull-up resistor and a second pull-up resistor; the gate of the first NMOS tube is electrically connected to the second output end of the control unit, the gate of the first NMOS tube is grounded through the first pull-down resistor, the source of the first NMOS tube is grounded, the drain of the first NMOS tube is electrically connected to the gate of the first PMOS tube, the gate of the first PMOS tube is electrically connected to the source of the first PMOS tube through the first pull-up resistor, and the drain of the first PMOS tube is electrically connected to the gate of the first PMOS tube. The gate of the second NMOS tube is electrically connected to the second output end of the control unit, the gate of the second NMOS tube is grounded through the second pull-down resistor, the source of the second NMOS tube is grounded, the drain of the second NMOS tube is electrically connected to the gate of the second PMOS tube, the gate of the second PMOS tube is electrically connected to the source of the second PMOS tube through the second pull-up resistor, the drain of the second PMOS tube is electrically connected to the second end of the terminal resistance unit, and the source of the second PMOS tube is electrically connected to the second signal line.

[0008] Optionally, the terminal resistance unit includes a first terminal resistance, a second terminal resistance and a terminal capacitor; the first terminal resistance is connected in series with the second terminal resistance, one end of the first terminal resistance is electrically connected to the first signal line through the switching unit, one end of the second terminal resistance is electrically connected to the second signal line through the switching unit, and the other end of the first terminal resistance and the other end of the second terminal resistance are both grounded through the terminal capacitor.

[0009] The present disclosure also provides a CAN bus grid-connected method, the grid-connected device includes a bus, two bus segments; n terminal resistor connection modules, the n terminal resistor connection modules are connected in parallel to the bus, and m grid-connected switches, the grid-connected switches are arranged between adjacent terminal resistor connection modules; wherein n is an integer greater than or equal to 4, and m is a positive integer not exceeding n-3; the grid-connected method includes: obtaining a main control module of the bus; wherein the main control module is a terminal resistor connection module for sending instructions; based on the grid-connected pre-instruction of the main control module, configuring the first parameter and the second parameter of each terminal resistor connection module; wherein the first parameter is a parameter indicating that each terminal resistor connection module sets the main control module; the second parameter is a parameter indicating that the terminal resistor is connected or disconnected; based on the grid-connected instruction of the main control module, controlling the grid-connected switch to switch the bus to a bus segment; based on the bus switching to the bus segment, controlling each terminal resistor connection module to perform a self-test operation; wherein the self-test operation is an operation in which each terminal resistor connection module sets the main control module according to the first parameter, and connects or disconnects the terminal resistor according to the second parameter; and controlling the bus segment to power on.

[0010] Optionally, the terminal resistance connection module includes a storage unit, a bus signal transceiver unit, a control unit, a switch unit and a terminal resistance unit, the control unit is electrically connected to the storage unit, the bus signal transceiver unit and the switch unit, respectively, and the terminal resistance unit is electrically connected to the bus through the switch unit; the storage unit is used to store the position information of the terminal resistance connection module; the bus signal transceiver unit is used to communicate with other terminal resistance connection modules through the bus; based on the network division pre-instruction of the main control module, the second parameters of each terminal resistance connection module are configured, including: based on the network division pre-instruction of the main control module, obtaining the position information stored in the storage unit, and obtaining the position information of other terminal resistance connection modules received by the bus signal transceiver unit; based on the comparison result of the position information with the position information of other terminal resistance connection modules, determining the position of the terminal resistance connection module in the bus segment; based on the terminal resistance connection module being located at both ends of the bus segment, the second parameters of the terminal resistance connection module are configured.

[0011] Optionally, the method also includes: configuring the first parameter and the second parameter of each terminal resistance connection module based on the grid-connected pre-instruction of the main control module; controlling the sub-grid-connected switch to switch the bus segment to the bus based on the grid-connected instruction of the main control module; controlling each terminal resistance connection module to perform a self-test operation based on the bus segment switching to the bus; and controlling the bus to power on.

[0012] Optionally, the terminal resistance connection module includes a storage unit, a bus signal transceiver unit, a control unit, a switch unit and a terminal resistance unit, the control unit is electrically connected to the storage unit, the bus signal transceiver unit and the switch unit, respectively, and the terminal resistance unit is electrically connected to the bus through the switch unit; the storage unit is used to store the position information of the terminal resistance connection module; the bus signal transceiver unit is used to communicate with other terminal resistance connection modules through the bus; based on the grid-connected pre-instructions of the main control module, the second parameters of each terminal resistance connection module are configured, including: based on the grid-connected pre-instructions of the main control module, controlling the acquisition of the position information stored in the storage unit, and acquiring the position information of other terminal resistance connection modules received by the bus signal transceiver unit; determining the position of the terminal resistance connection module in the bus based on the comparison result of the position information with the position information of other terminal resistance connection modules; configuring the second parameters of the terminal resistance connection module based on the terminal resistance connection module being located between the two ends of the bus.

[0013] Optionally, obtaining the main control module of the bus includes: obtaining flag information of the terminal resistor connection module; wherein the flag information is a binary number; and determining the main control module of the bus based on a comparison result of the flag information of the terminal resistor connection module with flag information of other terminal resistor connection modules in the bus.

[0014] Optionally, before obtaining the identification information of the terminal resistance connection module, it includes: marking serial numbers for the n terminal resistance connection modules in turn according to the arrangement order of the n terminal resistance connection modules in the bus; based on the marked serial numbers of the terminal resistance connection modules, obtaining the binary number corresponding to the serial number of the terminal resistance connection module as the identification information.

[0015] The present disclosure provides a CAN bus grid-connected device and method, the grid-connected device includes a bus, n terminal resistor connection modules and m grid-connected switches, wherein n is an integer greater than or equal to 4, and m is a positive integer not exceeding n-3. The n terminal resistor connection modules are connected in parallel to the bus, and the grid-connected switch is arranged between two adjacent terminal resistor connection modules. The bus can be divided into two bus segments by the grid-connected switch, and the two bus segments can be merged into a bus by the grid-connected switch, thereby enabling the switching between the bus and the two bus segments to be realized by the grid-connected switch. The n terminal resistor connection modules compare their respective positions in the bus or bus segment, and select a terminal resistor connection module located at one end of the bus or bus segment as the main control module, which is used to send a grid-connected instruction and a grid-connected instruction to other terminal resistor connection modules and the grid-connected switch. Through the grid-connected instruction, the grid-connected switch switches the bus into two bus segments, and connects the terminal resistor to the bus segment through the terminal resistor connection modules located at both ends of the bus segment. Through the grid connection instruction, the grid-connected switch switches the two bus segments to the bus, and the terminal resistor is disconnected from the bus through the terminal resistor connection module located between the two ends of the bus. Therefore, the present disclosure also detects the position of each terminal resistor connection module on the bus, so that after the grid connection, only one terminal resistor is connected to each end of the bus, and after the grid is divided, only one terminal resistor is connected to each end of the bus segment, and only one main control module is set in the bus and each bus segment to control all terminal resistor connection modules, without manually controlling the connection and disconnection of the terminal resistor, saving manpower, and avoiding the problem of manual operation errors, further ensuring the guarantee of bus communication quality. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments of the present invention are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0017] Figure 1 A schematic diagram of the structure of a CAN bus grid-connected device provided in an embodiment of the present disclosure.

[0018] Figure 2 A schematic diagram of the structure of a terminal resistance connection module provided in an embodiment of the present disclosure.

[0019] Figure 3 A schematic diagram of the structure of another terminal resistance connection module provided in an embodiment of the present disclosure.

[0020] Figure 4A flowchart of a CAN bus grid-connection method provided in an embodiment of the present disclosure.

[0021] Figure 5 A flowchart of another CAN bus grid-connection method provided in an embodiment of the present disclosure.

[0022] Figure 6 A flowchart of another CAN bus grid-connection method provided in an embodiment of the present disclosure. DETAILED DESCRIPTION

[0023] The features and exemplary embodiments of various aspects of the present invention will be described in detail below. In the detailed description below, many specific details are proposed to provide a comprehensive understanding of the present invention. However, it is obvious to those skilled in the art that the present invention can be implemented without the need for some of these specific details. The following description of the embodiments is only to provide a better understanding of the present invention by illustrating examples of the present invention.

[0024] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The embodiments will be described in detail below in conjunction with the accompanying drawings.

[0025] Figure 1 A schematic diagram of a CAN bus grid-connected device provided in an embodiment of the present disclosure is shown in FIG. Figure 1 As shown, the grid-connected device includes: a bus 100, n terminal resistor connection modules 200, and m grid-connected switches 300; the bus 100 can be divided into two bus segments 110. The n terminal resistor connection modules 200 are connected in parallel to the bus 100, and the grid-connected switches 300 are arranged between adjacent terminal resistor connection modules 200, and any of the m grid-connected switches 300 can switch the bus 100 between the two bus segments 110; based on the terminal resistor connection module 200 being connected to one end of the bus 100 or the bus segment 110, the main control module 400 is determined, and the main control module 400 is used to send a grid-connected instruction and a grid-connected instruction; the terminal resistor connection module 200 is used to control the terminal resistor connection modules 200 located at both ends of the bus segment 110 to connect the terminal resistor to the bus segment according to the grid-connected instruction, and to control the terminal resistor connection module 200 located between the two ends of the bus 100 to disconnect the terminal resistor from the bus 100 according to the grid-connected instruction.

[0026] Specifically, n is an integer greater than or equal to 4, and m is a positive integer not exceeding n-3. Since the two ends of the bus 100 or the bus segment 110 must be provided with a terminal resistance connection module 200, the number n of the terminal resistance connection modules 200 provided in the bus 100 must be at least 4, so as to ensure that the two ends of the two bus segments 110 formed after the bus 100 is divided are provided with a terminal resistance connection module 200. In addition, when setting the sub-grid switch 300, it must also be considered to ensure that the two ends of the bus segment 110 are provided with a terminal resistance connection module 200. Therefore, the setting position of the sub-grid switch 300 cannot be between the terminal resistance connection module 200 at the two ends of the bus 100 and the adjacent terminal resistance connection module 200. Therefore, the setting number m of the sub-grid switch 300 does not exceed n-3.

[0027] By way of example, taking n as 8 and m as 1 as an example, the terminal resistance connection module 200 includes a first terminal resistance connection module 210, a second terminal resistance connection module 220, a third terminal resistance connection module 230, a fourth terminal resistance connection module 240, a fifth terminal resistance connection module 250, a sixth terminal resistance connection module 260, a seventh terminal resistance connection module 270 and an eighth terminal resistance connection module 280.

[0028] The first terminal resistor connection module 210, the second terminal resistor connection module 220, the third terminal resistor connection module 230, the fourth terminal resistor connection module 240, the fifth terminal resistor connection module 250, the sixth terminal resistor connection module 260, the seventh terminal resistor connection module 270 and the eighth terminal resistor connection module 280 are sequentially connected in parallel to the bus 100, and the first terminal resistor connection module 210 and the eighth terminal resistor connection module 280 are arranged at both ends of the bus 100. The grid-connected switch 300 is arranged on the bus between the fourth terminal resistor connection module 240 and the fifth terminal resistor connection module 250. Each terminal resistor connection module 200 stores a first parameter, the value of the first parameter stored in the ordinary terminal resistor connection module is 0, and the value of the first parameter stored in the terminal resistor connection module as the main control module is 1, and each terminal resistor connection module determines the main control module by determining the value of the stored first parameter.

[0029] When the bus is not performing grid-connected operation, the value of the first parameter stored in the first terminal resistor connection module 210 is 1, so it is used as the main control module 400, and the first terminal resistor connection module 210 and the eighth terminal resistor connection module 280 are arranged at both ends of the bus 100, so the terminal resistors in the first terminal resistor connection module 210 and the eighth terminal resistor connection module 280 are connected to the bus 100.

[0030] When the main control module 400 sends a network division instruction, the network division and connection switch 300 switches the bus 100 to the first bus segment 111 and the second bus segment 112. Since the first terminal resistance connection module 210 is located in the first bus segment 111, the main control module 400 is provided in the first bus segment 111. Before performing the network division operation, the main control module 400 in the second bus segment 112 communicates with each terminal resistance connection module 200 in a bus segment corresponding to the second bus segment 112, and selects the fifth terminal resistance connection module 250 provided at one end of a bus segment corresponding to the second bus segment 112 as the main control module 400 in the second bus segment 112, and sets the value of the first parameter stored in the fifth terminal resistance connection module 250 to 1. After the bus 100 performs the network division operation, the fifth terminal resistance connection module 250 performs a self-check and switches itself to the main control module 400 according to the first parameter stored as 1. And before the bus 100 performs the network division operation, the main control module 400 sends instructions to a bus segment corresponding to the first bus segment 111 and the second bus segment 112 respectively to determine the terminal resistance connection module located at both ends of the first bus segment 111 and the second bus segment 112 in the bus 100, and sets the second parameter stored in the terminal resistance connection module to 1. The terminal resistor connection module performs self-check after network division. When it detects that the second parameter is 1, the terminal resistor connection module will connect the terminal resistor to the bus 100, so that the terminal resistor connection modules located at both ends of the first bus segment 111 and the second bus segment 112 connect the terminal resistor, that is, the first terminal resistor connection module 210, the fourth terminal resistor connection module 240, the fifth terminal resistor connection module 250 and the eighth terminal resistor connection module 280 connect the terminal resistor respectively. Since the first terminal resistor connection module 210 and the eighth terminal resistor connection module 280 have already connected the terminal resistor before network division, only the fourth terminal resistor connection module 240 and the fifth terminal resistor connection module 250 need to connect the terminal resistor respectively, thereby completing the network division operation of the bus 100.

[0031] When the main control module 400 sends a grid connection instruction, the sub-grid connection switch 300 merges the first bus segment 111 and the second bus segment 112 into the bus 100. At this time, the first terminal resistance connection module 210 and the fifth terminal resistance connection module 250 in the bus 100 are both used as the main control module 400. Therefore, before performing the grid connection operation, the value of the first parameter of the fifth terminal resistance connection module 250 needs to be switched to 0, so that after the two bus segments are merged into the bus 100, the fifth terminal resistance connection module 250 passes the self-check and switches itself to a common terminal resistance connection module 200 according to the first parameter stored as 0, so that only one terminal resistance connection module 200 in the bus 100 is used as the main control module 400. And before the first bus segment 111 and the second bus segment 112 perform the grid connection operation, the second parameter stored in the fourth terminal resistance connection module 240 set in the first bus segment 111 is set to 0, and the second parameter stored in the fifth terminal resistance connection module 250 set in the second bus segment 112 is set to 0. After the first bus segment 111 and the second bus segment 112 are merged into the bus 100, each terminal resistor connection module 200 performs a self-check and selects the terminal resistor connection modules located at both ends of the bus 100 to connect the terminal resistor, and the other terminal resistor connection modules disconnect the terminal resistor from the bus, that is, the first terminal resistor connection module 210 and the eighth terminal resistor connection module 280 connect the terminal resistor respectively. Since the first terminal resistor connection module 210 and the eighth terminal resistor connection module 280 have already connected the terminal resistor before grid connection, it is only necessary for the fourth terminal resistor connection module 240 and the fifth terminal resistor connection module 250 to disconnect the terminal resistor from the bus according to the second parameter stored in themselves being 0, thereby completing the grid connection operation of the bus 100. Therefore, the present invention detects the position of each terminal resistor connection module 200 on the bus 100, so that after grid connection, only the two ends of the bus 100 are connected with terminal resistors, and after grid division, only the two ends of the bus segment 110 are connected with terminal resistors, and only one main control module 400 is set in the bus 100 and each bus segment 110 for controlling all terminal resistor connection modules 200, without manually controlling the connection and disconnection of the terminal resistors, saving manpower and avoiding the problem of manual operation errors, further ensuring the quality of bus communication.

[0032] It should be noted that n is 8 and m is 1 for example only, and the number of terminal resistance connection modules needs to be set according to actual needs, and is not specifically limited here. The grid-connected switch can also be set to other numbers besides 1, such as 2, 3, etc., as long as it is ensured that after the grid-connected switch performs grid-connected or grid-connected operation, both ends of the bus or bus segment are provided with terminal resistance connection modules.

[0033] In some embodiments, Figure 2A schematic diagram of the structure of a terminal resistance connection module provided in an embodiment of the present disclosure is shown in FIG. Figure 2 As shown, the terminal resistance connection module includes: a switch unit 201, a storage unit 202, a control unit 203, a bus signal transceiver unit 204, and a terminal resistance unit 205; the first end of the bus signal transceiver unit 204 is electrically connected to the first signal line 101, and the second end of the bus signal transceiver unit 204 is electrically connected to the second signal line 102; the bus signal transceiver unit 204 communicates with other terminal resistance connection modules through the first signal line 101 and the second signal line 102; the control unit 203 is electrically connected to the storage unit 202, the bus signal transceiver unit 204 and the switch unit 201 respectively, and the terminal resistance unit 205 is electrically connected to the first signal line 101 and the second signal line 102 through the switch unit 201; the storage unit 202 stores the position information of the terminal resistance connection module in the bus 100, and the control unit 203 is used to control the switch unit 201 to be turned on or off according to the comparison result of the position information stored in the storage unit 202 and the position information of other terminal resistance connection modules. The first signal line 101 and the second signal line 102 are two signal transmission lines in the bus 100 .

[0034] Specifically, the storage unit 202 stores the location information of the terminal resistance connection module in the bus 100, and the control unit 203 is electrically connected to the storage unit 202, and the control unit 203 can extract the location information stored in the storage unit 202 at any time. The control unit 203 is also electrically connected to the bus signal transceiver unit 204, and the control unit 203 can interact with other terminal resistance connection modules connected to the bus through the bus signal transceiver unit 204.

[0035] For a common terminal resistance connection module, before the terminal resistance connection module performs the grid-connected operation, the control unit 203 extracts the position information from the storage unit 202, and sends it to other terminal resistance connection modules through the bus signal transceiver unit 204, and receives the position information from other terminal resistance connection modules through the bus signal transceiver unit 204. The control unit 203 determines whether it is located at both ends of the bus or bus segment by comparing the position information provided by the storage unit 202 with the position information of other terminal resistance connection modules. When the control unit 203 determines that the corresponding terminal resistance connection module is located at both ends of the bus or bus segment, the control unit 203 controls the switch unit 201 to turn on or remain in the on state, so that the terminal resistance unit 205 is connected to the bus 100. When the control unit 203 determines that the corresponding terminal resistance connection module is not located at the bus or both ends of the bus, the control unit 203 controls the switch unit 201 to switch to the off state or remain in the off state, so that the terminal resistance unit 205 is disconnected from the bus 100. For the terminal resistance connection module as the main control module, the control unit 203 sends a network division instruction or a network connection instruction to other modules connected to the bus 100 through the bus signal transceiver unit 204. During the network connection operation, the control unit 203 also determines whether it is located at one of the two ends of the bus 100 by comparing the position information provided by the storage unit 202 and the position information of other terminal resistance connection modules. When it is determined that it is located at one of the two ends of the bus 100, it continues to serve as the main control module. When it is determined that it is located between the two ends of the bus 100, it switches itself to a common terminal resistance connection module. Thus, the present disclosure compares the positions of each terminal resistance connection module on the bus 100 through the control unit 203 set in the terminal resistance connection module, determines its own position in the bus 100, so that only the two ends of the bus 100 are connected to the terminal resistance unit 205 after the network connection, and only the two ends of the bus segment are connected to the terminal resistance unit 205 after the network division, without manually controlling the connection and disconnection of the terminal resistance, saving manpower, but also avoiding the problem of manual operation errors, and further ensuring the guarantee of the quality of bus communication.

[0036] In some embodiments, Figure 3 A schematic diagram of the structure of another terminal resistance connection module provided in an embodiment of the present disclosure is shown in FIG. Figure 3 As shown, the switch unit includes a first pull-down resistor R1, a second pull-down resistor R2, a first NMOS transistor Q1, a second NMOS transistor Q2, a first PMOS transistor Q3, a second PMOS transistor Q4, a first pull-up resistor R3 and a second pull-up resistor R4.

[0037] The gate of the first NMOS transistor Q1 is electrically connected to the second output end of the control unit 203, the gate of the first NMOS transistor Q1 is grounded through the first pull-down resistor R1, the source of the first NMOS transistor Q1 is grounded, the drain of the first NMOS transistor Q1 is electrically connected to the gate of the first PMOS transistor Q3, the gate of the first PMOS transistor Q3 is electrically connected to the source of the first PMOS transistor Q3 through the first pull-up resistor R3, the drain of the first PMOS transistor Q3 is electrically connected to the first end of the terminal resistance unit 205, and the source of the first PMOS transistor Q3 is electrically connected to the first signal line 101.

[0038] The gate of the second NMOS tube Q2 is electrically connected to the second output end of the control unit 203, the gate of the second NMOS tube Q2 is grounded through the second pull-down resistor R2, the source of the second NMOS tube Q2 is grounded, the drain of the second NMOS tube Q2 is electrically connected to the gate of the second PMOS tube Q4, the gate of the second PMOS tube Q4 is electrically connected to the source of the second PMOS tube Q4 through the second pull-up resistor R4, the drain of the second PMOS tube Q4 is electrically connected to the second end of the terminal resistance unit 205, and the source of the second PMOS tube Q4 is electrically connected to the second signal line 102.

[0039] Specifically, when the control unit 203 determines that the terminal resistance unit 205 does not need to be connected to the bus, the second output end of the control unit 203 does not output a control signal, the gate of the first NMOS tube Q1 is grounded through the first pull-down resistor R1, and the gate of the first NMOS tube Q1 continues to receive a low-level signal, so the first NMOS tube Q1 is in a turned-off state, and the gate of the first PMOS tube Q3 is electrically connected to the first signal line 101 through the first pull-up resistor R3, and since the first signal line 101 continuously provides a high-level signal to the gate of the first PMOS tube Q3, the first PMOS tube Q3 is also turned off. The gate of the second NMOS tube Q2 is grounded through the second pull-down resistor R2, and the gate of the second NMOS tube Q2 continues to receive a low-level signal, so the second NMOS tube Q2 is in a turned-off state, and the gate of the second PMOS tube Q4 is electrically connected to the second signal line 102 through the second pull-up resistor R4, and since the second signal line 102 continuously provides a high-level signal to the gate of the second PMOS tube Q4, the second PMOS tube Q4 is also turned off. At this time, the first end of the terminal resistance unit 205 is disconnected from the first signal line 101 , and the second end of the terminal resistance unit 205 is disconnected from the second signal line 102 , thereby disconnecting the terminal resistance unit 205 from the bus 100 .

[0040] When the control unit 203 determines that the terminal resistance unit 205 needs to be connected to the bus, the second output terminal of the control unit 203 outputs a high-level signal, the first NMOS tube Q1 is turned on according to the received high-level signal, the gate of the first PMOS tube Q3 is grounded and receives a low-level signal, the first PMOS tube Q3 is turned on, thereby connecting the first end of the terminal resistance unit 205 to the first signal line 101. The second NMOS tube Q2 is turned on according to the received high-level signal, the gate of the second PMOS tube Q4 is grounded and receives a low-level signal, the second PMOS tube Q4 is turned on, thereby connecting the second end of the terminal resistance unit 205 to the second signal line 102, thereby realizing the connection of the terminal resistance unit 205 to the bus 100. Therefore, the present disclosure realizes the control of the terminal resistance unit to be connected or disconnected with the bus 100 through the control signal output by the control unit 203, without manual control, saving manpower, and avoiding the problem of manual operation errors, further ensuring the quality of bus communication. Compared with the solution of using relays as controllable switches, the present invention adopts NMOS tubes and PMOS tubes as controllable switches, which reduces the volume of the entire circuit, realizes the miniaturization of the circuit, and reduces the circuit cost.

[0041] In some embodiments, the terminal resistance unit includes a first terminal resistance, a second terminal resistance and a terminal capacitor; the first terminal resistance is connected in series with the second terminal resistance, one end of the first terminal resistance is electrically connected to the first signal line through the switching unit, one end of the second terminal resistance is electrically connected to the second signal line through the switching unit, and the other end of the first terminal resistance and the other end of the second terminal resistance are both grounded through the terminal capacitor.

[0042] Specifically, according to the ISO11898-2 standard, a 120Ω terminal resistor needs to be connected at both ends of the bus. Therefore, the resistance values ​​of the first terminal resistor and the second terminal resistor are both 60Ω. The first terminal resistor, the second terminal resistor and the terminal capacitor are used to adjust the bus impedance matching to avoid signal reflection problems caused by impedance mismatch during bus signal transmission.

[0043] Figure 4 A schematic flow chart of a CAN bus grid-connected method provided by an embodiment of the present disclosure, wherein the grid-connected device comprises a bus, two bus segments, n terminal resistor connection modules, the n terminal resistor connection modules are connected in parallel to the bus, and m grid-connected switches, the grid-connected switches are arranged between adjacent terminal resistor connection modules; wherein n is an integer greater than or equal to 4, and m is a positive integer not exceeding n-3. Figure 4 As shown, the grid-connected method includes: S510 to S550.

[0044] S510, obtaining a main control module of the bus, wherein the main control module is a terminal resistance connection module for sending instructions.

[0045] Specifically, each terminal resistor connection module stores a first parameter. The value of the first parameter stored in an ordinary terminal resistor connection module is 0, and the value of the first parameter stored in a terminal resistor connection module serving as a main control module is 1. Before the bus is connected to the grid, each terminal resistor connection module has already stored the first parameter and a default main control module. After connecting to the bus, each terminal resistor connection module performs a self-check on the first parameter stored in itself, and determines that the terminal resistor connection module with the first parameter stored as 1 is the main control module.

[0046] S520: Based on the network division pre-instruction of the main control module, configure the first parameter and the second parameter of each terminal resistance connection module.

[0047] Specifically, the first parameter is a parameter indicating that each terminal resistor connection module sets a main control module; the second parameter is a parameter indicating whether the terminal resistor is connected or disconnected. When the first parameter is 1, it indicates that the terminal resistor connection module is used as the main control module of the bus segment after the network is divided, and when the first parameter is 0, it indicates that the terminal resistor connection module is used as a common terminal resistor connection module after the network is divided. When the second parameter is 1, it indicates that the terminal resistor connection module connects the terminal resistor to the bus segment after the network is divided, and when the second parameter is 0, it indicates that the terminal resistor connection module disconnects the terminal resistor from the bus segment after the network is divided. When the bus is just divided into bus segments, the terminal resistors at both ends of the bus segment are not connected. Therefore, after the bus segment is powered on, since both ends of the bus segment are not connected to the terminal resistor, the bus segment will have a communication failure after powering on. Therefore, the terminal resistor connection modules set in the bus segment cannot communicate through the bus segment, and it is impossible to determine the main control module after the bus is divided into bus segments, and determine the terminal resistor connection module that needs to be connected to the terminal resistor. Therefore, it is necessary to configure the first parameter and the second parameter of each terminal resistor connection module before the bus is divided into bus segments.

[0048] Before the bus is divided into networks, the main control module issues a network division pre-instruction, so that the bus determines the position of the network-dividing switch that needs to be divided into networks before the network division, and communicates with the two bus sections located on both sides of the network-dividing switch. Because there is a main control module of the original bus in one of the bus sections, the main control module can be used as the main control module of the bus section after the network division. The other bus section compares the positions of each terminal resistance connection module in the bus section, determines that the terminal resistance connection module at any one of the two ends of the bus section is used as the main control module of the bus section after the network division, and switches the value of the first parameter stored in the terminal resistance connection module from 0 to 1. In addition, after comparing the positions, each terminal resistance connection module will also determine that the terminal resistance connection modules at both ends of the bus section will connect the terminal resistance to the bus section after the network division, so the second parameters of the two terminal resistance connection modules are set to 1.

[0049] 530. Based on the network division instruction of the main control module, control the network division switch to switch the bus into a bus segment.

[0050] Specifically, the grid-connected switch is disconnected after receiving the grid-connected command from the main control module, dividing the bus into two bus segments.

[0051] S540: Based on the bus being switched to a bus segment, control each terminal resistance connection module to perform a self-check operation.

[0052] Specifically, the self-check operation is the operation of each terminal resistor connection module setting the main control module according to the first parameter, and connecting or disconnecting the terminal resistor according to the second parameter. After the bus is switched to a bus segment, each terminal resistor connection module performs a self-check on the stored first parameter and the second parameter. The terminal resistor connection module whose first parameter is configured as 1 is set as the main control module, and the terminal resistor connection module whose first parameter is configured as 0 continues to be used as an ordinary terminal resistor connection module. The terminal resistor connection module whose second parameter is configured as 1 connects the terminal resistor to the bus segment, and the terminal resistor connection module whose second parameter is configured as 0 disconnects the terminal resistor from the bus segment. As a result, after the bus is divided into bus segments, the terminal resistor connection module automatically configures itself as the main control module after determining that the stored first parameter is 1 through self-checking, and automatically connects the terminal resistor to the bus segment after determining that the stored second parameter is 1 through self-checking.

[0053] S550, power on the control bus segment.

[0054] Specifically, before performing the network division operation, the bus must first be powered off. After the terminal resistors in the bus segment are connected, the two bus segments are powered on. This avoids the bus segment starting to work when the terminal resistors are not connected to both ends of the bus segment, thereby causing bus communication failures due to the lack of terminal resistors.

[0055] Before the main control module on the bus sends the network division instruction, the main control module will send the network division pre-instruction to enable the bus to determine the position of the network division switch, and communicate with the two bus sections on both sides of the network division switch, compare the positions of each terminal resistance connection module, and when it is determined that there is no main control module in one of the bus sections, the first parameter stored in the terminal resistance connection module at either end of the bus section is set from 0 to 1, and the second parameter stored in the terminal resistance connection module located in the two bus sections is set to 1. After the main control module on the bus sends the network division instruction, each terminal resistance connection module located in the bus section will perform self-test, and determine through self-test that the terminal resistance connection module with the first parameter stored in itself as 1 is configured as the main control module, and control the terminal resistance connection module with the second parameter of 1 in the two bus sections to connect the terminal resistance to the bus section. After the terminal resistance in the bus section is connected, the bus section is powered on and starts working. Therefore, the present invention detects the position of each terminal resistor connection module on the bus, so that after the network is divided, only the two ends of the bus segment are connected with terminal resistors, and only one main control module is set in each bus segment to control all terminal resistor connection modules. There is no need to manually control the connection and disconnection of the terminal resistors, which saves manpower and avoids the problem of manual operation errors, further ensuring the quality of bus communication.

[0056] In some embodiments, the terminal resistance connection module includes a storage unit, a bus signal transceiver unit, a control unit, a switch unit and a terminal resistance unit. The control unit is electrically connected to the storage unit, the bus signal transceiver unit and the switch unit, respectively, and the terminal resistance unit is electrically connected to the bus through the switch unit; the storage unit is used to store the location information of the terminal resistance connection module; the bus signal transceiver unit is used to communicate with other terminal resistance connection modules through the bus.

[0057] Specifically, each terminal resistor connection module is provided with a storage unit, and each storage unit stores the position information of the corresponding terminal resistor connection module, and the position information can reflect the position of the terminal resistor connection module in the bus. The control unit can directly extract the relevant position information from the storage unit, and send the position information to the bus signal transceiver unit, and the bus signal transceiver unit communicates with the bus signal transceiver unit provided in other terminal resistor connection modules through the bus, so that the position information can be sent to other terminal resistor connection modules, and thus the control unit can also obtain the position information of other terminal resistor connection modules through the bus signal transceiver unit.

[0058] Based on the network division pre-instruction of the main control module, the second parameters of each terminal resistance connection module are configured, including: based on the network division pre-instruction of the main control module, the location information stored in the storage unit is obtained, and the location information of other terminal resistance connection modules received by the bus signal transceiver unit is obtained; based on the comparison result of the location information with the location information of other terminal resistance connection modules, the location of the terminal resistance connection module in the bus segment is determined; based on the terminal resistance connection module being located at both ends of the bus segment, the second parameters of the terminal resistance connection module are configured.

[0059] Exemplarily, the control unit in the terminal resistor connection module extracts the position information of the corresponding terminal resistor connection module from the storage unit according to the network division pre-instruction issued by the main control module, and extracts the position information of other terminal resistor connection modules through the bus signal transceiver unit, and compares the position information with the position information of other terminal resistor connection modules. The position information can be, for example, the serial number marked starting from one end of the bus after the terminal resistor connection modules are sequentially connected in the bus. The control unit compares the serial number stored in the storage unit with the serial number of other terminal resistor connection modules, so as to determine the position of the terminal resistor connection module corresponding to the control unit in the two bus sections on both sides of the grid-connected switch, so as to obtain the position of the terminal resistor connection module in the bus section. When the control unit determines that the serial number stored in the storage unit is the largest or smallest in this bus section, it can be determined that the corresponding terminal resistor connection module is located at both ends of this bus section. The control unit sets the second parameter stored in the storage unit to 1, so that after the bus is divided into bus sections, the terminal resistor connection module determines that it is located at both ends of the bus section through self-test according to the second parameter being 1, and connects the terminal resistor to the bus section.

[0060] It should be noted that the position information may also be other information other than the serial number that can determine the position of the terminal resistance connection module in the bus or bus segment, which is not specifically limited here.

[0061] In some embodiments, Figure 5 A flow chart of another CAN bus grid-connection method provided in an embodiment of the present disclosure is shown as follows: Figure 5 As shown, the grid-connected method further includes: S610 to S640.

[0062] S610: Based on the grid connection pre-instruction of the main control module, configure the first parameter and the second parameter of each terminal resistance connection module.

[0063] Specifically, since both ends of the two bus segments are connected to terminal resistors, four terminal resistors are connected to the bus after the grid connection. Therefore, there will be a communication failure after the bus is powered on, making it impossible for the terminal resistor connection modules set in the bus to communicate through the bus segments, and it is impossible to determine the main control module after the bus segments are merged into a bus, and determine the terminal resistor connection module that needs to disconnect the terminal resistor. Therefore, it is necessary to configure the first parameter and the second parameter of each terminal resistor connection module before the bus segment is connected to the grid. Before the bus is connected to the grid, the main control modules of the two bus segments issue a grid connection pre-instruction. According to the grid connection pre-instruction, one bus segment keeps the first parameter stored in the main control module unchanged at 1, and the other bus segment switches the first parameter stored in the main control module from 1 to 0, so that after the grid connection, the main control module of the other bus segment is switched to a common terminal resistor connection module, and only one main control module is retained in the bus. In addition, each terminal resistance connection module in the bus segment will also compare the position in the bus segment to determine the two terminal resistance connection modules closest to the grid-connected switch to switch the second parameter from 1 to 0, so that after grid connection, the two terminal resistance connection modules will disconnect the terminal resistance from the bus segment.

[0064] S620. Based on the grid-connected instruction of the main control module, control the sub-grid-connected switch to switch the bus segment to the bus.

[0065] Specifically, the sub-grid-connected switch is turned on after receiving the grid-connected instruction sent by the main control module, and the two bus segments are merged into one bus.

[0066] S630: Based on the bus segment being switched to the bus, control each terminal resistance connection module to perform a self-check operation.

[0067] Specifically, after the two bus segments are merged into a bus, each terminal resistor connection module performs a self-check on the stored first parameter and the second parameter. Since the two main control modules in the two bus segments exist in the bus after the merger, and the first parameter of one of the two main control modules is configured as 0, the main control module with the first parameter of 1 continues to be used as the main control module of the bus, and the main control module with the first parameter of 0 is switched to a common terminal resistor connection module. Among the terminal resistor connection modules, the terminal resistor connection module with the second parameter configured as 0 disconnects the terminal resistor from the bus, and the terminal resistor connection module with the second parameter configured as 1 keeps the terminal resistor connected to the bus. As a result, after the two bus segments are merged into a bus, the terminal resistor connection module determines through self-checking that the main control module with the stored first parameter of 0 is automatically configured as a common terminal resistor connection module, and the terminal resistor connection module determines through self-checking that the stored second parameter of 0 automatically disconnects the terminal resistor from the bus.

[0068] S640, power on the control bus.

[0069] Specifically, before performing the grid-connected operation, the two bus segments need to be powered off. After the terminal resistors in the bus are disconnected, the bus is powered on. This avoids the bus starting to work when other terminal resistor connection modules other than the two ends of the bus have not disconnected the terminal resistors, thereby causing bus communication failures due to too many terminal resistors connected.

[0070] Before the master control module on the bus segment sends a grid connection instruction, the master control modules in the two bus segments will send a grid connection pre-instruction, so that the bus segment determines the position of the sub-grid connection switch, and configures the second parameter of the terminal resistance connection module closest to the sub-grid connection switch in the two buses to 0, so that after the grid connection, the two terminal resistance connection modules disconnect the terminal resistance from the bus, ensuring that only two terminal resistances are connected in the bus. In addition, the first parameter of the master control module in one bus segment continues to be 1, and the first parameter of the master control module in the other bus segment is set to 0, so that after the grid connection, the master control module in the other bus segment will be configured as a common terminal resistance connection module, so that there is only one master control module in the bus. When there is only one master control module in the bus, and the terminal resistances at both ends of the bus are connected, the bus is powered on and starts working. Therefore, the present invention detects the position of each terminal resistor connection module on the bus, so that after being connected to the grid, only the two ends of the bus are connected with terminal resistors, and only one main control module is set in the bus to control all terminal resistor connection modules. There is no need to manually control the connection and disconnection of the terminal resistors, which saves manpower and avoids the problem of manual operation errors, further ensuring the quality of bus communication.

[0071] In some embodiments, the terminal resistance connection module includes a storage unit, a bus signal transceiver unit, a control unit, a switch unit and a terminal resistance unit. The control unit is electrically connected to the storage unit, the bus signal transceiver unit and the switch unit, respectively, and the terminal resistance unit is electrically connected to the bus through the switch unit; the storage unit is used to store the location information of the terminal resistance connection module; the bus signal transceiver unit is used to communicate with other terminal resistance connection modules through the bus.

[0072] Based on the grid-connected pre-instructions of the main control module, the second parameters of each terminal resistance connection module are configured, including: based on the grid-connected pre-instructions of the main control module, controlling the acquisition of position information stored in the storage unit, and acquiring the position information of other terminal resistance connection modules received by the bus signal transceiver unit; based on the comparison result of the position information with the position information of other terminal resistance connection modules, determining the position of the terminal resistance connection module in the bus; based on the terminal resistance connection module being located between the two ends of the bus, configuring the second parameters of the terminal resistance connection module.

[0073] Exemplarily, the control unit in the terminal resistor connection module extracts the position information of the corresponding terminal resistor connection module from the storage unit according to the grid connection pre-instruction issued by the main control module, and extracts the position information of other terminal resistor connection modules through the bus signal transceiver unit, and compares the position information with the position information of other terminal resistor connection modules. The position information can be, for example, the serial number marked starting from one end of the bus after the terminal resistor connection modules are sequentially connected in the bus. The control unit compares the serial number stored in the storage unit with the serial numbers of other terminal resistor connection modules to determine the position of the terminal resistor connection module corresponding to the control unit in the bus segment. When the control unit determines that the serial number stored in the storage unit is not the largest or smallest serial number, it can be determined that the corresponding terminal resistor connection module is located between the two ends of the bus segment. The control unit sets the second parameter stored in the storage unit to 0, so that after the two bus segments are merged into a bus, the terminal resistor connection module determines through self-test that it is not located at both ends of the bus according to the second parameter being 0, and disconnects the terminal resistor from the bus.

[0074] It should be noted that the position information may also be other information other than the serial number that can determine the position of the terminal resistance connection module in the bus or bus segment, which is not specifically limited here.

[0075] In some embodiments, Figure 6 A flow chart of another CAN bus grid-connection method provided in an embodiment of the present disclosure is shown as follows: Figure 6 As shown, the main control module for obtaining the bus includes: S710 and S720.

[0076] S710. Obtain flag information of a terminal resistance connection module; wherein the flag information is a binary number.

[0077] S720 . Determine a master control module of the bus based on a comparison result between the mark information of the terminal resistance connection module and the mark information of other terminal resistance connection modules in the bus.

[0078] Specifically, after the terminal resistor connection module is connected to the bus, from one end of the bus to the other end of the bus, the terminal resistor connection module stores the mark information indicating the position of the terminal resistor connection module in the bus in order from small to large, and the mark information is a binary number, so that each terminal resistor connection module can communicate through the bus to obtain the mark information corresponding to other terminal resistor connection modules, and compare the mark information with the size of the mark information of other terminal resistor connection modules. The two terminal resistor connection modules with the largest mark information and the smallest mark information can be determined to be located at the two ends of the bus, and the first parameter of any terminal resistor connection module located at the two ends of the bus can be configured to 1, so that after the terminal resistor connection module self-checks, it can be configured as the main control module according to the first parameter being 1. For the bus segment after the bus is cut, the terminal resistor connection module in the bus segment can also compare the mark information with the size of the mark information of other terminal resistor connection modules, so as to determine its own position in the bus segment, so that any terminal resistor connection module located at the two ends of the bus segment is determined to be the main control module.

[0079] In some embodiments, before obtaining the identification information of the terminal resistance connection module, it includes: marking the n terminal resistance connection modules in sequence according to the arrangement order of the n terminal resistance connection modules in the bus; based on the marked serial number of the terminal resistance connection module, obtaining the binary number corresponding to the serial number of the terminal resistance connection module as the identification information.

[0080] Exemplarily, taking n as 255 as an example, 255 terminal resistance connection modules are connected in sequence in the bus, and the terminal resistance connection modules are labeled from 1 to 255 from one end of the bus to the other end of the bus according to the order of the terminal resistance connection modules in the bus, and the binary numbers corresponding to the labels are stored in the terminal resistance connection modules as flag information, that is, from one end of the bus to the other end of the bus, the flag information of the terminal resistance connection modules is stored in sequence from 00000001 to 11111111.

[0081] It should be noted that n being 255 is only an example, and the specific number of terminal resistance connection modules is set according to actual conditions and is not specifically limited here.

[0082] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0083] The above are only specific embodiments of the present disclosure, so that those skilled in the art can understand or implement the present disclosure. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present disclosure. Therefore, the present disclosure will not be limited to these embodiments herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A CAN bus grid-connected device, characterized in that: include: bus, Two bus segments; n terminal resistance connection modules, wherein the n terminal resistance connection modules are connected in parallel to the bus; as well as m grid-connected switches, wherein the grid-connected switches are arranged between adjacent terminal resistance connection modules; The m grid-dividing switches are used to switch between the bus and the two bus segments; based on the terminal resistance connection module being connected to one end of the bus or the bus segment, a main control module is determined, and the main control module is used to send a grid-dividing instruction and a grid-connecting instruction; The terminal resistor connection module is used to control the terminal resistor connection modules located at both ends of the bus segment to connect the terminal resistor to the bus segment according to the network division instruction, and is used to control the terminal resistor connection module located between the two ends of the bus to disconnect the terminal resistor from the bus according to the network connection instruction; Wherein, n is an integer greater than or equal to 4, and m is a positive integer not exceeding n-3.

2. The grid-connected device according to claim 1, characterized in that: The terminal resistance connection module includes: a switch unit, a storage unit, a control unit, a bus signal transceiver unit, and a terminal resistance unit; The first end of the bus signal transceiver unit is electrically connected to the first signal line, and the second end of the bus signal transceiver unit is electrically connected to the second signal line; the bus signal transceiver unit communicates with other terminal resistance connection modules through the first signal line and the second signal line; The control unit is electrically connected to the storage unit, the bus signal transceiver unit and the switch unit respectively, and the terminal resistance unit is electrically connected to the first signal line and the second signal line through the switch unit; the storage unit stores the position information of the terminal resistance connection module in the bus, and the control unit is used to control the switch unit to be turned on or off according to the comparison result of the position information stored in the storage unit and the position information of other terminal resistance connection modules; The first signal line and the second signal line are two signal transmission lines in the bus.

3. The grid-connected device according to claim 2, characterized in that: The switch unit includes a first pull-down resistor, a second pull-down resistor, a first NMOS transistor, a second NMOS transistor, a first PMOS transistor, a second PMOS transistor, a first pull-up resistor and a second pull-up resistor; The gate of the first NMOS tube is electrically connected to the second output terminal of the control unit, the gate of the first NMOS tube is grounded through the first pull-down resistor, the source of the first NMOS tube is grounded, the drain of the first NMOS tube is electrically connected to the gate of the first PMOS tube, the gate of the first PMOS tube is electrically connected to the source of the first PMOS tube through the first pull-up resistor, the drain of the first PMOS tube is electrically connected to the first end of the terminal resistance unit, and the source of the first PMOS tube is electrically connected to the first signal line; The gate of the second NMOS tube is electrically connected to the second output end of the control unit, the gate of the second NMOS tube is grounded through the second pull-down resistor, the source of the second NMOS tube is grounded, the drain of the second NMOS tube is electrically connected to the gate of the second PMOS tube, the gate of the second PMOS tube is electrically connected to the source of the second PMOS tube through the second pull-up resistor, the drain of the second PMOS tube is electrically connected to the second end of the terminal resistance unit, and the source of the second PMOS tube is electrically connected to the second signal line.

4. The grid-connected device according to claim 2, characterized in that: The terminal resistance unit includes a first terminal resistance, a second terminal resistance and a terminal capacitor; The first terminal resistor is connected in series with the second terminal resistor, one end of the first terminal resistor is electrically connected to the first signal line through the switch unit, one end of the second terminal resistor is electrically connected to the second signal line through the switch unit, and the other end of the first terminal resistor and the other end of the second terminal resistor are both grounded through the terminal capacitor.

5. A CAN bus grid-connection method, characterized in that: The grid-connected device comprises a bus, two bus segments; n terminal resistance connection modules, the n terminal resistance connection modules are connected in parallel to the bus, and m grid-connected switches, the grid-connected switches are arranged between adjacent terminal resistance connection modules; wherein n is an integer greater than or equal to 4, and m is a positive integer not exceeding n-3; The method comprises: Acquire the main control module of the bus; wherein the main control module is the terminal resistance connection module used to send instructions; Based on the network pre-instruction of the main control module, configure the first parameter and the second parameter of each terminal resistor connection module; wherein the first parameter is a parameter indicating that each terminal resistor connection module sets the main control module; and the second parameter is a parameter indicating whether the terminal resistor is connected or disconnected; Based on the network division instruction of the main control module, control the network division switch to switch the bus to the bus segment; Based on the bus being switched to the bus segment, each of the terminal resistor connection modules is controlled to perform a self-check operation; wherein the self-check operation is an operation in which each of the terminal resistor connection modules sets a main control module according to the first parameter, and connects or disconnects the terminal resistor according to the second parameter; Controlling the bus segment to power on.

6. The method according to claim 5, characterized in that The terminal resistance connection module includes a storage unit, a bus signal transceiver unit, a control unit, a switch unit and a terminal resistance unit, wherein the control unit is electrically connected to the storage unit, the bus signal transceiver unit and the switch unit respectively, and the terminal resistance unit is electrically connected to the bus through the switch unit; The storage unit is used to store the position information of the terminal resistance connection module; the bus signal transceiver unit is used to communicate with other terminal resistance connection modules through the bus; The configuring the second parameters of each of the terminal resistance connection modules based on the network division pre-instruction of the main control module includes: Based on the network division pre-instruction of the main control module, the location information stored in the storage unit is obtained, and the location information of other terminal resistance connection modules received by the bus signal transceiver unit is obtained; Determine the position of the terminal resistor connection module in the bus segment based on a comparison result of the position information with position information of other terminal resistor connection modules; Based on the fact that the terminal resistance connection module is located at two ends of the bus segment, a second parameter of the terminal resistance connection module is configured.

7. The method according to claim 5, characterized in that The method further comprises: Based on the grid connection pre-instruction of the main control module, configure the first parameter and the second parameter of each terminal resistance connection module; Based on the grid-connection instruction of the main control module, controlling the sub-grid-connection switch to switch the bus segment to the bus; Based on the bus segment being switched to the bus, controlling each of the terminal resistance connection modules to perform a self-test operation; Controls the bus power-up.

8. The method according to claim 7, characterized in that The terminal resistance connection module includes a storage unit, a bus signal transceiver unit, a control unit, a switch unit and a terminal resistance unit, wherein the control unit is electrically connected to the storage unit, the bus signal transceiver unit and the switch unit respectively, and the terminal resistance unit is electrically connected to the bus through the switch unit; The storage unit is used to store the position information of the terminal resistance connection module; the bus signal transceiver unit is used to communicate with other terminal resistance connection modules through the bus; The configuring the second parameters of each of the terminal resistance connection modules based on the grid connection pre-instruction of the main control module includes: Based on the grid connection pre-command of the main control module, control to obtain the position information stored in the storage unit, and obtain the position information of other terminal resistance connection modules received by the bus signal transceiver unit; Determine the position of the terminal resistor connection module in the bus based on a comparison result of the position information with the position information of other terminal resistor connection modules; Based on the fact that the terminal resistance connection module is located between two ends of the bus, a second parameter of the terminal resistance connection module is configured.

9. The method according to claim 5, characterized in that The main control module for acquiring the bus includes: Obtaining the flag information of the terminal resistance connection module; wherein the flag information is a binary number; Based on the comparison result of the mark information of the terminal resistance connection module and the mark information of other terminal resistance connection modules in the bus, the main control module of the bus is determined.

10. The method according to claim 9, characterized in that Before obtaining the mark information of the terminal resistance connection module, the method includes: Marking serial numbers for the n terminal resistor connection modules in sequence according to the arrangement order of the n terminal resistor connection modules in the bus; Based on the terminal resistance connection module mark serial number, a binary number corresponding to the serial number of the terminal resistance connection module is obtained as flag information.

Citation Information

Cited By

  • Terminal resistor control circuit, control method and bus communication system

    CN122053284A