Line addressing method based on CAN communication

Through the addressing method along the line based on CAN communication, the problem of inefficient equipment addressing in the prior art is solved, breakpoint replication and abnormal reporting are realized, and the efficiency and security of addressing coal mine equipment is improved.

CN119766619AActive Publication Date: 2025-04-04ZHENGZHOU HENGDA INTELLIGENT CONTROL TECHNOLOGY CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411438323.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-15
Publication Date
2025-04-04
Estimated Expiration
2044-10-15

AI Technical Summary

Technical Problem

The existing coal mine equipment addressing method cannot quickly detect the breakpoint position when new equipment is connected or old equipment is powered off or reconnected, resulting in insufficiency of addressing, unable to recognize the power outage of the voice module, and the relay equipment cannot generate node reports.

Method used

Using the CAN communication-based addressing method, the device addressing, breakpoint relay, abnormal reporting and network information update are realized through the steps of broadcast clearing the device addressing, monitoring addressing requests, reading unique device codes, handling repeater conflicts, generating topology information, reading network and production information, normal heartbeat monitoring and breakpoint detection.

Benefits of technology

It improves the efficiency of equipment addressing and exception handling, can quickly identify new equipment access or breakpoint equipment, realize breakpoint replication, ensure safe and efficient operation of equipment along the line, and report abnormal situations in a timely manner.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119766619A_ABST
    Figure CN119766619A_ABST
Patent Text Reader

Abstract

The invention provides a along-line addressing method based on CAN (controller area network) communication, which comprises the following steps: judging the online and offline states of equipment by monitoring the heartbeat of all equipment along the line, and if a new addressing request along the line is monitored, immediately stopping all operation for reading equipment information and entering a breakpoint detection mode; and when the breakpoint equipment is detected, reporting is carried out immediately through a callback notification, addressing is carried out again from the breakpoint, and after addressing is completed, equipment information is updated again and reporting is carried out through the callback notification. According to the invention, a breakpoint resuming function of addressing equipment along the line is realized, whether new equipment is accessed or breakpoint equipment is generated can be quickly identified in an addressing service operation process, and different logic processing and exception reporting can be carried out according to different conditions; and rapid identification processing and reporting of abnormal restart caused by insufficient voltage or restart faults of a large number of devices along the line caused by overcurrent in the addressing process of the devices can be supported.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of coal mine equipment addressing, and in particular to a line addressing method based on CAN communication. Background Art

[0002] The CAN line upgrade method based on analog-to-digital conversion can address each device along the line according to the number of devices along the line. However, if a new device is connected or the old device is powered off and reconnected, the line must be re-addressed from the first device, and the location of the newly connected device and the power-off and reconnected device cannot be detected. The compilation logic is too simple and the efficiency is not high enough. In contrast, this addressing logic introduces a rapid detection of breakpoints generated by newly connected devices and power-off and reconnected devices, calculates the breakpoint location and reports it, and then continues to address from the breakpoint, greatly improving the addressing and exception handling efficiency.

[0003] The existing addressing methods have the following disadvantages: 1. The unique identification code of the current equipment along the line is too long, which greatly takes up the addressing time and slows down the addressing speed.

[0004] 2. When new equipment is connected along the line or the equipment is disconnected and reconnected, it is impossible to quickly calculate the breakpoint location and report it, nor is it possible to restart addressing from the breakpoint. It is necessary to re-address from the first device, which greatly reduces the efficiency of re-addressing.

[0005] 3. If there are relay devices along the line, node reporting cannot be generated.

[0006] 4. Since the telephones along the line are composed of an emergency stop input module and a voice module, and the voice module is powered by a battery, if the power supply or battery along the line is abnormal, it is very easy to cause the voice module to lose power, thereby interrupting the call along the line. The previous addressing logic could not quickly and timely identify the disconnection of the telephone voice module in this situation. Summary of the invention

[0007] In view of the defects existing in the existing equipment addressing methods, the present invention provides an addressing method based on CAN communication for realizing the addressing of equipment along the line of an intrinsically safe control main station and an intrinsically safe control substation for mines, breakpoint continuation, reporting of offline status of voice phones along the line, reporting of power supply abnormalities of equipment along the line, reporting of relay node generation, reading and reporting of network information of equipment along the line, and reading and reporting of production information of equipment along the line.

