WO2016206519A1 - 分配ip地址的方法及装置 - Google Patents

分配ip地址的方法及装置 Download PDF

Info

Publication number
WO2016206519A1
WO2016206519A1 PCT/CN2016/083699 CN2016083699W WO2016206519A1 WO 2016206519 A1 WO2016206519 A1 WO 2016206519A1 CN 2016083699 W CN2016083699 W CN 2016083699W WO 2016206519 A1 WO2016206519 A1 WO 2016206519A1
Authority
WO
WIPO (PCT)
Prior art keywords
address
segment
released
addresses
allocated
Prior art date
Application number
PCT/CN2016/083699
Other languages
English (en)
French (fr)
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 WO2016206519A1 publication Critical patent/WO2016206519A1/zh

Links

Images

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/5061Pools of addresses
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • 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

Definitions

  • the present application relates to, but is not limited to, the field of mobile communications, and in particular, to a method and apparatus for allocating an IP address.
  • the address resources in the address pool are allocated and reclaimed.
  • the address pool can store an address or a plurality of addresses.
  • the purpose is to allocate enough address resources for the address pool.
  • the existing allocation methods are as follows: :
  • Method 1 sequential allocation: that is, each time the address resource is allocated starts from the smallest address of the address segment, and an unused address is found and allocated to the user. When the segment address is used up, the next segment of the address is selected to start allocation;
  • Mode 2 Reverse order allocation: that is, each time the address of the address segment begins, and an available address is allocated to the user from large to small. When the segment address is used up, the next segment address is selected to start allocation;
  • the allocation method of the related art can all assign addresses to users, but are limited to allocating the above address resources in one address segment.
  • operators have such an application, and require a large number of IP addresses to be configured. For example, if there are 20,000 calls, 500 accounts will be dialed up and occupy 500 addresses. If the user dials the line and dials again, the obtained IP address must be circulated from 501 addresses instead of the previous user offline. One, until the loop allocates 20,000 addresses, and then cyclically allocates from the first address to ensure that the address obtained by the user is not the last assigned address. For red packets, online games and applications with click-through rate as a key performance indicator, this distribution method can achieve good results.
  • the related art method for allocating an IP address is generally limited to one address segment, and one place
  • the address configured in the address segment has a limit on the number of addresses, so the above requirements cannot be achieved.
  • the present application has been made in order to provide a method and apparatus for allocating an IP address that overcomes the above problems or at least partially solves the above problems.
  • the IP addresses of multiple address segments in the address pool are cyclically allocated, so that the address to be allocated is not the IP address released in the process of assigning an IP address.
  • An embodiment of the present invention provides a method for allocating an IP address, including:
  • the IP addresses of the plurality of address segments are sequentially allocated from the first address segment in the order of identification until the plurality of address segments All of the IP addresses are allocated, wherein the IP addresses of the plurality of address segments are sequentially allocated from the first address segment until all IP addresses of the plurality of address segments are allocated.
  • the IP address in each address segment is only assigned once;
  • the IP address to be assigned is determined according to the recorded location information of the IP address released in the process: if the IP address to be allocated is The IP address released in the process skips the IP address released in the process, and allocates the next available IP address until only the released IP address in the address pool is assignable, and is allocated in the process. The IP address that was released.
  • An embodiment of the present invention further provides an apparatus for assigning an IP address, including:
  • the binding module is configured to bind multiple address segments in the address pool and identify the bound address segment.
  • the recording module is configured to record the location information of the IP address released in such a process when the IP address is assigned: the IP addresses of the plurality of address segments are sequentially allocated from the first address segment in the order of identification, until All IP addresses of the plurality of address segments are allocated, wherein the IP addresses of the plurality of address segments are sequentially allocated from the first address segment until the plurality of locations In the process of all IP addresses of the address segment being allocated, the IP address in each address segment is only allocated once;
  • An allocation module configured to determine an IP address to be assigned according to the recorded location information of the IP address released in the process when the IP address is assigned in the order of identification from the first address segment: if the IP address to be allocated is to be allocated The IP address is the IP address released in the process, the IP address released in the process is skipped, and the next available IP address is assigned until only the released IP address in the address pool is assignable. Assign the IP address that was released during the process.
  • the application further provides a computer readable storage medium storing computer executable instructions that are implemented when the computer executable instructions are executed.
  • IP address to be assigned is not the IP address released during the process of assigning the IP address, and the address is cyclically allocated.
  • the IP address of each address segment in the pool reduces the possibility of duplicate IP addresses.
  • FIG. 1 is a flowchart of a method for allocating an IP address according to an embodiment of the present invention
  • FIG. 2 is a schematic diagram of a networking and system after a user goes online
  • FIG. 3 is a schematic diagram of a resource management structure of an address segment in an address pool according to an embodiment of the present invention.
  • FIG. 4 is a flowchart of a process of allocating an IP address in an address pool according to an embodiment of the present invention
  • FIG. 5 is a flowchart of a process for releasing an IP address according to an embodiment of the present invention.
  • FIG. 6 is a schematic structural diagram of an apparatus for allocating an IP address according to an embodiment of the present invention.
  • the embodiment of the present invention provides a method and an apparatus for allocating an IP address, which need to implement cyclic allocation among each address segment in the address pool, that is, each address segment in the address pool is regarded as a continuous address. Space, cyclically allocates a contiguous address space within the address pool to address the needs of the above applications.
  • FIG. 1 is a flowchart of a method for allocating an IP address according to an embodiment of the present invention. As shown in FIG. 1 , a method for allocating an IP address according to an embodiment of the present invention is shown. Including the following processing:
  • Step 101 Bind multiple address segments in the address pool, and identify the bound address segments.
  • the step of identifying the bound address segment includes: identifying the bound address segment by using an identity identifier; or identifying the bound address segment by using a linked list.
  • the step of identifying the bound address segment by using the identity identifier includes: identifying the bound address segment by using an identity identifier according to the length of the address segment; or adopting the time according to the time of binding the address segment The identity identifies the bound address segment.
  • Step 102 When assigning an IP address, record location information of an IP address released in such a process: sequentially assign IP addresses of the plurality of address segments from the first address segment in the order of identification until the plurality of addresses All IP addresses of the address segments are allocated, wherein the IP addresses of the plurality of address segments are sequentially allocated from the first address segment until all IP addresses of the plurality of address segments are allocated In the process, the IP address in each address segment is only allocated once;
  • Step 103 assign IP addresses in the order of identification starting from the first address segment again. Determining an IP address to be assigned according to the recorded location information of the IP address released in the process: if the IP address to be allocated is an IP address released in the process, skipping the process in the process The released IP address, and the next available IP address is assigned, until only the released IP address can be allocated in the address pool, the IP address released in the process is allocated.
  • the location information of the IP address released in the process includes: an identifier of an address segment in which the released IP address is located, and a location of the IP address released each time in the address segment.
  • step 103 includes:
  • Step 1 Bind multiple address segments in the address pool.
  • the address segment here can be understood as an address resource and multiple address resources bound in the address pool.
  • Step 2 The identity of the bound address segment is identified by using an identity identifier or by using a linked list to identify the identity.
  • the identifier is used to identify the identity, such as the identity of the first bound address segment.
  • the member ID is identified, and the identity of the second bound address segment is member2.
  • identity identification can be managed by means of identity identification, which is convenient for searching.
  • This example is based on identity management, and can also be arranged according to the length of the address segment, or according to the binding.
  • the time is arranged. This example sorts the address resources according to the time of binding.
  • Step 3 After the configuration is completed, if 10 segments or more are bound, when the IP address is assigned, the first available address is obtained from the first member in the order of the identification. That is, when an address is assigned, an unallocated IP address is found from the first member in the chronological order of the binding for allocation, and then allocated in the address order in the address segment.
  • Step 4 When the last unassigned IP address is assigned in the first member, the next assigned IP address is the address in the second member.
  • Step 5 If 10 address segments are bound, and the IP address of the tenth address segment has been allocated, jump to the first member to assign an IP address to implement circular allocation of IP addresses.
  • Step 6 When the IP address is cyclically allocated in an address pool, the location information of each released IP address is recorded, and if the address to be allocated is the IP address released in the loop of the last assigned IP address, the IP address is skipped. And assigning the next available address until the address released in the loop in the address pool where only the last assigned IP address can be allocated, the address released in the loop assigned the last assigned IP address is assigned to the user.
  • FIG. 2 is a schematic diagram of a network and a system after a user goes online, as shown in FIG. 2, the user dials the Internet through the PPPoE protocol or other methods; the user goes offline and then goes offline, and the IP address allocated each time is not same.
  • FIG. 3 is a schematic diagram of an address segment resource management structure in an address pool according to an embodiment of the present invention.
  • the configured address segment is managed according to an identity identifier; the first one is available from each time an address segment is allocated. After assigning the IP address to the last available IP address in the address segment, the IP address will be assigned in the next member with the available IP address; when the last available member in the last member is allocated When the IP address is assigned again, the IP address will be re-started, and the first available member will be restarted.
  • FIG. 4 is a flowchart of a process for allocating an IP address in an address pool according to an embodiment of the present invention. As shown in FIG. 4, the method includes the following steps:
  • Step 1 Find an available address pool, which has an assignable IP address.
  • Step 2 Determine whether the address pool is configured as a cyclic allocation mode. If it is not configured as a cyclic allocation mode, it is processed according to a conventional processing manner;
  • Step 3 Determine whether the address pool has been assigned an IP address in a round robin mode. If the address is not assigned in the recurrence mode, find a member with an available IP address in the order of the identity identifier, and proceed to step 8; Assigned an IP address and proceed to step 4;
  • Step 4 Obtain the member of the last assigned IP address from the address pool
  • Step 5 Obtain location information of the most recently assigned IP address of the member, and start to find an available IP address in the cyclic order from the IP address;
  • Step 6 determine whether there is an available IP address in the member, if there is an available IP address, proceed to step 8; if there is no available IP address, proceed to step 7;
  • Step 7 Find the member of the next available IP address from the member in a cyclical order
  • Step 8 Allocating the first available IP address from the found member with the available IP address
  • Step 9 Update the information of the member in the address pool and save the location information of the IP address assigned this time.
  • FIG. 5 is a flowchart of a process for releasing an IP address according to an embodiment of the present invention. As shown in FIG. 5, the following processing is included:
  • Step 2 determining the member of the IP address to be released
  • Step 3 Release the IP address in the member.
  • Step 4 Save the location information of the released IP address.
  • the technical solution of the embodiment of the present invention by identifying multiple address segments in the address pool and recording the location information of the IP address released during the process of assigning the IP address, it is ensured that the IP address to be allocated is not the previous one.
  • the IP address released during the process of assigning an IP address, and the IP address of multiple address segments in the address pool are cyclically allocated, which reduces the possibility of duplicate IP addresses.
  • FIG. 6 is a schematic structural diagram of an apparatus for allocating an IP address according to an embodiment of the present invention. As shown in FIG. 6, an IP address is allocated according to an embodiment of the present invention.
  • the device includes: a binding module 60 and an allocation module 62. The modules of the embodiments of the present invention are described in detail below.
  • the binding module 60 is configured to bind multiple address segments in the address pool and identify the bound address segments.
  • the binding module 60 is configured to: use the identity identifier to bind the bound address segments.
  • the identifier; or, the linked address segment is identified by a linked list.
  • the binding module 60 may identify the bound address segment by using an identity identifier according to the length of the address segment, or use the identity identifier to identify the bound address segment according to the time of the binding address segment.
  • the recording module 62 is configured to record, when the IP address is assigned, location information of the IP address released in such a process: assigning the plurality of addresses from the first address segment to the beginning in the order of identification
  • the IP addresses of the address segments are allocated until all the IP addresses of the plurality of address segments are allocated, wherein the IP addresses of the plurality of address segments are sequentially allocated from the first address segment until the plurality of addresses
  • the IP address in each address segment is only allocated once.
  • the allocating module 64 is configured to determine, according to the recorded location information of the IP address released in the process, the IP address to be assigned when the IP address is assigned in the order of identification from the first address segment: if the IP address to be allocated is determined: The assigned IP address is the IP address released in the process, the IP address released in the process is skipped, and the next available IP address is allocated until only the released IP address in the address pool is assignable. , allocating the IP address released during the process.
  • the allocating module 64 is configured to allocate the available IP addresses in the first address segment in the order of identification starting from the first available IP address in the first address segment until the first allocation has been assigned When all available IP addresses in the address segment, the available IP addresses in the next address segment are allocated from the first available IP address in the next address segment until all available IP addresses of the multiple address segments The points are assigned.
  • the location information of the IP address released in the process includes: an identifier of an address segment in which the released IP address is located, and a location of the IP address released each time in the address segment.
  • Embodiments of the present invention further provide a computer readable storage medium storing computer executable instructions that are implemented when the computer executable instructions are executed.
  • the technical solution of the embodiment of the present invention by identifying multiple address segments in the address pool and recording the location information of the IP address released in the process of assigning the IP address, it is ensured that the IP address to be allocated is not the previous one.
  • the IP address released during the process of assigning an IP address, and the IP address of multiple address segments in the address pool are cyclically allocated, which reduces the possibility of duplicate IP addresses.
  • each module/unit in the above embodiment may be implemented in the form of hardware, for example, by an integrated circuit to implement its corresponding function, It can be implemented in the form of a software function module, for example, by a processor executing a program/instruction stored in a memory to implement its corresponding function.
  • Embodiments of the invention are not limited to any specific form of combination of hardware and software.
  • modules in the client in the embodiment can be adaptively changed and placed in one or more clients different from the embodiment.
  • the modules in the embodiments can be combined into one module, and further they can be divided into a plurality of sub-modules or sub-units or sub-components.
  • any combination of the features disclosed in the specification, including the accompanying claims, the abstract and the drawings, and any methods so disclosed, or All processes or units of the client are combined.
  • the various component embodiments of the present application can be implemented in hardware, or in a software module running on one or more processors, or in a combination thereof.
  • a microprocessor or digital signal processor may be used in practice to implement some or all of the functionality of some or all of the components loaded with the ordered web address in accordance with an embodiment of the present invention.
  • the application can also be implemented as a device or device program (eg, a computer program and a computer program product) configured to perform some or all of the methods described herein.
  • Such a program implementing the present application may be stored on a computer readable medium or may be in the form of one or more signals. Such signals may be downloaded from an Internet website, provided on a carrier signal, or provided in any other form.
  • IP address of the address segment reduces the possibility of duplicate IP addresses.

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

