CN115460174A - Method and system for automatically allocating terminal IP static address - Google Patents

Method and system for automatically allocating terminal IP static address Download PDF

Info

Publication number
CN115460174A
CN115460174A CN202210962229.8A CN202210962229A CN115460174A CN 115460174 A CN115460174 A CN 115460174A CN 202210962229 A CN202210962229 A CN 202210962229A CN 115460174 A CN115460174 A CN 115460174A
Authority
CN
China
Prior art keywords
terminal
address
server
addressing
instruction
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
CN202210962229.8A
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.)
Zhuhai Hivi Technology Co ltd
Original Assignee
Zhuhai Hivi 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 Zhuhai Hivi Technology Co ltd filed Critical Zhuhai Hivi Technology Co ltd
Priority to CN202210962229.8A priority Critical patent/CN115460174A/en
Publication of CN115460174A publication Critical patent/CN115460174A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/16Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
    • H04L69/164Adaptation or special uses of UDP protocol

Abstract

The invention discloses a method and a system for automatically allocating a terminal IP static address, wherein the method comprises the following steps: the router distributes IP addresses of all terminals in the system through a DHCP protocol; sending a self-enumeration instruction by a server terminal by broadcasting, and requiring each terminal to reply key information; the server side addresses the terminal and stores the terminal information; finishing terminal addressing; when the terminal is connected with the server for the first time, the default ID number is 0; the terminal waits for receiving a UDP multicast data packet of the server side; responding to the UDP multicast data packet, and sending a data packet containing an SN code of a local terminal to a server side of a source IP address of the UDP multicast data packet; so that the server side distributes the terminal ID number of the current terminal to the terminal. The invention improves the stability and reliability, can realize automatic allocation of the static IP address without manual intervention, and can be widely applied to the technical field of communication.

Description

