Networking equipment system configuration method and device, storage medium and electronic equipment
By testing and controlling the matching resistor access circuits of the head and tail devices of the bus in the networking equipment system, the missed or misconnected problems caused by the large number of CAN communication equipment are solved, and stable communication of the networking equipment system is achieved.
Patent Information
- Application Number
- CN202410036831.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-08
- Publication Date
- 2025-07-08
AI Technical Summary
In networking equipment systems, when there are many CAN communication equipment, it is easy to get confused at the head and tail of the CAN communication connection circuit, resulting in misconnection or misconnection of matching resistors, affecting communication stability.
Communication is carried out through the controller's local area network bus, test whether the equipment in the networking equipment system is normal, determine the head-end equipment and tail-end equipment of the bus, and control its matching resistor access circuit before operation, disconnect the matching resistors of non-head-end equipment and non-tail-end equipment to ensure stable communication.
In the networking equipment system, ensure that the CAN communication connection circuit is correctly connected to the matching resistor, avoid communication interruption, and ensure the normal operation of the networking equipment system.
Smart Images

Figure CN120281641A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of networking device systems, and more particularly, to a configuration method, apparatus, storage medium, and electronic device for a networking device system. Background Art
[0002] In a power supply system, there are many devices using CAN (Controller Area Network) communication, including unit devices such as rectifier modules, photovoltaic modules, and DC / DC modules. When the CAN bus connects these unit devices through CAN communication ports, it is required to add a matching resistor at each end of the CAN communication connection circuit to ensure stable communication waveforms and reduce the error rate.
[0003] It should be noted that when the unit devices of the power supply system leave the factory, a matching resistor is usually installed at each end. However, when multiple independent power supply systems need to be networked to form a larger-capacity power supply system, the number of unit devices communicating through CAN will increase, and the CAN connection relationships between different unit devices will become more complex, making it easy to have the phenomenon of confusion at the head and tail ends of the CAN communication connection circuit, resulting in missing or misconnecting the matching resistors, thereby causing unstable CAN communication in the networked power supply system, leading to communication interruption and even affecting the reliable operation of the networking system.
[0004] Regarding the problem in the related art that there are many CAN communication devices in the networking device system, resulting in missing or misconnecting the matching resistors in the CAN communication connection circuit and thus affecting communication, no effective solution has been proposed yet. Summary of the Invention
[0005] The present application provides a configuration method, apparatus, storage medium, and electronic device for a networking device system to solve the problem in the related art that there are many CAN communication devices in the networking device system, resulting in missing or misconnecting the matching resistors in the CAN communication connection circuit and thus affecting communication.
[0006] According to one aspect of the present application, a configuration method for a networking device system is provided. Devices in the networking device system communicate via a Controller Area Network (CAN) bus. The method includes: controlling the matching resistors of two target devices in the networking device system to be connected to the circuit, and testing whether all devices in the networking device system communicate normally. Among them, a matching resistor is provided in the bus communication circuit of each device in the networking device system. The matching resistor is used to stabilize the communication waveform. When the matching resistors of the two target devices are connected to the circuit, the matching resistors of non-target devices in the networking device system are disconnected; in the case where any device in the networking device system is tested to have abnormal communication, at least one target device is re-determined, and the matching resistors of the two target devices are controlled to be connected to the circuit until all devices are tested to communicate normally. The two target devices when all devices communicate normally are determined as the head-end device and the tail-end device of the bus; before controlling the networking device system to operate, control the matching resistors of the head-end device and the tail-end device to be connected to the circuit, and control the matching resistors of non-head-end devices and non-tail-end devices in the networking device system to be disconnected.
[0007] Optionally, controlling the matching resistors of two target devices in the networking device system to be connected to the circuit includes: determining a master device from all devices in the networking device system according to the networking rules, and determining the master device and any device other than the master device as target devices to obtain two target devices; controlling the switching devices in the bus communication circuits of each target device to act, and connecting the matching resistors to the bus communication circuits through the switching devices.
[0008] Optionally, testing whether all devices in the networking device system communicate normally includes: determining the monitoring unit of the master device as the main monitoring unit; controlling the main monitoring unit to send multiple groups of preset signal groups to all slave devices, and collecting the bit error rate of each slave device. Among them, the slave device determines the bit error rate according to the received multiple groups of preset signal groups. All slave devices refer to devices other than the master device in the networking device system; in the case where the bit error rate of a slave device is greater than the preset bit error rate, it is determined that the slave device has abnormal communication; in the case where the bit error rate of a slave device is less than or equal to the preset bit error rate, it is determined that the slave device communicates normally.
[0009] Optionally, testing whether all devices in the networking device system communicate normally includes: determining the monitoring unit of the master device as the main monitoring unit; controlling the main monitoring unit to send a preset signal to all slave devices other than the master device, and collecting the waveform of the signal received by each slave device through a waveform analyzer. All slave devices refer to devices other than the master device in the networking device system; determining whether the slave device communicates normally according to the difference between the waveform of the signal received by the slave device and the waveform of the preset signal.
[0010] Optionally, after controlling the matching resistors of the head-end device and the tail-end device to be connected to the circuit and controlling the matching resistors of the non-head-end devices and non-tail-end devices in the networking device system to be disconnected, the method further includes: in the case where a device in the networking device system needs to be replaced, determining the device to be replaced and testing whether the original devices other than the device to be replaced are communicating normally; in the case where the original devices are communicating normally, controlling the device to be replaced to be disconnected and connecting a replacement device at the position of the device to be replaced, wherein, in the case where the matching resistor of the device to be replaced is connected to the circuit, controlling the matching resistor of the replacement device to be connected to the circuit, and in the case where the matching resistor of the device to be replaced is disconnected, controlling the matching resistor of the replacement device to be disconnected.
[0011] Optionally, after testing whether the original devices other than the device to be replaced are communicating normally, the method further includes: in the case where any of the original devices has abnormal communication, controlling the device to be replaced to be disconnected and connecting a replacement device at the position of the device to be replaced to obtain an updated networking device system; controlling the matching resistors of two target devices in the updated networking device system to be connected to the circuit and testing whether all the devices in the networking device system are communicating normally, in the case where any device in the networking device system has abnormal communication, re-determining at least one target device and controlling the matching resistors of the two target devices to be connected to the circuit until it is tested that all the devices are communicating normally, wherein, in the case where the matching resistors of the two target devices are connected to the circuit, the matching resistors of the non-target devices in the networking device system are disconnected.
[0012] Optionally, after controlling the matching resistors of the head-end device and the tail-end device to be connected to the circuit and controlling the matching resistors of the non-head-end devices and non-tail-end devices in the networking device system to be disconnected, the method further includes: in the case where the networking device system needs to be expanded, testing whether all the devices in the networking device system are communicating normally; in the case where all the devices in the networking device system are communicating normally, connecting the device to be connected to the networking device system to obtain an updated networking device system and testing whether the device to be connected is communicating normally; in the case where the device to be connected has abnormal communication, controlling the matching resistors of the adjacent devices of the device to be connected to be disconnected and controlling the matching resistor of the device to be connected to be connected to the circuit.
[0013] Optionally, after testing whether the devices in the network device system communicate normally, the method further includes: in the case that any device in the network device system has abnormal communication, controlling the matching resistors of two target devices in the network device system to be connected to the circuit, and testing whether all devices communicate normally; in the case that any device is detected to have abnormal communication, at least re-determining one target device, and controlling the matching resistors of the two target devices to be connected to the circuit until it is tested that all devices communicate normally, and determining the obtained two target devices as the head-end device or the tail-end device; connecting the device to be connected to the bus of the network device system in one of the following ways: connecting the device to be connected between the head-end and the tail-end of the bus of the network device system; connecting the device to be connected to the head-end of the bus of the network device system, controlling the matching resistor of the device to be connected to be connected to the circuit, and controlling the matching resistor of the original head-end device to be disconnected; connecting the device to be connected to the tail-end of the bus of the network device system, controlling the matching resistor of the device to be connected to be connected to the circuit, and controlling the matching resistor of the original head-end device to be disconnected.
[0014] According to another aspect of the present application, there is provided a configuration device for a network device system. The devices in the network device system communicate through a Controller Area Network (CAN) bus. The device includes: a first control unit, configured to control the matching resistors of two target devices in the network device system to be connected to the circuit, and test whether all devices in the network device system communicate normally, wherein a matching resistor is provided in the bus communication circuit of each device in the network device system, and the matching resistor is used to stabilize the communication waveform. When the matching resistors of the two target devices are connected to the circuit, the matching resistors of the non-target devices in the network device system are disconnected; a second control unit, configured to, in the case that any device in the network device system is detected to have abnormal communication, at least re-determine one target device, and control the matching resistors of the two target devices to be connected to the circuit until it is tested that all devices communicate normally, and determine the two target devices when all devices communicate normally as the head-end device and the tail-end device of the bus; a third control unit, configured to, before controlling the network device system to operate, control the matching resistors of the head-end device and the tail-end device to be connected to the circuit, and control the matching resistors of the non-head-end devices and non-tail-end devices in the network device system to be disconnected.
[0015] According to another aspect of the embodiments of the present invention, there is also provided a computer storage medium for storing a program, wherein the program, when running, controls the device where the non-volatile storage medium is located to execute a configuration method for a network device system.
[0016] According to another aspect of the embodiments of the present invention, there is also provided an electronic device, including a processor and a memory; a computer-readable instruction is stored in the memory, and the processor is configured to run the computer-readable instruction, wherein the computer-readable instruction, when running, executes a configuration method for a network device system.
[0017] According to the present application, the following steps are adopted: controlling the matching resistors of two target devices in the networking device system to access the circuit, and testing whether all devices in the networking device system communicate normally. Wherein, a matching resistor is provided in the bus communication circuit of each device in the networking device system, and the matching resistor is used to stabilize the communication waveform resistor. When the matching resistors of the two target devices are accessed to the circuit, the matching resistors of the non-target devices in the networking device system are disconnected; in the case that any device in the networking device system is tested to have abnormal communication, at least one target device is re-determined, and the matching resistors of the two target devices are controlled to access the circuit until all devices are tested to communicate normally, and the two target devices when all devices communicate normally are determined as the head-end device and the tail-end device of the bus; before controlling the networking device system to operate, controlling the matching resistors of the head-end device and the tail-end device to access the circuit, and controlling the matching resistors of the non-head-end devices and non-tail-end devices in the networking device system to be disconnected, which solves the problem that in the related art, there are many CAN communication devices in the networking device system, resulting in the leakage or misconnection of the matching resistors in the CAN communication connection circuit, thereby affecting communication. By testing the head-end device and the tail-end device of the bus and controlling the matching resistors of the head-end device and the tail-end device to access the circuit when controlling the networking device system to operate, the effect of correctly connecting the matching resistors to the CAN communication connection circuit even when there are many CAN communication devices in the networking device system is achieved, ensuring the normal communication of the networking device system. Description of the Drawings
[0018] The drawings forming a part of this application are used to provide a further understanding of this application. The schematic embodiments of this application and their descriptions are used to explain this application and do not constitute an improper limitation to this application. In the drawings:
[0019] Figure 1 is a flowchart of a configuration method for a networking device system according to an embodiment of this application;
[0020] Figure 2 is a schematic diagram of the configuration of a networking device system according to an embodiment of this application;
[0021] Figure 3 is a schematic diagram of the bus communication circuit of a device in a networking device system according to an embodiment of this application;
[0022] Figure 4 is a schematic diagram of a configuration device for a networking device system according to an embodiment of this application;
[0023] Figure 5 is a schematic diagram of an electronic device according to an embodiment of this application. Detailed Embodiments
[0024] It should be noted that, without conflict, the embodiments in the present application and the features in the embodiments may be combined with each other. The present application will be described in detail below with reference to the drawings and in combination with the embodiments.
[0025] In order to enable those skilled in the art of the present technology to better understand the solution of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments in the present application without creative efforts shall fall within the protection scope of the present application.
[0026] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and do not necessarily need to describe a specific order or sequence. It should be understood that such used data can be interchanged under appropriate circumstances so as to implement the embodiments of the present application described herein. In addition, the terms "comprising" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device comprising a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products or devices.
[0027] It should be noted that the relevant information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for display, data for analysis, etc.) involved in the present disclosure are all information and data authorized by the user or fully authorized by all parties.
[0028] According to an embodiment of the present application, a configuration method for a networking device system is provided. The devices in the networking device system communicate through a Controller Area Network (CAN) bus.
[0029] It should be noted that each device in the networking device system includes a CAN bus communication circuit for connecting to the CAN bus so as to communicate with other devices through the CAN bus. The CAN bus communication circuit includes a CAN circuit and a matching resistor. Connecting the matching resistors in the CAN bus communication circuits of the head-end device and the tail-end device of the bus into the circuit can stabilize the voltage in the CAN bus communication circuit, thereby stabilizing the communication waveform. However, in the case where there are a large number of devices in the networking device system and the CAN connection relationships between the devices are complex, it is difficult to determine the head-end device and the tail-end device of the bus. Therefore, before controlling the operation of the networking device system, it is necessary to first test the head-end device and the tail-end device of the bus.
[0030] Figure 1 is a flowchart of a configuration method for a networking device system provided according to an embodiment of the present application. As Figure 1 shown, the method includes the following steps:
[0031] Step S102, control the matching resistors of two target devices in the networking device system to be connected to the circuit, and test whether all devices in the networking device system communicate normally. Among them, a matching resistor is provided in the bus communication circuit of each device in the networking device system. The matching resistor is a resistor for stabilizing the communication waveform. When the matching resistors of the two target devices are connected to the circuit, the matching resistors of the non-target devices in the networking device system are disconnected.
[0032] Specifically, the devices in the networking device system are all devices that can perform CAN (Controller Area Network) communication. When only two devices are networked in the networking device system, the two devices are the head-end device and the tail-end device of the bus. Controlling the matching resistors of these two devices to be connected to the circuit is sufficient.
[0033] When there are three or more power systems networked in the networking device, determine two target devices, control the matching resistors of the two target devices to be connected to the circuit, and control the matching resistors of the devices other than the two target devices to be disconnected. It should be noted that only when the matching resistors of the head-end device and the tail-end device of the bus are connected to the circuit, all devices in the networking device system are between the matching resistor at the head-end and the matching resistor at the tail-end, and all devices can communicate normally. Since these two target devices are not necessarily the head-end device and the tail-end device of the bus, it is necessary to test whether each device communicates normally to determine whether each device is between the matching resistor at the head-end and the matching resistor at the tail-end.
[0034] Step S104, when it is detected that any device in the networking device system has abnormal communication, re-determine at least one target device, and control the matching resistors of the two target devices to be connected to the circuit until it is tested that all devices communicate normally, and determine the two target devices when all devices communicate normally as the head-end device and the tail-end device of the bus.
[0035] It should be noted that when it is detected that any device has abnormal communication, it means that at least one device is not between the matching resistor at the head-end and the matching resistor at the tail-end. That is, at least one of the two target devices is not the head-end device or the tail-end device of the bus. It is necessary to re-determine at least one target device, then connect the matching resistors of the re-determined pair of target devices to the circuit, and test whether each device communicates normally until it is tested that all devices communicate normally, indicating that all devices are between the matching resistor at the head-end and the matching resistor at the tail-end, and the two target devices are the head-end device and the tail-end device of the bus.
[0036] Step S106, before controlling the operation of the networking device system, control the matching resistors of the head-end device and the tail-end device to be connected to the circuit, and control the matching resistors of the non-head-end devices and non-tail-end devices in the networking device system to be disconnected.
[0037] In an optional embodiment, the networking device system is a networking power supply system. There are four power supply systems, A, B, C, and D, in the networking power supply system. Figure 2 It is a schematic diagram of the configuration of the networking device system provided by the embodiment of the present application. As Figure 2 shown, it is tested that power supply system A and power supply system D are the head-end device and the tail-end device of the CAN communication bus. Before controlling the operation of the networking device system, connect the matching resistors of power supply system A and power supply system D respectively, and at the same time disconnect the matching resistors of power supply system B and power supply system C. In this way, all four power supply systems A, B, C, and D are between the matching resistor at the head-end and the matching resistor at the tail-end and can communicate normally.
[0038] The configuration method of the networking device system provided by the embodiment of the present application. The devices in the networking device system communicate through a controller area network bus. Control the matching resistors of two target devices in the networking device system to be connected to the circuit, and test whether all devices in the networking device system communicate normally. Among them, a matching resistor is provided in the bus communication circuit of each device in the networking device system. The matching resistor is a resistor used to stabilize the communication waveform. When the matching resistors of the two target devices are connected to the circuit, the matching resistors of the non-target devices in the networking device system are disconnected; when it is detected that any device in the networking device system has abnormal communication, at least re-determine one target device, and control the matching resistors of the two target devices to be connected to the circuit until it is tested that all devices communicate normally, and determine the two target devices when all devices communicate normally as the head-end device and the tail-end device of the bus; before controlling the operation of the networking device system, control the matching resistors of the head-end device and the tail-end device to be connected to the circuit, and control the matching resistors of the non-head-end devices and non-tail-end devices in the networking device system to be disconnected, which solves the problem in the related art that there are many CAN communication devices in the networking device system, resulting in missed connection or wrong connection of the matching resistors in the CAN communication connection circuit, thereby affecting communication. By testing the head-end device and the tail-end device of the bus and controlling the matching resistors of the head-end device and the tail-end device to be connected to the circuit when controlling the operation of the networking device system, the effect of correctly connecting the matching resistors to the CAN communication connection circuit even when there are many CAN communication devices in the networking device system is achieved, ensuring the normal communication of the networking device system.
[0039] Optionally, in the configuration method of the networking device system provided in the embodiments of the present application, controlling the access of the matching resistors of two target devices in the networking device system includes: determining a master device from all devices in the networking device system according to the networking rules, determining the master device and any device other than the master device as target devices to obtain two target devices; controlling the operation of the switching devices in the bus communication circuits of each target device, and connecting the matching resistors to the bus communication circuits through the switching devices.
[0040] Specifically, the networking rules can be: networking according to the device numbers, the device with the smallest device number can be determined as the master device, the master device is determined as a target device, and any device other than the master device is determined as another target device, and control the matching resistors in the bus communication circuits of the two target devices to be connected to the bus communication circuits. In addition, it should be noted that when the devices in the networking device system are convenient to view, the two target devices can also be determined by observation, so as to improve the efficiency of determining the head-end device and the tail-end device of the bus.
[0041] Figure 3 is a schematic diagram of the bus communication circuit of the devices in the networking device system provided in the embodiments of the present application, as Figure 3 shown, the bus communication circuit includes a matching resistor, a matching resistor control circuit, and a control and communication unit (i.e., a microcontroller unit, abbreviated as MCU). The matching resistor control circuit includes a CAN circuit and a switching device. The MCU can control the on / off of the switching device to realize the connection or disconnection of the matching resistor by the CAN circuit. The MCU can also receive and send power information. The switching device can be a MOS transistor or a relay. The type of the switching transistor is not limited in this embodiment. The size of the matching resistor is determined by the circuit parameters of the CAN circuit. For example, it can be a 120-ohm resistor or a 100-ohm resistor. In this embodiment, the MCU is used to control the conduction and disconnection of the switching transistor in the matching resistor control circuit, so as to flexibly control the matching resistor to be connected to the circuit or disconnected.
[0042] To improve the efficiency of testing whether the devices communicate normally, optionally, in the configuration method of the networking device system provided in the embodiments of the present application, testing whether all devices in the networking device system communicate normally includes: determining the monitoring unit of the master device as the main monitoring unit; controlling the main monitoring unit to send multiple groups of preset signal groups to all slave devices, and collecting the bit error rate of each slave device, where the slave device determines the bit error rate according to the received multiple groups of preset signal groups, and all slave devices refer to the devices other than the master device in the networking device system; when the bit error rate of a slave device is greater than the preset bit error rate, it is determined that the slave device communicates abnormally; when the bit error rate of a slave device is less than or equal to the preset bit error rate, it is determined that the slave device communicates normally.
[0043] It should be noted that the preset signal group refers to the CAN signal group with a high bit error rate detected in advance under abnormal communication conditions. Each preset signal group consists of a string of "0" or "1", for example, 0101. The MCU of each device has preset several groups of CAN signal groups. After the slave device receives these signal groups sent by the main monitoring unit, it needs to perform comparative analysis according to the preset CAN signal groups. If the received signal is the same as the preset signal group, it indicates that no bit error has occurred. If the received signal is different from the preset signal group, it indicates that a bit error has occurred. Determine whether this power supply is already between the two CAN matching resistors based on the relationship between the bit error rate and the preset bit error rate, and send this information back to the main monitoring. Specifically, the preset bit error rate can take values between 85% and 90%. For example, it can be 85%. When the bit error rate of a device is greater than 85%, it is determined that the device communication is abnormal. When the bit error rate of a device is less than or equal to 85%, it is determined that the device communication is normal.
[0044] In an alternative embodiment, the networking device system is a networking power supply system. In the networking power supply system, there are three power supply systems A, B, and C networking. The main monitoring unit controls the matching resistor of its own power supply system A to be inserted and disconnects the matching resistor of any other power supply system. For example, disconnect the matching resistor of power supply system B and keep the matching resistor of power supply system C inserted. Determine the head-end device and the tail-end device of the bus through the following steps:
[0045] First, the main monitoring unit of power supply system A first sends several groups of preset CAN signal groups to power supply system C with the inserted resistor. Power supply system C compares the received signal with the preset several groups of CAN signal groups. If it determines through the bit error rate that it is already between the two CAN matching resistors, it sends this information back to the main monitoring unit.
[0046] Furthermore, the main monitoring unit of power supply system A then sends several groups of preset CAN signal groups to power supply system B. Power supply system B compares the received signal with the preset several groups of CAN signal groups and determines whether it is already between the two CAN matching resistors through the bit error rate. If it is determined that power supply system B is already between the two CAN matching resistors of power supply system A and power supply system C, it sends this information back to the main monitoring. At this time, it is determined that the head-end device and the tail-end device of the CAN bus are power supply system A and power supply system C.
[0047] If it is determined that power supply system B is not between the CAN matching resistors of power supply system A and power supply system C, then the CAN matching resistor of power supply system B is turned on, and at the same time, the CAN matching resistor of power supply system C is turned off. The main monitoring unit of power supply system A first sends several groups of preset CAN signal groups to power supply system B. Power supply system B compares the received signals with the preset several groups of CAN signal groups. If it is determined that it is already between the two CAN matching resistors through the bit error rate, it sends this information back to the main monitor.
[0048] Then, the main monitoring unit of power supply system A sends several groups of preset CAN signal groups to power supply system C again. Power supply system C compares the received signals with the preset several groups of CAN signal groups, and determines whether it is already between the two CAN matching resistors through the bit error rate. If it is determined that power supply system C is between the two CAN matching resistors of power supply system A and power supply system B, it sends this information back to the main monitor. At this time, the head-end device and the tail-end device of the CAN bus are determined to be power supply system A and power supply system B.
[0049] If it is determined that power supply system C is not between the two CAN matching resistors of power supply system A and power supply system B, then the CAN matching resistor of power supply system C is turned on, and at the same time, the CAN matching resistor of power supply system A is turned off. The main monitor of power supply system A sends several groups of preset CAN signal groups to power supply system B. Power supply system B compares the received signals with the preset several groups of CAN signal groups. If it is determined that it is already between the two CAN matching resistors through the bit error rate, it sends this information back to the main monitor.
[0050] Then, the main monitoring unit of power supply system A sends several groups of preset CAN signal groups to power supply system C again. Power supply system C compares the received signals with the preset several groups of CAN signal groups. If it is determined that it is already between the two CAN matching resistors through the bit error rate, it sends this information back to the main monitor. At this time, the head-end device and the tail-end device of the CAN bus are determined to be power supply system B and power supply system C.
[0051] It should be noted that when there are more than three devices in the networking device system, the principle for determining the head-end device and the tail-end device of the bus is the same as the above steps. In addition, during the process of detecting whether the devices can communicate normally, in order to improve the detection efficiency, when it is detected in one detection step that several connected devices can communicate normally, it means that these devices form a path between the matching resistors at the head-end and the tail-end. In the next detection step, these devices can be not detected, thereby reducing the number of detections and improving the detection efficiency.
[0052] There are various ways to test whether the test device communicates normally. Optionally, in the configuration method of the networking device system provided in the embodiments of the present application, testing whether all devices in the networking device system communicate normally includes: determining the monitoring unit of the master device as the main monitoring unit; controlling the main monitoring unit to send a preset signal to all slave devices, and collecting the waveforms of the signals received by each slave device through a waveform analyzer. All slave devices refer to the devices other than the master device in the networking device system; determining whether the slave devices communicate normally according to the difference between the waveforms of the signals received by the slave devices and the waveform of the preset signal.
[0053] Specifically, a waveform analyzer can be connected to the CAN bus communication interface of each device, and then the difference between the waveforms of the signals collected by the waveform analyzer and the waveform of the preset signal is analyzed. According to the difference situation, it is judged whether the device communicates normally. If the difference between the two is large, it indicates that the device communication is abnormal. If the difference between the two is within the error tolerance range, it indicates that the device communication is normal. In this embodiment, the waveform analyzer is used to collect the waveforms of the signals received by the devices, and by comparing with the waveforms of the preset signals, it is determined whether the devices communicate normally, achieving the effect of accurately determining the communication status of the devices.
[0054] When a device in the networking device system is damaged, there is a need to replace the device. Optionally, in the configuration method of the networking device system provided in the embodiments of the present application, after controlling the matching resistors of the head-end device and the tail-end device to be connected to the circuit and controlling the matching resistors of the non-head-end devices and non-tail-end devices in the networking device system to be disconnected, the method further includes: when it is necessary to replace a device in the networking device system, determining the device to be replaced, and testing whether the original devices other than the device to be replaced communicate normally; when the original devices communicate normally, controlling the device to be replaced to be disconnected, and connecting a replacement device at the position of the device to be replaced. Among them, when the matching resistor of the device to be replaced is connected to the circuit, controlling the matching resistor of the replacement device to be connected to the circuit, and when the matching resistor of the device to be replaced is disconnected, controlling the matching resistor of the replacement device to be disconnected.
[0055] It should be noted that in the case of a device failure, if the hardware circuit of the device's CAN communication is not damaged and is still connected to the CAN bus, it will not affect the communication of the original devices other than the device to be replaced. Therefore, when it is tested that the communication of the original devices other than the device to be replaced is normal, the replacement device sets the state of its own matching resistor according to the state of the matching resistor of the device to be replaced. Specifically, if the matching resistor of the device to be replaced is connected to the circuit, it indicates that the device to be replaced is the head or tail device of the bus. Replace the device to be replaced with the replacement device, then the replacement device becomes the head or tail device of the bus, and control the matching resistor of the replacement device to be connected to the circuit; if the matching resistor of the device to be replaced is disconnected, it indicates that the device to be replaced is the device between the head and tail of the bus. Replace the device to be replaced with the replacement device, then the replacement device becomes the device between the head and tail of the bus, and control the matching resistor of the replacement device to be disconnected.
[0056] Through this embodiment, when the device failure does not affect the communication of the original devices other than the device to be replaced, after the replacement device, it is only necessary to set the state of the matching resistor of the replacement device according to the state of the matching resistor of the device to be replaced, ensuring that the networked device system after the replacement device can communicate normally.
[0057] If the hardware circuit of the CAN communication of the device to be replaced is damaged, it will affect the communication of the original devices other than the device to be replaced. Optionally, in the configuration method of the networked device system provided in this embodiment of the present application, after testing whether the original devices other than the device to be replaced communicate normally, the method further includes: in the case of abnormal communication of any original device, control the device to be replaced to disconnect, and connect a replacement device at the position of the device to be replaced to obtain an updated networked device system; control the matching resistors of two target devices in the updated networked device system to be connected to the circuit, and test whether all devices in the networked device system communicate normally. In the case of testing that any device in the networked device system has abnormal communication, at least re-determine one target device, and control the matching resistors of the two target devices to be connected to the circuit until it is tested that all devices communicate normally, where in the case of the matching resistors of the two target devices being connected to the circuit, the matching resistors of the non-target devices in the networked device system are disconnected.
[0058] Specifically, in the case of a device failure, if the hardware circuit of the device's CAN communication is damaged, it is necessary to re-wire and replace the device to be replaced with a replacement device to obtain an updated networked device system. In the updated networked device system, the head and tail devices of the bus are uncertain. It is necessary to first test the head and tail devices of the bus, and then control the matching resistors of the head and tail devices of the bus to be connected to the circuit, and control the matching resistors of the devices other than the head and tail devices to be disconnected, so that each device in the updated networked device system can communicate normally.
[0059] Through this embodiment, when the damage of the device affects the communication of the original devices other than the device to be replaced, the head-end device and the tail-end device of the bus in the updated networking device system are automatically tested, and the matching resistors of the two are controlled to be connected to the circuit, ensuring that the networking device system after replacing the device can communicate normally.
[0060] The number of devices in the networking device system is not fixed and can be expanded according to service requirements. Optionally, in the configuration method of the networking device system provided in the embodiments of the present application, after controlling the matching resistors of the head-end device and the tail-end device to be connected to the circuit and controlling the matching resistors of the non-head-end devices and non-tail-end devices in the networking device system to be disconnected, the method further includes: when the networking device system needs to be expanded, testing whether all devices in the networking device system communicate normally; when all devices in the networking device system communicate normally, connecting the device to be connected to the networking device system to obtain an updated networking device system, and testing whether the device to be connected communicates normally; when the device to be connected has abnormal communication, controlling the matching resistor of the adjacent device of the device to be connected to be disconnected and controlling the matching resistor of the device to be connected to be connected to the circuit.
[0061] Specifically, before expansion, if it is tested that the devices in the original networking device system communicate normally, it means that each device is between the matching resistor at the head end of the bus and the matching resistor at the tail end. Connect the device to be connected to the networking device system. At this time, the matching resistor of the device to be connected is disconnected, and it is detected whether the device to be connected communicates normally. When the device to be connected communicates normally, it means that the device to be connected is a device between the head-end device and the tail-end device; when the device to be connected has abnormal communication, it means that the adjacent device of the device to be connected is the original head-end device or tail-end device, and the device to be connected becomes the new head-end device or tail-end device. Control the matching resistor of the adjacent device to be disconnected and control the matching resistor of the device to be connected to be connected to the circuit, so that all devices are between the matching resistor at the head end of the bus and the matching resistor at the tail end.
[0062] Through this embodiment, when expanding the devices in the networking device system under the condition that the devices communicate normally, only the communication situation of the device to be connected needs to be tested, and the matching resistor mode of the networking device system is adjusted in the case of abnormal communication, ensuring that the expanded networking device system can communicate normally.
[0063] Optionally, in the configuration method of the networking device system provided in the embodiments of the present application, after testing whether the devices in the networking device system communicate normally, the method further includes: in the case where any device in the networking device system has abnormal communication, controlling the matching resistors of two target devices in the networking device system to be connected to the circuit, and testing whether all devices communicate normally. In the case where any device is tested to have abnormal communication, at least re-determine one target device, and control the matching resistors of the two target devices to be connected to the circuit until it is tested that all devices communicate normally, and determine the obtained two target devices as the head-end device or the tail-end device; connect the device to be connected to the bus of the networking device system in one of the following ways: connect the device to be connected between the head-end and the tail-end of the bus of the networking device system; connect the device to be connected to the head-end of the bus of the networking device system, control the matching resistor of the device to be connected to be connected to the circuit, and control the matching resistor of the original head-end device to be disconnected; connect the device to be connected to the tail-end of the bus of the networking device system, control the matching resistor of the device to be connected to be connected to the circuit, and control the matching resistor of the original head-end device to be disconnected.
[0064] It should be noted that in the case where any device has abnormal communication, it indicates that the matching resistors in the networking device system before expansion are not connected or misconnected. It is necessary to first test the head-end device and the tail-end device of the bus in the original networking device system. After obtaining the head-end device and the tail-end device, then connect the resistor to be connected to the head-end, the tail-end or the middle of the bus. When connecting the device to be connected to the head-end or the tail-end of the bus of the networking device system, it is necessary to disconnect the matching resistor of the original head-end device or the tail-end device, and then connect the matching resistor of the device to be connected to the circuit. When connecting the device to be connected to the middle of the bus of the networking device system, control the matching resistor of the device to be connected to be disconnected.
[0065] Through this embodiment, when expanding the devices in the case where the devices in the networking device system have abnormal communication, first test the head-end device or the tail-end device of the bus, and then connect the device to be connected to the middle, the head-end or the tail-end of the bus, and adjust the matching resistor mode of the networking device system in the case of connecting to the head-end or the tail-end, ensuring that the expanded networking device system can communicate normally.
[0066] It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. And although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in a different order than here.
[0067] The embodiment of the present application further provides a configuration device for a networking device system. It should be noted that the configuration device for the networking device system in the embodiment of the present application can be used to execute the configuration method for the networking device system provided by the embodiment of the present application. The following introduces the configuration device for the networking device system provided by the embodiment of the present application.
[0068] Figure 4 It is a schematic diagram of the configuration device for the networking device system provided by the embodiment of the present application. As Figure 4 shown, the device includes: a first control unit 402, a second control unit 404, and a third control unit 406.
[0069] Specifically, the first control unit 402 is configured to control the matching resistors of two target devices in the networking device system to be connected to the circuit, and test whether all devices in the networking device system communicate normally. Among them, a matching resistor is provided in the bus communication circuit of each device in the networking device system, and the matching resistor is used to stabilize the communication waveform. When the matching resistors of the two target devices are connected to the circuit, the matching resistors of the non-target devices in the networking device system are disconnected.
[0070] The second control unit 404 is configured to, when any device in the networking device system is detected to communicate abnormally, at least re-determine one target device, and control the matching resistors of the two target devices to be connected to the circuit until all devices are detected to communicate normally, and determine the two target devices when all devices communicate normally as the head-end device and the tail-end device of the bus.
[0071] The third control unit 406 is configured to, before controlling the networking device system to operate, control the matching resistors of the head-end device and the tail-end device to be connected to the circuit, and control the matching resistors of the non-head-end devices and non-tail-end devices in the networking device system to be disconnected.
[0072] The configuration device of the networking device system provided by the embodiment of the present application controls the matching resistors of two target devices in the networking device system to be connected to the circuit through the first control unit 402, and tests whether all devices in the networking device system communicate normally. Among them, a matching resistor is provided in the bus communication circuit of each device in the networking device system, and the matching resistor is used to stabilize the communication waveform. When the matching resistors of the two target devices are connected to the circuit, the matching resistors of the non-target devices in the networking device system are disconnected; the second control unit 404, when it is detected that any device in the networking device system has abnormal communication, re-determines at least one target device, and controls the matching resistors of the two target devices to be connected to the circuit until it is detected that all devices communicate normally, and determines the two target devices when all devices communicate normally as the head-end device and the tail-end device of the bus; the third control unit 406, before controlling the networking device system to operate, controls the matching resistors of the head-end device and the tail-end device to be connected to the circuit, and controls the matching resistors of the non-head-end devices and non-tail-end devices in the networking device system to be disconnected, which solves the problem in the related art that there are many CAN communication devices in the networking device system, resulting in missed connection or wrong connection of the matching resistors in the CAN communication connection circuit, thereby affecting communication. By testing the head-end device and the tail-end device of the bus and controlling the matching resistors of the head-end device and the tail-end device to be connected to the circuit when controlling the networking device system to operate, the effect of correctly connecting the matching resistors to the CAN communication connection circuit even when there are many CAN communication devices in the networking device system is achieved, ensuring the normal communication of the networking device system.
[0073] Optionally, in the configuration device of the networking device system provided by the embodiment of the present application, the first control unit 402 includes: a first determination module, configured to determine a master device from all devices in the networking device system according to the networking rules, and determine the master device and any device other than the master device as target devices, so as to obtain two target devices; a first control module, configured to control the switching device in the bus communication circuit of each target device to act, and connect the matching resistor to the bus communication circuit through the switching device.
[0074] Optionally, the first control unit 402 further includes: a second determination module, configured to determine the monitoring unit of the master device as the master monitoring unit; a second control module, configured to control the master monitoring unit to send multiple groups of preset signal groups to all slave devices, and collect the bit error rate of each slave device, where the slave device determines the bit error rate according to the received multiple groups of preset signal groups, and all slave devices refer to devices other than the master device in the networking device system; a third determination module, configured to determine that the slave device has abnormal communication when the bit error rate of a slave device is greater than the preset bit error rate; a fourth determination module, configured to determine that the slave device communicates normally when the bit error rate of a slave device is less than or equal to the preset bit error rate.
[0075] Optionally, the first control unit 402 further includes: a fifth determination module, configured to determine the monitoring unit of the master device as the main monitoring unit; a third control module, configured to control the main monitoring unit to send a preset signal to all slave devices other than the master device, and collect the waveforms of the signals received by each slave device through a waveform analyzer, where all slave devices refer to devices other than the master device in the networking device system; a sixth determination module, configured to determine whether the slave devices communicate normally according to the difference between the waveforms of the signals received by the slave devices and the waveform of the preset signal.
[0076] Optionally, the device further includes: a first determination unit, configured to, after controlling the matching resistors of the head-end device and the tail-end device to be connected to the circuit and controlling the matching resistors of the non-head-end devices and non-tail-end devices in the networking device system to be disconnected, determine the device to be replaced in the case of needing to replace a device in the networking device system, and test whether the original devices other than the device to be replaced communicate normally; a fourth control unit, configured to, in the case where the original devices communicate normally, control the device to be replaced to be disconnected, and connect a replacement device at the position of the device to be replaced, where, in the case where the matching resistor of the device to be replaced is connected to the circuit, control the matching resistor of the replacement device to be connected to the circuit, and in the case where the matching resistor of the device to be replaced is disconnected, control the matching resistor of the replacement device to be disconnected.
[0077] Optionally, the device further includes: a fifth control unit, configured to, after testing whether the original devices other than the device to be replaced communicate normally, in the case where any of the original devices has abnormal communication, control the device to be replaced to be disconnected, and connect a replacement device at the position of the device to be replaced, to obtain an updated networking device system; a sixth control unit, configured to control the matching resistors of two target devices in the updated networking device system to be connected to the circuit, and test whether all devices in the networking device system communicate normally. In the case where any device in the networking device system has abnormal communication, at least re-determine one target device, and control the matching resistors of the two target devices to be connected to the circuit until it is tested that all devices communicate normally, where, in the case where the matching resistors of the two target devices are connected to the circuit, the matching resistors of the non-target devices in the networking device system are disconnected.
[0078] Optionally, the apparatus further comprises: a first test unit, configured to, after controlling the matching resistors of the head-end device and the tail-end device to be connected to the circuit and controlling the matching resistors of the non-head-end devices and non-tail-end devices in the network device system to be disconnected, test whether all devices in the network device system communicate normally when the network device system needs to be expanded; a second test unit, configured to, when all devices in the network device system communicate normally, connect the device to be connected to the network device system to obtain an updated network device system, and test whether the device to be connected communicates normally; a seventh control unit, configured to, when the device to be connected communicates abnormally, control the matching resistor of the adjacent device of the device to be connected to be disconnected and control the matching resistor of the device to be connected to be connected to the circuit.
[0079] Optionally, the apparatus further comprises: an eighth control unit, configured to, after testing whether the devices in the network device system communicate normally, when any device in the network device system communicates abnormally, control the matching resistors of two target devices in the network device system to be connected to the circuit and test whether all devices communicate normally. When it is tested that any device communicates abnormally, at least one target device is re-determined, and the matching resistors of the two target devices are controlled to be connected to the circuit until it is tested that all devices communicate normally, and the two obtained target devices are determined as the head-end device or the tail-end device; an access unit, configured to connect the device to be connected to the bus of the network device system in one of the following ways: connecting the device to be connected between the head-end and the tail-end of the bus of the network device system; connecting the device to be connected to the head-end of the bus of the network device system, controlling the matching resistor of the device to be connected to be connected to the circuit, and controlling the matching resistor of the original head-end device to be disconnected; connecting the device to be connected to the tail-end of the bus of the network device system, controlling the matching resistor of the device to be connected to be connected to the circuit, and controlling the matching resistor of the original head-end device to be disconnected.
[0080] The configuration apparatus of the above network device system comprises a processor and a memory. The above first control unit 402, second control unit 404, third control unit 406, etc. are all stored in the memory as program units, and the corresponding functions are realized by the processor executing the above program units stored in the memory.
[0081] The processor contains a kernel, and the kernel retrieves the corresponding program units from the memory. One or more kernels can be set, and by adjusting the kernel parameters, the problem in the related art that there are many CAN communication devices in the network device system, resulting in missed connection or misconnection of the matching resistors in the CAN communication connection circuit, thereby affecting communication, can be solved.
[0082] The memory may include non-permanent memory in a computer-readable medium, in the form of random access memory (RAM) and / or non-volatile memory such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.
[0083] An embodiment of the present application also provides a computer storage medium for storing a program, where, when the program runs, it controls a device where the non-volatile storage medium is located to execute a configuration method of a networking device system.
[0084] An embodiment of the present application also provides an electronic device, Figure 5 which is a schematic diagram of the electronic device provided according to the embodiment of the present application, as Figure 5 shown, the electronic device 50 includes a processor and a memory; computer-readable instructions are stored in the memory, and the processor is used to run the computer-readable instructions, where, when the computer-readable instructions run, they execute a configuration method of a networking device system. The electronic device herein may be a server, a PC, a PAD, a mobile phone, etc.
[0085] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system, or a computer program product. Therefore, the present application can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0086] The present application is described with reference to the flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each flow and / or block in the flowcharts and / or block diagrams, as well as the combination of flows and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to generate a machine, such that the instructions executed by the processor of the computer or other programmable data processing devices generate a device for implementing the specified functions in Figure 1 one process or multiple processes and / or blocks Figure 1 one block or multiple blocks.
[0087] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, such that the instructions stored in the computer-readable memory generate a manufactured article including an instruction device, and the instruction device implements the specified functions in Figure 1 one process or multiple processes and / or blocksFigure 1 the functions specified in one or more boxes
[0088] These computer program instructions can also be loaded onto a computer or other programmable data processing device, so that a series of operation steps are executed on the computer or other programmable device to generate a computer-implemented process. Thus, the instructions executed on the computer or other programmable device provide for implementing the steps of the functions specified in one Figure 1 one process or more processes and / or boxes Figure 1 the steps of the functions specified in one or more boxes
[0089] In a typical configuration, a computing device includes one or more processors (CPUs), an input / output interface, a network interface, and memory.
[0090] The memory may include non-permanent memory in the form of computer-readable media, random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash memory (flash RAM). Memory is an example of computer-readable media.
[0091] Computer-readable media includes permanent and non-permanent, removable and non-removable media and can store information by any method or technology. The information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include transitory computer-readable media, such as modulated data signals and carrier waves.
[0092] It should also be noted that the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, commodity or device comprising a series of elements not only includes those elements, but also includes other elements not expressly listed, or elements inherent to such process, method, commodity or device. Without further limitation, an element defined by the statement "comprising one..." does not exclude the presence of additional identical elements in the process, method, commodity or device comprising the element.
[0093] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, various changes and modifications can be made to the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included within the scope of the claims of the present application.
Claims
1. A configuration method for a networking device system, characterized in that, Devices in a networking device system communicate via a Controller Area Network (CAN) bus. The method includes: Controlling the matching resistors of two target devices in the networking device system to be connected to the circuit, and testing whether all devices in the networking device system communicate normally. Each device in the networking device system has a matching resistor in its bus communication circuit. The matching resistor is used to stabilize the communication waveform. When the matching resistors of the two target devices are connected to the circuit, the matching resistors of non-target devices in the networking device system are disconnected. When it is detected that any device in the networking device system communicates abnormally, at least one more target device is re-determined, and the matching resistors of the two target devices are controlled to be connected to the circuit until it is tested that all devices communicate normally. The two target devices when all devices communicate normally are determined as the head-end device and the tail-end device of the bus. Before controlling the networking device system to operate, control the matching resistors of the head-end device and the tail-end device to be connected to the circuit, and control the matching resistors of non-head-end devices and non-tail-end devices in the networking device system to be disconnected.
2. The method according to claim 1, wherein Controlling the matching resistors of two target devices in the networking device system to be connected to the circuit includes: Determining the master device from all devices in the networking device system according to the networking rules, and determining the master device and any device other than the master device as target devices to obtain two target devices. Controlling the switching devices in the bus communication circuits of each target device to act, and connecting the matching resistors to the bus communication circuits through the switching devices.
3. The method according to claim 2, wherein Testing whether all devices in the networking device system communicate normally includes: Determining the monitoring unit of the master device as the main monitoring unit. Controlling the main monitoring unit to send multiple groups of preset signal groups to all slave devices, and collecting the bit error rate of each slave device. The slave devices determine the bit error rate according to the received multiple groups of preset signal groups. All slave devices refer to devices other than the master device in the networking device system. When the bit error rate of a slave device is greater than the preset bit error rate, it is determined that the slave device communicates abnormally. When the bit error rate of a slave device is less than or equal to the preset bit error rate, it is determined that the slave device communicates normally.
4. The method according to claim 2, characterized in that Testing whether all devices in the networking device system communicate normally includes: Determining the monitoring unit of the master device as the main monitoring unit. Controlling the main monitoring unit to send a preset signal to all slave devices other than the master device, and collecting the waveforms of the signals received by each slave device through a waveform analyzer. All slave devices refer to devices other than the master device in the networking device system. Determining whether each slave device communicates normally according to the difference between the waveform of the signal received by each slave device and the waveform of the preset signal.
5. The method according to claim 1, wherein After controlling the matching resistors of the head-end device and the tail-end device to be connected to the circuit, and controlling the matching resistors of non-head-end devices and non-tail-end devices in the networking device system to be disconnected, the method further includes: In the case where a device in the networking device system needs to be replaced, determine the device to be replaced, and test whether the original devices other than the device to be replaced are communicating normally; When the original devices are communicating normally, control the device to be replaced to disconnect, and connect a replacement device at the position of the device to be replaced. Among them, when the matching resistor of the device to be replaced is connected to the circuit, control the matching resistor of the replacement device to be connected to the circuit, and when the matching resistor of the device to be replaced is disconnected, control the matching resistor of the replacement device to be disconnected.
6. The method according to claim 5, wherein After testing whether the original devices other than the device to be replaced are communicating normally, the method further includes: When any of the original devices has abnormal communication, control the device to be replaced to disconnect, and connect the replacement device at the position of the device to be replaced to obtain an updated networking device system; Control the matching resistors of two target devices in the updated networking device system to be connected to the circuit, and test whether all devices in the networking device system are communicating normally. When any device in the networking device system is tested to have abnormal communication, at least re-determine one target device, and control the matching resistors of the two target devices to be connected to the circuit until all devices are tested to be communicating normally. Among them, when the matching resistors of the two target devices are connected to the circuit, the matching resistors of the non-target devices in the networking device system are disconnected.
7. The method according to claim 1, wherein After controlling the matching resistors of the head-end device and the tail-end device to be connected to the circuit, and controlling the matching resistors of the non-head-end devices and non-tail-end devices in the networking device system to be disconnected, the method further includes: In the case where the networking device system needs to be expanded, test whether all devices in the networking device system are communicating normally; When all devices in the networking device system are communicating normally, connect the device to be connected to the networking device system to obtain an updated networking device system, and test whether the device to be connected is communicating normally; When the device to be connected has abnormal communication, control the matching resistor of the adjacent device of the device to be connected to be disconnected, and control the matching resistor of the device to be connected to be connected to the circuit.
8. The method according to claim 7, wherein After testing whether all devices in the networking device system are communicating normally, the method further includes: When any device in the networking device system has abnormal communication, control the matching resistors of two target devices in the networking device system to be connected to the circuit, and test whether all devices are communicating normally. When any device is tested to have abnormal communication, at least re-determine one target device, and control the matching resistors of the two target devices to be connected to the circuit until all devices are tested to be communicating normally, and determine the two obtained target devices as the head-end device or the tail-end device; Connect the device to be connected to the bus of the networking device system in one of the following ways: connect the device to be connected between the head end and the tail end of the bus of the networking device system; connect the device to be connected to the head end of the bus of the networking device system, control the matching resistor of the device to be connected to be connected to the circuit, and control the matching resistor of the original head-end device to be disconnected; connect the device to be connected to the tail end of the bus of the networking device system, control the matching resistor of the device to be connected to be connected to the circuit, and control the matching resistor of the original head-end device to be disconnected.
9. A configuration device for a network device system, characterized in that, The devices in the networking device system communicate via a Controller Area Network (CAN) bus. The device includes: A first control unit, configured to control the matching resistors of two target devices in the networking device system to be connected to the circuit, and test whether all devices in the networking device system communicate normally. Wherein, a matching resistor is provided in the bus communication circuit of each device in the networking device system, and the matching resistor is used to stabilize the communication waveform. When the matching resistors of the two target devices are connected to the circuit, the matching resistors of the non-target devices in the networking device system are disconnected; A second control unit, configured to, when it is detected that any device in the networking device system communicates abnormally, re-determine at least one target device, and control the matching resistors of the two target devices to be connected to the circuit until it is tested that all devices communicate normally, and determine the two target devices when all devices communicate normally as the head-end device and the tail-end device of the bus; A third control unit, configured to, before controlling the networking device system to operate, control the matching resistors of the head-end device and the tail-end device to be connected to the circuit, and control the matching resistors of the non-head-end devices and non-tail-end devices in the networking device system to be disconnected.
10. The device according to claim 9, characterized in that, The device further includes: A first determination unit, configured to, after controlling the matching resistors of the head-end device and the tail-end device to be connected to the circuit, and controlling the matching resistors of the non-head-end devices and non-tail-end devices in the networking device system to be disconnected, when a device in the networking device system needs to be replaced, determine the device to be replaced, and test whether the original devices other than the device to be replaced communicate normally; A fourth control unit, configured to, when the original devices communicate normally, control the device to be replaced to be disconnected, and connect a replacement device at the position of the device to be replaced. Wherein, when the matching resistor of the device to be replaced is connected to the circuit, control the matching resistor of the replacement device to be connected to the circuit; when the matching resistor of the device to be replaced is disconnected, control the matching resistor of the replacement device to be disconnected.
11. The device according to claim 9, wherein, The device further includes: A first test unit, configured to, after controlling the matching resistors of the head-end device and the tail-end device to be connected to the circuit, and controlling the matching resistors of the non-head-end devices and non-tail-end devices in the networking device system to be disconnected, when the networking device system needs to be expanded, test whether all devices in the networking device system communicate normally; A second test unit, configured to connect a device to be connected to the network device system to obtain an updated network device system when all devices in the network device system communicate normally, and test whether the device to be connected communicates normally; A seventh control unit, configured to control the matching resistor of an adjacent device of the device to be connected to be disconnected and control the matching resistor of the device to be connected to be connected to the circuit when the device to be connected communicates abnormally.
12. A computer storage medium, characterized in that, The computer storage medium is used for storing a program, wherein the program, when running, controls the device where the computer storage medium is located to execute the configuration method of the network device system according to any one of claims 1 to 8.
13. An electronic device, comprising a memory and a processor, characterized in that, A computer program is stored in the memory, and the processor is configured to execute the configuration method of the network device system according to any one of claims 1 to 8 through the computer program.
Citation Information
Cited By
Terminal resistor automatic matching method, device and equipment, medium and CAN bus communication system
CN121193556A