公开了一种分配IP地址的方法及装置。该方法包括:在地址池中绑定多个地址段,并对绑定的地址段进行标识;在分配IP地址时,记录在这样一个过程中释放的IP地址的位置信息:按照标识的顺序从第一个地址段开始依次分配所述多个地址段的IP地址,直至所述多个地址段的所有IP地址均被分配;在重新从所述第一个地址段开始按照标识的顺序分配IP地址时,根据记录的在所述过程中释放的IP地址的位置信息确定要分配的IP地址:若待分配的IP地址为在所述过程中释放的IP地址,则略过该在所述过程中释放的IP地址,并分配下一个可用IP地址,直至所述地址池内只有释放的IP地址可分配时,分配在所述过程中释放的IP地址。

Description

分配IP地址的方法及装置 技术领域
本申请涉及但不限于移动通讯领域,特别是一种分配IP地址的方法及装置。
背景技术
在相关技术中,地址池中的地址资源被分配及回收,地址池里可以存放一段地址,也可以存放多段地址,目的是为了地址池有足够的地址资源可以分配,目前已有的分配方式如下:
方式一,顺序分配:即每次分配地址资源都是从地址段的最小地址开始,找到一个未使用地址,分配给用户,当该段地址都使用完,才会选择下一段地址开始分配;
方式二,倒序分配:即每次都是地址段的最大地址开始,从大往小找到一个可用的地址分配给用户,当该段地址都使用完,才会选择下一段地址开始分配;
方式三,循环分配:在一个地址段内实现地址递增循环分配,每次分地址总是从上一次分配地址的位置,找到下一个可用的地址,当该段地址都使用完,才会选择下一段地址开始分配;
从上面的描述可以看出,相关技术的分配方式都能分配地址给用户,但都局限于在一个地址段内分配上述的地址资源,目前运营商有这样一种应用,要求配置大量的IP地址,如20000个,有500个账号拨号上线,占用了500个地址,要求:若用户下线后,再拨号,获取的IP地址必须是从501个地址开始循环,而不是前面用户下线释放的一个,直到循环分配20000个地址都获取完后,再从第一个地址开始循环分配,保证用户获取的地址不是上次分配的地址。对于抢红包,网游及以点击率作为关键绩效指标的应用,这种分配方式能达到很好的效果。
相关技术的分配IP地址的方法,一般都局限在一个地址段内,而一个地 址段配置的地址都有地址数量的限制,所以不能够达到上述需求。
发明内容
以下是对本文详细描述的主题的概述。本概述并非是为了限制权利要求的保护范围。
鉴于上述问题,提出了本申请以便提供一种克服上述问题或者至少部分地解决上述问题的分配IP地址的方法及装置。在地址池内,循环分配地址池内的多个地址段的IP地址,使将要分配的地址并非上一个分配IP地址的过程中释放的IP地址。
本发明实施例提供一种分配IP地址的方法,包括:
在地址池中绑定多个地址段,并对绑定的地址段进行标识;
在分配IP地址时,记录在这样一个过程中释放的IP地址的位置信息:按照标识的顺序从第一个地址段开始依次分配所述多个地址段的IP地址,直至所述多个地址段的所有IP地址均被分配,其中,在所述从第一个地址段开始依次分配所述多个地址段的IP地址,直至所述多个地址段的所有IP地址均被分配的过程中,每个地址段中的IP地址仅分配一次;
在重新从所述第一个地址段开始按照标识的顺序分配IP地址时,根据记录的在所述过程中释放的IP地址的位置信息确定要分配的IP地址:若待分配的IP地址为在所述过程中释放的IP地址,则略过该在所述过程中释放的IP地址,并分配下一个可用IP地址,直至所述地址池内只有释放的IP地址可分配时,分配在所述过程中释放的IP地址。
本发明实施例还提供了一种分配IP地址的装置,包括:
绑定模块,设置成在地址池中绑定多个地址段,并对绑定的地址段进行标识;
记录模块,设置成在分配IP地址时,记录在这样一个过程中释放的IP地址的位置信息:按照标识的顺序从第一个地址段开始依次分配所述多个地址段的IP地址,直至所述多个地址段的所有IP地址均被分配,其中,在所述从第一个地址段开始依次分配所述多个地址段的IP地址,直至所述多个地 址段的所有IP地址均被分配的过程中,每个地址段中的IP地址仅分配一次;
分配模块,设置成在重新从所述第一个地址段开始按照标识的顺序分配IP地址时,根据记录的在所述过程中释放的IP地址的位置信息确定要分配的IP地址:若待分配的IP地址为在所述过程中释放的IP地址,则略过该在所述过程中释放的IP地址,并分配下一个可用IP地址,直至所述地址池内只有释放的IP地址可分配时,分配在所述过程中释放的IP地址。
本申请另外提供一种计算机可读存储介质,存储有计算机可执行指令,所述计算机可执行指令被执行时实现上述方法。
本申请有益效果如下:
通过标识地址池内的多个地址段,并记录在分配IP地址的过程中释放的IP地址的位置信息,确保将要分配的IP地址不是上一个分配IP地址的过程中释放的IP地址,循环分配地址池内各个地址段的IP地址,降低了IP地址重复的可能性。
上述说明仅是本申请技术方案的概述,为了能够更清楚了解本申请的技术手段,而可依照说明书的内容予以实施,以下特举本申请的实施方式。
在阅读并理解了附图和详细描述后,可以明白其他方面。
附图概述
通过阅读下文可选实施方式的详细描述,各种其他的优点和益处对于本领域普通技术人员将变得清楚明了。附图仅用于示出可选实施方式的目的,而并不认为是对本申请的限制。而且在整个附图中,用相同的参考符号表示相同的部件。在附图中:
图1是本发明实施例的分配IP地址的方法的流程图;
图2是本发明实施例的用户上线后的组网及系统的示意图;
图3是本发明实施例的地址池内地址段资源管理结构的示意图;
图4是本发明实施例的分配地址池中的IP地址的过程的流程图;
图5是本发明实施例的释放IP地址的过程的流程图;
图6是本发明实施例的分配IP地址的装置的结构示意图。
本发明的较佳实施方式
下面将参照附图更详细地描述本公开的示例性实施例。虽然附图中显示了本公开的示例性实施例,然而应当理解,可以以各种形式实现本公开而不应被这里阐述的实施例所限制。相反,提供这些实施例是为了能够更透彻地理解本公开,并且能够将本公开的范围完整的传达给本领域的技术人员。
为了满足运营商的应用需求,本发明实施例提供了一种分配IP地址的方法及装置,需要实现在地址池内的各个地址段之间实现循环分配,即将地址池内的各个地址段作为连续的地址空间,循环分配地址池内的连续地址空间,从而解决上述应用的需求。以下结合附图以及实施例,对本申请进行进一步详细说明。应当理解,此处所描述的实施例仅仅用以解释本申请,并不限定本申请。
根据本发明的实施例,提供了一种分配IP地址的方法,图1是本发明实施例的分配IP地址的方法的流程图,如图1所示,本发明实施例的分配IP地址的方法包括如下处理:
步骤101,在地址池中绑定多个地址段,并对绑定的地址段进行标识;
在步骤101中,所述对绑定的地址段进行标识的步骤包括:采用身份标识对绑定的地址段进行标识;或者,采用链表对绑定的地址段进行标识。可选地,所述采用身份标识对绑定的地址段进行标识的步骤包括:按照地址段的长度,采用身份标识对绑定的地址段进行标识;或者,按照绑定地址段的时间,采用身份标识对绑定的地址段进行标识。
步骤102,在分配IP地址时,记录在这样一个过程中释放的IP地址的位置信息:按照标识的顺序从第一个地址段开始依次分配所述多个地址段的IP地址,直至所述多个地址段的所有IP地址均被分配,其中,在所述从第一个地址段开始依次分配所述多个地址段的IP地址,直至所述多个地址段的所有IP地址均被分配的过程中,每个地址段中的IP地址仅分配一次;
步骤103,在重新从所述第一个地址段开始按照标识的顺序分配IP地址 时,根据记录的在所述过程中释放的IP地址的位置信息确定要分配的IP地址:若待分配的IP地址为在所述过程中释放的IP地址,则略过该在所述过程中释放的IP地址,并分配下一个可用IP地址,直至所述地址池内只有释放的IP地址可分配时,分配在所述过程中释放的IP地址。可选地,在所述过程中释放的IP地址的位置信息包括:每次释放的IP地址所处的地址段的标识、以及每次释放的IP地址在地址段中的位置。
可选地,步骤103包括:
从第一个地址段中第一个可用IP地址开始按照标识的顺序对所述第一个地址段中的可用IP地址进行分配,直至已分配了第一个地址段中所有可用IP地址时,从下一个地址段中第一个可用IP地址开始对所述下一个地址段中的可用IP地址进行分配,直到所述多个地址段的所有可用IP地址均被分配。以下结合附图,对本发明实施例的上述技术方案进行详细说明。
步骤1,在地址池中绑定多个地址段。这里的地址段可以理解为地址资源,及地址池中绑定的多个地址资源。
步骤2,对绑定的地址段采用身份标识进行标识的方式或者采用链表进行标识的方式进行管理,在本实例中,采用身份标识进行标识的方式,如第一个绑定的地址段的身份标识的就是member1,第二个绑定的地址段的身份标识就是member2。需要说明的是,对于新绑定的地址段,可以采用身份标识的方式进行管理,便于查找,本实例是基于身份标识的管理,也可按照地址段的长度进行排列,也可以按照绑定的时间进行排列,本实例是按照绑定的时间对地址资源进行排序。
步骤3,当配置完成后,如绑定10个段或者更多段,在分配IP地址时,从第一个member下按照标识的顺序获取第一个可用地址。也就是说,当分配地址时,从按照绑定的时间顺序的第一个member中找到一个未分配的IP地址以用于分配,然后在地址段内按照地址顺序进行分配。
步骤4,当在第一个member中分配最后一个未分配的IP地址时,下一个分配的IP地址是第二个member中的地址。
步骤5,如果绑定10个地址段,且第十个地址段的IP地址已分配完,则跳转到第一个member分配IP地址,以实现循环分配IP地址。
步骤6,当在一个地址池内循环分配IP地址时,记录每次释放的IP地址的位置信息,如果待分配的地址是上一个分配IP地址的循环中释放的IP地址,则略过该IP地址并分配下一个可用的地址,直到地址池内只有上一个分配IP地址的循环中释放的地址可分配时,才分配上一个分配IP地址的循环中释放的地址分配给用户。
记录上次释放的IP地址所在的member信息,及member内IP地址的位置信息,如果将要分配的地址是上一个分配IP地址的循环中释放的地址,则略过上一个分配IP地址的循环中释放的地址,找到下一个可用的地址。
图2是本发明实施例的用户上线后的组网及系统的示意图,如图2所示,用户通过PPPoE协议或者其他方式拨号上网;用户上线后再下线,每次分配的IP地址都不一样。
图3是本发明实施例的地址池内地址段资源管理结构的示意图,如图3所示,配置的地址段按照身份标识进行标识的方式来管理;每次从分配一个地址段的第一个可用的IP地址到分配该地址段中最后一个可用的IP地址后,再次分配IP地址时,就会在下一个具有可用的IP地址的member中进行分配;当分配了最后一个member中的最后一个可用的IP地址时,再次分配IP地址的时候,就会重新开始查找第一个可用的member;
图4是本发明实施例的分配地址池中的IP地址的过程的流程图,如图4所示,包括如下步骤:
步骤1、找到一个可用的地址池,该地址池有可分配的IP地址;
步骤2、判断地址池是否配置为循环分配模式,若没有被配置为循环分配模式,则按常规的处理方式处理;
步骤3、判断该地址池是否按循环模式分配过IP地址,若没有按循环模式分配过地址,按照身份标识的顺序从小到大找到一个由可用的IP地址的member,进行到步骤8;若已分配过IP地址,进行到步骤4;
步骤4、从地址池中获取最近一次分配的IP地址所在的member;
步骤5、获取该member的最近一次分配的IP地址的位置信息,从该IP地址按照循环顺序开始查找一个可用的IP地址;
步骤6、判断该member中是否有一个可用的IP地址,如果有可用的IP地址,进行到步骤8;如果没有可用的IP地址,进行到步骤7;
步骤7、从该member的按照循环顺序的查找下一个有可用的IP地址所在的member;
步骤8、从查找到的有可用的IP地址的member下分配第一个可用的IP地址;
步骤9、更新地址池中的member的信息,同时保存本次分配的IP地址的位置信息。
图5是本发明实施例的释放IP地址的过程的流程图,如图5所示,包括如下处理:
步骤2、确定将要释放的IP地址所在的member;
步骤3、释放该member中的IP地址;
步骤4、保存本次释放的IP地址的位置信息。综上所述,借助于本发明实施例的技术方案,通过标识地址池内的多个地址段,并记录分配IP地址的过程中释放的IP地址的位置信息,确保将要分配的IP地址不是上一个分配IP地址的过程中释放的IP地址,循环分配地址池内多个地址段的IP地址,降低了IP地址重复的可能性。
根据本发明的实施例,提供了一种分配IP地址的装置,图6是本发明实施例的分配IP地址的装置的结构示意图,如图6所示,根据本发明实施例的分配IP地址的装置包括:绑定模块60、分配模块62,以下对本发明实施例的各个模块进行详细的说明。
绑定模块60,设置成在地址池中绑定多个地址段,并对绑定的地址段进行标识;可选地,绑定模块60是设置成:采用身份标识对绑定的地址段进行标识;或者,采用链表对绑定的地址段进行标识。可选地,绑定模块60可以按照地址段的长度,采用身份标识对绑定的地址段进行标识;或者,按照绑定地址段的时间,采用身份标识对绑定的地址段进行标识。
记录模块62,设置成在分配IP地址时,记录在这样一个过程中释放的IP地址的位置信息:按照标识的顺序从第一个地址段到开始依次分配所述多 个地址段的IP地址直至所述多个地址段的所有IP地址均被分配,其中,在所述从第一个地址段开始依次分配所述多个地址段的IP地址,直至所述多个地址段的所有IP地址均被分配的过程中,每个地址段中的IP地址仅分配一次。
分配模块64,设置成在重新从所述第一个地址段开始按照标识的顺序分配IP地址时,根据记录的在所述过程中释放的IP地址的位置信息确定要分配的IP地址:若待分配的IP地址为在所述过程中释放的IP地址,则略过该在所述过程中释放的IP地址,并分配下一个可用IP地址,直至所述地址池内只有释放的IP地址可分配时,分配在所述过程中释放的IP地址。
可选地,分配模块64是设置成从第一个地址段中第一个可用IP地址开始按照标识的顺序对所述第一个地址段中的可用IP地址进行分配,直至已分配了第一个地址段中所有可用IP地址时,从下一个地址段中第一个可用IP地址开始对所述下一个地址段中的可用IP地址进行分配,直到所述多个地址段的所有可用IP地址分均被分配。
可选地,在所述过程中释放的IP地址的位置信息包括:每次释放的IP地址所处的地址段的标识、以及每次释放的IP地址在地址段中的位置。
本发明实施例的上述装置中各个模块的处理可以参照方法实施例进行理解,在此不再赘述。
本发明实施例另外提供一种计算机可读存储介质,存储有计算机可执行指令,所述计算机可执行指令被执行时实现上述方法。
综上所述,根据本发明实施例的技术方案,通过标识地址池内的多个地址段,并记录在分配IP地址的过程中释放的IP地址的位置信息,确保将要分配的IP地址不是上一个分配IP地址的过程中释放的IP地址,循环分配地址池内多个地址段的IP地址,降低了IP地址重复的可能性。
本领域普通技术人员可以理解上述方法中的全部或部分步骤可通过程序来指令相关硬件(例如处理器)完成,所述程序可以存储于计算机可读存储介质中,如只读存储器、磁盘或光盘等。可选地,上述实施例的全部或部分步骤也可以使用一个或多个集成电路来实现。相应地,上述实施例中的各模块/单元可以采用硬件的形式实现,例如通过集成电路来实现其相应功能,也 可以采用软件功能模块的形式实现,例如通过处理器执行存储于存储器中的程序/指令来实现其相应功能。本发明实施例不限制于任何特定形式的硬件和软件的结合。
显然,本领域的技术人员可以对本申请进行各种改动和变型而不脱离本申请的精神和范围。这样,倘若本申请的这些修改和变型属于本申请权利要求及其等同技术的范围之内,则本申请也意图包含这些改动和变型在内。
在此提供的算法和显示不与任何特定计算机、虚拟系统或者其它设备固有相关。各种通用系统也可以与基于在此的示教一起使用。根据上面的描述,构造这类系统所要求的结构是显而易见的。此外,本申请也不针对任何特定编程语言。应当明白,可以利用各种编程语言实现在此描述的本申请的内容,并且上面对特定语言所做的描述是为了披露本发明的最佳实施方式。
在此处所提供的说明书中,说明了大量细节。然而,能够理解,本发明的实施例可以在没有这些细节的情况下实践。在一些实例中,并未详细示出公知的方法、结构和技术,以便不模糊对本说明书的理解。
类似地,应当理解,为了精简本公开并帮助理解各个方面中的一个或多个,在上面对本发明的示例性实施例的描述中,本发明实施例的各个特征有时被一起分组到单个实施例、图、或者对其的描述中。然而,并不应将该公开的方法解释成反映如下意图:即所要求保护的本申请要求比在每个权利要求中所明确记载的特征更多的特征。更确切地说,如下面的权利要求书所反映的那样,申请方面在于少于前面公开的单个实施例的所有特征。因此,遵循实施方式的权利要求书由此明确地并入该实施方式,其中每个权利要求本身都作为本申请的单独实施例。
本领域技术人员可以理解,可以对实施例中的客户端中的模块进行自适应性地改变并且把它们设置在与该实施例不同的一个或多个客户端中。可以把实施例中的模块组合成一个模块,以及此外可以把它们分成多个子模块或子单元或子组件。除了这样的特征和/或过程或者单元中的至少一些是相互排斥之外,可以采用任何组合对本说明书(包括伴随的权利要求、摘要和附图)中公开的所有特征以及如此公开的任何方法或者客户端的所有过程或单元进行组合。除非另外明确陈述,本说明书(包括伴随的权利要求、摘要和附图) 中公开的每个特征可以由提供相同、等同或相似目的的替代特征来代替。
此外,本领域的技术人员能够理解,尽管在此所述的一些实施例包括其它实施例中所包括的某些特征而不是其它特征,但是不同实施例的特征的组合意味着处于本申请的范围之内并且形成不同的实施例。例如,下面的权利要求书中,所要求保护的实施例的任意之一都可以以任意的组合方式来使用。
本申请的各个部件实施例可以以硬件实现,或者以在一个或者多个处理器上运行的软件模块实现,或者以它们的组合实现。本领域的技术人员应当理解,可以在实践中使用微处理器或者数字信号处理器(DSP)来实现根据本发明实施例的加载有排序网址的客户端中的一些或者全部部件的一些或者全部功能。本申请还可以实现为设置成执行这里所描述的方法的一部分或者全部的设备或者装置程序(例如,计算机程序和计算机程序产品)。这样的实现本申请的程序可以存储在计算机可读介质上,或者可以具有一个或者多个信号的形式。这样的信号可以从因特网网站上下载得到,或者在载体信号上提供,或者以任何其他形式提供。
应该注意的是上述实施例对本申请进行说明而不是对本申请进行限制,并且本领域技术人员在不脱离所附权利要求的范围的情况下可设计出替换实施例。在权利要求中,不应将位于括号之间的任何参考符号构造成对权利要求的限制。单词“包含”不排除存在未列在权利要求中的元件或步骤。位于元件之前的单词“一”或“一个”不排除存在多个这样的元件。本申请可以借助于包括有若干不同元件的硬件以及借助于适当编程的计算机来实现。在列举了若干装置的单元权利要求中,这些装置中的若干个可以是通过同一个硬件项来体现。单词第一、第二、以及第三等的使用不表示任何顺序。可将这些单词解释为名称。
工业实用性
通过标识地址池内的多个地址段,并记录在分配IP地址的过程中释放的IP地址的位置信息,确保将要分配的地址不是分配IP地址的过程中释放的IP地址,循环分配地址池内多个地址段的IP地址,降低了IP地址重复的可能性。