Method and system for automatically allocating terminal IP static address
Technical Field
The invention relates to the technical field of communication, in particular to a method and a system for automatically allocating a terminal IP static address.
Background
At present, the wired public broadcasting system based on the IP network needs to set IP addresses for network audio broadcasting devices of all levels in the network, thereby realizing network data communication.
Generally, on the basis of broadcast management software, manual filling is adopted to set fixed static IP address related parameters for each stage of network audio broadcasting equipment. In such a manner, unit users and engineering constructors using the IP network broadcasting system are required to be skilled in network structure and network knowledge, and need to undergo lengthy network technology training, otherwise, correct configuration cannot be performed, the technical threshold is high, and for medium-and large-sized IP network broadcasting systems with a capacity of more than a hundred, the workload required to be set is large, errors are easy to occur, and the address information of each IP broadcasting terminal is difficult to remember. These factors adversely affect the use and maintenance of the IP network broadcasting system, thereby affecting the market popularization and large-area application of the IP network broadcasting system.
In order to realize the automatic allocation of the IP broadcast terminal address, the automatic address allocation is realized by adopting a mature DHCP technology at present, and in the actual use process, the IP address of the IP broadcast terminal is found to be possibly different from the IP address obtained in the previous operation every time the system is started to operate, so that the condition that one terminal has a unique IP address in the working life cycle cannot be ensured, and the IP address and the IP terminal are required to be in definite one-to-one correspondence in the use and maintenance of the IP public broadcast system, so that the address selection and the function binding are realized. The system cannot be used once because the system cannot be started and the IP terminal address changes once.
How to realize automatic IP address allocation, the allocated IP address is a static address, the allocated IP address is the same and does not change when being electrified every time, and IP addresses of IP broadcast terminals in the system are not repeated, which becomes a problem to be solved urgently.
Disclosure of Invention
In view of this, embodiments of the present invention provide a method and a system for stably and reliably automatically allocating a static IP address of a terminal, so as to automatically allocate the static IP address without manual intervention.
One aspect of the embodiments of the present invention provides a method for automatically allocating a terminal IP static address, which is applied to a server side and includes:
the router distributes IP addresses of all terminals in the system through a DHCP protocol; sending a self-enumeration instruction by a server terminal by broadcasting, and requiring each terminal to reply key information;
the server side addresses the terminal and stores the terminal information; and finishing terminal addressing.
Optionally, the allocating, by the router, an IP address of each terminal in the system through a DHCP protocol includes:
when the power is initially powered on, the router adopts DHCP to distribute respective IP addresses to all online terminals in the network;
the IP address obtained by the terminal is used as an IP for temporary communication.
Optionally, the sending, by the server, a self-enumeration instruction by broadcasting, where each terminal is required to reply the key information includes:
the server side broadcasts a self-enumeration instruction through a UDP multicast address, the self-enumeration instruction is broadcasted to all terminals of a whole network in the system by adopting UDP, and all terminals are required to return 96-bit global unique serial numbers and terminal information of own MCU; and after receiving the self-enumeration instruction, the terminal returns the relevant information to the server for storage.
Optionally, the server addresses the terminal and stores the terminal information, including:
the server side obtains the MCU serial number fed back by the terminal, and converts the MCU serial number into a character string in a Base64 coding format;
comparing the terminal database, if the coding character string of the MCU serial number is not stored in the data, indicating that the terminal is a new terminal, allocating a new addressing ID for the terminal, and storing all information of the terminal in the database;
and forming an addressing instruction by the new addressing ID and the MCU serial number, and sending the addressing instruction to the terminal.
Optionally, the completing the terminal addressing includes:
if the non-target terminal receives the addressing instruction, the addressing instruction is discarded if the MCU serial number is not the own MCU serial number;
if the target terminal receives the addressing instruction, it will save the addressing ID assigned to it and set the addressing ID as its own IP address.
Another aspect of the embodiments of the present invention further provides a method for automatically allocating a static IP address of a terminal, which is applied to the terminal, and includes:
when the terminal is connected with the server for the first time, the default ID number is 0;
the terminal waits for receiving a UDP multicast data packet of the server side;
responding to the UDP multicast data packet, and sending a data packet containing an SN code of a local terminal to a server side of a source IP address of the UDP multicast data packet; so that the server side distributes the terminal ID number of the current terminal to the terminal.
Optionally, after receiving the UDP multicast data packet sent by the server, the terminal checks whether the SN code in the UDP multicast data packet is consistent with the SN code of the local terminal, and if so, sets an ID number of the local terminal and stores the ID number in a FLASH ROM of the processor;
the terminal reads the ID number from the FLASH RAOM and then performs DHCP when initializing;
the terminal circularly waits when not being allocated with the IP address;
and after the terminal acquires the IP address by the DHCP, changing the last section of numerical value of the IP address into an ID number.
Another aspect of the embodiments of the present invention further provides a system for automatically allocating a static IP address of a terminal, including: a terminal and a server;
the server is used for realizing the method for automatically allocating the terminal IP static address;
the terminal is used for implementing the method for automatically allocating the terminal IP static address.
Another aspect of the embodiments of the present invention further provides an electronic device, which includes a processor and a memory;
the memory is used for storing programs;
the processor executes the program to implement the method as described above.
Yet another aspect of the embodiments of the present invention provides a computer-readable storage medium, which stores a program, which is executed by a processor to implement the method as described above.
Embodiments of the present invention also disclose a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The computer instructions may be read by a processor of a computer device from a computer-readable storage medium, and the computer instructions executed by the processor cause the computer device to perform the foregoing method.
In the server side of the embodiment of the invention, the router distributes IP addresses of all terminals in the system through a DHCP protocol; sending a self-enumeration instruction by a server terminal by broadcasting, and requiring each terminal to reply key information; the server side addresses the terminal and stores the terminal information; and finishing terminal addressing. In the terminal of the embodiment of the invention, when the terminal is connected with the server for the first time, the default ID number is 0; the terminal waits for receiving a UDP multicast data packet of the server side; responding to the UDP multicast data packet, and sending a data packet containing an SN code of a local terminal to a server side of a source IP address of the UDP multicast data packet; so that the server side allocates the terminal ID number of the current terminal to the terminal. The invention improves the stability and reliability and can realize automatic allocation of the static IP address without manual intervention.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a schematic diagram of an operation architecture of an IP network broadcasting system according to an embodiment of the present invention;
fig. 2 is a flowchart of steps executed by the server according to the embodiment of the present invention;
fig. 3 is a flowchart of an execution procedure of a terminal according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more clearly understood, the present application is further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of and not restrictive on the broad application.
To solve the problems in the prior art, an aspect of the embodiments of the present invention provides a method for automatically allocating a static IP address of a terminal, which is applied to a server side and includes:
the router distributes IP addresses of all terminals in the system through a DHCP protocol; sending a self-enumeration instruction by a server terminal by broadcasting, and requiring each terminal to reply key information;
the server side addresses the terminal and stores the terminal information; and finishing terminal addressing.
Optionally, the allocating, by the router, an IP address of each terminal in the system through a DHCP protocol includes:
when the power is initially powered on, the router adopts DHCP to distribute respective IP addresses to all online terminals in the network;
the IP address obtained by the terminal is used as an IP for temporary communication.
Optionally, the sending, by the server, a self-enumeration instruction by broadcasting, where each terminal is required to reply the key information includes:
the server broadcasts a self-enumeration instruction through a UDP multicast address, the self-enumeration instruction is broadcasted to all terminals of a whole network in the system by UDP, and all terminals are required to return 96-bit global unique serial numbers of MCU and terminal information; and after the terminal receives the self-enumeration instruction, the terminal returns the relevant information to the server for storage.
Optionally, the server addresses the terminal and stores the terminal information, including:
the server side obtains the MCU serial number fed back by the terminal, and converts the MCU serial number into a character string in a Base64 coding format;
comparing the terminal database, if the coding character string of the MCU serial number is not stored in the data, indicating that the terminal is a new terminal, allocating a new addressing ID for the terminal, and storing all information of the terminal in the database;
and forming an addressing instruction by the new addressing ID and the MCU serial number, and sending the addressing instruction to the terminal.
Optionally, the completing the terminal addressing includes:
if the non-target terminal receives the addressing instruction and finds that the MCU serial number is not the own MCU serial number, the addressing instruction is discarded;
if the target terminal receives the addressing instruction, it will save the addressing ID assigned to it and set the addressing ID as its own IP address.
Another aspect of the embodiments of the present invention further provides a method for automatically allocating a static IP address of a terminal, which is applied to the terminal, and includes:
when the terminal is connected with the server for the first time, the default ID number is 0;
the terminal waits for receiving a UDP multicast data packet of the server side;
responding to the UDP multicast data packet, and sending a data packet containing an SN code of a local terminal to a server side of a source IP address of the UDP multicast data packet; so that the server side allocates the terminal ID number of the current terminal to the terminal.
Optionally, after receiving the UDP multicast data packet sent by the server, the terminal checks whether SN codes in the UDP multicast data packet are consistent with SN codes of the local terminal, and if so, sets an ID number of the local terminal and stores the ID number in a FLASH ROM of the processor;
the terminal reads the ID number from the FLASH RAOM and then performs DHCP (dynamic host configuration protocol) during initialization;
the terminal circularly waits when not being allocated with the IP address;
and after the terminal acquires the IP address by the DHCP, changing the last section of numerical value of the IP address into an ID number.
Another aspect of the embodiments of the present invention further provides a system for automatically allocating a static IP address of a terminal, including: a terminal and a server;
the server is used for realizing the method for automatically allocating the terminal IP static address;
the terminal is used for realizing the method for automatically allocating the IP static address of the terminal.
Another aspect of the embodiments of the present invention further provides an electronic device, including a processor and a memory;
the memory is used for storing programs;
the processor executes the program to implement the method as described above.
Yet another aspect of the embodiments of the present invention provides a computer-readable storage medium, which stores a program, which is executed by a processor to implement the method as described above.
Embodiments of the present invention also disclose a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The computer instructions may be read by a processor of a computer device from a computer-readable storage medium, and the computer instructions executed by the processor cause the computer device to perform the foregoing method.
The following detailed description of the invention is made with reference to the accompanying drawings:
the operation architecture of the IP network broadcasting system of the present invention is shown in fig. 1, and the implementation process of the method provided by the present invention is based on, but not limited to, the following physical conditions; (1) The server has the wired Ethernet network communication capability, the embodiment of the invention adopts a common commercial computer + WIN10 system + IPCAS (IP broadcast server management software), which is hereinafter referred to as a server end; (2) The system needs a router or a server supporting DHCP to install network routing software supporting DHCP protocol; (3) The IP broadcast terminal supports the capabilities of wired Ethernet protocol stacks such as DHCP, UDP and the like, the embodiment of the invention adopts STM32F407, supports IEEE802.3 Ethernet, adopts an LWIP protocol stack (containing DHCP and UDP protocols), runs related embedded broadcast control software, and is hereinafter referred to as a terminal for short; and (4) the processor of the terminal has a unique SN serial number. The present invention adopts STM32F407 series processor, and the chip is provided with unique 96-bit SN series number. Other processors may be used as long as they have a unique SN number or can be provided with a unique serial number.
The technology and the method provided by the invention need to be respectively coordinated and executed at the server end and the terminal to complete the realization.
The server side operation process comprises the following steps:
when the terminal leaves a factory, the MAC address is not initialized, a plurality of terminals use the same MAC address, and IP conflict occurs when the IP address is allocated by using a DHCP protocol.
The server side uses a multi-bit serial number (96 bits in the embodiment of the invention) of the terminal as an identifier, can accurately identify each terminal, and provides necessary conditions for automatically allocating IP addresses. And a server side is provided with a certain algorithm rule to distribute a fixed ID for each MCU serial number, and the terminal sets an own IP address by using the ID number to meet the requirement of a static IP address.
The execution steps of the server side are shown in fig. 2, and the whole method comprises the following steps 1) to 5):
1) The router distributes IP addresses of all terminals in the system through a DHCP protocol
When the terminal is initially powered on, the terminal supports a DHCP protocol, the router adopts the DHCP to distribute respective IP addresses to all online terminals in the network, the IP address obtained by the terminal at this stage is used as an IP for temporary communication, the IP address is not yet required, the IP duplication possibility possibly exists in the system, and the IP address is dynamically distributed and is not bound with the IP terminal. And then the server side executes the next second step action.
2) The server side sends a self-enumeration instruction by broadcasting and requires each terminal to reply key information
The server side broadcasts a self-enumeration instruction (named as a self-enumeration instruction which can be different actually) through a UDP multicast address, the instruction is broadcasted to all terminals of the whole internal network of the system by adopting UDP, and all terminals are required to return 96-bit global unique serial numbers of own MCU and other useful information of the terminals. The terminal receives the instruction and returns the relevant information to the server, and the server side stores the information for the next processing.
The self-enumeration instruction format of the embodiment of the present invention is shown in table 1:
TABLE 1
Type of protocol Header Object ID Source ID Type of command Data length Data of Checksum
0x0910 0x5555 0xffff 0x0000 0xff 0x0001 0x01 0xe6
And after receiving the instruction, the terminal sends a message with the MCU serial number to the server.
The format of the response self-enumeration instruction is shown in table 2:
TABLE 2
Type of protocol Header Object ID Source ID Type of command Data length Data bit Checksum
0x0910 0x5555 0x0000 0x0000 0xff 0x0022 Subcommands 1 byte
The format of the response self-enumeration instruction subcommand is shown in Table 3:
TABLE 3
Subcommands Character Function(s) Volume of sound MCU serial number Type number Version(s)
0x02 1 byte 1 byte 1 byte (96 bits 12 bytes in total) 2 bytes 4 bytes
4) The server then addresses the terminal and saves the terminal information
The server side obtains the MCU serial number, converts the MCU serial number into a character string in a Base64 coding format, compares the character string with a terminal database, if the coding character string of the MCU serial number is not stored in the data, the terminal is a new terminal, allocates a new addressing ID for the terminal, and stores all information of the terminal in the database. And finally, forming an addressing instruction by the ID and the MCU serial number, and sending the addressing instruction to the terminal.
ID generation rule: the ID is an integer greater than 0 and less than 65535, with ID%256 resulting in a value not equal to 0,1,255 (0,1, 255 is a special IP address, usually avoided as an IP address for the terminal). The terminal automatically sets the IP according to the ID.
The ID generation code is as follows:
Figure BDA0003793743430000071
the format of the addressing instruction is shown in table 4:
TABLE 4
Type of protocol Header Object ID Source ID Type of command Data length Data of Checksum
0x0910 0x5555 0x0000 0x0000 0xff 0x0001 Subcommands 0xe6
The addressing instruction subcommand format is shown in table 5:
TABLE 5
Subcommands Generated ID MCU serial number
0x03 2 bytes (96 bit 12 bytes in total)
5) Terminal addressing completion
At this time, the terminal may have repeated IP addresses, and if the non-target terminal receives the addressing instruction and finds that the MCU serial number is not the own MCU serial number, the instruction will be discarded; if the destination terminal receives the addressing instruction, it stores the addressing ID assigned to it and newly sets its own IP address.
(II) terminal operation Process
The execution steps of the terminal are shown in fig. 3, when the terminal is connected with the server for the first time, because no ID number is allocated, the default ID number is 0, it needs to wait for receiving an enumeration instruction (UDP multicast data packet) of the server, once the data packet is detected, it sends a data packet containing the SN code of the local terminal (SN code is the unique identifier of the terminal processing chip) to the source IP address (server), the server receives the SN data packet of the terminal and calculates and allocates the terminal ID number according to a specified algorithm, and sends a data packet (UDP unicast data packet) of ID number + SN code to the terminal, after receiving the data packet, the terminal checks once whether the SN code is consistent with the SN code of the local terminal, if so, sets the ID number of the local terminal and stores the ID number in the FLASH ROM of the processor. The terminal reads key data such as an ID number and the like from a FLASH RAOM during initialization, then performs DHCP, circularly waits when an IP address is not allocated, avoids IP address conflict when multiple terminals simultaneously perform DHCP, and changes the last section of numerical value of the IP address into the ID number after the DHCP acquires the IP address, if the IP address allocated to the terminal is 192.168.1.10 and the terminal ID number is 2, the IP address of the terminal after the change is 192.168.1.2.
An example of the code of the terminal is as follows:
Figure BDA0003793743430000081
in summary, the techniques and methods provided by the present invention, in combination with DHCP, achieve automatic assignment of static IP addresses without manual intervention. Through practical operation, the automatic allocation of the IP static address of the IP network public broadcasting system terminal is well solved, so that stable and reliable addressing is realized, and the actual requirements of IP public broadcasting are met.
In alternative embodiments, the functions/acts noted in the block diagrams may occur out of the order noted in the operational illustrations. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality/acts involved. Furthermore, the embodiments presented and described in the flow charts of the present invention are provided by way of example in order to provide a more thorough understanding of the technology. The disclosed methods are not limited to the operations and logic flows presented herein. Alternative embodiments are contemplated in which the order of various operations is changed and in which sub-operations described as part of larger operations are performed independently.
Furthermore, although the present invention is described in the context of functional modules, it should be understood that, unless otherwise stated to the contrary, one or more of the described functions and/or features may be integrated in a single physical device and/or software module, or one or more functions and/or features may be implemented in a separate physical device or software module. It will also be appreciated that a detailed discussion of the actual implementation of each module is not necessary for an understanding of the present invention. Rather, the actual implementation of the various functional modules in the apparatus disclosed herein will be understood within the ordinary skill of an engineer given the nature, function, and interrelationships of the modules. Accordingly, those skilled in the art can, using ordinary skill, practice the invention as set forth in the claims without undue experimentation. It is also to be understood that the specific concepts disclosed are merely illustrative of and not intended to limit the scope of the invention, which is defined by the appended claims and their full scope of equivalents.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
The logic and/or steps represented in the flowcharts or otherwise described herein, such as an ordered listing of executable instructions that can be considered to implement logical functions, can be embodied in any computer-readable medium for use by or in connection with an instruction execution system, apparatus, or device, such as a computer-based system, processor-containing system, or other system that can fetch the instructions from the instruction execution system, apparatus, or device and execute the instructions. For the purposes of this description, a "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device.
More specific examples (a non-exhaustive list) of the computer-readable medium would include the following: an electrical connection (electronic device) having one or more wires, a portable computer diskette (magnetic device), a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). Further, the computer-readable medium could even be paper or another suitable medium upon which the program is printed, as the program can be electronically captured, via for instance optical scanning of the paper or other medium, then compiled, interpreted or otherwise processed in a suitable manner if necessary, and then stored in a computer memory.
It should be understood that portions of the present invention may be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, the various steps or methods may be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, any one or combination of the following techniques, which are known in the art, may be used: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application specific integrated circuit having an appropriate combinational logic gate circuit, a Programmable Gate Array (PGA), a Field Programmable Gate Array (FPGA), or the like.
In the description herein, references to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., mean that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, the schematic representations of the terms used above do not necessarily refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
While embodiments of the invention have been shown and described, it will be understood by those of ordinary skill in the art that: various changes, modifications, substitutions and alterations can be made to the embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the claims and their equivalents.
While the preferred embodiments of the present invention have been illustrated and described, it will be understood by those skilled in the art that various changes in form and details may be made therein without departing from the spirit and scope of the invention as defined in the appended claims.

