CN216565184U - Automatic node identifier distribution device based on CAN bus - Google Patents

Automatic node identifier distribution device based on CAN bus Download PDF

Info

Publication number
CN216565184U
CN216565184U CN202120496871.2U CN202120496871U CN216565184U CN 216565184 U CN216565184 U CN 216565184U CN 202120496871 U CN202120496871 U CN 202120496871U CN 216565184 U CN216565184 U CN 216565184U
Authority
CN
China
Prior art keywords
node
bus
slave
master
master node
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.)
Active
Application number
CN202120496871.2U
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.)
Fussen Technology Co ltd
Original Assignee
Fussen 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 Fussen Technology Co ltd filed Critical Fussen Technology Co ltd
Priority to CN202120496871.2U priority Critical patent/CN216565184U/en
Application granted granted Critical
Publication of CN216565184U publication Critical patent/CN216565184U/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Small-Scale Networks (AREA)

Abstract

The embodiment of the application belongs to the technical field of automation, and relates to a node identification automatic allocation device based on a CAN bus, which comprises: the CAN bus control system comprises a setting module, a master control module and a slave control module, wherein the setting module is used for setting a CAN bus into a master-master multi-slave mode and determining a master node of the CAN bus; the connection establishing module is used for initializing all slave nodes of the CAN bus and establishing communication connection with the master node, wherein the communication connection comprises direct connection; and the distribution module is used for sequentially configuring the slave nodes through the direct connection by the master node and distributing node identifiers to each slave node. According to the method and the device, the ID identification is not manually allocated to each slave node and the codes are independently burned, so that the workload of manual maintenance and modification is reduced, and the production efficiency is improved.

Description

