CN116389505A - Networking method based on CAN bus and computer equipment - Google Patents

Networking method based on CAN bus and computer equipment Download PDF

Info

Publication number
CN116389505A
CN116389505A CN202310324802.7A CN202310324802A CN116389505A CN 116389505 A CN116389505 A CN 116389505A CN 202310324802 A CN202310324802 A CN 202310324802A CN 116389505 A CN116389505 A CN 116389505A
Authority
CN
China
Prior art keywords
target
signal
equipment
slave station
address
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310324802.7A
Other languages
Chinese (zh)
Inventor
林晓明
张威
李晶
张超剑
宋健
汪利敏
蒲韬
管乐丰
黄志峰
叶冬华
桂平隆
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Chint Intelligent Technology Co Ltd
Original Assignee
Shanghai Chint Intelligent Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Chint Intelligent Technology Co Ltd filed Critical Shanghai Chint Intelligent Technology Co Ltd
Priority to CN202310324802.7A priority Critical patent/CN116389505A/en
Publication of CN116389505A publication Critical patent/CN116389505A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/104Peer-to-peer [P2P] networks
    • H04L67/1044Group management mechanisms 
    • H04L67/1046Joining mechanisms
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/40Bus networks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/40Bus networks
    • H04L2012/40208Bus networks characterized by the use of a particular bus standard
    • H04L2012/40215Controller Area Network CAN
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/02Total factory control, e.g. smart factories, flexible manufacturing systems [FMS] or integrated manufacturing systems [IMS]

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Small-Scale Networks (AREA)
  • Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • Mathematical Physics (AREA)
  • Theoretical Computer Science (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

The invention provides a networking method and computer equipment based on a CAN bus, wherein the method comprises the following steps: broadcasting a synchronous signal to all the slave stations based on a preset CAN bus; if a target equipment identification signal fed back according to the synchronous signal is received, generating a target equipment address configuration signal according to the target equipment identification signal, and sending the target equipment address configuration signal to a target slave station corresponding to the target equipment identification signal; and if the address configuration response signal fed back by the target slave station according to the address configuration signal of the target equipment is received, the target slave station is determined to complete networking with the target slave station. The automatic networking of the CAN bus is realized, and the equipment address in the networking process is realized based on the equipment identification signal of the slave station, so that the equipment address and the equipment identification in the equipment identification signal have a mapping relation, and the equipment address CAN be realized based on the equipment identification when the follow-up external server needs to access and control the slave station.

Description

Networking method based on CAN bus and computer equipment
Technical Field
The invention relates to the technical field of communication, in particular to a networking method based on a CAN bus and computer equipment.
Background
At present, the CAN bus is increasingly widely applied to automobiles, medical treatment and industrial sites due to high reliability and high real-time performance. The field devices are connected through the CAN bus to form a local network, and then connected to an external server through a gateway, so that the field devices become a common topological structure in the application of the Internet of things.
In practice, how to perform CAN communication address setting of field devices (and to implement networking between field devices) has been a difficulty in application. In the prior art, the field devices are usually set one by one in the field in a manual mode, but the field devices bring certain inconvenience to field personnel, so that the networking efficiency is quite low, and higher labor cost is required.
Disclosure of Invention
Aiming at the defects existing in the prior art, the invention provides a networking method based on a CAN bus and computer equipment.
In a first aspect, in one embodiment, the present invention provides a networking method based on a CAN bus, including:
broadcasting a synchronous signal to all the slave stations based on a preset CAN bus;
if a target equipment identification signal fed back according to the synchronous signal is received, generating a target equipment address configuration signal according to the target equipment identification signal, and sending the target equipment address configuration signal to a target slave station corresponding to the target equipment identification signal;
The target equipment address configuration signal is used for indicating the target slave station to update the initial equipment address to the target equipment address in the target equipment address configuration signal;
and if the address configuration response signal fed back by the target slave station according to the address configuration signal of the target equipment is received, the target slave station is determined to complete networking with the target slave station.
In one embodiment, generating the target device address configuration signal from the target device identification signal includes:
determining a target device address according to the target device identification signal;
and generating a target device address configuration signal according to the target device address.
In one embodiment, determining the target device address based on the target device identification signal comprises:
determining a target receiving order of the target equipment identification signal;
determining a target equipment number of the target slave station according to the target receiving sequence;
and determining the address of the target device according to the number of the target device.
In one embodiment, determining the target device number of the target secondary station according to the target receiving order comprises:
acquiring a target equipment identifier in a target equipment identifier signal;
according to the target receiving sequence, adding the target equipment identifier into a preset equipment list;
The device number of the target device identified in the device list is determined as the target device number of the target secondary station.
In one embodiment, adding the target device identification to the preset device list includes:
inquiring the equipment list according to the target equipment identifier to obtain an inquiring result;
if the query result indicates that the equipment list does not have the equipment identifier which is the same as the target equipment identifier, the target equipment identifier is added into the equipment list.
In one embodiment, after the step of adding the target device identifier to the device list, the above-mentioned CAN bus-based networking method further includes:
after the first signal is sent to the target slave station, counting a first duration for which the second signal fed back by the target slave station according to the first signal is not detected continuously;
and if the first time length is longer than the preset time length, deleting the target equipment identifier from the equipment list.
In one embodiment, generating a target device address configuration signal according to a target device identification signal, and sending the target device address configuration signal to a target slave station corresponding to the target device identification signal includes:
acquiring a target equipment identifier in a target equipment identifier signal; the target device identification includes a target device type and a target serial number;
Determining the type of the target device as a target version revision code;
obtaining a target LSS address according to the target version revision code and the target serial number;
transmitting a first LSS state switching signal to the target secondary station based on the target LSS address;
the first LSS state switching signal is used for indicating the target slave station to set the LSS state to be a configuration state;
and if the first LSS state response signal fed back by the target slave station according to the first LSS state switching signal is received, generating a target equipment address configuration signal according to the target equipment identification signal, and transmitting the target equipment address configuration signal to the target slave station corresponding to the target equipment identification signal.
In one embodiment, after the step of generating the target device address configuration signal according to the target device identification signal and sending the target device address configuration signal to the target slave station corresponding to the target device identification signal, the networking method based on the CAN bus further includes:
transmitting a second LSS state switching signal to the target secondary station based on the target LSS address;
wherein the second LSS state switching signal is used to instruct the target slave station to set the LSS state to a waiting state;
if a second LSS state response signal fed back by the target slave station according to the second LSS state switching signal is received, sending a working state switching signal to the target slave station based on the target equipment address;
The working state switching signal is used for indicating the target slave station to set the working state to the operation state.
In a second aspect, in one embodiment, the present invention provides a networking method based on a CAN bus, including:
according to the synchronous signal broadcast by the master station, a target equipment identification signal is sent to the master station;
if a target equipment address configuration signal fed back by the master station according to the target equipment identification signal is received, updating the initial equipment address into a target equipment address in the target equipment address configuration signal;
and sending an address configuration response signal to the master station.
In one embodiment, after the step of sending the address configuration response signal to the master station, the networking method based on the CAN bus further includes:
if a working state switching signal sent by the master station is received, setting the working state as an operation state;
transmitting a third signal to the master station;
counting a second duration of a fourth signal which is continuously not detected and fed back by the master station according to the third signal;
and if the second time length is longer than the preset time length, setting the working state to be a pause state.
In a third aspect, in one embodiment, the invention provides a computer device comprising a memory and a processor; the memory stores a computer program and the processor is configured to execute the computer program in the memory to perform the steps in the CAN bus-based networking method in any of the embodiments described above.
By the networking method based on the CAN bus and the computer equipment, corresponding networking programs are respectively configured in the master station and the slave stations, so that the master station broadcasts synchronous signals to all the slave stations based on the preset CAN bus, if a target equipment identification signal fed back according to the synchronous signals is received, a target equipment address configuration signal is sent to a target slave station corresponding to the target equipment identification signal, the target equipment address configuration signal is used for indicating the target slave station to update an initial equipment address into a target equipment address in the target equipment address configuration signal, and if an address configuration response signal fed back by the target slave station according to the target equipment address configuration signal is received, networking with the target slave station is determined to be completed; the automatic networking of the CAN bus is realized, and the equipment address in the networking process is realized based on the equipment identification signal of the slave station, so that the equipment address and the equipment identification in the equipment identification signal have a mapping relation, and the equipment address CAN be realized based on the equipment identification when the follow-up external server needs to access and control the slave station.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings that are needed in the description of the embodiments will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present invention, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic diagram of an application scenario of a networking method based on a CAN bus in an embodiment of the present invention;
FIG. 2 is a flow chart of a networking method based on a CAN bus according to an embodiment of the invention;
FIG. 3 is a schematic diagram of a specific flow for a master station in one embodiment of the invention;
FIG. 4 is a schematic flow diagram of a target secondary station according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of a networking device based on a CAN bus according to an embodiment of the present invention;
fig. 6 is a schematic diagram showing an internal structure of a computer device according to an embodiment of the present invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to fall within the scope of the invention.
In the description of the present invention, it should be understood that the terms "first," "second," and the like are used for descriptive purposes only and are not to be construed as indicating or implying a relative importance or number of technical features indicated. Thus, a feature defining "a first" or "a second" may explicitly or implicitly include one or more of the described features. In the description of the present application, the meaning of "a plurality" is two or more, unless explicitly defined otherwise. In this application, the term "exemplary" is used to mean "serving as an example, instance, or illustration. Any embodiment described herein as "exemplary" is not necessarily to be construed as preferred or advantageous over other embodiments. The following description is presented to enable any person skilled in the art to make and use the invention. In the following description, details are set forth for purposes of explanation. It will be apparent to one of ordinary skill in the art that the present invention may be practiced without these specific details. In other instances, well-known structures and processes have not been described in detail so as not to obscure the description of the invention with unnecessary detail. Thus, the present invention is not intended to be limited to the embodiments shown, but is to be accorded the widest scope consistent with the principles and features disclosed herein.
The networking method based on the CAN bus is applied to the networking device based on the CAN bus, and the networking device based on the CAN bus is arranged in the computer equipment; the computer device may be a terminal, for example, a mobile phone or a tablet computer, and the computer device may also be a server, or a service cluster formed by a plurality of servers.
As shown in fig. 1, fig. 1 is a schematic view of an application scenario of a networking method based on a CAN bus in an embodiment of the present invention, where the application scenario of the networking method based on the CAN bus in the embodiment of the present invention includes a computer device 100 (a networking device based on the CAN bus is integrated in the computer device 100), and a computer readable storage medium corresponding to the networking method based on the CAN bus is run in the computer device 100 to execute steps of the networking method based on the CAN bus.
It may be understood that the computer device in the application scenario of the networking method based on the CAN bus shown in fig. 1, or the apparatus included in the computer device, does not limit the embodiments of the present invention, that is, the number of devices and the type of devices included in the application scenario of the networking method based on the CAN bus, or the number of apparatuses and the type of apparatuses included in each device do not affect the overall implementation of the technical solution in the embodiments of the present invention, and may be calculated as equivalent replacement or derivation of the technical solution claimed in the embodiments of the present invention.
The computer device 100 in the embodiment of the present invention may be an independent device, or may be a device network or a device cluster formed by devices, for example, the computer device 100 described in the embodiment of the present invention includes, but is not limited to, a computer, a network host, a single network device, a plurality of network device sets, or a cloud device formed by a plurality of devices. Wherein, cloud equipment is composed of a large number of computers or network equipment based on Cloud Computing (Cloud Computing).
It will be understood by those skilled in the art that the application scenario shown in fig. 1 is only one application scenario corresponding to the technical solution of the present invention, and does not limit the application scenario of the technical solution of the present invention, and other application scenarios may further include more or fewer computer devices than those shown in fig. 1, or a network connection relationship of the computer devices, for example, only 1 computer device is shown in fig. 1, and it may be understood that the scenario of the network connection method based on the CAN bus may further include one or more other computer devices, which is not limited herein in particular; the computer device 100 may further include a memory for storing information related to the networking method based on the CAN bus.
In addition, in the application scenario of the networking method based on the CAN bus in the embodiment of the present invention, the computer device 100 may be provided with a display device, or the computer device 100 is not provided with a display device and is in communication connection with the external display device 200, where the display device 200 is used to output a result executed by the networking method based on the CAN bus in the computer device. The computer device 100 may access a background database 300 (the background database 300 may be a local memory of the computer device 100, and the background database 300 may also be disposed in the cloud), where the background database 300 stores information related to a networking method based on the CAN bus.
It should be noted that, the application scenario of the networking method based on the CAN bus shown in fig. 1 is only an example, and the application scenario of the networking method based on the CAN bus described in the embodiment of the present invention is for more clearly describing the technical solution of the embodiment of the present invention, and does not constitute a limitation to the technical solution provided by the embodiment of the present invention.
Based on the application scenario of the networking method based on the CAN bus, an embodiment of the networking method based on the CAN bus is provided.
In a first aspect, as shown in fig. 2, in an embodiment, the present invention provides a networking method based on a CAN bus, including:
Step 201, broadcasting a synchronous signal to all the slave stations based on a preset CAN bus;
the execution main body of the networking method based on the CAN bus in the embodiment is a master station corresponding to a slave station, and in general, one master station corresponds to a plurality of slave stations, and the master station is connected with the plurality of slave stations through the CAN bus; it should be noted that, only the connection between the lines exists between the master station and the slave station connected through the CAN bus, and the communication connection is not necessarily provided, that is, normal data transmission is not necessarily completed, and the normal data transmission CAN be realized only after the master station and the slave station are both in a power-on state and networking between the master station and the slave station is completed; that is, when either the master station or the slave station is in a power-down state, or the master station and the slave station are in a power-up state, but the master station and the slave station are not in a networking state, the normal data transmission cannot be realized;
the synchronization signal sent by the master station is used as a trigger signal of a networking process, and the sent time node can be used for indicating the slave station to feed back a corresponding equipment identification signal after the master station is electrified, wherein the equipment identification signal contains equipment identification showing identity information of the slave station;
The synchronous signal is sent in a broadcast mode, namely, the slave stations which are connected to the CAN bus and in a power-on state CAN receive the synchronous signal;
the synchronization signal may be sent once by the master station for a fixed period of time after the master station is powered on, but the mode may make the slave station that fails to receive the synchronization signal sent this time unable to complete networking, for example, the slave station is not connected to the CAN bus, the slave station is not powered on or other abnormal conditions during the period of the current transmission; therefore, for this situation, the master station in this embodiment may also adopt a manner of continuously sending a synchronization signal, so that a newly added slave station may be networked, and flexibility of networking is improved; the continuous transmission may specifically be transmission without interval and transmission with interval, and transmission without interval increases power consumption of the master station, so that transmission with interval is preferable; for the transmission mode with interval, the interval time can be set to 5s, that is, the transmission with fixed duration is performed once every 5s, the fixed duration can be set to 5ms, and the message of the synchronization signal adopting the transmission mode with interval can be as follows:
arbitration section Data 1 Data 2-8 (without complement 0)
80H Counter cnt (cnt is more than or equal to 0 and less than or equal to 255) 00H 00H 00H 00H 00H 00H
The arbitration section part is used for reflecting the priority of the message (namely, occupying the priority of the CAN bus), thereby determining the transmission sequence with other messages and realizing the purpose of collision prevention;
The data 1 part is a count value of a counter, and is used for reflecting the sending times of the synchronous signal in the current sending period, and of course, in other embodiments, other specific meanings can be also reflected;
step 202, if a target equipment identification signal fed back according to the synchronization signal is received, generating a target equipment address configuration signal according to the target equipment identification signal, and sending the target equipment address configuration signal to a target slave station corresponding to the target equipment identification signal;
under normal conditions, the slave station receiving the synchronous signal generates a corresponding equipment identification signal according to the self equipment identification according to a pre-configured networking program, and then feeds back the equipment identification signal to the master station; in this embodiment, in order to embody a difference between a slave station that feeds back a device identification signal and a slave station that does not feed back a device identification signal, the slave station that feeds back the device identification signal is taken as a target slave station;
the target equipment identification signal fed back by the target slave station is used for informing the master station of which slave station is currently responding to the networking, namely, the master station determines to the target slave station, so that the target slave station is configured with equipment address, namely, a target equipment address configuration signal containing the target equipment address is sent to the target slave station;
The external server usually accesses and controls each slave station through the master station, the equipment addresses obtained by networking between the master station and each slave station are only limited to be used by a subnet formed by the master station and the slave stations, and the external server is invalid to the outside, namely the external server cannot know the equipment addresses of each slave station, but the external server can complete the access and control of each slave station through the master station according to the equipment identification because the mapping relation between the equipment addresses of each slave station and the equipment identification is stored in the master station;
the message of the target equipment identification signal fed back by the target slave station may be as follows:
Figure BDA0004152932580000081
wherein, in the message, relative to the synchronous signal, there is a difference in the arbitration section part, and the arbitration section part of the message includes, in addition to the 11-bit basic ID (i.e., 7AAH in the message), an 18-bit extended ID (i.e., an 18-bit random number in the message, which is generated by the target slave station in real time and generated each time the target device identification signal is fed back, thereby avoiding the data field bit filling error caused by CAN bus arbitration);
the data 1-8 part is the equipment identifier of the target slave station, namely the target equipment identifier; specifically, the components of the target device identifier are as follows:
Figure BDA0004152932580000082
The message of the target device address configuration signal sent by the master station to the target slave station may be as follows:
arbitration section CS Data 2 Data 3-8 (without complement 0)
7E5H 11H Node-ID 00H 00H 00H 00H 00H 00H
The arbitration section of the message is not described in detail, and reference is made to the above;
wherein the CS part represents the check data;
wherein, the data 2 part reflects the target equipment address distributed by the master station for the target slave station, namely Node-ID;
the target equipment address configuration signal is used for indicating the target slave station to update the initial equipment address to the target equipment address in the target equipment address configuration signal;
the target equipment address configuration signal comprises the target equipment address configured by the master station to the target slave station, so that the target equipment address can be acquired and set after the target slave station receives the target equipment address configuration signal;
step 203, if an address configuration response signal fed back by the target slave station according to the address configuration signal of the target device is received, the target slave station is determined to complete networking with the target slave station;
after the target slave station finishes the setting of the equipment address, a corresponding address configuration response signal needs to be fed back to inform the master station that the setting of the equipment address is finished, so that after the master station receives the address configuration response signal of the target slave station, the master station can determine that the networking with the target slave station is finished; thereafter, the master station may perform normal data transmission with the target slave station;
The message of the address configuration response signal fed back by the target slave station may be as follows:
arbitration section CS Data 2 Data 3 Data 4 Data 5-8 (without complement 0)
7E4H 11H Node-ID Fault code Specific fault code 00H 00H 00H 00H
Wherein, (1) fault code: 0 indicates that the protocol was successfully completed; 1 indicates Node-ID out of range; 2-254 represent reservations; 255 indicates that a specific error occurs; (2) specific fault codes: if the fault code is equal to 255, the specific fault code indicates that a specific error has occurred, defined by the user;
the method comprises the steps that after receiving an address configuration response signal fed back by a target slave station, a master station further analyzes the address configuration response signal, and only when fault codes indicate that faults do not exist, the master station and the target slave station can be determined to complete networking.
By the networking method based on the CAN bus, corresponding networking programs are respectively configured in the master station and the slave stations, so that the master station broadcasts synchronous signals to all the slave stations based on the preset CAN bus, if a target equipment identification signal fed back according to the synchronous signals is received, a target equipment address configuration signal is sent to a target slave station corresponding to the target equipment identification signal, the target equipment address configuration signal is used for indicating the target slave station to update an initial equipment address into a target equipment address in the target equipment address configuration signal, and if an address configuration response signal fed back by the target slave station according to the target equipment address configuration signal is received, networking with the target slave station is determined to be completed; the automatic networking of the CAN bus is realized, and the equipment address in the networking process is realized based on the equipment identification signal of the slave station, so that the equipment address and the equipment identification in the equipment identification signal have a mapping relation, and the equipment address CAN be realized based on the equipment identification when the follow-up external server needs to access and control the slave station.
In one embodiment, generating the target device address configuration signal from the target device identification signal includes:
determining a target device address according to the target device identification signal;
the target device identifier signal includes a target device identifier, and in this embodiment, a preset address conversion algorithm may be used to calculate the target device identifier, so as to obtain a corresponding target device address;
and generating a target device address configuration signal according to the target device address.
In one embodiment, determining the target device address based on the target device identification signal comprises:
determining a target receiving order of the target equipment identification signal;
the above embodiment has mentioned that, the target device identifier in the target device identifier signal may be directly calculated to obtain the corresponding target device address, but the processing operation in this manner is relatively complex; therefore, in this embodiment, the device address is determined directly according to the receiving order of the device identification signals, and in general, different slave stations feed back the device identification signals at different times, so that different device identification signals have different receiving orders, and if in a specific case, a plurality of device identification signals have the same receiving order, the master station may also pre-order the plurality of device identification signals, so that each device identification signal has a unique receiving order, and the corresponding device address can be determined according to the receiving order of the device identification signals;
Wherein, based on the above analysis, for the target slave station, it is first necessary to determine a target receiving order of the target device identification signal;
determining a target equipment number of the target slave station according to the target receiving sequence;
the receiving sequence and the device number may be the same value, or may be simply mapped according to actual requirements, for example, if the target receiving sequence of the target device identification signal is 1, the target device number of the target slave station may be determined to be 0;
determining a target equipment address according to the number of the target equipment;
the device number and the device address may be the same numerical value, or may be simply mapped according to actual requirements, for example, if the target device number is 0, it may be determined that the target device address of the target slave station is 0+2=2.
In one embodiment, determining the target device number of the target secondary station according to the target receiving order comprises:
acquiring a target equipment identifier in a target equipment identifier signal;
according to the target receiving sequence, adding the target equipment identifier into a preset equipment list;
determining the device number of the target device identifier in the device list as the target device number of the target slave station;
Wherein, the above embodiment has mentioned that the device address may be determined according to the receiving sequence, and in particular, in this embodiment, the device address may be implemented in a device list manner; the device list is used for recording the slave stations of the networking, and the device identification can be used as a unique identification to embody the identity information of the slave stations, so that the slave stations are recorded, and the device identification can be converted into the device identification; for example, if the target receiving order of the target equipment identification signal is 1, the target equipment identification can be added to the equipment list for the first time, and the equipment number of the target equipment identification is set to be 0, so that the target equipment number of the target slave station is 0;
the device list may be as follows:
Figure BDA0004152932580000111
Figure BDA0004152932580000121
it can be seen from the device list that 0 and 1 in the Node-ID are already occupied, so "+2" is needed when determining the device address according to the device number, and 127 in the Node-ID is also already occupied, so that the maximum device number that can be recorded in the device list is 2-126, namely 125 slave stations can be recorded.
In one embodiment, adding the target device identification to the preset device list includes:
inquiring the equipment list according to the target equipment identifier to obtain an inquiring result;
If the query result indicates that the equipment list does not have the equipment identifier which is the same as the target equipment identifier, adding the target equipment identifier into the equipment list;
wherein, the above embodiment has mentioned that the corresponding device address can be determined according to the device identification signal by means of a device list; in this embodiment, the repeated device identifier signal may be further filtered by using the device list, and in particular, the above embodiment has mentioned that the master station may broadcast the synchronization signal in a continuous transmission manner, which may cause the same slave station to feed back the device identifier signal multiple times in an abnormal situation, and if the master station does not have a deduplication function, the processing may be repeated, thereby causing resource waste; therefore, in this embodiment, after receiving the target device identifier signal fed back by the target slave station, comparing and querying the target device identifier with the device identifiers in the device list, if the query result indicates that the device identifier identical to the target device identifier exists in the device list, it is indicated that the target device identifier signal is fed back repeatedly, and the duplication removal is needed, so that the adding step is not executed, so as to save the subsequent processing resources, otherwise, the adding step is normally executed if the target device identifier signal does not exist.
In one embodiment, after the step of adding the target device identifier to the device list, the above-mentioned CAN bus-based networking method further includes:
after the first signal is sent to the target slave station, counting a first duration for which the second signal fed back by the target slave station according to the first signal is not detected continuously;
if the first time length is longer than the preset time length, deleting the target equipment identifier from the equipment list;
in the actual process, the secondary station may continuously send no heartbeat to the primary station due to various conditions, for example, the secondary station is powered down, and when the secondary station is powered down, networking is usually required to be performed again, in order to ensure that the re-networking can be normally performed, the corresponding device identifier in the device list is required to be deleted, so that triggering of the de-duplication function in the above embodiment is avoided;
for the target slave station, judging whether the target slave station is powered down or not, counting a first time length when the second signal is not detected, if the first time length is longer than a preset time length, indicating that the power is turned down, wherein the preset time length can be set to be 5 minutes;
the second signal of the target slave station may refer to any response of the target slave station after the target device identifier is added to the device list, for example, a response to an address configuration signal of the target device, that is, a feedback address configuration response signal (the first signal is the address configuration signal of the target device, and the second signal is the address configuration response signal), and may also be a response to a data requirement of the master station at any time in a normal data transmission stage after the completion of networking;
The second signal of the target secondary station may also be a response of the pointer to the heartbeat detection initiated by the primary station, i.e. both the first signal and the second signal are heartbeat packets.
In one embodiment, generating a target device address configuration signal according to a target device identification signal, and sending the target device address configuration signal to a target slave station corresponding to the target device identification signal includes:
acquiring a target equipment identifier in a target equipment identifier signal; the target device identification includes a target device type and a target serial number;
determining the type of the target device as a target version revision code;
obtaining a target LSS address according to the target version revision code and the target serial number;
transmitting a first LSS state switching signal to the target secondary station based on the target LSS address;
the first LSS state switching signal is used for indicating the target slave station to set the LSS state to be a configuration state;
in the CAN bus protocol, if a parameter configuration is required for a slave station, firstly, the LSS (Layer setting service ) state of the slave station needs to be switched to a configuration state, an LSS address is required for switching the LSS state, in the CAN bus protocol, the LSS address comprises four parts, namely a manufacturer ID, a product code, a version revision code and a serial number, which are respectively unique to each slave station, and the slave station needs to provide the version revision code and the serial number, namely, the device identification in a device identification signal fed back by the slave station comprises the version revision code and the serial number, in practice, the device identification comprises a device type and the serial number, so that the device type needs to be determined as the version revision code, and the manufacturer ID and the product code are shared by all the slave stations, and CAN be stored in the master station in advance;
The first LSS state switching signal includes four sub-signals corresponding to four portions of the LSS address, which are a manufacturer ID signal, a product code signal, a version revision code signal, and a serial number signal, respectively, and four messages corresponding to the first LSS state switching signal may be sequentially as follows:
arbitration section CS Data 2-5 Data 6-8 (without complement 0)
7E5H 40H Manufacturer ID (vendor-ID) 00H 00H 00H
Arbitration section CS Data 2-5 Data 6-8 (without complement 0)
7E5H 41H Product code (product-code) 00H 00H 00H
Arbitration section CS Data 2-5 Data 6-8 (without complement 0)
7E5H 42H Version revision code (version-number) 00H 00H 00H
Arbitration section CS Data 2-5 Data 6-8 (without complement 0)
7E5H 43H Serial number (serial-number) 00H 00H 00H
If a first LSS state response signal fed back by the target slave station according to the first LSS state switching signal is received, generating a target equipment address configuration signal according to the target equipment identification signal, and sending the target equipment address configuration signal to the target slave station corresponding to the target equipment identification signal;
after the target slave station finishes switching of the LSS state, a corresponding first LSS state response signal is fed back to inform the master station of finishing switching, so that after the master station receives the first LSS state response signal, the target slave station can be determined to finish switching, and a corresponding target equipment address configuration signal can be sent to the target slave station;
The message of the first LSS status response signal may be as follows:
arbitration section CS Data 2 Data 6-8 (without complement 0)
7E4H 44H LSS Slave current state 00H 00H 00H
The important part of the message is data 2, which reflects the current state of LSS, so that the master station needs to further analyze the first LSS state response signal after receiving the first LSS state response signal to determine whether the current state of LSS is a configuration state, and if so, the target slave station can be determined to finish switching;
after the step of generating the target device address configuration signal according to the target device identification signal and transmitting the target device address configuration signal to the target slave station corresponding to the target device identification signal, the networking method based on the CAN bus further comprises the following steps:
transmitting a second LSS state switching signal to the target secondary station based on the target LSS address;
wherein the second LSS state switching signal is used to instruct the target slave station to set the LSS state to a waiting state;
if a second LSS state response signal fed back by the target slave station according to the second LSS state switching signal is received, sending a working state switching signal to the target slave station based on the target equipment address;
the working state switching signal is used for indicating the target slave station to set the working state to be an operation state;
The specific roles and details of the second LSS state switching signal and the second LSS state response signal may refer to the first LSS state switching signal and the first LSS state response signal in the above steps, and are not described herein again;
when the target slave station switches the LSS state to the waiting state again, the working state of the target slave station needs to be switched, and the subsequent normal data transmission can be performed only when the working state is the operation state; the operation state is NMT (Network management ) operation state.
In one embodiment, before the step of broadcasting the synchronization signal to all the slaves, the above-mentioned networking method based on the CAN bus further includes:
after power-on, broadcasting reset signals to all the slave stations;
the reset signal is used for indicating the slave station to reset data; the data reset includes a device address reset;
after the master station is powered on, networking needs to be performed again, so that for networking convenience, the slave stations need to be uniformly reset in communication, even if the device addresses of the slave stations return to default addresses.
In an embodiment, in order to make the technical solution of the foregoing embodiment clearer, the foregoing embodiment will be described in combination, as shown in fig. 3, a networking method based on a CAN bus is provided, and the method is applied to a master station, and includes:
Initializing the CAN communication of the slave station and resetting the CAN communication of the slave station;
detecting whether the time from the current time to the start of sending the synchronizing signal of the batch is 5s or not, if yes, starting broadcasting the synchronizing signal of the batch, and if not, continuing waiting;
if a device identification signal containing a device identification sent by the slave station is received, broadcasting a working state switching signal so that the working states of all the slave stations are set to be in a pause state;
determining whether all slave stations sending the equipment identification have completed adding the equipment list, if not, adding the equipment list to each slave station, if so, directly configuring the equipment address to each slave station, namely determining whether an address configuration flag bit group of each slave station is nonzero, if so, considering that the equipment address configuration is completed, and if not, considering that the equipment address configuration is not completed;
for the equipment list addition of each secondary station, firstly determining whether the secondary station exists in the equipment list, if so, directly setting the address configuration flag group flag bit of the secondary station, if not, adding the secondary station into the equipment list, distributing the corresponding equipment address according to the equipment number, and then setting the address configuration flag group flag bit of the secondary station;
For the equipment address configuration of each secondary station, firstly, performing LSS state switching on the secondary station to enable the secondary station to be set into a configuration state, then performing equipment address configuration on the secondary station, namely, sending an equipment address configuration signal, determining whether the configuration is successful or not according to an address configuration response signal, if so, performing LSS state switching on the secondary station again to enable the secondary station to be reset into a waiting state, and if not, deleting the secondary station from an equipment list to wait for the next batch of processing;
resetting the address configuration flag group flag bit of the slave station which executes the equipment address configuration step;
and when the address configuration flag set flag bits corresponding to all the slave stations in the equipment list are zero, switching the working states of all the slave stations in the equipment list so that the slave stations are set to be NMT operation states.
In a second aspect, as shown in fig. 4, in an embodiment, the present invention provides a networking method based on a CAN bus, including:
according to the synchronous signal broadcast by the master station, a target equipment identification signal is sent to the master station;
the execution main body of the networking method based on the CAN bus in the embodiment is a target slave station, namely a slave station under a certain normal condition (which CAN receive the synchronous signal and CAN feed back the corresponding equipment identification signal);
After receiving the synchronous signal, delaying for random time and then sending a target equipment identification signal containing a target equipment identification;
if a target equipment address configuration signal fed back by the master station according to the target equipment identification signal is received, updating the initial equipment address into a target equipment address in the target equipment address configuration signal;
according to the networking program of the master station, the master station starts to configure the device address 1s after the target slave station feeds back the target device identification signal;
and sending an address configuration response signal to the master station.
By the networking method based on the CAN bus, corresponding networking programs are respectively configured in the master station and the slave stations, so that the master station broadcasts synchronous signals to all the slave stations based on the preset CAN bus, if a target equipment identification signal fed back according to the synchronous signals is received, a target equipment address configuration signal is sent to a target slave station corresponding to the target equipment identification signal, the target equipment address configuration signal is used for indicating the target slave station to update an initial equipment address into a target equipment address in the target equipment address configuration signal, and if an address configuration response signal fed back by the target slave station according to the target equipment address configuration signal is received, networking with the target slave station is determined to be completed; the automatic networking of the CAN bus is realized, and the equipment address in the networking process is realized based on the equipment identification signal of the slave station, so that the equipment address and the equipment identification in the equipment identification signal have a mapping relation, and the equipment address CAN be realized based on the equipment identification when the follow-up external server needs to access and control the slave station.
In one embodiment, after the step of sending the address configuration response signal to the master station, the networking method based on the CAN bus further includes:
if a working state switching signal sent by the master station is received, setting the working state as an operation state;
transmitting a third signal to the master station;
counting a second duration of a fourth signal which is continuously not detected and fed back by the master station according to the third signal;
if the second time length is longer than the preset time length, setting the working state to be a pause state;
it has been mentioned in the embodiment of the first aspect that the master station may delete the device list by the first time when the heartbeat of the slave station is not detected, so as to realize the function of de-duplication, and solve the abnormal situation that the slave station is powered down; in the actual process, the master station may also generate a power failure condition, so in this embodiment, the slave station may also detect the heartbeat of the master station, and if the second time period for which the heartbeat of the master station is not detected to be continuous is longer than the preset time period, consider that the master station is powered down, at this time, set the working state to a suspension state, and avoid interference caused by continuously sending invalid data, thereby solving the abnormal condition that the master station is powered down;
in other embodiments, after detecting that the master station is powered down, the master station may also directly reset its CAN communication.
In a third aspect, as shown in fig. 5, in one embodiment, the present invention provides a networking device based on a CAN bus, including:
a synchronous broadcasting module 301, configured to broadcast a synchronous signal to all the slave stations based on a preset CAN bus;
the address configuration module 302 is configured to generate a target device address configuration signal according to the target device identification signal if a target device identification signal fed back according to the synchronization signal is received, and send the target device address configuration signal to a target slave station corresponding to the target device identification signal;
the target equipment address configuration signal is used for indicating the target slave station to update the initial equipment address to the target equipment address in the target equipment address configuration signal;
the networking confirmation module 303 is configured to determine that networking with the target slave station is completed if an address configuration response signal fed back by the target slave station according to the target device address configuration signal is received.
By the networking device based on the CAN bus, corresponding networking programs are respectively configured in the master station and the slave stations, so that the master station broadcasts synchronous signals to all the slave stations based on the preset CAN bus, if a target equipment identification signal fed back according to the synchronous signals is received, a target equipment address configuration signal is sent to a target slave station corresponding to the target equipment identification signal, the target equipment address configuration signal is used for indicating the target slave station to update an initial equipment address into a target equipment address in the target equipment address configuration signal, and if an address configuration response signal fed back by the target slave station according to the target equipment address configuration signal is received, networking with the target slave station is determined to be completed; the automatic networking of the CAN bus is realized, and the equipment address in the networking process is realized based on the equipment identification signal of the slave station, so that the equipment address and the equipment identification in the equipment identification signal have a mapping relation, and the equipment address CAN be realized based on the equipment identification when the follow-up external server needs to access and control the slave station.
In a fourth aspect, in one embodiment, the present invention provides a computer device comprising a master station or a target slave station in any of the embodiments described above, as shown in fig. 6, which shows the structure of the computer device to which the present invention relates, in particular:
the computer device may include one or more processors 401 of a processing core, memory 402 of one or more computer readable storage media, a power supply 403, and an input unit 404, among other components. Those skilled in the art will appreciate that the architecture of the computer device shown in fig. 6 is not limiting of the computer device, and may include more or fewer components than shown, or may combine certain components, or a different arrangement of components. Wherein:
the processor 401 is a control center of the computer device, connects various parts of the entire computer device using various interfaces and lines, and performs various functions of the computer device and processes data by running or executing software programs and/or modules stored in the memory 402, and calling data stored in the memory 402, thereby performing overall monitoring of the computer device. Optionally, processor 401 may include one or more processing cores; preferably, the processor 401 may integrate an application processor and a modem processor, wherein the application processor mainly processes an operating system, a user interface, a computer program, etc., and the modem processor mainly processes wireless communication. It will be appreciated that the modem processor described above may not be integrated into the processor 401.
The memory 402 may be used to store software programs and modules, and the processor 401 executes various functional applications and data processing by executing the software programs and modules stored in the memory 402. The memory 402 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, a computer program (such as a sound playing function, an image playing function, etc.) required for at least one function, and the like; the storage data area may store data created according to the use of the server, etc. In addition, memory 402 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, the memory 402 may also include a memory controller to provide the processor 401 with access to the memory 402.
The computer device further comprises a power supply 403 for supplying power to the various components, preferably the power supply 403 may be logically connected to the processor 401 by a power management system, so that functions of charge, discharge, and power consumption management may be performed by the power management system. The power supply 403 may also include one or more of any of a direct current or alternating current power supply, a recharging system, a power failure detection circuit, a power converter or inverter, a power status indicator, and the like.
The computer device may also include an input unit 404, which input unit 404 may be used to receive input numeric or character information and to generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control.
Although not shown, the computer device may further include a display unit or the like, which is not described herein. In particular, in this embodiment, when the computer device is the master station, the processor 401 in the computer device loads executable files corresponding to the processes of one or more computer programs into the memory 402 according to the following instructions, and the processor 401 executes the computer programs stored in the memory 402 to perform the following steps:
broadcasting a synchronous signal to all the slave stations based on a preset CAN bus;
if a target equipment identification signal fed back according to the synchronous signal is received, generating a target equipment address configuration signal according to the target equipment identification signal, and sending the target equipment address configuration signal to a target slave station corresponding to the target equipment identification signal;
the target equipment address configuration signal is used for indicating the target slave station to update the initial equipment address to the target equipment address in the target equipment address configuration signal;
And if the address configuration response signal fed back by the target slave station according to the address configuration signal of the target equipment is received, the target slave station is determined to complete networking with the target slave station.
Through the computer equipment, corresponding networking programs are respectively configured in the master station and the slave stations, so that the master station broadcasts synchronous signals to all the slave stations based on a preset CAN bus, if a target equipment identification signal fed back according to the synchronous signals is received, a target equipment address configuration signal is sent to a target slave station corresponding to the target equipment identification signal, the target equipment address configuration signal is used for indicating the target slave station to update an initial equipment address into a target equipment address in the target equipment address configuration signal, and if an address configuration response signal fed back by the target slave station according to the target equipment address configuration signal is received, networking with the target slave station is determined to be completed; the automatic networking of the CAN bus is realized, and the equipment address in the networking process is realized based on the equipment identification signal of the slave station, so that the equipment address and the equipment identification in the equipment identification signal have a mapping relation, and the equipment address CAN be realized based on the equipment identification when the follow-up external server needs to access and control the slave station.
It will be appreciated by those of ordinary skill in the art that all or part of the steps of any of the methods of the above embodiments may be performed by a computer program, or by computer program control related hardware, which may be stored in a computer readable storage medium and loaded and executed by a processor.
In a fourth aspect, in one embodiment, the present invention provides a storage medium having stored therein a plurality of computer programs, the computer programs being loadable by a processor, to perform the steps of:
broadcasting a synchronous signal to all the slave stations based on a preset CAN bus;
if a target equipment identification signal fed back according to the synchronous signal is received, generating a target equipment address configuration signal according to the target equipment identification signal, and sending the target equipment address configuration signal to a target slave station corresponding to the target equipment identification signal;
the target equipment address configuration signal is used for indicating the target slave station to update the initial equipment address to the target equipment address in the target equipment address configuration signal;
and if the address configuration response signal fed back by the target slave station according to the address configuration signal of the target equipment is received, the target slave station is determined to complete networking with the target slave station.
Through the storage medium, corresponding networking programs are respectively configured in the master station and the slave stations, so that the master station broadcasts synchronous signals to all the slave stations based on a preset CAN bus, if a target equipment identification signal fed back according to the synchronous signals is received, a target equipment address configuration signal is sent to a target slave station corresponding to the target equipment identification signal, the target equipment address configuration signal is used for indicating the target slave station to update an initial equipment address into a target equipment address in the target equipment address configuration signal, and if an address configuration response signal fed back by the target slave station according to the target equipment address configuration signal is received, networking with the target slave station is determined to be completed; the automatic networking of the CAN bus is realized, and the equipment address in the networking process is realized based on the equipment identification signal of the slave station, so that the equipment address and the equipment identification in the equipment identification signal have a mapping relation, and the equipment address CAN be realized based on the equipment identification when the follow-up external server needs to access and control the slave station.
It will be appreciated by those of ordinary skill in the art that any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory. The nonvolatile memory can include Read Only Memory (ROM), programmable ROM (PROM), electrically Programmable ROM (EPROM), electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double Data Rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink), DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), among others.
The steps in the networking method based on the CAN bus in any embodiment provided by the present invention CAN be executed by the computer program stored in the storage medium, so that the beneficial effects that CAN be achieved by the networking method based on the CAN bus in any embodiment provided by the present invention CAN be achieved, which are detailed in the previous embodiments and are not described herein.
The specific implementation of each operation above may be referred to the previous embodiments, and will not be described herein.
In the foregoing embodiments, the descriptions of the embodiments are focused on, and the portions of one embodiment that are not described in detail in the foregoing embodiments may be referred to in the foregoing detailed description of other embodiments, which are not described herein again.
The networking method and the computer equipment based on the CAN bus provided by the invention are described in detail, and specific examples are applied to illustrate the principle and the implementation mode of the invention, and the description of the above examples is only used for helping to understand the method and the core idea of the invention; meanwhile, as those skilled in the art will have variations in the specific embodiments and application scope in light of the ideas of the present invention, the present description should not be construed as limiting the present invention.
The technical features of the above embodiments may be arbitrarily combined, and all possible combinations of the technical features in the above embodiments are not described for brevity of description, however, as long as there is no contradiction between the combinations of the technical features, they should be considered as the scope of the description.

