[go: up one dir, main page]
More Web Proxy on the site http://driver.im/

WO2017101159A1 - Ip address generating method and device - Google Patents

Ip address generating method and device Download PDF

Info

Publication number
WO2017101159A1
WO2017101159A1 PCT/CN2015/099707 CN2015099707W WO2017101159A1 WO 2017101159 A1 WO2017101159 A1 WO 2017101159A1 CN 2015099707 W CN2015099707 W CN 2015099707W WO 2017101159 A1 WO2017101159 A1 WO 2017101159A1
Authority
WO
WIPO (PCT)
Prior art keywords
address
terminal
generating
preset
segment
Prior art date
Application number
PCT/CN2015/099707
Other languages
French (fr)
Chinese (zh)
Inventor
王艳波
Original Assignee
邦彦技术股份有限公司
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 邦彦技术股份有限公司 filed Critical 邦彦技术股份有限公司
Publication of WO2017101159A1 publication Critical patent/WO2017101159A1/en

Links

Classifications

    • 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

Definitions

  • the present invention relates to the field of computer technologies, and in particular, to a method and an apparatus for generating an IP address.
  • the communication terminal accesses the management network port, it uses the same IP address set by the system (Internet Protocol). Address, Internet Protocol address) access, that is, the system configures each terminal to be the same IP address, so that multiple terminals use the same IP address to access the management network port and communicate, but when multiple terminals are in the same If you use the same IP address to access the management network port at a time, the network will be busy and the network speed will be slow. Obviously, multiple terminals are configured as the same IP address to access the management network port, enabling terminal access management. The efficiency of the network port is low.
  • Internet Protocol Internet Protocol
  • the main purpose of the present invention is to provide a method and an apparatus for generating an IP address, which aims to solve the technical problem that the terminal accesses the management network port with low efficiency.
  • the present invention provides an IP address generating method, where the IP address generating method includes the following steps:
  • the step of generating the Internet Protocol address IP address of the terminal according to the obtained physical address and the preset IP address segment includes:
  • the IP address generating method further includes:
  • the step of storing the generated IP address comprises:
  • the IP address is stored in a read only memory.
  • the IP address generating method further includes:
  • the IP address of the terminal Upon receiving the IP address input by the user based on the information input interface, the IP address of the terminal is updated according to the input IP address.
  • the present invention further provides an IP address generating apparatus, where the IP address generating apparatus includes:
  • An obtaining module configured to acquire a physical address of the terminal when detecting an instruction for generating an IP address
  • a generating module configured to generate an internet protocol address IP address of the terminal according to the obtained physical address and a preset IP address segment;
  • a storage module stores the generated IP address.
  • the generating module comprises:
  • An extracting unit configured to extract a lower address of a preset number of bits in the physical address
  • a generating unit configured to add the extracted lower address to the preset IP address segment to generate an IP address of the terminal.
  • the generating module further includes:
  • An obtaining unit configured to obtain an updated IP address segment when detecting an update instruction of the IP address segment
  • an updating unit configured to update an IP address of the terminal according to the updated IP address segment.
  • the storage module is further configured to store the IP address into a read only memory.
  • the IP address generating apparatus further includes:
  • a display module configured to display a preset information input interface when detecting a modification instruction of the IP address
  • an update module configured to update an IP address of the terminal according to the input IP address when receiving an IP address input by the user based on the information input interface.
  • the method and device for generating an IP address acquires a physical address of a terminal when detecting an instruction for generating an IP address, and then generates an internet protocol of the terminal according to the obtained physical address and a preset IP address segment.
  • the address IP address stores the generated IP address instead of configuring each terminal as the same IP address.
  • the present invention generates an IP address of the terminal through the physical address of the terminal, so that each terminal accesses the IP of the management network port. Different addresses reduce the network speed and the network speed is slow, which improves the efficiency of the terminal access management network port.
  • FIG. 1 is a schematic flowchart of a first embodiment of an IP address generation method according to the present invention
  • FIG. 2 is a schematic flowchart of a first embodiment of generating an Internet Protocol address IP address of the terminal according to the obtained physical address and a preset IP address segment;
  • FIG. 3 is a schematic flowchart of a second embodiment of generating an Internet Protocol address IP address of the terminal according to the obtained physical address and a preset IP address segment;
  • FIG. 4 is a schematic flowchart of a fourth embodiment of an IP address generation method according to the present invention.
  • FIG. 5 is a schematic diagram of functional modules of a first embodiment of an IP address generating apparatus according to the present invention.
  • FIG. 6 is a schematic diagram of a first refinement function module of the generation module in FIG. 5;
  • FIG. 7 is a schematic diagram of a second refinement function module of the generation module in FIG. 5;
  • FIG. 8 is a schematic diagram of functional modules of a fourth embodiment of an IP address generating apparatus according to the present invention.
  • the invention provides an IP address generation method.
  • FIG. 1 is a schematic flowchart diagram of a first embodiment of an IP address generation method according to the present invention.
  • This embodiment provides an IP address generation method, where the IP address generation method includes:
  • Step S10 Acquire a physical address of the terminal when detecting an instruction for generating an IP address
  • the triggering manner of the generating instruction of the IP address includes:
  • Method 1 When detecting an access command of the terminal accessing the management network port, acquiring an IP address pre-stored by the terminal, extracting a low-order address of the preset number of bits in the obtained IP address, and The lower address of the same number of bits is extracted from the physical address of the terminal, and the two extracted lower addresses are compared, and when the two lower addresses are inconsistent, the generation instruction of the IP address is triggered.
  • Method 2 When the access command of the terminal access management network port is detected, if the pre-stored IP address in the terminal is an IP address assigned by the server, an IP address generation command is triggered.
  • triggering manners of the generating instructions of the two types of IP addresses listed above are merely exemplary. Those skilled in the art can use the technical idea of the present invention to trigger the generating instructions of other IP addresses according to their specific requirements. Within the scope of the present invention, it is not exhaustive here.
  • the physical address of the terminal is obtained, and the physical address of the terminal is a MAC address (Media Access Control, also known as hardware address).
  • MAC address Media Access Control, also known as hardware address
  • Step S20 Generate an IP address of the terminal according to the obtained physical address and a preset IP address segment.
  • the manner of generating the IP address of the terminal according to the obtained physical address and the preset IP address segment is: extracting a low-order address of a preset number of bits in the physical address, and extracting The lower address is added to the preset IP address segment to generate the IP address of the terminal.
  • Step S30 storing the generated IP address.
  • the generated IP address is stored in a preset storage space, where the storage space includes a built-in memory and an external memory, and the built-in memory Including memory, flash memory or cache, the memory including read only memory and random access memory
  • the external memory includes an SD card, a hard disk, and the like.
  • the generated IP address is to be stored.
  • the conventional storage method is to store the generated IP address into a FLASH flash memory, and store the IP address in a flash memory.
  • the IP address cannot be read because the data stored in the flash memory is large and is repeatedly read and written, which tends to cause the stored data to be unstable. Therefore, in this embodiment, in order to improve the stability of the IP address storage.
  • the IP address is stored in the read-only memory. It can be understood that the read-only memory cannot be rewritten after the data is stored, and therefore, the stored data is more stable.
  • the generated IP address is stored, and then, when the management network port is accessed next time, the IP address stored in the pre-stored storage space is acquired first, and the obtained IP address is obtained.
  • the IP address is obtained by accessing the management network port according to the IP address. If the IP address fails to be obtained, the physical address of the terminal is re-acquired, and then the IP address of the terminal is generated according to the physical address of the terminal. Address and store the generated IP address.
  • the IP address generation method of the present embodiment acquires the physical address of the terminal when detecting the generation instruction of the IP address, and then generates the internet protocol address of the terminal according to the obtained physical address and the preset IP address segment.
  • the IP address is used to store the generated IP address, instead of configuring each terminal as the same IP address.
  • the present invention generates an IP address of the terminal through the physical address of the terminal, so that each terminal accesses the IP address of the management network port. Different, the network is slow and the network speed is slow, and the efficiency of the terminal access management network port is improved.
  • the step S20 includes:
  • Step S21 extracting a lower address of a preset number of bits in the physical address
  • the lower address of the preset number of bits in the physical address is extracted first.
  • the physical address is a MAC address
  • the MAC address is ten.
  • the hexadecimal number is represented by a total of six bytes (48 bits).
  • the first three bytes ie, the upper 24 bits
  • the last three bytes ie, the lower 24 bits
  • the extended identifier which is unique
  • Step S22 Add the extracted lower address to the preset IP address segment to generate an IP address of the terminal.
  • the extracted lower address is added to a preset IP address segment, and the preset IP address segment is the first 8 address in the IP address.
  • the IP address is a 32-bit binary number, and is usually divided into four "8-bit binary numbers" (that is, 4 bytes).
  • the preset IP address segment is used. Adding the extracted lower address to the preset IP address segment for the first 8 addresses in the IP address, that is, adding the lower 24-bit address extracted from the physical address to the 8-bit IP address to generate a new one.
  • IP address, and the MAC address is a hexadecimal number, and the IP address is a binary number.
  • the lower address of the MAC address is added to the preset IP address segment, and the MAC address is first
  • the lower address is converted to obtain a binary number, and the obtained binary number is added to the preset IP address segment to generate an IP address of the terminal.
  • the IP address segment is displayed by a decimal number. Therefore, the final generated IP address can be converted to a decimal number for display.
  • the physical address of the terminal is At 44-45-53-54-00-00, at this time, it can be known that the lower 24-bit address in the terminal is 54-00-00, and when the preset IP address segment is 192.xx.xx.xx, The extracted lower address 54-00-00 is added to the preset IP address segment 192.xx.xx.xx, and the extracted lower address 54-00-00 is added to the preset IP address segment 192.xx. The way in xx.xx is: convert the lower address 54-00-00 into the binary number 01010100-00000000-0000.
  • the binary number 01010100-00000000-00000000 is converted into a decimal number 84.0.0, and finally the converted decimal number 84.0.0 is added to the preset IP address segment 192.xx.xx.xx.
  • the IP address of the terminal is generated 192.84.0.0.
  • the lower-order address of the preset number of bits in the physical address is extracted, and the hexadecimal number of the extracted lower-order address is converted into the hexadecimal number of the preset IP address segment, and finally the converted The lower address is added to the preset IP address segment of the terminal, and the IP address of the terminal is generated, which improves the accuracy of the IP address generation of the terminal.
  • a third embodiment of the IP address generation method of the present invention is proposed based on the second embodiment.
  • the step S20 is performed. Also includes:
  • Step S23 Acquire an updated IP address segment when detecting an update instruction of the IP address segment
  • the manner of detecting whether the IP address segment is updated includes: real-time detection and timing detection, and the specific detection manner is set according to a specific situation, and the time interval of the timing detection is also determined according to specific conditions.
  • the setting needs to be set.
  • the interval between the timing detections is set to be shorter, such as every 5 minutes, and in the low peak period of the network access, the interval between the timing detections is set to be longer. , such as once every 30 minutes.
  • Step S24 updating the IP address of the terminal according to the updated IP address segment.
  • the preset IP address segment is set according to specific needs, that is, the IP address segment is not fixed, but may be changed according to specific needs, if the IP is detected.
  • the address segment is updated, for example, when the user updates the preset IP address segment from 192.xx.xx.xx to 202.xx.xx.xx according to specific needs, at this time, the updated IP address segment is obtained, and according to The updated IP address segment updates the IP address of the terminal, that is, keeps the last 24 bit address in the IP address unchanged, and updates the first 8 bit address to update the IP address of the terminal.
  • a fourth embodiment of the IP address generation method of the present invention is proposed based on the first, second or third embodiment.
  • the step S30 is performed.
  • the IP address generation method further includes:
  • Step S40 displaying a preset information input interface when detecting a modification instruction of the IP address
  • Step S50 Upon receiving the IP address input by the user based on the information input interface, update the IP address of the terminal according to the input IP address.
  • the user may trigger the modification instruction of the IP address based on the preset setting interface of the terminal, and when the modification instruction of the IP address is detected, Displaying a preset information input interface for the user to input an IP address based on the information input interface, such as the user inputting the IP address 159.226.1.1, and receiving the IP address input by the user based on the information input interface, according to the input
  • the IP address updates the IP address of the terminal, that is, replaces the input IP address with the stored IP address to update the IP address of the terminal.
  • the information input interface is displayed by the address update command input by the user, and after the user input information is completed, the IP address is updated, and the IP address is not only generated by the physical address of the terminal and the preset IP address segment, but also It can be modified according to the needs of users, which improves the intelligence of IP address generation.
  • the present invention further provides an IP address generating apparatus.
  • FIG. 5 is a schematic diagram of functional modules of a first embodiment of an IP address generating apparatus according to the present invention.
  • the functional block diagram shown in FIG. 5 is merely an exemplary diagram of a preferred embodiment, and those skilled in the art will surround the functional modules of the IP address generating apparatus shown in FIG.
  • the new function modules can be easily supplemented; the names of the function modules are custom names, which are only used to assist in understanding the various program function blocks of the IP address generating device, and are not used to limit the technical solution of the present invention.
  • the core is the function that each functional module of the defined name has to achieve.
  • the embodiment provides an IP address generating apparatus, where the IP address generating apparatus includes:
  • the obtaining module 10 is configured to acquire a physical address of the terminal when detecting an instruction for generating an IP address;
  • the triggering manner of the generating instruction of the IP address includes:
  • Method 1 When detecting an access command of the terminal accessing the management network port, acquiring an IP address pre-stored by the terminal, extracting a low-order address of the preset number of bits in the obtained IP address, and The lower address of the same number of bits is extracted from the physical address of the terminal, and the two extracted lower addresses are compared, and when the two lower addresses are inconsistent, the generation instruction of the IP address is triggered.
  • Method 2 When the access command of the terminal access management network port is detected, if the pre-stored IP address in the terminal is an IP address assigned by the server, an IP address generation command is triggered.
  • triggering manners of the generating instructions of the two types of IP addresses listed above are merely exemplary. Those skilled in the art can use the technical idea of the present invention to trigger the generating instructions of other IP addresses according to their specific requirements. Within the scope of the present invention, it is not exhaustive here.
  • the acquiring module 10 when detecting the generation instruction of the IP address, acquires the physical address of the terminal, and the physical address of the terminal is a MAC address (Media Access Control, also known as hardware address).
  • MAC address Media Access Control, also known as hardware address
  • the generating module 20 is configured to generate an internet protocol address IP address of the terminal according to the obtained physical address and a preset IP address segment;
  • the generating module 20 generates the IP address of the terminal according to the physical address and the preset IP address segment acquired by the acquiring module 10, and extracts the preset in the physical address.
  • the lower address of the number of bits adds the extracted lower address to the preset IP address segment to generate the IP address of the terminal.
  • the storage module 30 stores the generated IP address.
  • the storage module 30 stores the generated IP address into a preset storage space, where the storage space includes a built-in storage space.
  • the storage space includes a built-in storage space.
  • the internal memory including a memory, a flash memory or a cache, the memory including a read only memory and a random access memory
  • the external memory includes an SD card, a hard disk, and the like.
  • the storage module 30 stores the generated IP address, and the traditional storage manner is to store the generated IP address into the FLASH flash memory.
  • the IP address is stored in the flash memory, there may be a case where the IP address cannot be read, because the data stored in the flash memory is large, and the data is repeatedly read and written, which may easily cause the stored data to be unstable.
  • the storage module 30 stores the IP address into the read-only memory. It can be understood that the read-only memory is After the data is stored, it cannot be rewritten, so the stored data is more stable.
  • the storage module 30 stores the generated IP address, and then, when accessing the management network port, the acquiring module 10 acquires the pre-stored storage.
  • the IP address stored in the space may be accessed by the acquiring module 10 when the IP address is obtained, and the acquiring module 10 may be accessed when the IP address fails to be obtained.
  • the generating module 20 Retrieving the physical address of the terminal, the generating module 20 generates an IP address of the terminal according to the physical address of the terminal, and the storage module 30 stores the generated IP address.
  • the IP address generating apparatus of the present embodiment acquires the physical address of the terminal when detecting the generation instruction of the IP address, and then generates the internet protocol address of the terminal according to the obtained physical address and the preset IP address segment.
  • the IP address is used to store the generated IP address, instead of configuring each terminal as the same IP address.
  • the present invention generates an IP address of the terminal through the physical address of the terminal, so that each terminal accesses the IP address of the management network port. Different, the network is slow and the network speed is slow, and the efficiency of the terminal access management network port is improved.
  • the generating module 20 includes:
  • the extracting unit 21 is configured to extract a lower address of the preset number of bits in the physical address
  • the extracting unit 21 first extracts a low-order address of a preset number of bits in the physical address of the terminal, and it can be understood that the The physical address of the terminal is the MAC address, and the MAC address is represented by a hexadecimal number, which is six bytes (48 bits).
  • the first three bytes (ie, the upper 24 bits) represent the code of different manufacturers, and the last three bytes (ie, the lower 24 bits) specify the adapter interface of the production, called the extended identifier, which is unique, so
  • the extracting unit 21 extracts the lower address of the preset number of bits in the physical address of the terminal, and actually extracts the lower 24-bit address of the physical address of the terminal.
  • the generating unit 22 is configured to add the extracted lower address to the preset IP address segment to generate an IP address of the terminal.
  • the generating unit 22 adds the lower address extracted by the extracting unit 21 to a preset IP address segment, where the preset IP address segment is the first 8 bit address in the IP address.
  • the IP address is a 32-bit binary number, and is usually divided into four "8-bit binary numbers" (that is, 4 bytes).
  • the preset IP address segment is used.
  • the generating unit 22 adds the extracted lower address to the preset IP address segment, that is, adds the lower 24-bit address extracted from the physical address to the 8-bit IP address.
  • the IP address is a binary number, therefore, adding the lower address of the MAC address to the preset IP address segment, first of all The lower address of the MAC address is converted to obtain a binary number, and the obtained binary number is added to the preset IP address segment to generate an IP address of the terminal.
  • the IP address segment is passed through a decimal number. The number is displayed, so the resulting IP address can be converted to a decimal number for display.
  • the physical address of the terminal is At 44-45-53-54-00-00, at this time, it can be known that the lower 24-bit address in the terminal is 54-00-00, and when the preset IP address segment is 192.xx.xx.xx, The generating unit 22 adds the lower address 54-00-00 extracted by the extracting unit 21 to the preset IP address segment 192.xx.xx.xx, and the generating unit 22 extracts the low bit extracted by the extracting unit 21.
  • the address 54-00-00 is added to the preset IP address segment 192.xx.xx.xx in the following way: the lower address 54-00-00 is converted into a binary number 01010100-00000000-00000000, at this time, in order to make the conversion
  • the hexadecimal number of the lower address is the same as the hexadecimal number of the preset IP address segment, and the binary number 01010100-00000000-00000000 is converted into a decimal number 84.0.0, and the converted decimal number 84.0.0 is finally converted.
  • Adding to the preset IP address segment 192.xx.xx.xx generating the IP address of the terminal 192.84.0.0.
  • the extracting unit 21 converts the lower-order address of the preset low-order address into the hexadecimal number of the preset IP address segment by extracting the lower-order address of the preset number of bits in the physical address.
  • the generating unit 22 adds the converted lower address to the IP address segment preset by the terminal, generates an IP address of the terminal, and improves the accuracy of the IP address generation of the terminal.
  • the generating module 20 further includes:
  • the obtaining unit 23 is configured to obtain an updated IP address segment when detecting an update instruction of the IP address segment;
  • the manner of detecting whether the IP address segment is updated includes: real-time detection and timing detection, and the specific detection manner is set according to a specific situation, and the time interval of the timing detection is also determined according to specific conditions.
  • the setting needs to be set.
  • the interval between the timing detections is set to be shorter, such as every 5 minutes, and in the low peak period of the network access, the interval between the timing detections is set to be longer. , such as once every 30 minutes.
  • the updating unit 24 is configured to update an IP address of the terminal according to the updated IP address segment.
  • the preset IP address segment is set according to specific needs, that is, the IP address segment is not fixed, but may be changed according to specific needs, if the IP is detected.
  • the address segment is updated, for example, the user updates the preset IP address segment from 192.xx.xx.xx to 202.xx.xx.xx according to specific needs.
  • the obtaining unit 23 obtains the updated IP.
  • the update unit 24 updates the IP address of the terminal according to the updated IP address segment, that is, the update unit 24 keeps the last 24 bit addresses in the IP address unchanged, before the update.
  • An 8-bit address to update the IP address of the terminal is set according to specific needs, that is, the IP address segment is not fixed, but may be changed according to specific needs, if the IP is detected.
  • the address segment is updated, for example, the user updates the preset IP address segment from 192.xx.xx.xx to 202.xx.xx.xx according to specific needs.
  • the obtaining unit 23 obtains the updated IP.
  • the update unit 24 updates the IP
  • the obtaining unit 23 obtains an updated IP address segment, and the updating unit 24 is configured according to the updated The IP address segment updates the IP address of the terminal, which improves the flexibility of IP address generation.
  • the generating device further includes:
  • the display module 40 is configured to display a preset information input interface when detecting a modification instruction of the IP address;
  • the updating module 50 is configured to update an IP address of the terminal according to the input IP address when receiving an IP address input by the user based on the information input interface.
  • the user can trigger the modification instruction of the IP address based on the preset setting interface of the terminal, and the IP address is detected.
  • the display module 40 displays a preset information input interface for the user to input an IP address based on the information input interface, such as the user inputting the IP address 159.226.1.1, and receiving the user based on the information input interface.
  • the update module 50 can update the IP address of the terminal according to the input IP address, that is, replace the input IP address with the stored IP address to update the IP address of the terminal.
  • the display module 40 displays an information input interface by using an address update command input by the user, and after the user input information is completed, the update module 50 updates the IP address, and implements the IP address not only through the physical address of the terminal but also The preset IP address segment is generated, and can be modified according to the user's needs, thereby improving the intelligence of IP address generation.
  • the foregoing embodiment method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be through hardware, but in many cases, the former is better.
  • Implementation Based on such understanding, the technical solution of the present invention, which is essential or contributes to the prior art, may be embodied in the form of a software product stored in a storage medium (such as ROM/RAM, disk,
  • the optical disc includes a number of instructions for causing a terminal device (which may be a cell phone, a computer, a server, an air conditioner, or a network device, etc.) to perform the methods described in various embodiments of the present invention.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Small-Scale Networks (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

An IP address generating method and device. The method comprises: obtaining a physical address of a terminal when an instruction for generating an Internet Protocol (IP) address is detected (S10); generating an IP address of the terminal according to the obtained physical address and a preset IP address field (S20); and storing the generated IP address (S30). By generating IP addresses of terminals on the basis of physical addresses of the terminals, the IP addresses of the various terminals accessing a management port are different, thereby reducing the occurrence of slow network speeds caused by heavy network load and improving the efficiency of accesses to a management port by terminals.

Description

IP地址生成方法及装置  IP address generation method and device
技术领域Technical field
本发明涉及计算机技术领域,尤其涉及一种IP地址生成方法及装置。The present invention relates to the field of computer technologies, and in particular, to a method and an apparatus for generating an IP address.
背景技术Background technique
目前,通讯终端接入管理网口时,都是使用系统设置的同一个IP地址(Internet Protocol Address,网际协议地址)进行接入,也就是说系统将各个终端都配置为同一个IP地址,让多个终端使用同一个IP地址接入管理网口并通讯,但是,当多个终端在同一个时间使用同一个IP地址接入管理网口时,会导致网络繁忙,而出现网速慢的情况,显然,将多个终端配置为同一个IP地址接入管理网口,使得终端接入管理网口的效率低。At present, when the communication terminal accesses the management network port, it uses the same IP address set by the system (Internet Protocol). Address, Internet Protocol address) access, that is, the system configures each terminal to be the same IP address, so that multiple terminals use the same IP address to access the management network port and communicate, but when multiple terminals are in the same If you use the same IP address to access the management network port at a time, the network will be busy and the network speed will be slow. Obviously, multiple terminals are configured as the same IP address to access the management network port, enabling terminal access management. The efficiency of the network port is low.
发明内容Summary of the invention
本发明的主要目的在于提出一种IP地址生成方法及装置,旨在解决终端接入管理网口的效率低的技术问题。The main purpose of the present invention is to provide a method and an apparatus for generating an IP address, which aims to solve the technical problem that the terminal accesses the management network port with low efficiency.
为实现上述目的,本发明提供的一种IP地址生成方法,所述IP地址生成方法包括以下步骤:To achieve the above objective, the present invention provides an IP address generating method, where the IP address generating method includes the following steps:
在检测到IP地址的生成指令时,获取终端的物理地址;Obtaining the physical address of the terminal when detecting the generation instruction of the IP address;
根据获取的所述物理地址以及预设的IP地址段,生成所述终端的网际协议地址IP地址;Generating an internet protocol address IP address of the terminal according to the obtained physical address and a preset IP address segment;
存储生成的所述IP地址。Store the generated IP address.
优选地,所述根据获取的所述物理地址以及预设的IP地址段生成所述终端的网际协议地址IP地址的步骤包括:Preferably, the step of generating the Internet Protocol address IP address of the terminal according to the obtained physical address and the preset IP address segment includes:
提取所述物理地址中预设位数的低位地址;Extracting a lower address of a preset number of bits in the physical address;
将提取的低位地址添加到预设的所述IP地址段中,生成所述终端的IP地址。Adding the extracted lower address to the preset IP address segment to generate an IP address of the terminal.
优选地,所述生成所述终端的IP地址的步骤之后,所述IP地址生成方法还包括:Preferably, after the step of generating the IP address of the terminal, the IP address generating method further includes:
在检测到所述IP地址段的更新指令时,获取更新后的IP地址段;Obtaining an updated IP address segment when detecting an update instruction of the IP address segment;
根据所述更新后的IP地址段更新所述终端的IP地址。Updating the IP address of the terminal according to the updated IP address segment.
优选地,所述存储生成的所述IP地址的步骤包括:Preferably, the step of storing the generated IP address comprises:
将所述IP地址存储至只读存储器中。The IP address is stored in a read only memory.
优选地,所述存储生成的所述IP地址的步骤之后,所述IP地址生成方法还包括:Preferably, after the step of storing the generated IP address, the IP address generating method further includes:
在检测到IP地址的修改指令时,显示预设的信息输入界面;When the modification instruction of the IP address is detected, a preset information input interface is displayed;
在接收到用户基于所述信息输入界面输入的IP地址时,根据输入的IP地址更新所述终端的IP地址。Upon receiving the IP address input by the user based on the information input interface, the IP address of the terminal is updated according to the input IP address.
此外,为实现上述目的,本发明还提出一种IP地址生成装置,所述IP地址生成装置包括:In addition, in order to achieve the above object, the present invention further provides an IP address generating apparatus, where the IP address generating apparatus includes:
获取模块,用于在检测到IP地址的生成指令时,获取终端的物理地址;An obtaining module, configured to acquire a physical address of the terminal when detecting an instruction for generating an IP address;
生成模块,用于根据获取的所述物理地址以及预设的IP地址段,生成所述终端的网际协议地址IP地址;a generating module, configured to generate an internet protocol address IP address of the terminal according to the obtained physical address and a preset IP address segment;
存储模块,存储生成的所述IP地址。A storage module stores the generated IP address.
优选地,所述生成模块包括:Preferably, the generating module comprises:
提取单元,用于提取所述物理地址中预设位数的低位地址;An extracting unit, configured to extract a lower address of a preset number of bits in the physical address;
生成单元,用于将提取的低位地址添加到预设的所述IP地址段中,生成所述终端的IP地址。And a generating unit, configured to add the extracted lower address to the preset IP address segment to generate an IP address of the terminal.
优选地,所述生成模块还包括:Preferably, the generating module further includes:
获取单元,用于在检测到所述IP地址段的更新指令时,获取更新后的IP地址段;An obtaining unit, configured to obtain an updated IP address segment when detecting an update instruction of the IP address segment;
更新单元,用于根据所述更新后的IP地址段更新所述终端的IP地址。And an updating unit, configured to update an IP address of the terminal according to the updated IP address segment.
优选地,所述存储模块还用于将所述IP地址存储至只读存储器中。Preferably, the storage module is further configured to store the IP address into a read only memory.
优选地,所述IP地址生成装置还包括:Preferably, the IP address generating apparatus further includes:
显示模块,用于在检测到IP地址的修改指令时,显示预设的信息输入界面;a display module, configured to display a preset information input interface when detecting a modification instruction of the IP address;
更新模块,用于在接收到用户基于所述信息输入界面输入的IP地址时,根据输入的IP地址更新所述终端的IP地址。And an update module, configured to update an IP address of the terminal according to the input IP address when receiving an IP address input by the user based on the information input interface.
本发明提出的IP地址生成方法及装置,在检测到IP地址的生成指令时,获取终端的物理地址,然后根据获取的所述物理地址以及预设的IP地址段,生成所述终端的网际协议地址IP地址,存储生成的所述IP地址,而不是将各个终端都配置为同一个IP地址,本发明通过终端的物理地址生成所述终端的IP地址,使得各个终端接入管理网口的IP地址不同,减少了网络繁忙而出现网速慢的情况,提高了终端接入管理网口的效率。The method and device for generating an IP address according to the present invention acquires a physical address of a terminal when detecting an instruction for generating an IP address, and then generates an internet protocol of the terminal according to the obtained physical address and a preset IP address segment. The address IP address stores the generated IP address instead of configuring each terminal as the same IP address. The present invention generates an IP address of the terminal through the physical address of the terminal, so that each terminal accesses the IP of the management network port. Different addresses reduce the network speed and the network speed is slow, which improves the efficiency of the terminal access management network port.
附图说明DRAWINGS
图1为本发明IP地址生成方法第一实施例的流程示意图;1 is a schematic flowchart of a first embodiment of an IP address generation method according to the present invention;
图2为本发明根据获取的所述物理地址以及预设的IP地址段,生成所述终端的网际协议地址IP地址第一实施例的流程示意图;2 is a schematic flowchart of a first embodiment of generating an Internet Protocol address IP address of the terminal according to the obtained physical address and a preset IP address segment;
图3为本发明根据获取的所述物理地址以及预设的IP地址段,生成所述终端的网际协议地址IP地址第二实施例的流程示意图;FIG. 3 is a schematic flowchart of a second embodiment of generating an Internet Protocol address IP address of the terminal according to the obtained physical address and a preset IP address segment;
图4为本发明IP地址生成方法第四实施例的流程示意图;4 is a schematic flowchart of a fourth embodiment of an IP address generation method according to the present invention;
图5为本发明IP地址生成装置第一实施例的功能模块示意图;FIG. 5 is a schematic diagram of functional modules of a first embodiment of an IP address generating apparatus according to the present invention; FIG.
图6为图5中生成模块的第一细化功能模块示意图;6 is a schematic diagram of a first refinement function module of the generation module in FIG. 5;
图7为图5中生成模块的第二细化功能模块示意图;7 is a schematic diagram of a second refinement function module of the generation module in FIG. 5;
图8为本发明IP地址生成装置第四实施例的功能模块示意图。FIG. 8 is a schematic diagram of functional modules of a fourth embodiment of an IP address generating apparatus according to the present invention.
本发明目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。The implementation, functional features, and advantages of the present invention will be further described in conjunction with the embodiments.
具体实施方式detailed description
应当理解,此处所描述的具体实施例仅仅用以解释本发明,并不用于限定本发明。It is understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
本发明提供一种IP地址生成方法。The invention provides an IP address generation method.
参照图1,图1为本发明IP地址生成方法第一实施例的流程示意图。Referring to FIG. 1, FIG. 1 is a schematic flowchart diagram of a first embodiment of an IP address generation method according to the present invention.
本实施例提出一种IP地址生成方法,所述IP地址生成方法包括:This embodiment provides an IP address generation method, where the IP address generation method includes:
步骤S10,在检测到IP地址的生成指令时,获取终端的物理地址;Step S10: Acquire a physical address of the terminal when detecting an instruction for generating an IP address;
在本实施例中,所述IP地址的生成指令的触发方式包括:In this embodiment, the triggering manner of the generating instruction of the IP address includes:
1)方式一、在检测到终端接入管理网口的接入指令时,获取所述终端预存的IP地址,在获取的所述IP地址中提取出预设位数的低位地址,并在所述终端的物理地址中提取出同样位数的低位地址,将两个提取的低位地址进行对比,在两个低位地址不一致时,触发IP地址的生成指令。1) Method 1: When detecting an access command of the terminal accessing the management network port, acquiring an IP address pre-stored by the terminal, extracting a low-order address of the preset number of bits in the obtained IP address, and The lower address of the same number of bits is extracted from the physical address of the terminal, and the two extracted lower addresses are compared, and when the two lower addresses are inconsistent, the generation instruction of the IP address is triggered.
2)方式二、在检测到终端接入管理网口的接入指令时,若终端中的预存的IP地址为服务器分配的IP地址,则触发IP地址的生成指令。2) Method 2: When the access command of the terminal access management network port is detected, if the pre-stored IP address in the terminal is an IP address assigned by the server, an IP address generation command is triggered.
以上所列举出的两种IP地址的生成指令的触发方式仅仅为示例性的,本领域技术人员利用本发明的技术思想,根据其具体需求所提出的其它IP地址的生成指令的触发方式均在本发明的保护范围内,在此不进行一一穷举。The triggering manners of the generating instructions of the two types of IP addresses listed above are merely exemplary. Those skilled in the art can use the technical idea of the present invention to trigger the generating instructions of other IP addresses according to their specific requirements. Within the scope of the present invention, it is not exhaustive here.
在本实施例中,在检测IP地址的生成指令时,获取终端的物理地址,所述终端的物理地址为MAC地址(Media Access Control,也称硬件地址)。In this embodiment, when detecting an IP address generation instruction, the physical address of the terminal is obtained, and the physical address of the terminal is a MAC address (Media Access Control, also known as hardware address).
步骤S20,根据获取的所述物理地址以及预设的IP地址段,生成所述终端的IP地址;Step S20: Generate an IP address of the terminal according to the obtained physical address and a preset IP address segment.
在本实施例中,所述根据获取的所述物理地址以及预设的IP地址段,生成所述终端的IP地址的方式为:提取所述物理地址中预设位数的低位地址,将提取的低位地址添加到预设的IP地址段中,生成所述终端的IP地址。In this embodiment, the manner of generating the IP address of the terminal according to the obtained physical address and the preset IP address segment is: extracting a low-order address of a preset number of bits in the physical address, and extracting The lower address is added to the preset IP address segment to generate the IP address of the terminal.
步骤S30,存储生成的所述IP地址。Step S30, storing the generated IP address.
在本实施例中,在生成所述终端的所述IP地址后,将生成的所述IP地址存储到预设的存储空间中,所述存储空间包括内置存储器和外置存储器,所述内置存储器包括内存、闪存或缓存,所述内存包括只读存储器和随机存储器 ;所述外置存储器包括SD卡、硬盘等等。In this embodiment, after the IP address of the terminal is generated, the generated IP address is stored in a preset storage space, where the storage space includes a built-in memory and an external memory, and the built-in memory Including memory, flash memory or cache, the memory including read only memory and random access memory The external memory includes an SD card, a hard disk, and the like.
在本实施例中,生成所述IP地址后,要存储生成的所述IP地址,传统的存储方式是将生成的所述IP地址存储到FLASH闪存中,而将所述IP地址存储到闪存中,可能存在读取不到IP地址的情况,因为,闪存中存储的数据较多,并且会反复读写,容易导致存储的数据不稳定,因此本实施例中,为了提高IP地址存储的稳定性,在生成所述IP地址后,将所述IP地址存储至只读存储器中,可以理解的是,只读存储器在数据存入后就不能进行改写,因此,存储的数据更加稳定。In this embodiment, after the IP address is generated, the generated IP address is to be stored. The conventional storage method is to store the generated IP address into a FLASH flash memory, and store the IP address in a flash memory. There may be cases where the IP address cannot be read because the data stored in the flash memory is large and is repeatedly read and written, which tends to cause the stored data to be unstable. Therefore, in this embodiment, in order to improve the stability of the IP address storage. After the IP address is generated, the IP address is stored in the read-only memory. It can be understood that the read-only memory cannot be rewritten after the data is stored, and therefore, the stored data is more stable.
进一步地,在生成终端的所述IP地址后,存储生成的所述IP地址,然后在下次接入管理网口时,先获取预存的存储空间中存储的所述IP地址,在获取到所述IP地址时,可根据所述IP地址接入管理网口;而在获取到IP地址失败时,则重新获取所述终端的物理地址,然后再根据所述终端的物理地址生成所述终端的IP地址,并存储生成的IP地址。Further, after the IP address of the terminal is generated, the generated IP address is stored, and then, when the management network port is accessed next time, the IP address stored in the pre-stored storage space is acquired first, and the obtained IP address is obtained. The IP address is obtained by accessing the management network port according to the IP address. If the IP address fails to be obtained, the physical address of the terminal is re-acquired, and then the IP address of the terminal is generated according to the physical address of the terminal. Address and store the generated IP address.
本实施例提出的IP地址生成方法,在检测到IP地址的生成指令时,获取终端的物理地址,然后根据获取的所述物理地址以及预设的IP地址段,生成所述终端的网际协议地址IP地址,存储生成的所述IP地址,而不是将各个终端都配置为同一个IP地址,本发明通过终端的物理地址生成所述终端的IP地址,使得各个终端接入管理网口的IP地址不同,减少了网络繁忙而出现网速慢的情况,提高了终端接入管理网口的效率。The IP address generation method of the present embodiment acquires the physical address of the terminal when detecting the generation instruction of the IP address, and then generates the internet protocol address of the terminal according to the obtained physical address and the preset IP address segment. The IP address is used to store the generated IP address, instead of configuring each terminal as the same IP address. The present invention generates an IP address of the terminal through the physical address of the terminal, so that each terminal accesses the IP address of the management network port. Different, the network is slow and the network speed is slow, and the efficiency of the terminal access management network port is improved.
进一步地,为了提高IP地址生成的准确性,基于第一实施例提出本发明IP地址生成方法的第二实施例,在本实施例中,参照图2,所述步骤S20包括:Further, in order to improve the accuracy of the IP address generation, a second embodiment of the IP address generation method of the present invention is proposed based on the first embodiment. In this embodiment, referring to FIG. 2, the step S20 includes:
步骤S21,提取所述物理地址中预设位数的低位地址;Step S21, extracting a lower address of a preset number of bits in the physical address;
在本实施例中,在获取到所述终端的物理地址时,先提取出所述物理地址中预设位数的低位地址,可以理解的是,所述物理地址是MAC地址,MAC地址采用十六进制数表示,共六个字节(48位)。其中,前三个字节(即高位24位)是表示的是不同厂家的代码,而后三个字节(即低位24位)指定生产的适配器接口,称为扩展标识符,具有唯一性,因此,提取所述物理地址中预设位数的低位地址,实际上是提取所述物理地址中的低位24位地址。In this embodiment, when the physical address of the terminal is obtained, the lower address of the preset number of bits in the physical address is extracted first. It can be understood that the physical address is a MAC address, and the MAC address is ten. The hexadecimal number is represented by a total of six bytes (48 bits). Wherein, the first three bytes (ie, the upper 24 bits) represent the code of different manufacturers, and the last three bytes (ie, the lower 24 bits) specify the adapter interface of the production, called the extended identifier, which is unique, so Extracting the lower address of the preset number of bits in the physical address, actually extracting the lower 24-bit address of the physical address.
步骤S22,将提取的低位地址添加到预设的IP地址段中,生成所述终端的IP地址。Step S22: Add the extracted lower address to the preset IP address segment to generate an IP address of the terminal.
在本实施例中,将提取的低位地址添加到预设的IP地址段中,所述预设的IP地址段是IP地址中的前8位地址。可以理解的是,IP地址是一个32位的二进制数,通常被分割为4个“8位二进制数”(也就是4个字节),而本实施例中,所述预设的IP地址段为IP地址中前8位地址,将提取的低位地址添加到预设的IP地址段中,也就是将所述物理地址中提取的低位24位地址添加到8位IP地址后面,以生成一个新的IP地址,而所述MAC地址是十六进制数,IP地址是二进制数,因此,将所述MAC地址的低位地址添加到预设的IP地址段中,首先要将所述MAC地址的低位地址进行转化得到二进制数,再将得到的二进制数添加到所述预设的IP地址段中,以生成所述终端的IP地址,一般情况下,IP地址段是通过十进制数进行显示的,因此,可将最终生成的IP地址转化为十进制数进行显示。为更好理解本实施例,举例如下:在终端的物理地址为 44-45-53-54-00-00时,此时,可知道终端中低位24位地址为54-00-00,而在预设的IP地址段为192.xx.xx.xx时,将提取的低位地址54-00-00添加到预设的IP地址段192.xx.xx.xx中,所述将提取的低位地址54-00-00添加到预设的IP地址段192.xx.xx.xx中的方式为:将低位地址54-00-00转化为二进制数01010100-00000000-00000000,此时,为了使转化后的低位地址的进制数和预设的IP地址段的进制数一致,将所述二进制数01010100-00000000-00000000转化为十进制数84.0.0,最后将转化得到的十进制数84.0.0添加到所述预设的IP地址段192.xx.xx.xx中,生成所述终端的IP地址192.84.0.0。In this embodiment, the extracted lower address is added to a preset IP address segment, and the preset IP address segment is the first 8 address in the IP address. It can be understood that the IP address is a 32-bit binary number, and is usually divided into four "8-bit binary numbers" (that is, 4 bytes). In this embodiment, the preset IP address segment is used. Adding the extracted lower address to the preset IP address segment for the first 8 addresses in the IP address, that is, adding the lower 24-bit address extracted from the physical address to the 8-bit IP address to generate a new one. IP address, and the MAC address is a hexadecimal number, and the IP address is a binary number. Therefore, the lower address of the MAC address is added to the preset IP address segment, and the MAC address is first The lower address is converted to obtain a binary number, and the obtained binary number is added to the preset IP address segment to generate an IP address of the terminal. Generally, the IP address segment is displayed by a decimal number. Therefore, the final generated IP address can be converted to a decimal number for display. For a better understanding of the embodiment, an example is as follows: the physical address of the terminal is At 44-45-53-54-00-00, at this time, it can be known that the lower 24-bit address in the terminal is 54-00-00, and when the preset IP address segment is 192.xx.xx.xx, The extracted lower address 54-00-00 is added to the preset IP address segment 192.xx.xx.xx, and the extracted lower address 54-00-00 is added to the preset IP address segment 192.xx. The way in xx.xx is: convert the lower address 54-00-00 into the binary number 01010100-00000000-00000000. At this time, in order to make the converted lower address hexadecimal and the preset IP address segment hexadecimal The number is consistent, the binary number 01010100-00000000-00000000 is converted into a decimal number 84.0.0, and finally the converted decimal number 84.0.0 is added to the preset IP address segment 192.xx.xx.xx. The IP address of the terminal is generated 192.84.0.0.
在本实施例中,通过提取所述物理地址中预设位数的低位地址,并将提取的低位地址的进制数转化为所述预设IP地址段的进制数,最后将转化后的低位地址添加到所述终端预设的IP地址段中,生成所述终端的IP地址,提高了终端的IP地址生成的准确性。In this embodiment, the lower-order address of the preset number of bits in the physical address is extracted, and the hexadecimal number of the extracted lower-order address is converted into the hexadecimal number of the preset IP address segment, and finally the converted The lower address is added to the preset IP address segment of the terminal, and the IP address of the terminal is generated, which improves the accuracy of the IP address generation of the terminal.
进一步地,为了提高IP地址生成的灵活性,基于第二实施例提出本发明IP地址生成方法的第三实施例,在本实施例中,参照图3,所述步骤S22之后,所述步骤S20还包括:Further, in order to improve the flexibility of IP address generation, a third embodiment of the IP address generation method of the present invention is proposed based on the second embodiment. In this embodiment, referring to FIG. 3, after step S22, the step S20 is performed. Also includes:
步骤S23,在检测到所述IP地址段的更新指令时,获取更新后的IP地址段;Step S23: Acquire an updated IP address segment when detecting an update instruction of the IP address segment;
在本实施例中,检测所述IP地址段是否更新的方式包括:实时检测和定时检测两种方式,具体采用何种检测方式根据具体情况进行设置,而所述定时检测的时间间隔也根据具体的需要进行设置,优选在网络接入高峰期时,将定时检测的时候间隔设置短一些,如每5min分钟检测一次,而在网络接入的低峰期,将定时检测的时候间隔设置长一些,如每30min分钟检测一次。In this embodiment, the manner of detecting whether the IP address segment is updated includes: real-time detection and timing detection, and the specific detection manner is set according to a specific situation, and the time interval of the timing detection is also determined according to specific conditions. The setting needs to be set. Preferably, when the network access peak period, the interval between the timing detections is set to be shorter, such as every 5 minutes, and in the low peak period of the network access, the interval between the timing detections is set to be longer. , such as once every 30 minutes.
步骤S24,根据所述更新后的IP地址段更新所述终端的IP地址。Step S24, updating the IP address of the terminal according to the updated IP address segment.
在本实施例中,预设的所述IP地址段是根据具体需要进行设置,即所述IP地址段并不是固定不变的,而是可以根据具体需要进行改变的,若检测到所述IP地址段更新时,例如用户根据具体的需要将预设的IP地址段从192.xx.xx.xx更新为202.xx.xx.xx时,此时,获取更新后的IP地址段,并根据所述更新后的IP地址段更新所述终端的IP地址,也就是说,保持所述IP地址中的后24位地址不变,更新前8位地址,以更新所述终端的IP地址。In this embodiment, the preset IP address segment is set according to specific needs, that is, the IP address segment is not fixed, but may be changed according to specific needs, if the IP is detected. When the address segment is updated, for example, when the user updates the preset IP address segment from 192.xx.xx.xx to 202.xx.xx.xx according to specific needs, at this time, the updated IP address segment is obtained, and according to The updated IP address segment updates the IP address of the terminal, that is, keeps the last 24 bit address in the IP address unchanged, and updates the first 8 bit address to update the IP address of the terminal.
在本实施例中,通过检测所述IP地址段是否更新,并在所述IP地址段更新时,获取更新后的IP地址段,最后根据所述更新后的IP地址段更新所述终端的IP地址,提高了IP地址生成的灵活性。In this embodiment, by detecting whether the IP address segment is updated, and updating the IP address segment, obtaining an updated IP address segment, and finally updating the IP address of the terminal according to the updated IP address segment. Addresses increase the flexibility of IP address generation.
进一步地,为了提高IP地址生成的智能性,基于第一、第二或第三实施例提出本发明IP地址生成方法的第四实施例,在本实施例中,参照图4,所述步骤S30之后,所述IP地址生成方法还包括:Further, in order to improve the intelligence of the IP address generation, a fourth embodiment of the IP address generation method of the present invention is proposed based on the first, second or third embodiment. In this embodiment, referring to FIG. 4, the step S30 is performed. The IP address generation method further includes:
步骤S40,在检测到IP地址的修改指令时,显示预设的信息输入界面;Step S40, displaying a preset information input interface when detecting a modification instruction of the IP address;
步骤S50,在接收到用户基于所述信息输入界面输入的IP地址时,根据输入的IP地址更新所述终端的IP地址。Step S50: Upon receiving the IP address input by the user based on the information input interface, update the IP address of the terminal according to the input IP address.
在本实施例中,在存储生成的IP地址后,若此时用户想要更改IP地址,用户可基于终端预设的设置界面触发IP地址的修改指令,在检测到IP地址的修改指令时,显示预设的信息输入界面,以供用户基于所述信息输入界面输入IP地址,如用户输入IP地址159.226.1.1,在接收到用户基于所述信息输入界面输入的IP地址时,即可根据输入的IP地址更新所述终端的IP地址,也就是将输入的IP地址替换存储的IP地址,以更新所述终端的IP地址。In this embodiment, after the generated IP address is stored, if the user wants to change the IP address at this time, the user may trigger the modification instruction of the IP address based on the preset setting interface of the terminal, and when the modification instruction of the IP address is detected, Displaying a preset information input interface for the user to input an IP address based on the information input interface, such as the user inputting the IP address 159.226.1.1, and receiving the IP address input by the user based on the information input interface, according to the input The IP address updates the IP address of the terminal, that is, replaces the input IP address with the stored IP address to update the IP address of the terminal.
本实施例中,通过用户输入的地址更新指令显示信息输入界面,并在用户输入信息完成后,更新IP地址,实现了IP地址不仅通过终端的物理地址以及预设的IP地址段进行生成,还可根据用户的需求进行修改生成,提高了IP地址生成的智能性。In this embodiment, the information input interface is displayed by the address update command input by the user, and after the user input information is completed, the IP address is updated, and the IP address is not only generated by the physical address of the terminal and the preset IP address segment, but also It can be modified according to the needs of users, which improves the intelligence of IP address generation.
本发明进一步提供一种IP地址生成装置。The present invention further provides an IP address generating apparatus.
参照图5,图5为本发明IP地址生成装置第一实施例的功能模块示意图。Referring to FIG. 5, FIG. 5 is a schematic diagram of functional modules of a first embodiment of an IP address generating apparatus according to the present invention.
需要强调的是,对本领域的技术人员来说,图5所示功能模块图仅仅是一个较佳实施例的示例图,本领域的技术人员围绕图5所示的IP地址生成装置的功能模块,可轻易进行新的功能模块的补充;各功能模块的名称是自定义名称,仅用于辅助理解该IP地址生成装置的各个程序功能块,不用于限定本发明的技术方案,本发明技术方案的核心是,各自定义名称的功能模块所要达成的功能。It should be emphasized that, for those skilled in the art, the functional block diagram shown in FIG. 5 is merely an exemplary diagram of a preferred embodiment, and those skilled in the art will surround the functional modules of the IP address generating apparatus shown in FIG. The new function modules can be easily supplemented; the names of the function modules are custom names, which are only used to assist in understanding the various program function blocks of the IP address generating device, and are not used to limit the technical solution of the present invention. The core is the function that each functional module of the defined name has to achieve.
本实施例提出一种IP地址生成装置,所述IP地址生成装置包括:The embodiment provides an IP address generating apparatus, where the IP address generating apparatus includes:
获取模块10,用于在检测到IP地址的生成指令时,获取终端的物理地址;The obtaining module 10 is configured to acquire a physical address of the terminal when detecting an instruction for generating an IP address;
在本实施例中,所述IP地址的生成指令的触发方式包括:In this embodiment, the triggering manner of the generating instruction of the IP address includes:
1)方式一、在检测到终端接入管理网口的接入指令时,获取所述终端预存的IP地址,在获取的所述IP地址中提取出预设位数的低位地址,并在所述终端的物理地址中提取出同样位数的低位地址,将两个提取的低位地址进行对比,在两个低位地址不一致时,触发IP地址的生成指令。1) Method 1: When detecting an access command of the terminal accessing the management network port, acquiring an IP address pre-stored by the terminal, extracting a low-order address of the preset number of bits in the obtained IP address, and The lower address of the same number of bits is extracted from the physical address of the terminal, and the two extracted lower addresses are compared, and when the two lower addresses are inconsistent, the generation instruction of the IP address is triggered.
2)方式二、在检测到终端接入管理网口的接入指令时,若终端中的预存的IP地址为服务器分配的IP地址,则触发IP地址的生成指令。2) Method 2: When the access command of the terminal access management network port is detected, if the pre-stored IP address in the terminal is an IP address assigned by the server, an IP address generation command is triggered.
以上所列举出的两种IP地址的生成指令的触发方式仅仅为示例性的,本领域技术人员利用本发明的技术思想,根据其具体需求所提出的其它IP地址的生成指令的触发方式均在本发明的保护范围内,在此不进行一一穷举。The triggering manners of the generating instructions of the two types of IP addresses listed above are merely exemplary. Those skilled in the art can use the technical idea of the present invention to trigger the generating instructions of other IP addresses according to their specific requirements. Within the scope of the present invention, it is not exhaustive here.
在本实施例中,在检测IP地址的生成指令时,所述获取模块10获取终端的物理地址,所述终端的物理地址为MAC地址(Media Access Control,也称硬件地址)。In this embodiment, when detecting the generation instruction of the IP address, the acquiring module 10 acquires the physical address of the terminal, and the physical address of the terminal is a MAC address (Media Access Control, also known as hardware address).
生成模块20,用于根据获取的所述物理地址以及预设的IP地址段,生成所述终端的网际协议地址IP地址;The generating module 20 is configured to generate an internet protocol address IP address of the terminal according to the obtained physical address and a preset IP address segment;
在本实施例中,所述生成模块20根据所述获取模块10获取的所述物理地址以及预设的IP地址段,生成所述终端的IP地址的方式为:提取所述物理地址中预设位数的低位地址,将提取的低位地址添加到预设的IP地址段中,生成所述终端的IP地址。In this embodiment, the generating module 20 generates the IP address of the terminal according to the physical address and the preset IP address segment acquired by the acquiring module 10, and extracts the preset in the physical address. The lower address of the number of bits adds the extracted lower address to the preset IP address segment to generate the IP address of the terminal.
存储模块30,存储生成的所述IP地址。The storage module 30 stores the generated IP address.
在本实施例中,在所述生成模块20生成所述终端的所述IP地址后,所述存储模块30将生成的所述IP地址存储到预设的存储空间中,所述存储空间包括内置存储器和外置存储器,所述内置存储器包括内存、闪存或缓存,所述内存包括只读存储器和随机存储器 ;所述外置存储器包括SD卡、硬盘等等。In this embodiment, after the generating module 20 generates the IP address of the terminal, the storage module 30 stores the generated IP address into a preset storage space, where the storage space includes a built-in storage space. a memory and an external memory, the internal memory including a memory, a flash memory or a cache, the memory including a read only memory and a random access memory The external memory includes an SD card, a hard disk, and the like.
在本实施例中,在所述生成模块20生成所述IP地址后,所述存储模块30存储生成的所述IP地址,传统的存储方式是将生成的所述IP地址存储到FLASH闪存中,而将所述IP地址存储到闪存中,可能存在读取不到IP地址的情况,因为,闪存中存储的数据较多,并且会反复读写,容易导致存储的数据不稳定,因此本实施例中,为了提高IP地址存储的稳定性,在所述生成模块20生成所述IP地址后,所述存储模块30将所述IP地址存储至只读存储器中,可以理解的是,只读存储器在数据存入后就不能进行改写,因此,存储的数据更加稳定。In this embodiment, after the generating module 20 generates the IP address, the storage module 30 stores the generated IP address, and the traditional storage manner is to store the generated IP address into the FLASH flash memory. When the IP address is stored in the flash memory, there may be a case where the IP address cannot be read, because the data stored in the flash memory is large, and the data is repeatedly read and written, which may easily cause the stored data to be unstable. In order to improve the stability of the IP address storage, after the generating module 20 generates the IP address, the storage module 30 stores the IP address into the read-only memory. It can be understood that the read-only memory is After the data is stored, it cannot be rewritten, so the stored data is more stable.
进一步地,在所述生成模块20生成终端的所述IP地址后,所述存储模块30存储生成的所述IP地址,然后在下次接入管理网口时,所述获取模块10获取预存的存储空间中存储的所述IP地址,在所述获取模块10获取到所述IP地址时,可根据所述IP地址接入管理网口;而在获取到IP地址失败时,则所述获取模块10重新获取所述终端的物理地址,所述生成模块20再根据所述终端的物理地址生成所述终端的IP地址,所述存储模块30存储生成的IP地址。Further, after the generating module 20 generates the IP address of the terminal, the storage module 30 stores the generated IP address, and then, when accessing the management network port, the acquiring module 10 acquires the pre-stored storage. The IP address stored in the space may be accessed by the acquiring module 10 when the IP address is obtained, and the acquiring module 10 may be accessed when the IP address fails to be obtained. Retrieving the physical address of the terminal, the generating module 20 generates an IP address of the terminal according to the physical address of the terminal, and the storage module 30 stores the generated IP address.
本实施例提出的IP地址生成装置,在检测到IP地址的生成指令时,获取终端的物理地址,然后根据获取的所述物理地址以及预设的IP地址段,生成所述终端的网际协议地址IP地址,存储生成的所述IP地址,而不是将各个终端都配置为同一个IP地址,本发明通过终端的物理地址生成所述终端的IP地址,使得各个终端接入管理网口的IP地址不同,减少了网络繁忙而出现网速慢的情况,提高了终端接入管理网口的效率。The IP address generating apparatus of the present embodiment acquires the physical address of the terminal when detecting the generation instruction of the IP address, and then generates the internet protocol address of the terminal according to the obtained physical address and the preset IP address segment. The IP address is used to store the generated IP address, instead of configuring each terminal as the same IP address. The present invention generates an IP address of the terminal through the physical address of the terminal, so that each terminal accesses the IP address of the management network port. Different, the network is slow and the network speed is slow, and the efficiency of the terminal access management network port is improved.
进一步地,为了提高IP地址生成的准确性,基于第一实施例提出本发明IP地址生成装置的第二实施例,在本实施例中,参照图6,所述生成模块20包括:Further, in order to improve the accuracy of the IP address generation, a second embodiment of the IP address generating apparatus of the present invention is proposed based on the first embodiment. In this embodiment, referring to FIG. 6, the generating module 20 includes:
提取单元21,用于提取所述物理地址中预设位数的低位地址;The extracting unit 21 is configured to extract a lower address of the preset number of bits in the physical address;
在本实施例中,在所述获取模块10获取到所述终端物理地址时,所述提取单元21先提取出所述终端物理地址中预设位数的低位地址,可以理解的是,所述终端物理地址是MAC地址,MAC地址采用十六进制数表示,共六个字节(48位)。其中,前三个字节(即高位24位)是表示的是不同厂家的代码,而后三个字节(即低位24位)指定生产的适配器接口,称为扩展标识符,具有唯一性,因此,所述提取单元21提取所述终端物理地址中预设位数的低位地址,实际上是提取所述终端物理地址中低位24位地址。In this embodiment, when the acquiring module 10 acquires the physical address of the terminal, the extracting unit 21 first extracts a low-order address of a preset number of bits in the physical address of the terminal, and it can be understood that the The physical address of the terminal is the MAC address, and the MAC address is represented by a hexadecimal number, which is six bytes (48 bits). Wherein, the first three bytes (ie, the upper 24 bits) represent the code of different manufacturers, and the last three bytes (ie, the lower 24 bits) specify the adapter interface of the production, called the extended identifier, which is unique, so The extracting unit 21 extracts the lower address of the preset number of bits in the physical address of the terminal, and actually extracts the lower 24-bit address of the physical address of the terminal.
生成单元22,用于将提取的低位地址添加到预设的所述IP地址段中,生成所述终端的IP地址。The generating unit 22 is configured to add the extracted lower address to the preset IP address segment to generate an IP address of the terminal.
在本实施例中,所述生成单元22将所述提取单元21提取的低位地址添加到预设的IP地址段中,所述预设的IP地址段是IP地址中的前8位地址。可以理解的是,IP地址是一个32位的二进制数,通常被分割为4个“8位二进制数”(也就是4个字节),而本实施例中,所述预设的IP地址段为IP地址中前8位地址,所述生成单元22将提取的低位地址添加到预设的IP地址段中,也就是将所述物理地址中提取的低位24位地址添加到8位IP地址后面,以生成一个新的IP地址,而所述MAC地址是十六进制数,IP地址是二进制数,因此,将所述MAC地址的低位地址添加到预设的IP地址段中,首先要将所述MAC地址的低位地址进行转化得到二进制数,再将得到的二进制数添加到所述预设的IP地址段中,以生成所述终端的IP地址,一般情况下,IP地址段是通过十进制数进行显示的,因此,可将最终生成的IP地址转化为十进制数进行显示。为更好理解本实施例,举例如下:在终端的物理地址为 44-45-53-54-00-00时,此时,可知道终端中低位24位地址为54-00-00,而在预设的IP地址段为192.xx.xx.xx时,所述生成单元22将所述提取单元21提取的低位地址54-00-00添加到预设的IP地址段192.xx.xx.xx中,所述生成单元22将所述提取单元21提取的低位地址54-00-00添加到预设的IP地址段192.xx.xx.xx中的方式为:将低位地址54-00-00转化为二进制数01010100-00000000-00000000,此时,为了使转化后的低位地址的进制数和预设的IP地址段的进制数一致,将所述二进制数01010100-00000000-00000000转化为十进制数84.0.0,最后将转化得到的十进制数84.0.0添加到所述预设的IP地址段192.xx.xx.xx中,生成所述终端的IP地址192.84.0.0。In this embodiment, the generating unit 22 adds the lower address extracted by the extracting unit 21 to a preset IP address segment, where the preset IP address segment is the first 8 bit address in the IP address. It can be understood that the IP address is a 32-bit binary number, and is usually divided into four "8-bit binary numbers" (that is, 4 bytes). In this embodiment, the preset IP address segment is used. As the first 8 bit address in the IP address, the generating unit 22 adds the extracted lower address to the preset IP address segment, that is, adds the lower 24-bit address extracted from the physical address to the 8-bit IP address. To generate a new IP address, and the MAC address is a hexadecimal number, the IP address is a binary number, therefore, adding the lower address of the MAC address to the preset IP address segment, first of all The lower address of the MAC address is converted to obtain a binary number, and the obtained binary number is added to the preset IP address segment to generate an IP address of the terminal. Generally, the IP address segment is passed through a decimal number. The number is displayed, so the resulting IP address can be converted to a decimal number for display. For a better understanding of the embodiment, an example is as follows: the physical address of the terminal is At 44-45-53-54-00-00, at this time, it can be known that the lower 24-bit address in the terminal is 54-00-00, and when the preset IP address segment is 192.xx.xx.xx, The generating unit 22 adds the lower address 54-00-00 extracted by the extracting unit 21 to the preset IP address segment 192.xx.xx.xx, and the generating unit 22 extracts the low bit extracted by the extracting unit 21. The address 54-00-00 is added to the preset IP address segment 192.xx.xx.xx in the following way: the lower address 54-00-00 is converted into a binary number 01010100-00000000-00000000, at this time, in order to make the conversion The hexadecimal number of the lower address is the same as the hexadecimal number of the preset IP address segment, and the binary number 01010100-00000000-00000000 is converted into a decimal number 84.0.0, and the converted decimal number 84.0.0 is finally converted. Adding to the preset IP address segment 192.xx.xx.xx, generating the IP address of the terminal 192.84.0.0.
在本实施例中,所述提取单元21通过提取所述物理地址中预设位数的低位地址,再将提取的低位地址的进制数转化为所述预设IP地址段的进制数,最后所述生成单元22将转化后的低位地址添加到所述终端预设的IP地址段中,生成所述终端的IP地址,提高了终端的IP地址生成的准确性。In this embodiment, the extracting unit 21 converts the lower-order address of the preset low-order address into the hexadecimal number of the preset IP address segment by extracting the lower-order address of the preset number of bits in the physical address. Finally, the generating unit 22 adds the converted lower address to the IP address segment preset by the terminal, generates an IP address of the terminal, and improves the accuracy of the IP address generation of the terminal.
进一步地,为了提高IP地址生成的灵活性,基于第二实施例提出本发明IP地址生成装置的第三实施例,在本实施例中,参照图7,所述生成模块20还包括:Further, in order to improve the flexibility of IP address generation, a third embodiment of the IP address generating apparatus of the present invention is proposed based on the second embodiment. In this embodiment, referring to FIG. 7, the generating module 20 further includes:
获取单元23,用于在检测到所述IP地址段的更新指令时,获取更新后的IP地址段;The obtaining unit 23 is configured to obtain an updated IP address segment when detecting an update instruction of the IP address segment;
在本实施例中,检测所述IP地址段是否更新的方式包括:实时检测和定时检测两种方式,具体采用何种检测方式根据具体情况进行设置,而所述定时检测的时间间隔也根据具体的需要进行设置,优选在网络接入高峰期时,将定时检测的时候间隔设置短一些,如每5min分钟检测一次,而在网络接入的低峰期,将定时检测的时候间隔设置长一些,如每30min分钟检测一次。In this embodiment, the manner of detecting whether the IP address segment is updated includes: real-time detection and timing detection, and the specific detection manner is set according to a specific situation, and the time interval of the timing detection is also determined according to specific conditions. The setting needs to be set. Preferably, when the network access peak period, the interval between the timing detections is set to be shorter, such as every 5 minutes, and in the low peak period of the network access, the interval between the timing detections is set to be longer. , such as once every 30 minutes.
更新单元24,用于根据所述更新后的IP地址段更新所述终端的IP地址。The updating unit 24 is configured to update an IP address of the terminal according to the updated IP address segment.
在本实施例中,预设的所述IP地址段是根据具体需要进行设置,即所述IP地址段并不是固定不变的,而是可以根据具体需要进行改变的,若检测到所述IP地址段更新时,例如用户根据具体的需要将预设的IP地址段从192.xx.xx.xx更新为202.xx.xx.xx时,此时,所述获取单元23获取更新后的IP地址段,所述更新单元24根据所述更新后的IP地址段更新所述终端的IP地址,也就是说,所述更新单元24保持所述IP地址中的后24位地址不变,更新前8位地址,以更新所述终端的IP地址。In this embodiment, the preset IP address segment is set according to specific needs, that is, the IP address segment is not fixed, but may be changed according to specific needs, if the IP is detected. When the address segment is updated, for example, the user updates the preset IP address segment from 192.xx.xx.xx to 202.xx.xx.xx according to specific needs. At this time, the obtaining unit 23 obtains the updated IP. An address unit, the update unit 24 updates the IP address of the terminal according to the updated IP address segment, that is, the update unit 24 keeps the last 24 bit addresses in the IP address unchanged, before the update. An 8-bit address to update the IP address of the terminal.
在本实施例中,通过检测所述IP地址段是否更新,并在所述IP地址段更新时,所述获取单元23获取更新后的IP地址段,所述更新单元24根据所述更新后的IP地址段更新所述终端的IP地址,提高了IP地址生成的灵活性。In this embodiment, by detecting whether the IP address segment is updated, and when the IP address segment is updated, the obtaining unit 23 obtains an updated IP address segment, and the updating unit 24 is configured according to the updated The IP address segment updates the IP address of the terminal, which improves the flexibility of IP address generation.
进一步地,为了提高IP地址生成的智能性,基于第一、第二或第三实施例提出本发明IP地址生成装置的第四实施例,在本实施例中,参照图8,所述IP地址生成装置还包括:Further, in order to improve the intelligence of IP address generation, a fourth embodiment of the IP address generating apparatus of the present invention is proposed based on the first, second or third embodiment. In this embodiment, referring to FIG. 8, the IP address is referred to. The generating device further includes:
显示模块40,用于在检测到IP地址的修改指令时,显示预设的信息输入界面;The display module 40 is configured to display a preset information input interface when detecting a modification instruction of the IP address;
更新模块50,用于在接收到用户基于所述信息输入界面输入的IP地址时,根据输入的IP地址更新所述终端的IP地址。The updating module 50 is configured to update an IP address of the terminal according to the input IP address when receiving an IP address input by the user based on the information input interface.
在本实施例中,在所述存储模块30存储生成的IP地址后,若此时用户想要更改IP地址,用户可基于终端预设的设置界面触发IP地址的修改指令,在检测到IP地址的修改指令时,所述显示模块40显示预设的信息输入界面,以供用户基于所述信息输入界面输入IP地址,如用户输入IP地址159.226.1.1,在接收到用户基于所述信息输入界面输入的IP地址时,所述更新模块50即可根据输入的IP地址更新所述终端的IP地址,也就是将输入的IP地址替换存储的IP地址,以更新所述终端的IP地址。In this embodiment, after the storage module 30 stores the generated IP address, if the user wants to change the IP address at this time, the user can trigger the modification instruction of the IP address based on the preset setting interface of the terminal, and the IP address is detected. When the instruction is modified, the display module 40 displays a preset information input interface for the user to input an IP address based on the information input interface, such as the user inputting the IP address 159.226.1.1, and receiving the user based on the information input interface. When the IP address is input, the update module 50 can update the IP address of the terminal according to the input IP address, that is, replace the input IP address with the stored IP address to update the IP address of the terminal.
本实施例中,所述显示模块40通过用户输入的地址更新指令显示信息输入界面,并在用户输入信息完成后,所述更新模块50更新IP地址,实现了IP地址不仅通过终端的物理地址以及预设的IP地址段进行生成,还可根据用户的需求进行修改生成,提高了IP地址生成的智能性。In this embodiment, the display module 40 displays an information input interface by using an address update command input by the user, and after the user input information is completed, the update module 50 updates the IP address, and implements the IP address not only through the physical address of the terminal but also The preset IP address segment is generated, and can be modified according to the user's needs, thereby improving the intelligence of IP address generation.
需要说明的是,在本文中,术语“包括”、“包含”或者其任何其它变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者装置不仅包括那些要素,而且还包括没有明确列出的其它要素,或者是还包括为这种过程、方法、物品或者装置所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者装置中还存在另外的相同要素。It is to be understood that the term "comprises", "comprising", or any other variants thereof, is intended to encompass a non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements includes those elements. It also includes other elements not explicitly listed, or elements that are inherent to such a process, method, article, or device. An element that is defined by the phrase "comprising a ..." does not exclude the presence of additional equivalent elements in the process, method, item, or device that comprises the element.
上述本发明实施例序号仅仅为了描述,不代表实施例的优劣。The serial numbers of the embodiments of the present invention are merely for the description, and do not represent the advantages and disadvantages of the embodiments.
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,空调器,或者网络设备等)执行本发明各个实施例所述的方法。Through the description of the above embodiments, those skilled in the art can clearly understand that the foregoing embodiment method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be through hardware, but in many cases, the former is better. Implementation. Based on such understanding, the technical solution of the present invention, which is essential or contributes to the prior art, may be embodied in the form of a software product stored in a storage medium (such as ROM/RAM, disk, The optical disc includes a number of instructions for causing a terminal device (which may be a cell phone, a computer, a server, an air conditioner, or a network device, etc.) to perform the methods described in various embodiments of the present invention.
以上仅为本发明的优选实施例,并非因此限制本发明的专利范围,凡是利用本发明说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其它相关的技术领域,均同理包括在本发明的专利保护范围内。The above are only the preferred embodiments of the present invention, and are not intended to limit the scope of the present invention, and the equivalent structure or equivalent process transformations made by the description of the present invention and the drawings are directly or indirectly applied to other related technical fields. The same is included in the scope of patent protection of the present invention.

Claims (20)

  1. 一种IP地址生成方法,其特征在于,所述IP地址生成方法包括以下步骤: An IP address generating method, characterized in that the IP address generating method comprises the following steps:
    在检测到IP地址的生成指令时,获取终端的物理地址;Obtaining the physical address of the terminal when detecting the generation instruction of the IP address;
    根据获取的所述物理地址以及预设的IP地址段,生成所述终端的网际协议地址IP地址;Generating an internet protocol address IP address of the terminal according to the obtained physical address and a preset IP address segment;
    存储生成的所述IP地址。Store the generated IP address.
  2. 如权利要求1所述的IP地址生成方法,其特征在于,所述根据获取的所述物理地址以及预设的IP地址段生成所述终端的网际协议地址IP地址的步骤包括:The IP address generating method according to claim 1, wherein the step of generating the Internet Protocol address IP address of the terminal according to the obtained physical address and the preset IP address segment comprises:
    提取所述物理地址中预设位数的低位地址;Extracting a lower address of a preset number of bits in the physical address;
    将提取的低位地址添加到预设的所述IP地址段中,生成所述终端的IP地址。Adding the extracted lower address to the preset IP address segment to generate an IP address of the terminal.
  3. 如权利要求2所述的IP地址生成方法,其特征在于,所述生成所述终端的IP地址的步骤之后,所述IP地址生成方法还包括:The method for generating an IP address according to claim 2, wherein after the step of generating an IP address of the terminal, the method for generating an IP address further comprises:
    在检测到所述IP地址段的更新指令时,获取更新后的IP地址段;Obtaining an updated IP address segment when detecting an update instruction of the IP address segment;
    根据所述更新后的IP地址段更新所述终端的IP地址。Updating the IP address of the terminal according to the updated IP address segment.
  4. 如权利要求1所述的IP地址生成方法,其特征在于,所述存储生成的所述IP地址的步骤包括:The IP address generating method according to claim 1, wherein the storing the generated IP address comprises:
    将所述IP地址存储至只读存储器中。The IP address is stored in a read only memory.
  5. 如权利要求2所述的IP地址生成方法,其特征在于,所述存储生成的所述IP地址的步骤包括:The IP address generating method according to claim 2, wherein the storing the generated IP address comprises:
    将所述IP地址存储至只读存储器中。The IP address is stored in a read only memory.
  6. 如权利要求3所述的IP地址生成方法,其特征在于,所述存储生成的所述IP地址的步骤包括:The IP address generating method according to claim 3, wherein the storing the generated IP address comprises:
    将所述IP地址存储至只读存储器中。The IP address is stored in a read only memory.
  7. 如权利要求1所述的IP地址生成方法,其特征在于,所述存储生成的所述IP地址的步骤之后,所述IP地址生成方法还包括:The IP address generating method according to claim 1, wherein after the step of storing the generated IP address, the IP address generating method further comprises:
    在检测到IP地址的修改指令时,显示预设的信息输入界面;When the modification instruction of the IP address is detected, a preset information input interface is displayed;
    在接收到用户基于所述信息输入界面输入的IP地址时,根据输入的IP地址更新所述终端的IP地址。Upon receiving the IP address input by the user based on the information input interface, the IP address of the terminal is updated according to the input IP address.
  8. 如权利要求2所述的IP地址生成方法,其特征在于,所述存储生成的所述IP地址的步骤之后,所述IP地址生成方法还包括:The IP address generating method according to claim 2, wherein after the step of storing the generated IP address, the IP address generating method further comprises:
    在检测到IP地址的修改指令时,显示预设的信息输入界面;When the modification instruction of the IP address is detected, a preset information input interface is displayed;
    在接收到用户基于所述信息输入界面输入的IP地址时,根据输入的IP地址更新所述终端的IP地址。Upon receiving the IP address input by the user based on the information input interface, the IP address of the terminal is updated according to the input IP address.
  9. 如权利要求3所述的IP地址生成方法,其特征在于,所述存储生成的所述IP地址的步骤之后,所述IP地址生成方法还包括:The IP address generating method according to claim 3, wherein after the step of storing the generated IP address, the IP address generating method further comprises:
    在检测到IP地址的修改指令时,显示预设的信息输入界面;When the modification instruction of the IP address is detected, a preset information input interface is displayed;
    在接收到用户基于所述信息输入界面输入的IP地址时,根据输入的IP地址更新所述终端的IP地址。Upon receiving the IP address input by the user based on the information input interface, the IP address of the terminal is updated according to the input IP address.
  10. 如权利要求4所述的IP地址生成方法,其特征在于,所述存储生成的所述IP地址的步骤之后,所述IP地址生成方法还包括:The IP address generating method according to claim 4, wherein after the step of storing the generated IP address, the IP address generating method further comprises:
    在检测到IP地址的修改指令时,显示预设的信息输入界面;When the modification instruction of the IP address is detected, a preset information input interface is displayed;
    在接收到用户基于所述信息输入界面输入的IP地址时,根据输入的IP地址更新所述终端的IP地址。Upon receiving the IP address input by the user based on the information input interface, the IP address of the terminal is updated according to the input IP address.
  11. 一种IP地址生成装置,其特征在于,所述IP地址生成装置包括以下步骤:An IP address generating apparatus, wherein the IP address generating apparatus comprises the following steps:
    获取模块,用于在检测到IP地址的生成指令时,获取终端的物理地址;An obtaining module, configured to acquire a physical address of the terminal when detecting an instruction for generating an IP address;
    生成模块,用于根据获取的所述物理地址以及预设的IP地址段,生成所述终端的网际协议地址IP地址;a generating module, configured to generate an internet protocol address IP address of the terminal according to the obtained physical address and a preset IP address segment;
    存储模块,存储生成的所述IP地址。A storage module stores the generated IP address.
  12. 如权利要求11所述的IP地址生成装置,其特征在于,所述生成模块包括:The IP address generating apparatus according to claim 11, wherein the generating module comprises:
    提取单元,用于提取所述物理地址中预设位数的低位地址;An extracting unit, configured to extract a lower address of a preset number of bits in the physical address;
    生成单元,用于将提取的低位地址添加到预设的所述IP地址段中,生成所述终端的IP地址。And a generating unit, configured to add the extracted lower address to the preset IP address segment to generate an IP address of the terminal.
  13. 如权利要求12所述的IP地址生成装置,其特征在于,所述生成模块还包括:The IP address generating apparatus according to claim 12, wherein the generating module further comprises:
    获取单元,用于在检测到所述IP地址段的更新指令时,获取更新后的IP地址段;An obtaining unit, configured to obtain an updated IP address segment when detecting an update instruction of the IP address segment;
    更新单元,用于根据所述更新后的IP地址段更新所述终端的IP地址。And an updating unit, configured to update an IP address of the terminal according to the updated IP address segment.
  14. 如权利要求11所述的IP地址生成装置,其特征在于,所述存储模块还用于将所述IP地址存储至只读存储器中。The IP address generating apparatus according to claim 11, wherein said storage module is further configured to store said IP address in a read only memory.
  15. 如权利要求12所述的IP地址生成装置,其特征在于,所述存储模块还用于将所述IP地址存储至只读存储器中。The IP address generating apparatus according to claim 12, wherein said storage module is further configured to store said IP address in a read only memory.
  16. 如权利要求13所述的IP地址生成装置,其特征在于,所述存储模块还用于将所述IP地址存储至只读存储器中。The IP address generating apparatus according to claim 13, wherein said storage module is further configured to store said IP address in a read only memory.
  17. 如权利要求11所述的IP地址生成装置,其特征在于,所述IP地址生成装置还包括: The IP address generating apparatus according to claim 11, wherein the IP address generating apparatus further comprises:
    显示模块,用于在检测到IP地址的修改指令时,显示预设的信息输入界面;a display module, configured to display a preset information input interface when detecting a modification instruction of the IP address;
    更新模块,用于在接收到用户基于所述信息输入界面输入的IP地址时,根据输入的IP地址更新所述终端的IP地址。And an update module, configured to update an IP address of the terminal according to the input IP address when receiving an IP address input by the user based on the information input interface.
  18. 如权利要求12所述的IP地址生成装置,其特征在于,所述IP地址生成装置还包括:The IP address generating apparatus according to claim 12, wherein the IP address generating apparatus further comprises:
    显示模块,用于在检测到IP地址的修改指令时,显示预设的信息输入界面;a display module, configured to display a preset information input interface when detecting a modification instruction of the IP address;
    更新模块,用于在接收到用户基于所述信息输入界面输入的IP地址时,根据输入的IP地址更新所述终端的IP地址。And an update module, configured to update an IP address of the terminal according to the input IP address when receiving an IP address input by the user based on the information input interface.
  19. 如权利要求13所述的IP地址生成装置,其特征在于,所述IP地址生成装置还包括:The IP address generating apparatus according to claim 13, wherein the IP address generating apparatus further comprises:
    显示模块,用于在检测到IP地址的修改指令时,显示预设的信息输入界面;a display module, configured to display a preset information input interface when detecting a modification instruction of the IP address;
    更新模块,用于在接收到用户基于所述信息输入界面输入的IP地址时,根据输入的IP地址更新所述终端的IP地址。And an update module, configured to update an IP address of the terminal according to the input IP address when receiving an IP address input by the user based on the information input interface.
  20. 如权利要求14所述的IP地址生成装置,其特征在于,所述IP地址生成装置还包括:The IP address generating apparatus according to claim 14, wherein the IP address generating apparatus further comprises:
    显示模块,用于在检测到IP地址的修改指令时,显示预设的信息输入界面;a display module, configured to display a preset information input interface when detecting a modification instruction of the IP address;
    更新模块,用于在接收到用户基于所述信息输入界面输入的IP地址时,根据输入的IP地址更新所述终端的IP地址。And an update module, configured to update an IP address of the terminal according to the input IP address when receiving an IP address input by the user based on the information input interface.
PCT/CN2015/099707 2015-12-14 2015-12-30 Ip address generating method and device WO2017101159A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510926732.8A CN105577847A (en) 2015-12-14 2015-12-14 IP address generating method and device
CN201510926732.8 2015-12-14

Publications (1)

Publication Number Publication Date
WO2017101159A1 true WO2017101159A1 (en) 2017-06-22

Family

ID=55887489

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2015/099707 WO2017101159A1 (en) 2015-12-14 2015-12-30 Ip address generating method and device

Country Status (2)

Country Link
CN (1) CN105577847A (en)
WO (1) WO2017101159A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106067837B (en) * 2016-05-18 2018-11-30 珠海格力电器股份有限公司 multi-connected air conditioning unit and address setting method and device thereof

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003298619A (en) * 2002-03-29 2003-10-17 Sanyo Electric Co Ltd Apparatus and method for creating ip address and apparatus and method for supplying identification information
US20050135364A1 (en) * 2003-12-17 2005-06-23 Byoung-Yue Kim Communication method and apparatus using multicast address
JP2008211504A (en) * 2007-02-26 2008-09-11 Hitachi Kokusai Electric Inc Information transmitting device
CN102469170A (en) * 2010-11-03 2012-05-23 英业达集团(天津)电子技术有限公司 Method for generating static Internet protocol (IP) address under disk operating system (DOS)
CN102547421A (en) * 2011-12-31 2012-07-04 福建星网视易信息系统有限公司 Cooperative communication method of STB (set top box)

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3631225B2 (en) * 2002-07-25 2005-03-23 キヤノン株式会社 Image processing apparatus, image processing apparatus control method, and image processing apparatus control program
KR100601673B1 (en) * 2004-05-10 2006-07-14 삼성전자주식회사 Communication method and apparatus at mobile station having multiple interfaces
CN101710906B (en) * 2009-12-18 2013-02-13 工业和信息化部电信传输研究所 IPv6 address structure and method and device for allocating and tracing same
CN102098354B (en) * 2011-02-28 2014-09-10 北京星网锐捷网络技术有限公司 Method and server for allocating dynamic host configuration protocol (DHCP) addresses
US8832238B2 (en) * 2011-09-12 2014-09-09 Microsoft Corporation Recording stateless IP addresses
CN103312836B (en) * 2013-06-28 2016-08-10 国家电网公司 A kind of large-scale local network ip address management method

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003298619A (en) * 2002-03-29 2003-10-17 Sanyo Electric Co Ltd Apparatus and method for creating ip address and apparatus and method for supplying identification information
US20050135364A1 (en) * 2003-12-17 2005-06-23 Byoung-Yue Kim Communication method and apparatus using multicast address
JP2008211504A (en) * 2007-02-26 2008-09-11 Hitachi Kokusai Electric Inc Information transmitting device
CN102469170A (en) * 2010-11-03 2012-05-23 英业达集团(天津)电子技术有限公司 Method for generating static Internet protocol (IP) address under disk operating system (DOS)
CN102547421A (en) * 2011-12-31 2012-07-04 福建星网视易信息系统有限公司 Cooperative communication method of STB (set top box)

Also Published As

Publication number Publication date
CN105577847A (en) 2016-05-11

Similar Documents

Publication Publication Date Title
WO2013131444A1 (en) Content sharing method, terminal, server, and system, and computer storage medium
WO2017041538A1 (en) Terminal user interface controlled display method and device
WO2019165691A1 (en) Method, apparatus and device for automatically generating test case, and readable storage medium
WO2016058258A1 (en) Terminal remote control method and system
WO2018107610A1 (en) Service data processing method, system and device, and computer-readable storage medium
WO2018227880A1 (en) Data comparison method, apparatus and device, and readable storage medium
WO2019051902A1 (en) Terminal control method, air conditioner and computer-readable storage medium
WO2020224247A1 (en) Blockchain–based data provenance method, apparatus and device, and readable storage medium
WO2019169814A1 (en) Method, apparatus and device for automatically generating chinese annotation, and storage medium
WO2018076811A1 (en) Data sharing method, device, system, storage medium and electronic device
WO2018053963A1 (en) Method and apparatus for upgrading system of smart television
WO2016173259A1 (en) Bluetooth pairing method and bluetooth pairing device
WO2019100604A1 (en) Account inquiry method, apparatus, device, and computer readable storage medium
WO2015120774A1 (en) Network access method and apparatus applied to mobile application
WO2017036208A1 (en) Method and system for extracting information in display interface
WO2017197802A1 (en) Character string fuzzy matching method and apparatus
WO2018121026A1 (en) Method and system for configuring set-top box
WO2019085301A1 (en) Missed call feedback method, apparatus and device for fixed phone, and readable storage medium
WO2017005062A1 (en) Image frame playing method and device
WO2019051897A1 (en) Terminal operating parameter adjustment method and device, and computer readable storage medium
WO2017059686A1 (en) Desktop displaying method and device
WO2015169209A1 (en) Animation data generating method, apparatus, and electronic device
WO2017088429A1 (en) Method and system for controlling touchscreen application program in display terminal by mobile terminal
WO2019019249A1 (en) Method, apparatus and device for executing network request, and computer-readable storage medium
WO2019051901A1 (en) Terminal control method and device, and computer readable storage medium

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 15910628

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 15910628

Country of ref document: EP

Kind code of ref document: A1