CN117499371A - Method and system for automatically distributing card ID according to slot position - Google Patents

Method and system for automatically distributing card ID according to slot position Download PDF

Info

Publication number
CN117499371A
CN117499371A CN202311404711.0A CN202311404711A CN117499371A CN 117499371 A CN117499371 A CN 117499371A CN 202311404711 A CN202311404711 A CN 202311404711A CN 117499371 A CN117499371 A CN 117499371A
Authority
CN
China
Prior art keywords
mac
slot
singlechip
automatically distributing
addresses
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
CN202311404711.0A
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.)
Zhongxin Fangzhi Suzhou Intelligent Technology Co ltd
Original Assignee
Zhongxin Fangzhi Suzhou 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 Zhongxin Fangzhi Suzhou Intelligent Technology Co ltd filed Critical Zhongxin Fangzhi Suzhou Intelligent Technology Co ltd
Priority to CN202311404711.0A priority Critical patent/CN117499371A/en
Publication of CN117499371A publication Critical patent/CN117499371A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/4401Bootstrapping
    • G06F9/4411Configuring for operating with peripheral devices; Loading of device drivers
    • G06F9/4413Plug-and-play [PnP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/50Address allocation
    • H04L61/5007Internet protocol [IP] addresses
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/50Address allocation
    • H04L61/5092Address allocation by self-assignment, e.g. picking addresses at random and testing if they are already in use

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Small-Scale Networks (AREA)

Abstract

The application discloses a method and a system for automatically distributing a card ID according to a slot position. The method for automatically distributing the card ID according to the slot position comprises the following steps: binding port numbers of slots of each singlechip with Mac (Mac) of the corresponding singlechip respectively; and respectively distributing an ip address for each Mac, wherein the distributed ip addresses are associated with port numbers. The method for automatically distributing the card ID according to the slot position can realize the binding of Mac and ip under the condition that the device without a display is inconvenient to configure ip and dhcp does not know the ip even if successful.

Description

Method and system for automatically distributing card ID according to slot position
Technical Field
The present disclosure relates to the field of virtual address allocation technologies, and in particular, to a method and system for automatically distributing a card ID according to a slot position.
Background
In actual work, when a set of system is inserted into the same bottom plate, the bottom plate is provided with a plurality of slots, each slot can be used for inserting one single chip microcomputer, each single chip microcomputer is required to be distinguished through a unique ID number at this time, and equipment on the slot is communicated through IP, so that after the IP is bound with the ID, only each single chip microcomputer is required to be allocated with a specified IP.
In this manner, however, it is inconvenient that the IP of each device needs to be set in advance. Configured as static IP has the following determination: firstly, the configuration is troublesome, and the operation steps are relatively more; secondly, the system is easy to confuse, and if the system is made into dynamic IP, the IP of each device cannot be known because no interface is displayed.
It is therefore desirable to have a solution that solves or at least alleviates the above-mentioned drawbacks of the prior art.
Disclosure of Invention
The present invention is directed to a method for automatically distributing a card ID according to a slot position, which solves at least one of the above-mentioned problems.
The invention provides the following scheme:
according to an aspect of the present invention, there is provided a method of automatically distributing a card ID according to a slot position, the method of automatically distributing a card ID according to a slot position including:
binding port numbers of slots of each singlechip with Mac (Mac) of the corresponding singlechip respectively;
and respectively distributing an ip address for each Mac, wherein the distributed ip addresses are associated with port numbers.
Optionally, binding the port number of the slot of each singlechip with the Mac of the corresponding singlechip includes:
obtaining a message sent by a link aggregation board, wherein the message comprises a port number of each slot and a Mac address of each singlechip;
and analyzing the message, so that the port number of the slot of each singlechip is respectively bound with Mac of the corresponding singlechip.
Optionally, the assigning an ip address to each Mac, where the associating the assigned ip address with the port number includes:
and transmitting the corresponding relation between each Mac and the port number of each slot to an application layer, so that the application layer script acquires the corresponding relation, and starting the DHCPserver to allocate the corresponding ip address to the corresponding Mac.
The application also provides a main control board, the main control board includes:
the binding module is used for binding port numbers of the slots of each singlechip with Mac of the corresponding singlechip respectively;
and the association module is used for respectively allocating an ip address to each Mac, and the allocated ip address and the port number form association.
The application also provides a method for automatically distributing the card ID according to the slot position, which comprises the following steps:
the main control board binds the port number of the slot of each singlechip with the Mac of the corresponding singlechip respectively;
the main control board distributes ip addresses for each Mac respectively, and the distributed ip addresses are associated with port numbers.
Optionally, before the main control board binds the port number of the slot of each singlechip with the Mac of the corresponding singlechip, the method for automatically distributing the card ID according to the slot position further includes:
the link aggregation board receives an original message, adds the port number of each slot in the original message and sends the port number to the main control board, wherein the original message comprises Mac addresses of all single-chip computers.
Optionally, before the link aggregation board receives the original message, the method for automatically distributing the card ID according to the slot position includes:
each singlechip respectively starts a DHCP mode and sends a DHCP request original message with a Mac address to the link aggregation board.
The present application also provides a system for automatically distributing a card ID according to a slot position, the system for automatically distributing a card ID according to a slot position comprising:
and the main controller is used for binding port numbers of the slots of each singlechip with macs corresponding to the singlechips respectively, distributing ip addresses for each Mac respectively, and associating the distributed ip addresses with the port numbers.
Optionally, the system for automatically distributing the card ID according to the slot position further comprises:
the link aggregation board is used for receiving an original message, adding the port number of each slot in the original message and sending the original message to the main control board, wherein the original message comprises Mac addresses of all single-chip computers.
Optionally, the number of the singlechips is multiple, each singlechip is used for starting a DHCP mode, and sending a DHCP request original message with a Mac address to the link aggregation board.
The method for automatically distributing the card ID according to the slot position can realize the binding of Mac and ip under the condition that the device without a display is inconvenient to configure ip and dhcp does not know the ip even if successful.
Drawings
Fig. 1 is a flow chart of a method for automatically distributing card IDs according to slot positions in an embodiment of the present application.
Fig. 2 is a network topology diagram of a method for automatically distributing card IDs according to slot positions in an embodiment of the present application.
Detailed Description
The following description of the embodiments of the present invention will be made apparent and fully in view of the accompanying drawings, in which some, but not all embodiments of the invention are shown. 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 be within the scope of the invention.
Fig. 1 is a flow chart of a method for automatically distributing card IDs according to slot positions in an embodiment of the present application.
The method of automatically distributing the card ID according to the slot position as shown in fig. 1 includes:
step 1: binding port numbers of slots of each singlechip with Mac (Mac) of the corresponding singlechip respectively;
step 2: and respectively distributing an ip address for each Mac, wherein the distributed ip addresses are associated with port numbers.
In this embodiment, the binding the port number of the slot of each singlechip with the Mac of the corresponding singlechip includes:
obtaining a message sent by a link aggregation board, wherein the message comprises a port number of each slot and a Mac address of each singlechip;
and analyzing the message, so that the port number of the slot of each singlechip is respectively bound with Mac of the corresponding singlechip.
In this embodiment, the assigning an ip address to each Mac, where the association between the assigned ip address and the port number includes:
and transmitting the corresponding relation between each Mac and the port number of each slot to an application layer, so that the application layer script acquires the corresponding relation, and starting the DHCPserver to allocate the corresponding ip address to the corresponding Mac.
The application also provides a main control board, which comprises a binding module and an association module, wherein the binding module is used for binding port numbers of the slots of each singlechip with Mac (Mac) of the corresponding singlechip respectively; the association module is used for respectively allocating an ip address to each Mac, and the allocated ip address and the port number form association.
The application also provides a method for automatically distributing the card ID according to the slot position, which comprises the following steps:
the main control board binds the port number of the slot of each singlechip with the Mac of the corresponding singlechip respectively;
the main control board distributes ip addresses for each Mac respectively, and the distributed ip addresses are associated with port numbers.
In this embodiment, before the main control board binds the port number of the slot of each singlechip with the Mac of the corresponding singlechip, the method for automatically distributing the card ID according to the slot position further includes:
the link aggregation board receives an original message, adds the port number of each slot in the original message and sends the port number to the main control board, wherein the original message comprises Mac addresses of all single-chip computers.
In this embodiment, before the link aggregation board receives the original message, the method for automatically distributing the card ID according to the slot position includes:
each singlechip respectively starts a DHCP mode and sends a DHCP request original message with a Mac address to the link aggregation board.
The present application also provides a system for automatically distributing a card ID according to a slot position, the system for automatically distributing a card ID according to a slot position comprising:
and the main controller is used for binding port numbers of the slots of each singlechip with macs corresponding to the singlechips respectively, distributing ip addresses for each Mac respectively, and associating the distributed ip addresses with the port numbers.
In this embodiment, the system for automatically distributing the card ID according to the slot position further includes:
the link aggregation board is used for receiving an original message, adding the port number of each slot in the original message and sending the original message to the main control board, wherein the original message comprises Mac addresses of all single-chip computers.
In this embodiment, the number of the singlechips is multiple, and each singlechip is used for starting a DHCP mode, and sending a DHCP request original message with a Mac address to the link aggregation board.
The present application is described in further detail below by way of examples, which are not to be construed as limiting the present application in any way.
Referring to fig. 2, in one embodiment, a set of systems is plugged into the same backplane, the backplane has a plurality of slots, and the modules from left to right are respectively: link aggregation board (network switch), master control (Linux board card based on rk 3568)
The device comprises a digital quantity acquisition module (single-chip microcomputer), a keyboard acquisition module (single-chip microcomputer), a digital quantity output module (single-chip microcomputer), a current analog quantity acquisition module (single-chip microcomputer) and a PT100 acquisition module (single-chip microcomputer).
In this embodiment, the process is unified for powering up the device, the singlechip starts a DHCP mode, sends a DHCP request message with a Mac address, waits for the DHCP server to allocate IP, the link aggregation board receives the message, adds a port number to the original message and transmits the original message to the linux end, at this time, the port (port number of the slot) and the Mac are successfully bound, the linux kernel analyzes the custom message, the correspondence between the Mac and the port is transmitted to the application layer, the application layer script discovers the correspondence, and starts the DHCPserver to allocate the corresponding IP address to the corresponding Mac, and the IP allocation is successful, namely the board card unique ID number.
In this embodiment, each slot of the backplane corresponds to a port of the link aggregation board, each port has a fixed port number, and the link aggregation board has the capability of distinguishing which port is the data that is transmitted by, so that the ethernet message is customized, and when the data transmitted by each port is automatically added with a port number, the data is transmitted to the linux board.
In this embodiment, the Linux board parses the packet according to the customized ethernet protocol, each frame of packet carries the MAC address and the port number, and the kernel adds a code to transfer the corresponding relationship between MAC and port binding to the system application layer.
In this embodiment, the Linux application layer can know the Mac address on each slot by resolving the binding relationship transmitted from the kernel, and knowing the Mac address, the Linux can start the dhcp server service to bind the IP address to the Mac address, so that the purpose of binding the fixed IP through the slots can be achieved.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present invention, and not for limiting the same; although the invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some or all of the technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit of the invention.

Claims (10)

1. A method for automatically distributing card IDs according to slot positions, the method comprising:
binding port numbers of slots of each singlechip with Mac (Mac) of the corresponding singlechip respectively;
and respectively distributing an ip address for each Mac, wherein the distributed ip addresses are associated with port numbers.
2. The method for automatically distributing the card ID according to the slot position of claim 1, wherein the binding the port number of the slot of each single-chip microcomputer with the Mac of the corresponding single-chip microcomputer includes:
obtaining a message sent by a link aggregation board, wherein the message comprises a port number of each slot and a Mac address of each singlechip;
and analyzing the message, so that the port number of the slot of each singlechip is respectively bound with Mac of the corresponding singlechip.
3. The method of automatically distributing board card IDs according to slot positions of claim 2, wherein said assigning ip addresses to each Mac, respectively, the assigned ip addresses being associated with port numbers comprises:
and transmitting the corresponding relation between each Mac and the port number of each slot to an application layer, so that the application layer script acquires the corresponding relation, and starting the DHCPserver to allocate the corresponding ip address to the corresponding Mac.
4. A master control board, the master control board comprising:
the binding module is used for binding port numbers of the slots of each singlechip with Mac of the corresponding singlechip respectively;
and the association module is used for respectively allocating an ip address to each Mac, and the allocated ip address and the port number form association.
5. A method for automatically distributing card IDs according to slot positions, the method comprising:
the main control board binds the port number of the slot of each singlechip with the Mac of the corresponding singlechip respectively;
the main control board distributes ip addresses for each Mac respectively, and the distributed ip addresses are associated with port numbers.
6. The method of automatically distributing board card IDs according to slot positions as in claim 5, wherein said method of automatically distributing board card IDs according to slot positions further comprises, before said master control board binds port numbers of slots of each single chip with macs of the corresponding single chip, respectively:
the link aggregation board receives an original message, adds the port number of each slot in the original message and sends the port number to the main control board, wherein the original message comprises Mac addresses of all single-chip computers.
7. The method for automatically distributing card IDs based on slot positions as recited in claim 6, wherein said method for automatically distributing card IDs based on slot positions comprises, before said link aggregation board receives an original message:
each singlechip respectively starts a DHCP mode and sends a DHCP request original message with a Mac address to the link aggregation board.
8. A system for automatically distributing card IDs based on slot positions, the system for automatically distributing card IDs based on slot positions comprising:
and the main controller is used for binding port numbers of the slots of each singlechip with macs corresponding to the singlechips respectively, distributing ip addresses for each Mac respectively, and associating the distributed ip addresses with the port numbers.
9. The system for automatically distributing card IDs based on slot positions as recited in claim 8, wherein said system for automatically distributing card IDs based on slot positions further comprises:
the link aggregation board is used for receiving an original message, adding the port number of each slot in the original message and sending the original message to the main control board, wherein the original message comprises Mac addresses of all single-chip computers.
10. The system for automatically distributing board card IDs according to slot positions of claim 9, wherein the number of said single-chip computers is plural, each of said single-chip computers is used to start a DHCP mode, respectively, and send DHCP request original messages with Mac addresses to the link aggregation board.
CN202311404711.0A 2023-10-27 2023-10-27 Method and system for automatically distributing card ID according to slot position Pending CN117499371A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311404711.0A CN117499371A (en) 2023-10-27 2023-10-27 Method and system for automatically distributing card ID according to slot position

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311404711.0A CN117499371A (en) 2023-10-27 2023-10-27 Method and system for automatically distributing card ID according to slot position

Publications (1)

Publication Number Publication Date
CN117499371A true CN117499371A (en) 2024-02-02

Family

ID=89680748

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311404711.0A Pending CN117499371A (en) 2023-10-27 2023-10-27 Method and system for automatically distributing card ID according to slot position

Country Status (1)

Country Link
CN (1) CN117499371A (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080077718A1 (en) * 2006-09-25 2008-03-27 Honeywell International Inc. Stacked card address assignment
CN101217394A (en) * 2007-12-29 2008-07-09 上海华为技术有限公司 A veneer groove bit mark collocation method, core veneer, and operation veneer and communication system
CN102571592A (en) * 2012-01-18 2012-07-11 神州数码网络(北京)有限公司 Three-layer switch equipment with port binding function and data message forwarding method
CN106210169A (en) * 2016-07-13 2016-12-07 邦彦技术股份有限公司 IP address automatic allocating method and device
CN109802856A (en) * 2019-01-04 2019-05-24 烽火通信科技股份有限公司 A kind of method of the how sub- deckle board card of list NE management
CN111510516A (en) * 2020-04-22 2020-08-07 上海御渡半导体科技有限公司 Network framework of distributed system of testing machine and communication method
CN114024940A (en) * 2021-10-30 2022-02-08 江苏信而泰智能装备有限公司 Port address setting and automatic configuration method of network tester
CN216817394U (en) * 2022-03-17 2022-06-24 陕西三海测试技术开发有限责任公司 Bus addressing circuit for plug-in box board card

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080077718A1 (en) * 2006-09-25 2008-03-27 Honeywell International Inc. Stacked card address assignment
CN101217394A (en) * 2007-12-29 2008-07-09 上海华为技术有限公司 A veneer groove bit mark collocation method, core veneer, and operation veneer and communication system
CN102571592A (en) * 2012-01-18 2012-07-11 神州数码网络(北京)有限公司 Three-layer switch equipment with port binding function and data message forwarding method
CN106210169A (en) * 2016-07-13 2016-12-07 邦彦技术股份有限公司 IP address automatic allocating method and device
WO2018010157A1 (en) * 2016-07-13 2018-01-18 邦彦技术股份有限公司 Method and device for automatic allocation of ip addresses
CN109802856A (en) * 2019-01-04 2019-05-24 烽火通信科技股份有限公司 A kind of method of the how sub- deckle board card of list NE management
CN111510516A (en) * 2020-04-22 2020-08-07 上海御渡半导体科技有限公司 Network framework of distributed system of testing machine and communication method
CN114024940A (en) * 2021-10-30 2022-02-08 江苏信而泰智能装备有限公司 Port address setting and automatic configuration method of network tester
CN216817394U (en) * 2022-03-17 2022-06-24 陕西三海测试技术开发有限责任公司 Bus addressing circuit for plug-in box board card

Similar Documents

Publication Publication Date Title
CN108307002B (en) DHCP message processing method and device
CN1123154C (en) System, device and method for routine selection dhcp configuration agreement packets
CN101179603B (en) Method and device for controlling user network access in IPv6 network
JP4948839B2 (en) Method and apparatus for allocating network subscriber device addresses in a ProfitetIO network
CN106131231B (en) The method and communication equipment of name service are provided in industrial automation system
CN104641620B (en) For the method and apparatus of dynamic address allocation
CN101582774B (en) Modem and method thereof for fixing user terminal IP address
CN1719808A (en) Power saving in wireless packet based networks
US10114771B1 (en) Interconnection of peripheral devices on different electronic devices
CN102185766A (en) Unicast forwarding method and forwarding equipment for responding messages by DHCP (Dynamic host configuration protocol) server
CN108667957B (en) IP address allocation method, first electronic device and first server
CN100382524C (en) Method and arrangement for configuration of a device in a data network
US11005706B2 (en) Method for configuring forwarding table for user equipment, apparatus, and system
CN110247778B (en) Operating system installation method and device, electronic equipment and storage medium
CN117499371A (en) Method and system for automatically distributing card ID according to slot position
CN115333933B (en) Automatic management method, medium and equipment for servers on machine room
CN101309154B (en) Datagram sending method, sending apparatus and transmission system
US20070064726A1 (en) Endpoint transparent independent messaging scheme system and method
EP2220849B1 (en) Address assignment protocol
WO2015085558A1 (en) Method, device and system for dynamically allocating ip address
CN106411784B (en) Global resource distribution method and device
JP3487430B2 (en) Server application multiplex communication system
CN112104764B (en) Method and system for classifying DHCP (dynamic host configuration protocol) client
KR100687746B1 (en) Method and apparatus for preventing collision of address
CN117478174A (en) Batch control method and device

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