Claims (11)

1. The networking method based on the CAN bus is characterized by comprising the following steps of:
broadcasting a synchronous signal to all the slave stations based on a preset CAN bus;
if a target equipment identification signal fed back according to the synchronous signal is received, generating a target equipment address configuration signal according to the target equipment identification signal, and sending the target equipment address configuration signal to a target slave station corresponding to the target equipment identification signal;
the target equipment address configuration signal is used for indicating the target slave station to update an initial equipment address to a target equipment address in the target equipment address configuration signal;
and if the address configuration response signal fed back by the target slave station according to the address configuration signal of the target equipment is received, the target slave station is determined to complete networking with the target slave station.
2. The CAN bus based networking method of claim 1, wherein the generating a target device address configuration signal from the target device identification signal comprises:
Determining the target equipment address according to the target equipment identification signal;
and generating the target equipment address configuration signal according to the target equipment address.
3. The CAN bus based networking method of claim 2, wherein the determining the target device address from the target device identification signal comprises:
determining a target receiving order of the target equipment identification signal;
determining a target equipment number of the target slave station according to the target receiving sequence;
and determining the target equipment address according to the target equipment number.
4. The CAN bus-based networking method of claim 3, wherein the determining the target device number of the target slave station according to the target reception order comprises:
acquiring a target equipment identifier in the target equipment identifier signal;
according to the target receiving sequence, adding the target equipment identifier into a preset equipment list;
and determining the device number of the target device identified in the device list as the target device number of the target slave station.
5. The CAN bus-based networking method of claim 4, wherein the adding the target device identification to a preset device list comprises:
Inquiring the equipment list according to the target equipment identifier to obtain an inquiry result;
and if the query result indicates that the equipment list does not have the equipment identifier which is the same as the target equipment identifier, adding the target equipment identifier into the equipment list.
6. The CAN bus based networking method of claim 5, further comprising, after the step of adding the target device identification to the device list:
after a first signal is sent to the target slave station, counting a first duration for which a second signal fed back by the target slave station according to the first signal is not detected continuously;
and if the first time length is longer than the preset time length, deleting the target equipment identifier from the equipment list.
7. The CAN bus-based networking method of claim 1, wherein the generating a target device address configuration signal from the target device identification signal, and transmitting the target device address configuration signal to a target slave station corresponding to the target device identification signal, comprises:
acquiring a target equipment identifier in the target equipment identifier signal; the target equipment identifier comprises a target equipment type and a target serial number;
Determining the target equipment type as a target version revision code;
obtaining a target LSS address according to the target version revision code and the target serial number;
transmitting a first LSS state switching signal to the target slave station based on the target LSS address;
wherein the first LSS state switching signal is configured to instruct the target slave station to set an LSS state to a configuration state;
and if a first LSS state response signal fed back by the target slave station according to the first LSS state switching signal is received, generating a target equipment address configuration signal according to the target equipment identification signal, and sending the target equipment address configuration signal to the target slave station corresponding to the target equipment identification signal.
8. The CAN bus-based networking method of claim 7, further comprising, after the step of generating a target device address configuration signal from the target device identification signal and transmitting the target device address configuration signal to a target slave station to which the target device identification signal corresponds:
transmitting a second LSS state switching signal to the target slave station based on the target LSS address; the second LSS state switching signal is configured to instruct the target slave station to set an LSS state to a waiting state;
If a second LSS state response signal fed back by the target slave station according to the second LSS state switching signal is received, sending a working state switching signal to the target slave station based on the target equipment address;
the working state switching signal is used for indicating the target slave station to set the working state to be an operation state.
9. The networking method based on the CAN bus is characterized by comprising the following steps of:
according to the synchronous signal broadcasted by the master station, a target equipment identification signal is sent to the master station;
if a target equipment address configuration signal fed back by the master station according to the target equipment identification signal is received, updating an initial equipment address into a target equipment address in the target equipment address configuration signal;
and sending an address configuration response signal to the master station.
10. The CAN bus based networking method of claim 9, further comprising, after the step of sending an address configuration reply signal to the master station:
if the working state switching signal sent by the master station is received, setting the working state as an operation state;
transmitting a third signal to the master station;
counting a second duration in which the fourth signal fed back by the master station according to the third signal is continuously not detected;
And if the second time length is longer than the preset time length, setting the working state to be a pause state.
11. A computer device comprising a memory and a processor; the memory stores a computer program, the processor being configured to execute the computer program in the memory to perform the steps of the CAN bus based networking method of any one of claims 1 to 8 or the steps of the CAN bus based networking method of any one of claims 9 to 10.
CN202310324802.7A 2023-03-29 2023-03-29 Networking method based on CAN bus and computer equipment Pending CN116389505A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310324802.7A CN116389505A (en) 2023-03-29 2023-03-29 Networking method based on CAN bus and computer equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310324802.7A CN116389505A (en) 2023-03-29 2023-03-29 Networking method based on CAN bus and computer equipment