Automatic node identifier distribution device based on CAN bus
Technical Field
The application relates to the technical field of automation, in particular to a node identification automatic distribution device based on a CAN bus.
Background
Today, modularization is promoted in program development, particularly software and hardware in embedded products, and the modularization is promoted, namely the same set of software and hardware can bear different functions at different positions. In the CAN bus of the existing CBCT (Cone beam CT), each node needs to be distinguished, and the ID of each node needs to be different, which leads to that the software of each node needs to distinguish the ID number, so that one node corresponds to one set of codes, and modularization in the true sense cannot be achieved.
The prior art has the following disadvantages: 1. because of the ID problem, each node needs to have a set of independent codes for maintenance, the maintenance difficulty is increased, the maintenance cost is increased, and the maintenance difficulty and the maintenance cost are increased along with the increase of the number of the nodes. 2. After the production process is started, research and development personnel need to give the burning files corresponding to each set of nodes according to the number of the nodes, and if the subsequent burning files are modified, each burning file needs to be modified, so that the process conversion is complicated. 3. In the production process, production personnel need to accurately distinguish the ID corresponding to each board card, download the burning file corresponding to the ID, make a record that each board card downloads the burning file of the ID, and install the board card at a position corresponding to a machine according to the ID, so that a plurality of process controls need to be added, the production flow is complicated, and the production efficiency is influenced.
SUMMERY OF THE UTILITY MODEL
The embodiment of the application aims to provide a node identifier automatic distribution device based on a CAN bus, which CAN realize high modularization of software by automatically distributing identifiers to nodes through the CAN bus, reduce the workload of manual maintenance and modification and improve the production efficiency.
In order to solve the above technical problem, an embodiment of the present application provides a method for automatically allocating node identifiers based on a CAN bus, including the following steps:
setting a CAN bus into a master multi-slave mode, and determining a master node of the CAN bus;
initializing all slave nodes of the CAN bus, and establishing communication connection with the master node, wherein the communication connection comprises direct connection;
and the master node sequentially configures the slave nodes through the direct connection and allocates a node identifier to each slave node.
Further, the method for automatically allocating node identifiers based on the CAN bus is characterized in that the direct connection is an IO direct connection between the slave node and the master node.
Further, the method for automatically allocating node identifiers based on the CAN bus is characterized in that the communication connection further includes data connection, the master node sequentially configures the slave nodes through the direct connection, and allocating a node identifier to each slave node includes:
each slave node is in a broadcast receiving state;
the master node broadcasts an identification to all slave nodes to be configured through the data connection;
the master node is directly connected with a slave node to be configured through the IO, and the slave node to be configured configures the node according to the identifier;
and repeating the process until all the slave nodes are configured.
Further, the method for automatically allocating node identifiers based on the CAN bus is characterized in that the master node is directly connected to and pulled up by the IO to-be-configured slave node, and the step of configuring the slave node to be configured with the node identifier further includes:
and after the slave node to be configured completes the configuration of the node, sending confirmation information to the master node through the data connection.
Further, the automatic node identifier allocation method based on the CAN bus is characterized in that a master node identifier is preset to determine a master node of the CAN bus.
Further, the automatic node identifier allocation method based on the CAN bus is characterized in that the slave node after configuration stores the preset master node identifier and communicates with the master node through the master node identifier.
In order to solve the above technical problem, an embodiment of the present application further provides an automatic node identifier allocating apparatus based on a CAN bus, which adopts the following technical solutions:
a node identification automatic distribution device based on a CAN bus comprises:
the CAN bus control system comprises a setting module, a master control module and a slave control module, wherein the setting module is used for setting a CAN bus into a master-master multi-slave mode and determining a master node of the CAN bus;
the connection establishing module is used for initializing all slave nodes of the CAN bus and establishing communication connection with the master node, wherein the communication connection comprises direct connection;
and the distribution module is used for sequentially configuring the slave nodes by the master node through the direct connection and distributing node identifiers to each slave node.
In order to solve the above technical problem, an embodiment of the present application further provides a CBCT system based on automatic allocation of CAN bus node identifiers, which adopts the following technical solutions:
the CAN bus, the host node and the slave node are in communication connection and configuration by the CAN bus-based node identification automatic allocation method, so that functions of all parts of the CBCT system are realized.
In order to solve the above technical problem, an embodiment of the present application further provides a computer device, which adopts the following technical solutions:
the computer equipment comprises a memory and a processor, wherein a computer program is stored in the memory, and the processor realizes the steps of the automatic node identification distribution method based on the CAN bus when executing the computer program.
In order to solve the above technical problem, an embodiment of the present application further provides a computer-readable storage medium, which adopts the following technical solutions:
the computer-readable storage medium has stored thereon a computer program which, when being executed by a processor, carries out the steps of the CAN-bus based node identification automatic allocation method.
In the embodiment, a CAN bus is set to be in a one-master multi-slave mode, and a master node of the CAN bus is determined; all slave nodes of the CAN bus are initialized, and communication connection is established with the master node, wherein the communication connection comprises direct connection; and the master node sequentially configures the slave nodes through the direct connection and allocates a node identifier to each slave node. Based on the master-slave mode of the CAN bus, the master node sequentially configures slave node identifiers in the CAN bus through communication connection including direct connection, so that each slave node automatically obtains an identifier capable of communicating with each other, the slave nodes do not need to consider the problem of self ID, one set of software CAN be burnt for a plurality of sets of nodes, the software achieves high modularization, the ID identifiers are not manually distributed for each slave node, burning of codes is not separately carried out, the workload of manual maintenance and modification is reduced, and the production efficiency is improved.
Drawings
In order to more clearly illustrate the solution of the present application, the drawings needed for describing the embodiments of the present application will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present application, and that other drawings can be obtained by those skilled in the art without inventive effort.
FIG. 1 is a flow diagram of one embodiment of a CAN bus based node identification automatic assignment method according to the present application;
FIG. 2 is a flow diagram of one embodiment of step 103 of FIG. 1;
FIG. 3 is a block flow diagram of one embodiment of automatically assigning identities by a master node according to the present application;
FIG. 4 is a block flow diagram illustrating an embodiment of the present application in which a slave node cooperates with a master node to perform automatic identifier assignment;
FIG. 5 is a schematic structural diagram of one embodiment of an automatic node identifier assignment device based on a CAN bus according to the present application;
fig. 6 is a schematic structural diagram of a CBCT system based on automatic allocation of CAN bus node identifiers according to an embodiment of the present disclosure;
FIG. 7 is a schematic block diagram of one embodiment of a computer device according to the present application.
Detailed Description
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs; the terminology used in the description of the application herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application; the terms "including" and "having," and any variations thereof, in the description and claims of this application and the description of the above figures are intended to cover non-exclusive inclusions. The terms "first," "second," and the like in the description and claims of this application or in the above-described drawings are used for distinguishing between different objects and not for describing a particular order.
Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the application. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It is explicitly and implicitly understood by one skilled in the art that the embodiments described herein can be combined with other embodiments.
In order to make the technical solutions better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings.
The following related background is first introduced. CBCT is a short name of Cone beam CT, i.e. Cone beam CT, and as the name suggests, is a Cone beam projection computer reconstruction tomographic imaging apparatus, whose principle is that an X-ray generator makes a ring DR (digital projection) around a projection body with a low dose (usually, a bulb current is about 10 ma). Then the data obtained in the intersection after digital projection for a plurality of times (180-360 times, different according to different products) around the projection body are 'recombined' in a computer, and then a three-dimensional image is obtained. The projection principle of CBCT acquisition data is completely different from that of conventional sector scan CT, and the algorithm principle of later computerized reconstruction is similar. Communication is required between various parts of the CBCT product, which typically employs a CAN bus. The CAN is a short name for a Controller Area Network (CAN), and is a serial communication Network capable of realizing node distributed real-time control.
Referring to fig. 1, fig. 1 is a flow chart illustrating an embodiment of a method for CAN bus based node identification automatic assignment according to the present application. The automatic node identifier distribution method based on the CAN bus comprises the following steps:
step 101, setting a CAN bus into a master-slave mode and determining a master node of the CAN bus;
102, initializing all slave nodes of the CAN bus, and establishing communication connection with the master node, wherein the communication connection comprises direct connection;
and 103, sequentially configuring the slave nodes by the master node through the direct connection, and distributing node identifiers to each slave node.
In this embodiment, the master node of the CAN bus is determined by presetting a master node identifier. Firstly, the CAN bus communication mode is confirmed to be a one-master multi-slave mode through software, the identification (ID number) of a master node is set in advance by the software, and the IDs of slave nodes of the other CAN buses are distributed by the master node.
The direct connection is the IO direct connection between the slave node and the master node. The connection of a signal line is added from the main node to each slave node except the connection of a CAN bus and a power line, namely the IO direct connection, and the IO direct connection signal line only distinguishes two signals of high and low levels, so that the signal line CAN be connected to any pin of a main node control chip.
The communication connection further includes a data connection, as shown in fig. 2, the step 103 of sequentially configuring, by the master node, the slave nodes through the direct connection, and allocating a node identifier to each slave node includes:
step 1031, each slave node being in a broadcast receiving state;
step 1032, the master node broadcasts an identifier to all slave nodes to be configured through the data connection;
step 1033, the master node directly connects to pull up a slave node to be configured through the IO, and the slave node to be configured configures the node according to the identifier;
and 1034, repeating the above process until all the slave nodes are configured.
After the step that the master node directly connects and pulls up a slave node to be configured through the IO, and the slave node to be configured configures the own node according to the identifier, the method further includes:
and after the slave node to be configured completes the configuration of the node, sending confirmation information to the master node through the data connection.
And the slave node after the configuration is finished stores the preset master node identification and communicates with the master node through the master node identification.
Specifically, in the initialization of a CAN module of a slave node, an ID filter is closed, the slave node is in a state capable of receiving a broadcast signal, in the process of configuring a slave node ID, a master node first pulls up an IO direct connection port signal of a corresponding node, that is, IO is at a high level, then broadcasts and sends ID number data to be set as a configuration instruction, all nodes of the data will receive the ID, but the slave node will detect its IO signal to judge whether the ID of the slave node is set, after the slave node confirms that its ID number is set, specific data sent from the master node will be immediately returned to the master node (i.e., a motherboard) with the ID number as the ID number, the master node receives the data from the ID to confirm that the ID number is set successfully, then the ID of the next CAN slave node is set, and the slave node not configuring its ID will not return confirmation information; fig. 3 and 4 show flowcharts of completing automatic identifier allocation by matching IDs of a master node and a slave node, where fig. 3 is a flowchart of a process for automatically allocating an identifier to a master node, and fig. 4 is a flowchart of a process for completing automatic identifier allocation by matching a slave node with a master node.
The configured slave nodes store the identification of the master node, the master node identification is read when the slave nodes need to communicate with the master node, communication can be quickly established between the master node and the slave nodes through the master node identification and the distributed slave node identifications, data are transmitted, such as configuration information, control commands, codes which need to be burnt by the slave nodes, and the like, so that the slave nodes do not need to consider the ID problem of the slave nodes, one set of software can be used for burning multiple sets of nodes, the software achieves high modularization, the manual burning of the codes for each slave node is not needed, the workload of manual maintenance and modification is reduced, and the production efficiency is improved.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer-readable storage medium, and can include the processes of the embodiments of the methods described above when the computer program is executed. The storage medium may be a non-volatile storage medium such as a magnetic disk, an optical disk, a Read-Only Memory (ROM), or a Random Access Memory (RAM).
It should be understood that, although the steps in the flowcharts of the figures are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and may be performed in other orders unless explicitly stated herein. Moreover, at least a portion of the steps in the flow chart of the figure may include multiple sub-steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, which are not necessarily performed in sequence, but may be performed alternately or alternately with other steps or at least a portion of the sub-steps or stages of other steps.
With further reference to fig. 5, as an implementation of the method for automatically allocating node identifiers based on the CAN bus shown in fig. 1, the present application provides an embodiment of an apparatus for automatically allocating node identifiers based on the CAN bus, where the embodiment of the apparatus corresponds to the embodiment of the method shown in fig. 1, and the apparatus may be specifically applied to various electronic devices.
As shown in fig. 5, the automatic node identifier allocating apparatus 500 based on CAN bus according to this embodiment includes:
the CAN bus setting module 501 is used for setting a CAN bus into a master-slave mode and determining a master node of the CAN bus;
a connection establishing module 502, configured to initialize all slave nodes of the CAN bus and establish a communication connection with the master node, where the communication connection includes a direct connection;
an allocating module 503, configured to sequentially configure the slave nodes through the direct connection by the master node, and allocate a node identifier to each slave node.
The automatic node identifier allocation device based on the CAN bus provided in the embodiment of the present application CAN implement each implementation manner in the method embodiment of fig. 1 and corresponding beneficial effects, and is not repeated here to avoid repetition.
Further, as shown in fig. 6, an embodiment of the present application further provides a CBCT system 600 based on CAN bus node identifier automatic allocation, which includes a CAN bus 601, a host node 602 accessed to the CAN bus, and at least one slave node 603, where the host node is a main control part of the CBCT system, the slave node is a controlled and action execution part of the CBCT system, and the CAN bus, the host node, and the slave node perform communication connection and configuration according to the CAN bus based node identifier automatic allocation method, and implement functions of each part of the CBCT system under the mutual cooperation of the host node and the slave node.
In order to solve the technical problem, an embodiment of the present application further provides a computer device. Referring to fig. 7, fig. 7 is a block diagram of a basic structure of a computer device according to the present embodiment.
The computer device 7 comprises a memory 71, a processor 72, a network interface 73, which are communicatively connected to each other via a system bus. It is noted that only a computer device 7 having components 71-73 is shown, but it is to be understood that not all of the shown components are required to be implemented, and that more or fewer components may be implemented instead. As will be understood by those skilled in the art, the computer device is a device capable of automatically performing numerical calculation and/or information processing according to a preset or stored instruction, and the hardware includes, but is not limited to, a microprocessor, an Application Specific Integrated Circuit (ASIC), a Programmable Gate Array (FPGA), a Digital Signal Processor (DSP), an embedded device, and the like.
The computer device can be a desktop computer, a notebook, a palm computer, a cloud server and other computing devices. The computer equipment can carry out man-machine interaction with a user through a keyboard, a mouse, a remote controller, a touch panel or voice control equipment and the like.
The memory 71 includes at least one type of readable storage medium including a flash memory, a hard disk, a multimedia card, a card type memory (e.g., SD or DX memory, etc.), a Random Access Memory (RAM), a Static Random Access Memory (SRAM), a Read Only Memory (ROM), an Electrically Erasable Programmable Read Only Memory (EEPROM), a Programmable Read Only Memory (PROM), a magnetic memory, a magnetic disk, an optical disk, etc. In some embodiments, the storage 71 may be an internal storage unit of the computer device 7, such as a hard disk or a memory of the computer device 7. In other embodiments, the memory 71 may also be an external storage device of the computer device 7, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, which are provided on the computer device 7. Of course, the memory 71 may also comprise both an internal storage unit of the computer device 7 and an external storage device thereof. In this embodiment, the memory 71 is generally used for storing an operating system installed in the computer device 7 and various types of application software, such as program codes of a node identifier automatic allocation method based on a CAN bus. Further, the memory 71 may also be used to temporarily store various types of data that have been output or are to be output.
The processor 72 may be a Central Processing Unit (CPU), controller, microcontroller, microprocessor, or other data Processing chip in some embodiments. The processor 72 is typically used to control the overall operation of the computer device 7. In this embodiment, the processor 72 is configured to execute the program code stored in the memory 71 or process data, for example, execute the program code of the CAN bus-based node identifier automatic allocation method.
The network interface 73 may comprise a wireless network interface or a wired network interface, and the network interface 73 is generally used for establishing a communication connection between the computer device 7 and other electronic devices.
The present application provides yet another embodiment, which provides a computer-readable storage medium storing a CAN bus-based node id automatic allocation program, which is executable by at least one processor to cause the at least one processor to perform the steps of the CAN bus-based node id automatic allocation method as described above.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present application may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal device (such as a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present application.
It is to be understood that the above-described embodiments are merely illustrative of some, but not restrictive, of the broad invention, and that the appended drawings illustrate preferred embodiments of the invention and do not limit the scope of the invention. This application is capable of embodiments in many different forms and is provided for the purpose of enabling a thorough understanding of the disclosure of the application. Although the present application has been described in detail with reference to the foregoing embodiments, it will be apparent to one skilled in the art that the present application may be practiced without modification or with equivalents of some of the features described in the foregoing embodiments. All equivalent structures made by using the contents of the specification and the drawings of the present application are directly or indirectly applied to other related technical fields, and all the equivalent structures are within the protection scope of the present application.

Claims (3)

1. The utility model provides a node identification automatic allocation device based on CAN bus which characterized in that includes:
the CAN bus control system comprises a setting module, a master control module and a slave control module, wherein the setting module is used for setting a CAN bus into a master-master multi-slave mode and determining a master node of the CAN bus;
the connection establishing module is used for initializing all slave nodes of the CAN bus and establishing communication connection with the master node, wherein the communication connection comprises direct connection;
and the distribution module is used for sequentially configuring the slave nodes through the direct connection by the master node and distributing node identifiers to each slave node.
2. The CAN bus-based node identification automatic assigning apparatus of claim 1, wherein the direct connection is an IO direct connection of the slave node with the master node.
3. The CAN-bus based node id automatic assigning apparatus of claim 1, wherein the communication connection further comprises a data connection, and the master node sequentially configures the slave nodes through the direct connection to assign a node id to each of the slave nodes.
CN202120496871.2U 2021-03-09 2021-03-09 Automatic node identifier distribution device based on CAN bus Active CN216565184U (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202120496871.2U CN216565184U (en) 2021-03-09 2021-03-09 Automatic node identifier distribution device based on CAN bus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202120496871.2U CN216565184U (en) 2021-03-09 2021-03-09 Automatic node identifier distribution device based on CAN bus

Publications (1)

Publication Number Publication Date
CN216565184U true CN216565184U (en) 2022-05-17

Family

ID=81536469

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202120496871.2U Active CN216565184U (en) 2021-03-09 2021-03-09 Automatic node identifier distribution device based on CAN bus

Country Status (1)

Country Link
CN (1) CN216565184U (en)

Similar Documents

Publication Publication Date Title
CN111885144B (en) Equipment binding method and device
CN110362009A (en) Building system configuration logic generation method and device and building system
CN114237676B (en) FPGA logic updating method, device, equipment and readable storage medium
CN112328440B (en) Hard disk physical position determining method and device
CN105653306B (en) The method and apparatus of display starting set interface
CN110290166B (en) Cross-cluster data interaction method, system and device and readable storage medium
CN110635944A (en) Cluster network configuration method and device, electronic equipment and storage medium
US20240107647A1 (en) Control method, control device and lighting system
CN112073555A (en) Method for configuring IP address, electronic device and computer readable storage medium
CN216565184U (en) Automatic node identifier distribution device based on CAN bus
CN110798824A (en) Electronic table card control method, intelligent terminal and system
CN104331330A (en) Resource pool generation method and device
CN113497735B (en) Management method of open interface, electronic device and storage medium
CN113556255B (en) Method and device for configuring smart home
CN115344292B (en) Firmware automatic upgrading method and device, electronic equipment and readable storage medium
CN115550427A (en) Equipment upgrading method, device, equipment and storage medium
CN115904447A (en) Version updating system, method, electronic equipment and storage medium
CN113626022A (en) Object model creating method and device, storage medium and electronic equipment
CN107453903B (en) Method and system for identifying communication slave station and storage device
CN112799743A (en) Method and device for loading system file of slave processor unit and electronic equipment
CN112887439A (en) CAN address configuration method and system for air conditioning unit frequency converter
CN117806206A (en) Device configuration method and device, electronic device and storage medium
CN112422745B (en) Method for unlocking mobile phone, computer and mobile phone
CN111061503A (en) Cluster system configuration method and cluster system
CN115834444A (en) Automatic topology identification method and device for indoor distribution system equipment and indoor distribution system

Legal Events

Date Code Title Description
GR01 Patent grant
GR01 Patent grant