Claims (11)

  1. 一种分配IP地址的方法,包括:
    在地址池中绑定多个地址段,并对绑定的地址段进行标识;
    在分配IP地址时,记录在这样一个过程中释放的IP地址的位置信息:按照标识的顺序从第一个地址段开始依次分配所述多个地址段的IP地址,直至所述多个地址段的所有IP地址均被分配,其中,在所述从第一个地址段开始依次分配所述多个地址段的IP地址,直至所述多个地址段的所有IP地址均被分配的过程中,每个地址段中的IP地址仅分配一次;
    在重新从所述第一个地址段开始按照标识的顺序分配IP地址时,根据记录的在所述过程中释放的IP地址的位置信息确定要分配的IP地址:若待分配的IP地址为在所述过程中释放的IP地址,则略过该在所述过程中释放的IP地址,并分配下一个可用IP地址,直至所述地址池内只有所述释放的IP地址可分配时,分配在所述过程中释放的IP地址。
  2. 如权利要求1所述的方法,其中,所述对绑定的地址段进行标识的步骤包括:
    采用身份标识对绑定的地址段进行标识;或者,采用链表对绑定的地址段进行标识。
  3. 如权利要求2所述的方法,其中,所述采用身份标识对绑定的地址段进行标识的步骤包括:
    按照地址段的长度,采用身份标识对绑定的地址段进行标识;或者,按照绑定地址段的时间,采用身份标识对绑定的地址段进行标识。
  4. 如权利要求1所述的方法,其中,所述从第一个地址段开始依次分配所述多个地址段的IP地址,直至所述多个地址段的所有IP地址均被分配的过程,包括:
    从第一个地址段中第一个可用IP地址开始按照标识的顺序对所述第一个地址段中的可用IP地址进行分配,直至已分配了第一个地址段中所有可用IP地址时,从下一个地址段中第一个可用IP地址开始对所述下一个地址段中的可用IP地址进行分配,直到所述多个地址段的所有可用IP地址均被分 配。
  5. 如权利要求1所述的方法,其中,在所述过程中释放的IP地址的位置信息包括:每次释放的IP地址所处的地址段的标识、以及每次释放的IP地址在所述地址段中的位置。
  6. 一种分配IP地址的装置,包括:
    绑定模块,设置成在地址池中绑定多个地址段,并对绑定的地址段进行标识;
    记录模块,设置成在分配IP地址时,记录这样一个过程中释放的IP地址的位置信息:按照标识的顺序从第一个地址段开始依次分配所述多个地址段的IP地址,直至所述多个地址段的所有IP地址均被分配,其中,在所述从第一个地址段开始依次分配所述多个地址段的IP地址,直至所述多个地址段的所有IP地址均被分配的过程中,每个地址段中的IP地址仅分配一次;
    分配模块,设置成在重新从所述第一个地址段开始按照标识的顺序分配IP地址时,根据记录的在所述过程中释放的IP地址的位置信息确定要分配的IP地址:若待分配的IP地址为在所述过程中释放的IP地址,则略过该在所述过程中释放的IP地址,并分配下一个可用IP地址,直至所述地址池内只有所述释放的IP地址可分配时,分配在所述过程中释放的IP地址。
  7. 如权利要求6所述的装置,其中,所述绑定模块是设置成:
    采用身份标识对绑定的地址段进行标识;或者,采用链表对绑定的地址段进行标识。
  8. 如权利要求6所述的装置,其中,所述绑定模块是设置成:
    按照地址段的长度,采用身份标识对绑定的地址段进行标识;或者,按照绑定地址段的时间,采用身份标识对绑定的地址段进行标识。
  9. 如权利要求6所述的装置,其中,所述分配模块是设置成:
    从第一个地址段中第一个可用IP地址开始按照标识的顺序对所述第一个地址段中的可用IP地址进行分配,直至已分配了第一个地址段中所有可用IP地址时,从下一个地址段中第一个可用IP地址开始对所述下一个地址段中的可用IP地址进行分配,直到所述多个地址段的所有可用IP地址均被分 配。
  10. 如权利要求6所述的装置,其中,在所述过程中释放的IP地址的位置信息包括:每次释放的IP地址所处的地址段的标识、以及每次释放的IP地址在所述地址段中的位置。
  11. 一种计算机可读存储介质,存储有计算机可执行指令,所述计算机可执行指令被执行时实现权利要求1-5中任意一项所述的方法。
PCT/CN2016/083699 2015-06-23 2016-05-27 分配ip地址的方法及装置 WO2016206519A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510349220.X 2015-06-23
CN201510349220.XA CN106331193A (zh) 2015-06-23 2015-06-23 地址池分配方法及装置

Publications (1)

Publication Number Publication Date
WO2016206519A1 true WO2016206519A1 (zh) 2016-12-29

Family

ID=57584642

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/083699 WO2016206519A1 (zh) 2015-06-23 2016-05-27 分配ip地址的方法及装置

Country Status (2)

Country Link
CN (1) CN106331193A (zh)
WO (1) WO2016206519A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2021218232A1 (zh) * 2020-04-27 2021-11-04 中兴通讯股份有限公司 地址分配方法和系统、电子设备、计算机可读存储介质
CN114726828A (zh) * 2022-05-10 2022-07-08 普联技术有限公司 Ip地址分配方法、装置、设备及存储介质

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112751949A (zh) * 2020-12-28 2021-05-04 紫光云技术有限公司 一种自适应分配管理网地址的方法
CN116112914A (zh) * 2023-04-04 2023-05-12 汉朔科技股份有限公司 一种lcd价签、lcd价签系统及通信方法

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1492615A (zh) * 2002-09-11 2004-04-28 ���ǵ�����ʽ���� 为码分多址系统中的移动节点分配互联网协议地址的方法
US7197549B1 (en) * 2001-06-04 2007-03-27 Cisco Technology, Inc. On-demand address pools
US20120042058A1 (en) * 2010-08-11 2012-02-16 Verizon Patent And Licensing Inc. Ip pool name lists
CN104378455A (zh) * 2014-11-13 2015-02-25 杭州华三通信技术有限公司 Ip地址分配方法以及装置
CN104506669A (zh) * 2014-12-30 2015-04-08 中国科学院信息工程研究所 一种面向分布式网络仿真平台的ip地址分配系统及方法
EP2882167A1 (en) * 2013-12-06 2015-06-10 Deutsche Telekom AG Method for an enhanced management of IP (Internet Protocol) addresses in a telecommunications network, and telecommunications network

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8238315B2 (en) * 2008-09-16 2012-08-07 Marvell World Trade Ltd. Rapid local address assignment for wireless communication networks
CN102238239A (zh) * 2010-04-21 2011-11-09 电信科学技术研究院 一种ip地址分配方法及设备
CN102457587B (zh) * 2010-10-26 2014-07-09 大唐移动通信设备有限公司 一种ip地址分配方法及设备

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7197549B1 (en) * 2001-06-04 2007-03-27 Cisco Technology, Inc. On-demand address pools
CN1492615A (zh) * 2002-09-11 2004-04-28 ���ǵ�����ʽ���� 为码分多址系统中的移动节点分配互联网协议地址的方法
US20120042058A1 (en) * 2010-08-11 2012-02-16 Verizon Patent And Licensing Inc. Ip pool name lists
EP2882167A1 (en) * 2013-12-06 2015-06-10 Deutsche Telekom AG Method for an enhanced management of IP (Internet Protocol) addresses in a telecommunications network, and telecommunications network
CN104378455A (zh) * 2014-11-13 2015-02-25 杭州华三通信技术有限公司 Ip地址分配方法以及装置
CN104506669A (zh) * 2014-12-30 2015-04-08 中国科学院信息工程研究所 一种面向分布式网络仿真平台的ip地址分配系统及方法

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2021218232A1 (zh) * 2020-04-27 2021-11-04 中兴通讯股份有限公司 地址分配方法和系统、电子设备、计算机可读存储介质
CN114726828A (zh) * 2022-05-10 2022-07-08 普联技术有限公司 Ip地址分配方法、装置、设备及存储介质
CN114726828B (zh) * 2022-05-10 2023-08-08 普联技术有限公司 Ip地址分配方法、装置、设备及存储介质

Also Published As

Publication number Publication date
CN106331193A (zh) 2017-01-11

Similar Documents

Publication Publication Date Title
US10686756B2 (en) Method and apparatus for managing MAC address generation for virtualized environments
WO2016206519A1 (zh) 分配ip地址的方法及装置
CN109684092B (zh) 资源分配方法及装置
CN109547570A (zh) 服务注册方法、装置、注册中心管理设备及存储介质
CN108322325B (zh) 一种虚拟机管理方法及装置
US8843632B2 (en) Allocation of resources between web services in a composite service
KR20170059451A (ko) 멀티테넌트 어플리케이션 서버 환경에서 파티션 식별자들의 결정을 위한 시스템 및 방법
US8997047B2 (en) Dynamically updating code without requiring processes to restart
JP5408353B2 (ja) マルチスレッド処理装置,マルチスレッド処理システム,マルチスレッド処理プログラム,及びマルチスレッド処理方法
WO2016029790A1 (zh) 数据传输方法及装置
CN106873970B (zh) 一种操作系统的安装方法和装置
CN104391657A (zh) 一种安卓系统上挂载多分区存储设备的方法
CN109343862B (zh) 应用的资源数据的调度方法及装置
WO2016078091A1 (zh) 一种输入输出io请求处理方法及文件服务器
US10237233B2 (en) Allocating identifiers with minimal fragmentation
CN107239297B (zh) 一种插件的多进程管理方法和装置
CN108920211A (zh) Launcher应用程序的启动方法及装置、电子设备、存储介质
EP3149625A1 (en) Data uniqueness control and information storage
WO2016095644A1 (zh) 数据库的高可用解决方法和装置
CN105975329A (zh) 一种虚拟机的创建方法和装置
CN108124021B (zh) 网际协议ip地址获取、网站访问的方法、装置及系统
WO2018068655A1 (zh) 一种许可管理方法和系统
CN106598706B (zh) 一种提高服务器的稳定性的方法、装置及服务器
JP2010272072A (ja) メモリ管理装置
US10528625B2 (en) Client cloud synchronizer

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: 16813635

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: 16813635

Country of ref document: EP

Kind code of ref document: A1