Publications (1)

Publication Number Publication Date
CN116389505A true CN116389505A (en) 2023-07-04

Family

ID=86972591

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310324802.7A Pending CN116389505A (en) 2023-03-29 2023-03-29 Networking method based on CAN bus and computer equipment

Country Status (1)

Country Link
CN (1) CN116389505A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108989169A (en) * 2018-08-23 2018-12-11 成都圭目机器人有限公司 The method of CAN bus based module intelligence ad hoc network
CN113395198A (en) * 2021-06-16 2021-09-14 广州极飞科技股份有限公司 Networking method and device of equipment and data transmission system
CN114567547A (en) * 2021-04-19 2022-05-31 浙江正泰电器股份有限公司 Equipment networking method, system, device, communication management equipment and storage medium
CN115442333A (en) * 2022-08-19 2022-12-06 上海长江电气设备集团有限公司 Self-networking method and device based on RS485 communication, computer equipment and medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108989169A (en) * 2018-08-23 2018-12-11 成都圭目机器人有限公司 The method of CAN bus based module intelligence ad hoc network
CN114567547A (en) * 2021-04-19 2022-05-31 浙江正泰电器股份有限公司 Equipment networking method, system, device, communication management equipment and storage medium
CN113395198A (en) * 2021-06-16 2021-09-14 广州极飞科技股份有限公司 Networking method and device of equipment and data transmission system
CN115442333A (en) * 2022-08-19 2022-12-06 上海长江电气设备集团有限公司 Self-networking method and device based on RS485 communication, computer equipment and medium