[0008] The solution adopted by the present invention to solve the technical problem is: a method for addressing along the line based on CAN communication, comprising the following steps: Step 1: Broadcast and clear the addresses of devices along the line to ensure that there is no remaining device address information on the network to avoid conflicts in the subsequent addressing process; Step 2: Wait for the addressing request of the equipment along the line. The equipment sends the addressing request after being powered on or reset. The master station monitors the addressing request and responds within the specified time. Otherwise, it may be considered that the equipment is not ready or there is a communication problem. Step 3: Clear the device address of the current requesting device again and then perform addressing. If the device requests addressing, the master station confirms that its address information has been cleared and then assigns it a new unique address. Step 4: Read the unique device code of the current device. If the reading fails, report the relevant exception. If the device code is repeated, restart the device and try to re-address it. Step 5: Turn on the power supply of the current device. After addressing is completed, turn on the power supply of the corresponding device so that it can work normally. Step 6: Handle conflicts between repeaters and devices. When encountering a repeater, increase the number of addressable devices. When multiple master stations are detected, report an exception. Step 7: Generate topological information along the line. After addressing is completed, build the topological structure of the entire network, including the connection relationship between devices; Step 8: Read the device network information and production information, obtain the device network configuration and production information, so that the device service can correctly manage the device; Step nine, perform normal heartbeat monitoring and breakpoint detection through the listening thread. After the device addressing is completed, enter the regular heartbeat monitoring mode to monitor the status of the device. If the device is found to be offline or a new device is added, re-address and information update.

[0009] Furthermore, in step 2, the response time of the master station monitoring the addressing request is 3 seconds.

[0010] Furthermore, when the device code reading in step 4 fails, the exception notification callback is called to report the current device exception. When the device code is read successfully, it is determined whether the device code is repeated. If the device code is repeated, it is reported that the current device power supply voltage is insufficient, resulting in an abnormal restart; when the first device code is repeated, the exception notification callback is called to report an overcurrent restart exception along the current line.

[0011] Furthermore, the network information of the device in step eight includes the IP address, subnet mask and gateway; the production information of the device includes the production code, hardware version and module model.

[0012] Furthermore, in step nine, when the monitoring thread receives a new device addressing request along the line, it sends an interrupt signal, stops all current operations, and then enters the breakpoint detection mode.

[0013] Furthermore, in step nine, the heartbeat status of each device is checked by polling from the first device at intervals of 10ms. The device whose heartbeat is detected to be offline is the breakpoint device. The re-addressing notification callback is called to report the breakpoint address and re-address from the breakpoint. After addressing is completed, steps eight and nine are repeated to update the device information.

[0014] Beneficial effects of the invention: The invention provides an addressing method along the line based on CAN communication, which realizes the breakpoint continuation function of the addressing of the equipment along the line, can quickly identify whether a new device is connected or a breakpoint device is generated during the operation of the addressing service, and can make different logical processing and exception reporting for different situations.

[0015] During the addressing process, each device is distinguished by reading the unique identification code of the device along the line to improve the identifiability of the addressed device. This can support the rapid identification, processing and reporting of abnormal restart caused by insufficient voltage or restart failures of a large number of devices along the line caused by overcurrent during the addressing process.

[0016] The addressing service in the present invention realizes the update reporting of addressing device information and the processing and notification of various abnormal situations in the addressing process by defining a re-addressing notification callback function, a device network and topology information update callback function, a device production information update callback function, a device addressing abnormal information notification callback function, and a relay node generation notification callback function as well as the processing logic of the corresponding abnormal addressing situation, thereby ensuring the safe and efficient completion of addressing along the line and the rapid update of device information. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] Figure 1 It is a block diagram of the addressing process of the present invention. DETAILED DESCRIPTION

[0018] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be described in detail below.

[0019] Embodiment 1: The present invention provides a method for addressing along the line based on CAN communication. During addressing, the method determines the online and offline status of the device by monitoring the heartbeat of all devices along the line. If a new addressing request is detected along the line, all operations of reading device information are immediately stopped and the breakpoint detection mode is entered. When a breakpoint device is detected, it is immediately reported through a callback notification, and addressing is performed again from the breakpoint. After waiting for the addressing to be completed, the device information is updated again and reported through a callback notification.

[0020] The present invention realizes the functions of addressing equipment along the line, continuing the addressing at breakpoints, reporting the offline status of voice phones along the line, reporting power supply anomalies of equipment along the line, reporting the generation of relay nodes, reading and reporting network information of equipment along the line, and reading and reporting production information of equipment along the line of the mine intrinsically safe control main station and the mine intrinsically safe control substation.

[0021] Before creating the MCU devices along the line, it is necessary to first address each device along the line so that each MCU device has a unique address for interactive communication with the master station. The specific addressing process is as follows: After the master station device is powered on, you can choose to turn on or off the power supply along the line. After the device service is started and running, the master station in CS mode will actively turn on the power supply along the corresponding CS line. At this time, since the power supply of the subsequent devices along the line has not been turned on, only the first device is powered on and online; if the master station is already online and needs to be addressed, it will broadcast and clear all device addresses along the line before addressing. At this time, after the microcontroller device receives the clear address command, it will clear its own address and then turn off the lower power supply. After the microcontroller device is powered on and reset or the address is cleared, it will actively send an addressing request to the CAN bus because it has no address. After receiving the addressing request, the master station determines the device type, then addresses the first device and reads the unique identification code. If the reading is successful and the identification code is correct, the lower power supply of the first device is turned on, and then this addressing logic is circulated to address each device along the line in turn.

[0022] like Figure 1 As shown, the addressing process is as follows: 1) Broadcast and clear the addresses of devices along the line 2) Waiting for the addressing request from the equipment along the line (timeout 3 seconds) 3) Clear the device address of the current request device again and then address it 4) Read the unique device code of the current device. If the reading fails, call the exception notification callback to report the current device exception. If the reading succeeds, determine whether the unique identification code of the device is repeated. If it is repeated, report that the current device power supply voltage is insufficient and causes abnormal restart. If the device with the repeated unique identification code is the first device, call the exception notification callback to report the overcurrent restart exception along the current line. 5) Turn on the power supply of the current device 6) If a repeater is addressed during the addressing process, a relay node is generated and reported through a callback notification. At this time, the maximum number of addressable devices is increased by 23 according to the maximum number of devices carried by each repeater; if a message is received from another master station along the line during the addressing process, the exception notification callback is called to report the master station device conflict exception along the line; when the last device is addressed and no addressing request is received again within 3 seconds or the last device type is determined to be a terminal device, the addressing along the line is considered to be completed 7) After all devices along the line are addressed, the topology information along the line is generated immediately and the device service is notified through callback so that the device service can quickly start creating devices, and the core service and node service can also quickly obtain the device topology information 8) Start reading the network information (IP address, subnet mask, gateway) of the devices along the line in sequence, fill in the network information in the topology information of the devices along the line obtained in the previous step, and update it to the device service through callback notification after reading. At the same time, read the production information (production code, hardware version, module model) of the devices along the line in sequence, and fill it based on the topology information of the devices along the line after reading in sequence, and then update it to the device service through callback notification 9) After addressing is completed, the normal heartbeat monitoring mode is turned on and the monitoring state along the line is entered; when the monitoring thread receives a new device addressing request along the line, an interrupt signal is sent, all current operations (network information reading, production information reading, normal heartbeat monitoring) are stopped, and then the breakpoint detection mode is immediately entered, that is, the heartbeat status of each device is checked from the address 1 device at intervals of 10ms. The device with the heartbeat offline is the breakpoint device, and the re-addressing notification callback is called to report the breakpoint address and start addressing from the breakpoint again. After addressing is completed, steps 8 and 9 are repeated to update the device information. If the heartbeats of all devices are normal, it is considered that the breakpoint does not exist and a new device is connected. At this time, the re-addressing notification callback is still called to report the starting address of the newly connected device and continue addressing from the new device address. After addressing is completed, steps 8 and 9 are repeated to update the device information.

[0023] The line addressing method based on CAN communication of the present invention adopts the method of reading and storing the unique identification ID of the device to distinguish different addressed devices, ensure the uniqueness of each device, and support the logical processing of various abnormal situations in the addressing process. The breakpoint continuation scheme is used, and two modes of normal device heartbeat detection and breakpoint device heartbeat detection are introduced, which greatly improves the speed and efficiency of device addressing.

[0024] Abnormal situations such as relay node generation and calculation of the maximum number of addressable devices during the addressing process, abnormal restart of devices caused by overcurrent and insufficient voltage, etc. can be quickly identified and calculated and reported by registering callback notifications.

[0025] The addressing scheme described in the present invention is based on the addressing under the device bus framework. Similarly, the device CAN hand-in-hand method can also be used for addressing, but the addressing efficiency of this method is much lower than the addressing of the device bus mode.

[0026] Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other implementation methods obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

Claims

1. A line addressing method based on CAN communication, characterized in that: The following steps are involved: Step 1: Broadcast and clear the addresses of devices along the line to ensure that there is no remaining device address information on the network to avoid conflicts in the subsequent addressing process; Step 2: Wait for the addressing request of the equipment along the line. The equipment sends the addressing request after being powered on or reset. The master station monitors the addressing request and responds within the specified time. Otherwise, it may be considered that the equipment is not ready or there is a communication problem. Step 3: Clear the device address of the current requesting device again and then perform addressing. If the device requests addressing, the master station confirms that its address information has been cleared and then assigns it a new unique address. Step 4: Read the unique device code of the current device. If the reading fails, report the relevant exception. If the device code is repeated, restart the device and try to re-address it. Step 5: Turn on the power supply of the current device. After addressing is completed, turn on the power supply of the corresponding device so that it can work normally. Step 6: Handle conflicts between repeaters and devices. When encountering a repeater, increase the number of addressable devices. When multiple master stations are detected, report an exception. Step 7: Generate topological information along the line. After addressing is completed, build the topological structure of the entire network, including the connection relationship between devices; Step 8: Read the device network information and production information, obtain the device network configuration and production information, so that the device service can correctly manage the device; Step nine, perform normal heartbeat monitoring and breakpoint detection through the listening thread. After the device addressing is completed, enter the regular heartbeat monitoring mode to monitor the status of the device. If the device is found to be offline or a new device is added, re-address and information update.

2. The method for addressing along the line based on CAN communication according to claim 1, characterized in that: In step 2, the response time of the master station monitoring the addressing request is 3 seconds.

3. The method for addressing along the line based on CAN communication according to claim 1, characterized in that: When the device code reading fails in step 4, the exception notification callback is called to report the current device exception. When the device code is read successfully, it is determined whether the device code is repeated. If the device code is repeated, it is reported that the current device power supply voltage is insufficient, resulting in an abnormal restart. When the first device code is repeated, the exception notification callback is called to report an overcurrent restart exception along the current line.

4. The method for addressing along the line based on CAN communication according to claim 1, characterized in that: The network information of the device in step 8 includes the IP address, subnet mask and gateway; the production information of the device includes the production code, hardware version and module model.

5. The method for addressing along the line based on CAN communication according to claim 1, characterized in that: In step nine, when the monitoring thread receives a new device addressing request along the line, it sends an interrupt signal, stops all current operations, and then enters the breakpoint detection mode.

6. The method for addressing along the line based on CAN communication according to claim 5, characterized in that: In step nine, the heartbeat status of each device is checked by polling from the first device at intervals of 10ms. The device whose heartbeat is detected to be offline is the breakpoint device. The re-addressing notification callback is called to report the breakpoint address and re-address from the breakpoint. After addressing is completed, steps eight and nine are repeated to update the device information.

Citation Information

Patent Citations

  • Automatic topological structure realization method and system

    CN107612714A

  • Multi-device master-slave communication system based on CAN communication and addressing and monitoring method

    CN117319185A

  • Method for recovering ipv6 fault in mobile communication network and pcrf

    US20170026334A1