Claims (10)

1. A method for automatically allocating terminal IP static address is applied to a server side, and is characterized by comprising the following steps:
the router distributes IP addresses of all terminals in the system through a DHCP protocol; sending a self-enumeration instruction by a server terminal by broadcasting, and requiring each terminal to reply key information;
the server side addresses the terminal and stores the terminal information; and finishing terminal addressing.
2. The method according to claim 1, wherein the router allocates the IP addresses of the terminals in the system through a DHCP protocol, comprising:
when the power is initially powered on, the router adopts DHCP to distribute respective IP addresses to all online terminals in the network;
the IP address obtained by the terminal is used as an IP for temporary communication.
3. The method according to claim 1, wherein the server sends a self-enumeration instruction by broadcasting to request each terminal to reply key information, and the method comprises:
the server side broadcasts a self-enumeration instruction through a UDP multicast address, the self-enumeration instruction is broadcasted to all terminals of a whole network in the system by adopting UDP, and all terminals are required to return 96-bit global unique serial numbers and terminal information of own MCU; and after receiving the self-enumeration instruction, the terminal returns the relevant information to the server for storage.
4. The method of claim 1, wherein the server addresses the terminal and stores the terminal information, comprising:
the server side obtains the MCU serial number fed back by the terminal, and converts the MCU serial number into a character string in a Base64 coding format;
comparing the terminal database, if the coding character string of the MCU serial number is not stored in the data, indicating that the terminal is a new terminal, allocating a new addressing ID for the terminal, and storing all information of the terminal in the database;
and forming an addressing instruction by the new addressing ID and the MCU serial number, and sending the addressing instruction to the terminal.
5. The method of claim 1, wherein the performing terminal addressing comprises:
if the non-target terminal receives the addressing instruction, the addressing instruction is discarded if the MCU serial number is not the own MCU serial number;
if the target terminal receives the addressing instruction, it will save the addressing ID assigned to it and set the addressing ID as its own IP address.
6. A method for automatically allocating terminal IP static address is applied to a terminal, and is characterized by comprising the following steps:
when the terminal is connected with the server for the first time, the default ID number is 0;
the terminal waits for receiving a UDP multicast data packet of the server side;
responding to the UDP multicast data packet, and sending a data packet containing an SN code of a local terminal to a server side of a source IP address of the UDP multicast data packet; so that the server side distributes the terminal ID number of the current terminal to the terminal.
7. The method of claim 6, wherein the step of automatically assigning the IP static address of the terminal,
after receiving a UDP multicast data packet sent by a server, the terminal firstly checks whether SN codes in the UDP multicast data packet are consistent with SN codes of a local terminal, if so, the terminal sets an ID number of the local terminal and stores the ID number in a FLASH ROM of a processor;
the terminal reads the ID number from the FLASH RAOM and then performs DHCP when initializing;
the terminal circularly waits when not being allocated with the IP address;
and after the terminal acquires the IP address through the DHCP, changing the last section of numerical value of the IP address into an ID number.
8. A system for automatically assigning a static IP address to a terminal, comprising: a terminal and a server;
wherein, the server is used for implementing the method for automatically allocating the terminal IP static address according to any one of claims 1 to 5;
the terminal is used for implementing the method for automatically allocating terminal IP static addresses according to claim 6 or 7.
9. An electronic device comprising a processor and a memory;
the memory is used for storing programs;
the processor executing the program realizes the method of any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that the storage medium stores a program which is executed by a processor to implement the method of any one of claims 1 to 7.
CN202210962229.8A 2022-08-11 2022-08-11 Method and system for automatically allocating terminal IP static address Pending CN115460174A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210962229.8A CN115460174A (en) 2022-08-11 2022-08-11 Method and system for automatically allocating terminal IP static address

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210962229.8A CN115460174A (en) 2022-08-11 2022-08-11 Method and system for automatically allocating terminal IP static address

Publications (1)

Publication Number Publication Date
CN115460174A true CN115460174A (en) 2022-12-09

Family

ID=84297639

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210962229.8A Pending CN115460174A (en) 2022-08-11 2022-08-11 Method and system for automatically allocating terminal IP static address

Country Status (1)

Country Link
CN (1) CN115460174A (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1435974A (en) * 2002-01-29 2003-08-13 三星电子株式会社 Domain name management method and apparatus
CN101141489A (en) * 2007-05-18 2008-03-12 中兴通讯股份有限公司 Terminal address automatic allocation method, terminal and network side server
US20120036233A1 (en) * 2009-03-31 2012-02-09 Scahill Francis J Addressing scheme
CN105407478A (en) * 2015-10-22 2016-03-16 深圳一电科技有限公司 Shooting equipment control method, shooting equipment and control terminal
CN110933192A (en) * 2019-10-21 2020-03-27 日立楼宇技术(广州)有限公司 Local area network IP address allocation method, device, system and computer equipment
CN111405078A (en) * 2020-03-05 2020-07-10 联想(北京)有限公司 Method, terminal and server for allocating IP address

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1435974A (en) * 2002-01-29 2003-08-13 三星电子株式会社 Domain name management method and apparatus
CN101141489A (en) * 2007-05-18 2008-03-12 中兴通讯股份有限公司 Terminal address automatic allocation method, terminal and network side server
US20120036233A1 (en) * 2009-03-31 2012-02-09 Scahill Francis J Addressing scheme
CN105407478A (en) * 2015-10-22 2016-03-16 深圳一电科技有限公司 Shooting equipment control method, shooting equipment and control terminal
CN110933192A (en) * 2019-10-21 2020-03-27 日立楼宇技术(广州)有限公司 Local area network IP address allocation method, device, system and computer equipment
CN111405078A (en) * 2020-03-05 2020-07-10 联想(北京)有限公司 Method, terminal and server for allocating IP address

Similar Documents

Publication Publication Date Title
CN102098354B (en) Method and server for allocating dynamic host configuration protocol (DHCP) addresses
JP4948839B2 (en) Method and apparatus for allocating network subscriber device addresses in a ProfitetIO network
CN105656653A (en) Network access method of newly added node in distributed coordination system, device and system
CN104426680A (en) Data transmission method, device and system
CN102984288A (en) Method and system for managing internet protocol version 6 (IPV6) address conflicts automatically
CN103797774A (en) Device and method for network address conversion
CN102447746B (en) Information supply method, family gateway and family network system
CN105119749A (en) Local batch upgrading method and system for home gateway
CN104378455A (en) IP address distribution method and device
CN103731353A (en) Physical address acquiring method of virtual machine
EP2704403A1 (en) Method and device for controlling address configuration manner
CN102404418A (en) Method, device and system for distributing IP (internet protocol) address for user terminal
CN102143242B (en) IP (internet protocol) network address allocation method, IP network address allocation equipment and IP network address allocation system
CN103916484A (en) IP-address configuring method and device
CN106357542A (en) Method for providing multicast service and software defined network controller
CN106576120A (en) Internet protocol address allocation method and router
CN114244842B (en) Secure resource scheduling method and device, electronic equipment and storage medium
CN102035899A (en) Method and device for determining addresses in IPv6 (internet protocol version 6) based LAN (local area network)
CN109769038A (en) A kind of method and device of configuring internet protocol address
CN103338275A (en) Port distribution method and apparatus
CN109885336B (en) Offline configuration method and device of intelligent equipment
CN115460174A (en) Method and system for automatically allocating terminal IP static address
CN109361694B (en) Network communication method
CN101779492B (en) Methods and apparatus for signaling parameter distribution for neighboring radio frequencies
CN115474257A (en) Method and device for accessing Mesh network

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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20221209