Similar Documents

Publication Publication Date Title
TWI446683B (en) Distributed battery management system and method for distributing identifications thereof
US9100397B2 (en) BACnet MS/TP automatic MAC addressing
CN113114793B (en) Slave node address competition method and device and electrical appliance system
EP4274190A1 (en) Smart device control method and apparatus, electronic device, and computer readable medium
CN110445700B (en) Master-slave communication system and method and terminal equipment
US20170242815A1 (en) Sas system, sas system traversal method, and apparatus
US11991779B2 (en) Subscription message processing method and apparatus, and computer device and storage medium
CN111355600B (en) Main node determining method and device
CN110677347A (en) Method for registering and discovering services of micro-services
CN112511662B (en) System communication address generation and distribution method and device and air conditioning system
CN113872799A (en) Method, node and system for managing node
CN116389505A (en) Networking method based on CAN bus and computer equipment
US8855693B2 (en) Method and apparatus for controlling wireless devices
EP3614789A1 (en) Rf transceiver and wireless mesh network
CN113612868B (en) Equipment address allocation method, device and system
CN113660353B (en) Method, device, equipment and medium for managing Provisioner address based on Bluetooth Mesh
EP4180947A1 (en) Software upgrading method, apparatus, and system
CN106028303B (en) Intelligent device discovery method and device
CN113438781B (en) Control method, control device and lighting system
CN114598605A (en) Multi-device management method, first device, center device and storage medium
CN111010286A (en) Intelligent registration method and device based on serial bus, electronic equipment and medium
CN112052214A (en) Communication method and device for multi-machine number competition
US10795848B2 (en) Dual way communication method, system, and master device thereof
CN112214437A (en) Storage device, communication method and device and computer readable storage medium
CN109982450B (en) Communication link repairing method, device, coordinator and system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination