[go: up one dir, main page]

CN103716416B - IP configuration method and apparatus under cloud computing platform - Google Patents

IP configuration method and apparatus under cloud computing platform Download PDF

Info

Publication number
CN103716416B
CN103716416B CN201210379708.3A CN201210379708A CN103716416B CN 103716416 B CN103716416 B CN 103716416B CN 201210379708 A CN201210379708 A CN 201210379708A CN 103716416 B CN103716416 B CN 103716416B
Authority
CN
China
Prior art keywords
address
user
pool
database
specifically
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201210379708.3A
Other languages
Chinese (zh)
Other versions
CN103716416A (en
Inventor
刘宇航
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Sohu Internet Information Service Co Ltd
Original Assignee
Beijing Sohu Internet Information Service Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Sohu Internet Information Service Co Ltd filed Critical Beijing Sohu Internet Information Service Co Ltd
Priority to CN201210379708.3A priority Critical patent/CN103716416B/en
Publication of CN103716416A publication Critical patent/CN103716416A/en
Application granted granted Critical
Publication of CN103716416B publication Critical patent/CN103716416B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention discloses an IP configuration method and apparatus under a cloud computing platform. The method comprises the following steps: receiving an IP processing request massage of a user; according to the IP processing request massage of the user, obtaining a distribution mode and a processing instruction; according to the distribution mode, executing the processing instruction; and updating the states of the IP addresses in an IP pool in an IP resource database and updating the states of static IP addresses, such that different distribution strategies are employed for different demands on a cloud platform, and the IP addresses distributed through the different distribution strategies are configured in a unified mode, thus correctness and uniqueness of IP distribution are guaranteed.

Description

一种云计算平台下的IP配置方法及装置IP configuration method and device under a cloud computing platform

技术领域technical field

本发明涉及云计算领域,特别涉及一种云计算平台下的IP配置方法及装置。The invention relates to the field of cloud computing, in particular to an IP configuration method and device under a cloud computing platform.

背景技术Background technique

在云计算平台中,IP资源作为云计算平台资源的一部分向用户进行提供,其对IP的配置是基于IP池分配方式基础之上的,IP池是一组IP集合,以IP范围来规定IP池的大小和开始结束位置,所述IP池分配方式是指从IP资源数据库中管理员已定义的IP范围中自动选择IP地址进行分配的分配方式,适用于云计算平台根据IP地址范围自动给虚拟机分配IP地址。In the cloud computing platform, IP resources are provided to users as part of the resources of the cloud computing platform. The configuration of IP is based on the IP pool allocation method. The size of the pool and the start and end positions. The IP pool distribution method refers to the distribution method that automatically selects the IP address from the IP range defined by the administrator in the IP resource database. It is suitable for cloud computing platforms to automatically assign The virtual machine is assigned an IP address.

但是,目前云计算平台仅提供基于IP池动态分配的IP配置方法不能满足实际需要,在实际应用中,传统数据中心的静态IP分配,DHCP动态分配等分配方式也常常需要在云计算平台上使用,但是由于云计算平台在IP配置方面发展还不够成熟,在多种分配方式共存于云计算平台时,不能够保证IP配置的正确性和唯一性的。However, the current cloud computing platform only provides the IP configuration method based on the dynamic allocation of IP pools, which cannot meet the actual needs. In practical applications, traditional data center static IP allocation, DHCP dynamic allocation and other allocation methods often need to be used on the cloud computing platform. , but because the cloud computing platform is not mature enough in terms of IP configuration, when multiple distribution methods coexist on the cloud computing platform, the correctness and uniqueness of IP configuration cannot be guaranteed.

发明内容Contents of the invention

有鉴于此,本发明的主要目的在于提供一种云计算平台下的IP配置方法及装置以实现对不同分配策略的IP地址进行统一有效配置,保证IP配置的正确性和唯一性的目的。In view of this, the main purpose of the present invention is to provide an IP configuration method and device under a cloud computing platform to realize unified and effective configuration of IP addresses with different allocation strategies and ensure the correctness and uniqueness of IP configuration.

本发明提供了一种云计算平台下的IP配置方法,该方法包括:The invention provides an IP configuration method under a cloud computing platform, the method comprising:

接收用户IP处理请求消息;Receive user IP processing request message;

根据所述用户IP处理请求消息,获得分配方式和处理指令,所述分配方式包括IP池分配方式或者静态IP分配方式;According to the user IP processing request message, an allocation mode and a processing instruction are obtained, and the allocation mode includes an IP pool allocation mode or a static IP allocation mode;

根据所述分配方式执行处理指令;Execute the processing instruction according to the allocation method;

若所述处理指令过程中状态改变的IP地址在IP池中,更新IP资源数据库中该IP池中该IP地址的状态信息;If the IP address whose status changes during the processing instruction is in the IP pool, update the status information of the IP address in the IP pool in the IP resource database;

若所述处理指令过程中状态改变的IP地址为静态IP地址,更新IP资源数据库中该静态IP地址的状态信息;If the IP address whose status changes during the processing instruction process is a static IP address, update the status information of the static IP address in the IP resource database;

所述IP资源数据库中包括:IP池、IP池与服务器池的对应关系、所述IP池中的每个IP地址的状态信息和用户已定义的静态IP地址的状态信息。The IP resource database includes: an IP pool, the corresponding relationship between the IP pool and the server pool, the state information of each IP address in the IP pool, and the state information of the static IP address defined by the user.

优选地,所述IP资源数据库包括第一数据库、第二数据库和第三数据库;Preferably, the IP resource database includes a first database, a second database and a third database;

其中,所述第一数据库存储IP池的IP地址范围;Wherein, the first database stores the IP address range of the IP pool;

所述第二数据库存储所述IP池与服务器池的对应关系,所述IP池与服务器池的对应关系为多对多的对应关系;The second database stores the correspondence between the IP pool and the server pool, and the correspondence between the IP pool and the server pool is a many-to-many correspondence;

所述第三数据库存储所述IP池中每个IP地址的状态信息和用户已定义的静态IP地址的状态信息。The third database stores status information of each IP address in the IP pool and status information of static IP addresses defined by users.

优选地,当所述分配方式具体为IP池分配方式,所述处理指令具体为分配IP地址指令时,还包括:根据所述用户IP处理请求消息,获取用户指定IP池;Preferably, when the allocation method is specifically an IP pool allocation method, and the processing instruction is specifically an IP address allocation instruction, it further includes: acquiring a user-specified IP pool according to the user IP processing request message;

所述根据所述分配方式执行处理指令具体包括以下步骤:The execution of the processing instruction according to the distribution method specifically includes the following steps:

在所述IP资源数据库的所述用户指定IP池范围内,查询状态为空闲的IP地址;Within the scope of the user-specified IP pool of the IP resource database, query the IP addresses whose status is idle;

若查询到状态为空闲的IP地址,将所述状态为空闲的IP地址中至少一个IP地址分配给所述用户,所述更新IP资源数据库具体为在IP资源数据库中将用户指定IP池中分配给所述用户的IP地址的状态更新为已分配。If the IP address whose status is idle is found, at least one IP address in the idle IP address is assigned to the user, and the updating of the IP resource database is specifically assigning the user to the specified IP pool in the IP resource database The status of the IP address for the user is updated to Allocated.

优选地,将IP地址分配给所述用户后,还包括:创建虚拟机,将分配给所述用户的IP地址写入该虚拟机配置文件。Preferably, after allocating the IP address to the user, the method further includes: creating a virtual machine, and writing the IP address allocated to the user into the virtual machine configuration file.

优选地,当所述用户IP的分配方式具体为IP池分配方式,所述处理指令具体为回收IP地址指令时,还包括:根据所述用户IP处理请求消息,获取用户源IP地址;Preferably, when the allocation method of the user IP is specifically an IP pool allocation method, and the processing instruction is specifically an instruction to reclaim an IP address, it further includes: processing the request message according to the user IP to obtain the user source IP address;

所述根据所述分配方式执行处理指令具体为确定所述用户源IP地址的状态改为空闲,所述更新IP资源数据库具体为在所述IP资源数据库中,将所述用户源IP地址的状态更新为空闲。The execution of the processing instruction according to the allocation method is specifically determining that the state of the user source IP address is changed to idle, and the updating of the IP resource database is specifically changing the state of the user source IP address in the IP resource database Update to idle.

优选地,在断开与所述用户的连接后,还包括:发出销毁由所述用户标识的虚拟机的处理指令。Preferably, after the connection with the user is disconnected, the method further includes: issuing a processing instruction for destroying the virtual machine identified by the user.

本发明还提供了一种云计算平台下的IP配置装置,该装置包括:The present invention also provides an IP configuration device under a cloud computing platform, the device comprising:

获取单元:用于接收用户IP处理请求消息,根据所述用户IP处理请求消息,获得分配方式和处理指令;An acquisition unit: used to receive a user IP processing request message, and obtain a distribution method and a processing instruction according to the user IP processing request message;

处理单元:用于根据所述分配方式执行处理指令,若所述处理指令过程中状态改变的IP地址在IP池中,更新IP资源数据库中该IP池中该IP地址的状态信息;若所述处理指令过程中状态改变的IP地址为静态IP地址,更新IP资源数据库中该静态IP地址的状态信息;所述IP资源数据库中包括:IP池、IP池与服务器池的对应关系、所述IP池中的每个IP地址的状态信息和用户已定义的静态IP地址的状态信息。Processing unit: used to execute processing instructions according to the allocation method, if the IP address whose state changes during the processing instruction process is in the IP pool, update the status information of the IP address in the IP pool in the IP resource database; if the The IP address whose status changes in the process of processing instructions is a static IP address, and the status information of the static IP address in the IP resource database is updated; the IP resource database includes: IP pool, the corresponding relationship between the IP pool and the server pool, the IP Status information for each IP address in the pool and status information for user-defined static IP addresses.

可见本发明具有如下有益效果:It can be seen that the present invention has the following beneficial effects:

由于本发明通过接收用户IP处理请求消息,根据用户IP处理请求消息获得用户IP的分配方式和处理指令,实现了在云平台上针对不同的需求采用不同的分配策略,通过更新IP资源数据库中IP池中IP地址的状态和更新静态IP地址的状态将不同分配策略所分配的IP地址进行统一配置,保证了IP分配的正确性和唯一性;其次,通过本发明,还可以在分配IP的同时将IP分配地址自动写入虚拟机配置,在回收IP的同时销毁虚拟机,在虚拟机的整个生命周期中对IP进行维护。Since the present invention obtains the distribution mode and processing instruction of the user IP according to the user IP processing request message by receiving the user IP processing request message, it realizes the adoption of different distribution strategies for different needs on the cloud platform, and updates the IP address in the IP resource database. The state of the IP address in the pool and the state of updating the static IP address will uniformly configure the IP addresses assigned by different distribution strategies, ensuring the correctness and uniqueness of IP distribution; secondly, through the present invention, it is also possible to distribute IP while Automatically write the IP allocation address into the virtual machine configuration, destroy the virtual machine while reclaiming the IP, and maintain the IP during the entire life cycle of the virtual machine.

附图说明Description of drawings

图1是本发明提供的一种云计算平台下的IP配置方法流程图;Fig. 1 is a flow chart of an IP configuration method under a cloud computing platform provided by the present invention;

图2是本发明提供的一种云计算平台下的IP配置装置组成图。Fig. 2 is a composition diagram of an IP configuration device under a cloud computing platform provided by the present invention.

具体实施方式detailed description

为使本发明的上述目的、特征和优点能够更加明显易懂,下面结合附图和具体实施方式对本发明实施例作进一步详细的说明。In order to make the above objects, features and advantages of the present invention more comprehensible, the embodiments of the present invention will be further described in detail below in conjunction with the accompanying drawings and specific implementation methods.

需要说明的是,本文所述一种云计算平台下的IP配置方法,其所述配置方法指的是IP地址分配、IP地址更改、IP地址回收等任何与IP相关的处理方法。It should be noted that, the IP configuration method under the cloud computing platform described herein refers to any IP-related processing methods such as IP address allocation, IP address change, and IP address recovery.

参见图1,为本发明提供的一种云计算平台下的IP配置方法流程图,该方法包括:Referring to Fig. 1, it is a flow chart of an IP configuration method under a cloud computing platform provided by the present invention, the method comprising:

S101、接收用户IP处理请求消息;S101. Receive a user IP processing request message;

S102、根据所述用户IP处理请求消息,获得分配方式和处理指令,所述分配方式包括IP池分配方式或者静态IP分配方式;S102. Obtain an allocation mode and a processing instruction according to the user IP processing request message, where the allocation mode includes an IP pool allocation mode or a static IP allocation mode;

其中,所述根据用户IP处理请求消息获得分配方式和处理指令,具体可以有以下几种方式实现:Wherein, the described processing request message according to the user IP obtains the distribution mode and the processing instruction, which can be realized in the following ways:

(1)用户IP处理请求消息携带IP配置表单,通过IP配置表单获得用户IP的分配方式和处理指令,在该IP配置表单上提供分配方式以供用户选择;(1) The user IP processing request message carries an IP configuration form, obtains the distribution method and processing instructions of the user IP through the IP configuration form, and provides the distribution method on the IP configuration form for the user to choose;

(2)用户IP处理请求消息携带具体IP地址和处理指令,通过查询所述IP资源数据库中该IP地址是否存在、该IP地址的状态,获得用户IP的分配方式,如:(2) User IP processing request message carries specific IP address and processing instructions, and obtains the distribution mode of user IP by querying whether the IP address exists in the IP resource database and the state of the IP address, such as:

用户IP处理请求消息携带的具体IP地址在所述IP资源数据库中,且状态为空闲或者已分配,则认为是IP池分配方式;The specific IP address carried in the user IP processing request message is in the IP resource database, and the status is idle or allocated, then it is considered as the IP pool allocation method;

用户IP处理请求消息携带的具体IP地址不在所述IP资源数据库中,或者在所述IP资源数据库中,且状态为静态IP分配,则认为静态IP分配方式。If the specific IP address carried in the user IP processing request message is not in the IP resource database, or is in the IP resource database, and the status is static IP allocation, then the static IP allocation mode is considered.

S103、根据所述分配方式执行处理指令;S103. Execute the processing instruction according to the allocation mode;

S104、若所述处理指令过程中状态改变的IP地址在IP池中,更新IP资源数据库中该IP池中该IP地址的状态信息;S104. If the IP address whose status changes during the processing instruction is in the IP pool, update the status information of the IP address in the IP pool in the IP resource database;

若所述处理指令过程中状态改变的IP地址为静态IP地址,更新IP资源数据库中该静态IP地址的状态信息;If the IP address whose status changes during the processing instruction process is a static IP address, update the status information of the static IP address in the IP resource database;

所述IP资源数据库中包括:IP池、IP池与服务器池的对应关系、所述IP池中的每个IP地址的状态信息和用户已定义的静态IP地址的状态信息。The IP resource database includes: an IP pool, the corresponding relationship between the IP pool and the server pool, the state information of each IP address in the IP pool, and the state information of the static IP address defined by the user.

需要说明的是,在IP资源数据库中,IP池中IP地址的状态信息包括分配、空闲两种状态;而静态IP地址由分配产生,由回收删除,因此在IP资源数据库中,静态IP地址的状态包括静态IP分配状态,不存在空闲状态。It should be noted that in the IP resource database, the status information of the IP addresses in the IP pool includes two states: allocation and idle; while static IP addresses are generated by allocation and deleted by recycling. Therefore, in the IP resource database, the status information of static IP addresses The state includes static IP allocation state, there is no idle state.

下面,对不同分配方式和不同处理指令的情况下,本发明的几个具体实施例进行详细说明:Below, several specific embodiments of the present invention are described in detail in the case of different distribution modes and different processing instructions:

实施例(一):当所述用户IP的分配方式具体为IP池分配方式,所述处理指令具体为分配IP地址指令时,本发明还包括:Embodiment (1): when the distribution method of the user IP is specifically an IP pool distribution method, and the processing instruction is specifically an IP address distribution instruction, the present invention also includes:

根据所述用户IP处理请求消息,获取用户指定IP池;Process the request message according to the user IP, and obtain the user-specified IP pool;

步骤S103所述根据所述分配方式执行处理指令具体包括以下步骤:The execution of the processing instruction according to the distribution method in step S103 specifically includes the following steps:

在所述IP资源数据库中的所述用户指定IP池范围内,查询状态为空闲的IP地址;Within the scope of the user-specified IP pool in the IP resource database, query the IP addresses whose status is idle;

若查询到状态为空闲的IP地址,将所述状态为空闲的IP地址中至少一个空闲的IP地址分配给所述用户;If an idle IP address is found, at least one idle IP address among the idle IP addresses is assigned to the user;

所述步骤S104包括:The step S104 includes:

若所述处理指令过程中状态改变的IP地址在IP池中,更新IP资源数据库中该IP池中该IP地址的状态信息;If the IP address whose status changes during the processing instruction is in the IP pool, update the status information of the IP address in the IP pool in the IP resource database;

若所述处理指令过程中状态改变的IP地址为静态IP地址,更新IP资源数据库中该静态IP地址的状态信息;If the IP address whose status changes during the processing instruction process is a static IP address, update the status information of the static IP address in the IP resource database;

具体到该实施例,所述处理指令过程中状态改变的IP地址在用户指定IP池中,因此,所述步骤S104中所述更新IP资源数据库具体为在IP资源数据库中将用户指定IP池中分配给所述用户的IP地址的状态更新为已分配。Specifically in this embodiment, the IP address whose status changes during the processing instruction process is in the user-designated IP pool, therefore, the updating of the IP resource database in the step S104 is specifically specifying the user-designated IP pool in the IP resource database The status of the IP address assigned to the user is updated to Allocated.

需要说明的是,若在所述IP资源数据库中的所述用户指定IP池范围内,未查询到状态为空闲的IP地址,可以向用户返回请求分配IP失败的消息,还可以在预先设置的备选IP池中为用户自动分配IP,并告知用户从备选IP池中分配IP的消息,因此,在本发明的基础上,可以采取任何一种挽救或者告知IP分配状态的方式,在本发明中不做限制。It should be noted that, if no idle IP address is found within the scope of the user-specified IP pool in the IP resource database, a message that the request for IP allocation fails can be returned to the user, or the IP address can be set in advance. IP is automatically assigned to the user in the candidate IP pool, and the user is notified of the message that the IP is allocated from the candidate IP pool. Therefore, on the basis of the present invention, any method of saving or notifying the IP allocation status can be taken. In this No limitations are set forth in the invention.

还需要说明的是,在该实施例(一)中,在所述IP资源数据库中的所述用户指定IP池范围内查询空闲的IP地址,具体可以利用最近最少使用算法查询合适的空闲IP地址,将其分配给所述用户。It should also be noted that, in this embodiment (1), free IP addresses are queried within the scope of the user-specified IP pool in the IP resource database, specifically, the least recently used algorithm can be used to inquire about suitable free IP addresses , assigning it to said user.

实施例(二):当所述用户IP的分配方式具体为静态IP分配方式,所述处理指令具体为分配IP地址指令时,本发明还包括:根据所述用户IP处理请求消息,获取用户指定的IP地址范围;Embodiment (2): When the distribution method of the user IP is specifically a static IP distribution method, and the processing instruction is specifically an IP address distribution instruction, the present invention further includes: processing the request message according to the user IP, and obtaining the specified IP address of the user. IP address range;

步骤S103所述根据所述分配方式执行处理指令具体包括以下步骤:The execution of the processing instruction according to the distribution method in step S103 specifically includes the following steps:

针对所述用户指定的IP地址范围内的每个IP地址,执行以下操作:For each IP address within the IP address range specified by the user, perform the following operations:

若在所述IP资源数据库中已存在该IP地址,查询该IP地址的状态信息;If the IP address already exists in the IP resource database, query the status information of the IP address;

如果该IP地址的状态为空闲,将该IP地址分配给所述用户,需要说明的是,由于该IP地址已经存在于所述IP资源数据库中,且状态为空闲,因此该IP地址为IP池中的IP地址,步骤S104所述更新IP资源数据库具体为将该IP地址的状态更新为已分配;If the status of the IP address is idle, assign the IP address to the user. It should be noted that since the IP address already exists in the IP resource database and the status is idle, the IP address is an IP pool In the IP address, the update of the IP resource database described in step S104 is specifically to update the status of the IP address to assigned;

需要说明的是,若所述IP资源数据库中已存在该IP地址,且该IP地址的状态为已分配或者静态IP分配,则对该IP地址分配的请求处理失败,可以向用户返回该IP地址分配请求失败的消息,还可以从预先设置的备选IP池中为用户自动分配IP,并告知用户从备选IP池中分配IP的消息,因此,在本发明的基础上,可以采取任何一种挽救或者告知IP分配状态的方式,在本发明中不做限制。It should be noted that if the IP address already exists in the IP resource database, and the status of the IP address is allocated or static IP allocation, then the request for allocation of the IP address fails to be processed, and the IP address can be returned to the user The message of distribution request failure can also automatically assign IP for the user from the preset candidate IP pool, and inform the user of the message of distributing IP from the candidate IP pool. Therefore, on the basis of the present invention, any method can be adopted. A way of rescuing or notifying the IP allocation status is not limited in the present invention.

若在所述IP资源数据库中不存在该IP地址,将该IP地址分配给所述用户,步骤S104所述更新IP资源数据库具体为在所述IP资源数据库中,增加该IP地址,将该IP地址的状态更新为静态IP分配。If the IP address does not exist in the IP resource database, the IP address is assigned to the user, and the update of the IP resource database in step S104 is specifically to add the IP address in the IP resource database, and the IP The status of the address is updated to Static IP Assignment.

需要说明的是,在云计算平台下,为了能够实现虚拟机IP的维护与虚拟机的生命周期相结合,在以上实施例(一)和(二)的基础上,本发明提出,将IP地址分配给所述用户后,还包括:创建虚拟机,将分配给所述用户的IP地址写入该虚拟机配置文件。It should be noted that, under the cloud computing platform, in order to realize the combination of the maintenance of the virtual machine IP and the life cycle of the virtual machine, on the basis of the above embodiments (1) and (2), the present invention proposes that the IP address After being allocated to the user, it also includes: creating a virtual machine, and writing the IP address allocated to the user into the configuration file of the virtual machine.

实施例(三):当所述用户IP的分配方式具体为DHCP分配方式,所述处理指令具体为分配IP地址指令时,步骤S103所述根据所述分配方式执行处理指令具体为将所述分配IP地址指令发送至外部DHCH服务器。Embodiment (3): When the distribution method of the user IP is specifically a DHCP distribution method, and the processing instruction is specifically an IP address distribution instruction, the execution of the processing instruction according to the distribution method in step S103 is specifically the allocation of the IP address. The IP address command is sent to the external DHCH server.

实施例(四):当所述用户IP的分配方式具体为IP池分配方式,所述处理指令具体为更改IP地址指令时,还包括:根据所述用户IP处理请求消息获取用户源IP地址和目标IP池;Embodiment (four): when the distribution method of the user IP is specifically an IP pool distribution method, and when the processing instruction is specifically an IP address change instruction, it also includes: obtaining the user source IP address and the user source IP address according to the user IP processing request message target IP pool;

步骤S103所述根据所述分配方式执行处理指令具体为将所述用户源IP地址在所述IP资源数据库中的所述目标IP池范围内,查询空闲的IP地址;Executing the processing instruction according to the allocation method in step S103 is specifically querying an idle IP address within the range of the target IP pool in the IP resource database for the source IP address of the user;

若查询到空闲的IP地址,将所述空闲的IP地址中至少一个空闲的IP地址分配给所述用户;If an idle IP address is found, assigning at least one idle IP address among the idle IP addresses to the user;

步骤104所述更新IP资源数据库具体为在所述IP资源数据库中,将所述目标IP池中分配给所述用户的空闲的IP地址的状态更新为已分配,且将所述用户源IP地址的状态更新为空闲。The updating of the IP resource database in step 104 is specifically updating the state of the free IP address allocated to the user in the target IP pool to allocated in the IP resource database, and updating the source IP address of the user to The status of is updated to idle.

实施例五:当所述用户IP的分配方式具体为IP池分配方式,所述处理指令具体为回收IP地址指令时,还包括:根据所述用户IP处理请求消息,获取用户源IP地址;Embodiment 5: when the distribution method of the user IP is specifically an IP pool distribution method, and the processing instruction is specifically an IP address recycling instruction, it further includes: processing the request message according to the user IP to obtain the user source IP address;

步骤S103所述根据所述分配方式执行处理指令具体为确定所述用户源IP地址的状态改为空闲,步骤104所述更新IP资源数据库具体为在所述IP资源数据库中,将所述用户源IP地址的状态更新为空闲。Executing the processing instruction according to the allocation method in step S103 is specifically determining that the status of the source IP address of the user is changed to idle, and updating the IP resource database in step S104 is specifically updating the source IP address of the user in the IP resource database. The status of the IP address is updated to free.

实施例六:当所述用户IP的分配方式具体为静态IP分配,所述处理指令具体为回收IP地址指令时,还包括:根据所述用户IP处理请求消息,获取用户源IP地址;Embodiment 6: when the allocation method of the user IP is specifically static IP allocation, and the processing instruction is specifically an instruction to reclaim the IP address, it also includes: processing the request message according to the user IP to obtain the user source IP address;

步骤S103所述根据所述分配方式执行处理指令具体为确定所述用户源IP地址的状态改为空闲,所述更新IP资源数据库具体为在所述IP资源数据库中,删除所述用户源IP地址及状态。In step S103, executing the processing instruction according to the allocation method is specifically to determine that the state of the user source IP address is changed to idle, and the updating of the IP resource database is specifically to delete the user source IP address in the IP resource database and status.

需要说明的是,为了能够实现虚拟机IP的维护与虚拟机的生命周期相结合,在以上实施例(五)和(六)的基础上,本发明提出,在断开与所述用户的连接后,还包括:发出销毁由所述用标识的虚拟机的处理指令。It should be noted that, in order to realize the combination of the maintenance of the virtual machine IP and the life cycle of the virtual machine, on the basis of the above embodiments (5) and (6), the present invention proposes that after disconnecting the user Afterwards, it further includes: issuing a processing instruction for destroying the virtual machine identified by the user.

下面,对所述IP资源数据库进行详细介绍,在本发明的一个实施例中,所述IP资源数据库包括第一数据库、第二数据库和第三数据库,具体可以利用mysql数据库建立,分别存储以下信息:Next, the IP resource database is introduced in detail. In one embodiment of the present invention, the IP resource database includes a first database, a second database, and a third database, which can be specifically established using a mysql database, and store the following information respectively :

(1)所述第一数据库存储IP池的IP地址范围;(1) The first database stores the IP address range of the IP pool;

所述第一数据库中存储IP池的IP地址范围主要是为了确定自动分配IP时所分配的IP范围,表示方式如192.168.0.0/24或192.168.1.2-200等;The IP address range stored in the IP pool in the first database is mainly to determine the IP range assigned when the IP is automatically assigned, and the representation is such as 192.168.0.0/24 or 192.168.1.2-200, etc.;

(2)所述第二数据库存储所述IP池与服务器池的对应关系,所述IP池与服务器池的对应关系为多对多的对应关系;(2) The second database stores the correspondence between the IP pool and the server pool, and the correspondence between the IP pool and the server pool is a many-to-many correspondence;

由于数据中心由多个服务器池组成,所以所述第二个数据库存储第一数据库中的IP池与服务器池的所属对应关系,用来判别服务器池能够使用哪些IP范围,其对应关系为多对多关系;Since the data center is composed of multiple server pools, the second database stores the corresponding relationship between the IP pools in the first database and the server pools to determine which IP ranges the server pools can use, and the corresponding relationship is multiple pairs Multiple relationships;

(3)所述第三数据库存储所述IP池中每个IP地址的状态信息和用户已定义的静态IP地址的状态信息;(3) The third database stores the state information of each IP address in the IP pool and the state information of the static IP address defined by the user;

所述IP地址的状态信息用来确定IP被分配的详细状况,如确定分配状态是已分配、空闲还是静态IP分配,还可以用来确定分配给哪台虚拟机等各种状态信息,在本发明中不做限制。The status information of the IP address is used to determine the detailed status of IP allocation, such as determining whether the allocation status is allocated, idle or static IP allocation, and can also be used to determine various status information such as which virtual machine is allocated to. No limitations are set forth in the invention.

需要说明的是,本发明对所述IP资源数据库的维护除了以上实施例(一)到(六)提到的由用户IP处理请求消息触发的对IP资源数据库的更新以外,还包括管理员对IP资源数据库的主动管理,具体可以通过提供网页界面,也可以通过命令行的方式由管理员进行主动管理,所述管理员对IP资源数据库的主动管理主要包括:IP池创建、IP池修改和IP池删除:It should be noted that, in addition to the updating of the IP resource database triggered by the user IP processing request message mentioned in the above embodiments (1) to (6), the maintenance of the IP resource database in the present invention also includes the administrator's maintenance of the IP resource database. The active management of the IP resource database can specifically be managed by an administrator by providing a web interface, or by the administrator through a command line. The active management of the IP resource database by the administrator mainly includes: IP pool creation, IP pool modification and IP pool deletion:

所述IP池创建具体包括以下步骤:The creation of the IP pool specifically includes the following steps:

获取管理员定义的新增IP地址范围;Obtain the newly added IP address range defined by the administrator;

判断所述管理员定义的新增IP地址范围是否与所述第一数据库中管理员已定义的IP地址范围有重叠部分;judging whether the newly added IP address range defined by the administrator overlaps with the IP address range defined by the administrator in the first database;

如果有重叠部分,创建IP池失败;If there are overlapping parts, the IP pool creation fails;

如果没有重叠部分,则:If there is no overlap then:

在所述第一数据库中加入管理员定义的新增IP地址范围;adding a new IP address range defined by the administrator to the first database;

在所述第二数据库中生成所述管理员定义的新增IP地址范围与服务器池的对应关系;generating a correspondence between the newly added IP address range defined by the administrator and the server pool in the second database;

判断在所述管理员定义的新增IP地址范围内是否有IP地址已经在第三数据库中;judging whether there is an IP address within the newly added IP address range defined by the administrator in the third database;

如果是,将第一类IP地址在所述第三数据库中的状态由静态IP分配更新为已分配,将第二类IP地址增加到所述第三数据库中,初始化第二类IP地址的状态为空闲,其中所述第一类IP地址为在所述管理员定义的新增IP地址范围内,且在第三数据库中的IP地址,所述第二类IP地址为在所述管理员定义的新增IP地址范围内,且不在第三数据库中的IP地址;If so, update the state of the first type of IP address in the third database from static IP allocation to assigned, add the second type of IP address to the third database, and initialize the state of the second type of IP address is free, wherein the first type of IP address is within the newly added IP address range defined by the administrator and is an IP address in the third database, and the second type of IP address is an IP address defined by the administrator IP addresses within the newly added IP address range of , and not in the third database;

如果否,将所述管理员定义的新增IP地址范围内的每个IP地址均增加到所述第三数据库中,状态初始化为空闲。If not, adding each IP address within the newly added IP address range defined by the administrator to the third database, and initializing the state as idle.

所述IP池修改具体包括以下步骤:The modification of the IP pool specifically includes the following steps:

获取管理员定义的修改IP地址范围及目标服务器池;Obtain the modified IP address range and target server pool defined by the administrator;

查询所述第三数据库中,所述管理员定义的修改IP地址范围内是否有已分配的IP地址;Querying the third database, whether there is an assigned IP address within the modified IP address range defined by the administrator;

如果有,修改IP池失败;If yes, modifying the IP pool fails;

如果没有,在所述第二数据库中删除所述管理员定义的修改IP地址范围与服务器池的对应关系,在所述第二数据库中生成所述管理员定义的修改IP地址范围与所述目标服务器池的对应关系。If not, delete the corresponding relationship between the modified IP address range defined by the administrator and the server pool in the second database, and generate the modified IP address range defined by the administrator and the target in the second database. Correspondence between server pools.

所述IP池删除具体包括以下步骤:The deletion of the IP pool specifically includes the following steps:

获取管理员定义的删除IP地址范围;Obtain the deleted IP address range defined by the administrator;

如果不是强行删除,执行以下验证步骤和删除步骤;If it is not forcibly deleted, perform the following verification steps and deletion steps;

如果是强行删除,执行以下删除步骤;If it is forcibly deleted, perform the following deletion steps;

所述验证步骤包括:The verification steps include:

判断在所述管理员定义的删除IP地址范围内是否有IP地址在第三数据库中的状态为已分配;Judging whether there is an IP address within the scope of the deleted IP address defined by the administrator, whose status in the third database is assigned;

如果有,将第三类IP地址在所述第三数据库中的状态更新为静态IP分配,将所述第三类IP地址在所述管理员定义的删除IP地址范围内排除,其中,所述第三类IP地址为在所述管理员定义的删除IP地址范围内,且在所述第三数据库中的状态为已分配;If so, update the status of the third type of IP address in the third database to static IP allocation, and exclude the third type of IP address from the deleted IP address range defined by the administrator, wherein the The third type of IP address is within the range of deleted IP addresses defined by the administrator, and the status in the third database is assigned;

所述删除步骤包括:The deletion steps include:

在所述第一数据库中删除所述管理员定义的删除IP地址范围,在所述第二数据库中删除所述管理员定已的删除IP地址范围与服务器池的对应关系,在所述第三数据库中删除所述管理员定义的删除IP地址范围内所有IP地址及状态。Delete the deleted IP address range defined by the administrator in the first database, delete the corresponding relationship between the deleted IP address range defined by the administrator and the server pool in the second database, and delete in the third database Delete all IP addresses and statuses within the range of deleted IP addresses defined by the administrator in the database.

需要说明的是,在以上IP池创建、IP池修改和IP池删除实施例中,所述IP地址范围的表现形式可以按照需要预先设置,例如192.168.0.0/24、192.168.0.0/255.255.255.0或者192.168.0.2-100,并且在获取管理员定义的IP地址范围之后,还可以包括验证所获取的管理员定义的IP地址范围表现形式是否合法的步骤,如果不合法,则返回错误消息,不执行相应的创建、修改或者删除动作;在所述IP池创建实施例中,在管理员定义的新增IP地址范围加入所述第一数据库之前,还可以包括,判断管理员定义的新增IP地址范围中的IP地址是否包含网关和广播地址,如果不包含,则按照预先设置的网关标准生成默认网关和广播地址。It should be noted that, in the above embodiments of IP pool creation, IP pool modification, and IP pool deletion, the expression form of the IP address range can be preset according to needs, such as 192.168.0.0/24, 192.168.0.0/255.255.255.0 Or 192.168.0.2-100, and after obtaining the IP address range defined by the administrator, it may also include a step of verifying whether the acquired IP address range expression form defined by the administrator is legal, if not legal, return an error message, and not Execute a corresponding creation, modification or deletion action; in the IP pool creation embodiment, before the new IP address range defined by the administrator is added to the first database, it may also include, judging the new IP address defined by the administrator Whether the IP addresses in the address range include the gateway and broadcast address, if not, generate the default gateway and broadcast address according to the preset gateway standard.

本发明还提供一种云计算平台下的IP配置装置,参见图2,该装置包括:The present invention also provides an IP configuration device under a cloud computing platform, referring to Fig. 2, the device includes:

获取单元201:用于接收用户IP处理请求消息,根据所述用户IP处理请求消息,获得分配方式和处理指令;Obtaining unit 201: used to receive a user IP processing request message, and obtain a distribution method and a processing instruction according to the user IP processing request message;

处理单元202:用于根据所述分配方式执行处理指令,若所述处理指令过程中状态改变的IP地址在IP池中,更新IP资源数据库中该IP池中该IP地址的状态信息;若所述处理指令过程中状态改变的IP地址为静态IP地址,更新IP资源数据库中该静态IP地址的状态信息;所述IP资源数据库中包括:IP池、IP池与服务器池的对应关系、所述IP池中的每个IP地址的状态信息和用户已定义的静态IP地址的状态信息。Processing unit 202: used to execute the processing instruction according to the allocation method, if the IP address whose status changes during the processing instruction is in the IP pool, update the status information of the IP address in the IP pool in the IP resource database; The IP address whose status changes in the process of the above-mentioned processing instruction is a static IP address, and the status information of the static IP address in the IP resource database is updated; the IP resource database includes: IP pool, the corresponding relationship between the IP pool and the server pool, the The status information of each IP address in the IP pool and the status information of the static IP addresses defined by the user.

需要说明的是,在本文中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个......”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。It should be noted that in this article, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply that there is a relationship between these entities or operations. There is no such actual relationship or order between them. Furthermore, the term "comprises", "comprises" or any other variation thereof is intended to cover a non-exclusive inclusion such that a process, method, article, or apparatus comprising a set of elements includes not only those elements, but also includes elements not expressly listed. other elements of or also include elements inherent in such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article or apparatus comprising said element.

以上所述仅为本发明的较佳实施例而已,并非用于限定本发明的保护范围。凡在本发明的精神和原则之内所作的任何修改、等同替换、改进等,均包含在本发明的保护范围内。The above descriptions are only preferred embodiments of the present invention, and are not intended to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principles of the present invention are included in the protection scope of the present invention.

Claims (13)

1.一种云计算平台下的IP配置方法,其特征在于,包括:1. an IP configuration method under a cloud computing platform, characterized in that, comprising: 接收用户IP处理请求消息;Receive user IP processing request message; 根据所述用户IP处理请求消息,获得分配方式和处理指令,所述分配方式包括IP池分配方式或者静态IP分配方式;According to the user IP processing request message, an allocation mode and a processing instruction are obtained, and the allocation mode includes an IP pool allocation mode or a static IP allocation mode; 根据所述分配方式执行处理指令;Execute the processing instruction according to the allocation method; 若所述处理指令过程中状态改变的IP地址在IP池中,更新IP资源数据库中该IP池中该IP地址的状态信息;If the IP address whose status changes during the processing instruction is in the IP pool, update the status information of the IP address in the IP pool in the IP resource database; 若所述处理指令过程中状态改变的IP地址为静态IP地址,更新IP资源数据库中该静态IP地址的状态信息;If the IP address whose status changes during the processing instruction process is a static IP address, update the status information of the static IP address in the IP resource database; 所述IP资源数据库中包括:IP池、IP池与服务器池的对应关系、所述IP池中的每个IP地址的状态信息和用户已定义的静态IP地址的状态信息;The IP resource database includes: an IP pool, the corresponding relationship between the IP pool and the server pool, the state information of each IP address in the IP pool, and the state information of the static IP address defined by the user; 当所述分配方式具体为静态IP分配方式,所述处理指令具体为分配IP地址指令时,所述方法还包括:根据所述用户IP处理请求消息,获取用户指定的IP地址范围;When the distribution method is specifically a static IP distribution method, and the processing instruction is specifically an IP address distribution instruction, the method further includes: according to the user IP processing request message, obtaining the IP address range specified by the user; 所述根据所述分配方式执行处理指令具体包括以下步骤:The execution of the processing instruction according to the distribution method specifically includes the following steps: 针对所述用户指定的IP地址范围内的每个IP地址,执行以下操作:For each IP address within the IP address range specified by the user, perform the following operations: 若在所述IP资源数据库中已存在该IP地址,查询该IP地址的状态信息;If the IP address already exists in the IP resource database, query the status information of the IP address; 如果该IP地址的状态为空闲,将该IP地址分配给所述用户,所述更新IP资源数据库具体为在IP资源数据库中将该分配给所述用户的IP地址的状态更新为已分配;If the state of the IP address is idle, assigning the IP address to the user, and the updating the IP resource database is specifically updating the state of the IP address assigned to the user in the IP resource database to assigned; 若在所述IP资源数据库中不存在该IP地址,将该IP地址分配给所述用户,所述更新IP资源数据库具体为在所述IP资源数据库中,增加该IP地址,将该IP地址的状态更新为静态IP分配。If the IP address does not exist in the IP resource database, assign the IP address to the user, and the update of the IP resource database specifically includes adding the IP address in the IP resource database, and adding the IP address to the IP address. Status update to Static IP Assignment. 2.根据权利要求1所述的方法,其特征在于,所述分配方式还包括:DHCP分配方式;2. The method according to claim 1, wherein the distribution method further comprises: a DHCP distribution method; 当所述分配方式具体为DHCP分配方式,所述处理指令具体为分配IP地址指令时,所述根据所述分配方式执行处理指令具体为将所述分配IP地址指令发送至外部DHCH服务器。When the allocation mode is specifically a DHCP allocation mode, and the processing instruction is specifically an IP address allocation command, the execution of the processing instruction according to the allocation mode is specifically sending the IP address allocation command to an external DHCH server. 3.根据权利要求1所述的方法,其特征在于,当所述分配方式具体为IP池分配方式,所述处理指令具体为分配IP地址指令时,还包括:根据所述用户IP处理请求消息,获取用户指定IP池;3. The method according to claim 1, wherein when the allocation method is specifically an IP pool allocation method, and the processing instruction is specifically an IP address allocation instruction, further comprising: processing the request message according to the user IP , to obtain the user-specified IP pool; 所述根据所述分配方式执行处理指令具体包括以下步骤:The execution of the processing instruction according to the distribution method specifically includes the following steps: 在所述IP资源数据库的所述用户指定IP池范围内,查询状态为空闲的IP地址;Within the scope of the user-specified IP pool of the IP resource database, query the IP addresses whose status is idle; 若查询到状态为空闲的IP地址,将所述状态为空闲的IP地址中至少一个IP地址分配给所述用户,所述更新IP资源数据库具体为在IP资源数据库中将用户指定IP池中分配给所述用户的IP地址的状态更新为已分配。If the IP address whose status is idle is found, at least one IP address in the idle IP address is assigned to the user, and the updating of the IP resource database is specifically assigning the user to the specified IP pool in the IP resource database The status of the IP address for the user is updated to Allocated. 4.根据权利要求1或3所述的方法,其特征在于,将IP地址分配给所述用户后,还包括:创建虚拟机,将分配给所述用户的IP地址写入该虚拟机配置文件。4. The method according to claim 1 or 3, wherein after assigning the IP address to the user, further comprising: creating a virtual machine, and writing the IP address assigned to the user into the virtual machine configuration file . 5.根据权利要求1所述的方法,其特征在于,5. The method of claim 1, wherein, 当所述用户IP的分配方式具体为IP池分配方式,所述处理指令具体为更改IP地址指令时,还包括:根据所述用户IP处理请求消息,获取用户源IP地址和目标IP池;When the distribution method of the user IP is specifically an IP pool distribution method, and the processing instruction is specifically an instruction to change an IP address, it also includes: processing the request message according to the user IP, and obtaining the user source IP address and the target IP pool; 所述根据所述分配方式执行处理指令具体包括以下步骤:The execution of the processing instruction according to the distribution method specifically includes the following steps: 在所述IP资源数据库中的所述目标IP池范围内,查询空闲的IP地址;Query idle IP addresses within the scope of the target IP pool in the IP resource database; 若查询到空闲的IP地址,将所述空闲的IP地址中至少一个空闲的IP地址分配给所述用户;If an idle IP address is found, assigning at least one idle IP address among the idle IP addresses to the user; 所述更新IP资源数据库具体为在所述IP资源数据库中,将所述目标IP池中分配给所述用户的空闲的IP地址的状态更新为已分配,将所述用户源IP地址的状态更新为空闲。The updating of the IP resource database is specifically updating the state of the idle IP address allocated to the user in the target IP pool to allocated, and updating the state of the user's source IP address in the IP resource database. for free. 6.根据权利要求1所述的方法,其特征在于,6. The method of claim 1, wherein, 当所述用户IP的分配方式具体为IP池分配方式,所述处理指令具体为回收IP地址指令时,还包括:根据所述用户IP处理请求消息,获取用户源IP地址;When the distribution method of the user IP is specifically an IP pool distribution method, and the processing instruction is specifically an IP address recycling instruction, it also includes: processing the request message according to the user IP to obtain the user source IP address; 所述根据所述分配方式执行处理指令具体为确定所述用户源IP地址的状态改为空闲,所述更新IP资源数据库具体为在所述IP资源数据库中,将所述用户源IP地址的状态更新为空闲。The execution of the processing instruction according to the allocation method is specifically determining that the state of the user source IP address is changed to idle, and the updating of the IP resource database is specifically changing the state of the user source IP address in the IP resource database Update to idle. 7.根据权利要求1所述的方法,其特征在于,7. The method of claim 1, wherein, 当所述用户IP的分配方式具体为静态IP分配,所述处理指令具体为回收IP地址指令时,还包括:根据所述用户IP处理请求消息,获取用户源IP地址;When the allocation method of the user IP is specifically static IP allocation, and the processing instruction is specifically an IP address recycling instruction, it also includes: processing the request message according to the user IP to obtain the user source IP address; 所述按照所述根据所述分配方式执行处理指令具体为确定所述用户源IP地址的状态改为空闲,所述更新IP资源数据库具体为在所述IP资源数据库中,删除所述用户源IP地址及状态。The execution of the processing instruction according to the allocation method is specifically to determine that the state of the user source IP address is changed to idle, and the update of the IP resource database is specifically to delete the user source IP address in the IP resource database. address and status. 8.根据权利要求6或7所述的方法,其特征在于,8. The method according to claim 6 or 7, characterized in that, 在确定所述用户源IP地址的状态改为空闲后,还包括:发出销毁由所述用户标识的虚拟机的处理指令。After determining that the state of the source IP address of the user is changed to idle, the method further includes: issuing a processing instruction for destroying the virtual machine identified by the user. 9.根据权利要求1-3、5-7中任意一项所述的方法,其特征在于,所述IP资源数据库包括第一数据库、第二数据库和第三数据库;9. The method according to any one of claims 1-3, 5-7, wherein the IP resource database comprises a first database, a second database and a third database; 其中,所述第一数据库存储IP池;Wherein, the first database stores an IP pool; 所述第二数据库存储所述IP池与服务器池的对应关系,所述IP池与服务器池的对应关系为多对多的对应关系;The second database stores the correspondence between the IP pool and the server pool, and the correspondence between the IP pool and the server pool is a many-to-many correspondence; 所述第三数据库存储所述IP池中每个IP地址的状态信息和用户已定义的静态IP地址的状态信息。The third database stores status information of each IP address in the IP pool and status information of static IP addresses defined by users. 10.根据权利要求9所述的方法,其特征在于,还包括:10. The method of claim 9, further comprising: 获取管理员定义的新增IP地址范围;Obtain the newly added IP address range defined by the administrator; 判断所述管理员定义的新增IP地址范围是否与所述第一数据库中管理员已定义的IP地址范围有重叠部分;judging whether the newly added IP address range defined by the administrator overlaps with the IP address range defined by the administrator in the first database; 如果有重叠部分,创建IP池失败;If there are overlapping parts, the IP pool creation fails; 如果没有重叠部分,则:If there is no overlap then: 在所述第一数据库中加入管理员定义的新增IP地址范围;adding a new IP address range defined by the administrator to the first database; 在所述第二数据库中生成所述管理员定义的新增IP地址范围与服务器池的对应关系;generating a correspondence between the newly added IP address range defined by the administrator and the server pool in the second database; 判断在所述管理员定义的新增IP地址范围内是否有IP地址已经在第三数据库中;judging whether there is an IP address within the newly added IP address range defined by the administrator in the third database; 如果是,将第一类IP地址在所述第三数据库中的状态更新为已分配,将第二类IP地址增加到所述第三数据库中,初始化第二类IP地址的状态为空闲,其中所述第一类IP地址为在所述管理员定义的新增IP地址范围内,且在第三数据库中的IP地址,所述第二类IP地址为在所述管理员定义的新增IP地址范围内,且不在第三数据库中的IP地址;If so, update the state of the first type of IP address in the third database to allocated, add the second type of IP address to the third database, and initialize the state of the second type of IP address to be idle, wherein The first type of IP address is within the range of newly added IP addresses defined by the administrator and is in the third database, and the second type of IP address is the newly added IP address defined by the administrator. IP addresses within the address range and not in the third database; 如果否,将所述管理员定义的新增IP地址范围内的每个IP地址均增加到所述第三数据库中,状态初始化为空闲。If not, adding each IP address within the newly added IP address range defined by the administrator to the third database, and initializing the state as idle. 11.根据权利要求9所述的方法,其特征在于,还包括:11. The method of claim 9, further comprising: 获取管理员定义的修改IP地址范围及目标服务器池;Obtain the modified IP address range and target server pool defined by the administrator; 查询所述第三数据库中,所述管理员定义的修改IP地址范围内是否有已分配的IP地址;Querying the third database, whether there is an assigned IP address within the modified IP address range defined by the administrator; 如果有,修改IP池失败;If yes, modifying the IP pool fails; 如果没有,在所述第二数据库中删除所述管理员定义的修改IP地址范围与服务器池的对应关系,在所述第二数据库中生成所述管理员定义的修改IP地址范围与所述目标服务器池的对应关系。If not, delete the corresponding relationship between the modified IP address range defined by the administrator and the server pool in the second database, and generate the modified IP address range defined by the administrator and the target in the second database. Correspondence between server pools. 12.根据权利要求9所述的方法,其特征在于,还包括:12. The method of claim 9, further comprising: 获取管理员定义的删除IP地址范围;Obtain the deleted IP address range defined by the administrator; 如果不是强行删除,执行以下验证步骤和删除步骤;If it is not forcibly deleted, perform the following verification steps and deletion steps; 如果是强行删除,执行以下删除步骤;If it is forcibly deleted, perform the following deletion steps; 所述验证步骤包括:The verification steps include: 判断在所述管理员定义的删除IP地址范围内是否有IP地址在第三数据库中的状态为已分配;Judging whether there is an IP address within the scope of the deleted IP address defined by the administrator, whose status in the third database is allocated; 如果有,将第三类IP地址在所述第三数据库中的状态更新为静态IP分配,将所述第三类IP地址在所述管理员定义的删除IP地址范围内排除,其中,所述第三类IP地址为在所述管理员定义的删除IP地址范围内,且在所述第三数据库中的状态为已分配;If so, update the status of the third type of IP address in the third database to static IP allocation, and exclude the third type of IP address from the deleted IP address range defined by the administrator, wherein the The third type of IP address is within the range of deleted IP addresses defined by the administrator, and the status in the third database is assigned; 所述删除步骤包括:The deletion steps include: 在所述第一数据库中删除所述管理员定义的删除IP地址范围,在所述第二数据库中删除所述管理员定已的删除IP地址范围与服务器池的对应关系,在所述第三数据库中删除所述管理员定义的删除IP地址范围内所有IP地址及状态。Delete the deleted IP address range defined by the administrator in the first database, delete the corresponding relationship between the deleted IP address range defined by the administrator and the server pool in the second database, and delete in the third database Delete all IP addresses and statuses within the range of deleted IP addresses defined by the administrator in the database. 13.一种云计算平台下的IP配置装置,其特征在于,包括:13. An IP configuration device under a cloud computing platform, characterized in that, comprising: 获取单元:用于接收用户IP处理请求消息,根据所述用户IP处理请求消息,获得分配方式和处理指令,所述分配方式包括IP池分配方式或者静态IP分配方式;An acquisition unit: used to receive a user IP processing request message, and obtain an allocation method and a processing instruction according to the user IP processing request message, and the allocation method includes an IP pool allocation method or a static IP allocation method; 处理单元:用于根据所述分配方式执行处理指令,若所述处理指令过程中状态改变的IP地址在IP池中,更新IP资源数据库中该IP池中该IP地址的状态信息;若所述处理指令过程中状态改变的IP地址为静态IP地址,更新IP资源数据库中该静态IP地址的状态信息;所述IP资源数据库中包括:IP池、IP池与服务器池的对应关系、所述IP池中的每个IP地址的状态信息和用户已定义的静态IP地址的状态信息;Processing unit: used to execute processing instructions according to the allocation method, if the IP address whose state changes during the processing instruction process is in the IP pool, update the status information of the IP address in the IP pool in the IP resource database; if the The IP address whose status changes in the process of processing instructions is a static IP address, and the status information of the static IP address in the IP resource database is updated; the IP resource database includes: IP pool, the corresponding relationship between the IP pool and the server pool, the IP The status information of each IP address in the pool and the status information of the static IP address defined by the user; 当所述分配方式具体为静态IP分配方式,所述处理指令具体为分配IP地址指令时,根据所述用户IP处理请求消息,获取用户指定的IP地址范围;When the allocation method is specifically a static IP allocation method, and the processing instruction is specifically an IP address allocation instruction, according to the user IP processing request message, obtain the IP address range specified by the user; 所述根据所述分配方式执行处理指令具体包括以下步骤:The execution of the processing instruction according to the distribution method specifically includes the following steps: 针对所述用户指定的IP地址范围内的每个IP地址,执行以下操作:For each IP address within the IP address range specified by the user, perform the following operations: 若在所述IP资源数据库中已存在该IP地址,查询该IP地址的状态信息;If the IP address already exists in the IP resource database, query the status information of the IP address; 如果该IP地址的状态为空闲,将该IP地址分配给所述用户,所述更新IP资源数据库具体为在IP资源数据库中将该分配给所述用户的IP地址的状态更新为已分配;If the state of the IP address is idle, assigning the IP address to the user, and the updating the IP resource database is specifically updating the state of the IP address assigned to the user in the IP resource database to assigned; 若在所述IP资源数据库中不存在该IP地址,将该IP地址分配给所述用户,所述更新IP资源数据库具体为在所述IP资源数据库中,增加该IP地址,将该IP地址的状态更新为静态IP分配。If the IP address does not exist in the IP resource database, assign the IP address to the user, and the update of the IP resource database specifically includes adding the IP address in the IP resource database, and adding the IP address to the IP address. Status update to Static IP Assignment.
CN201210379708.3A 2012-09-29 2012-09-29 IP configuration method and apparatus under cloud computing platform Active CN103716416B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201210379708.3A CN103716416B (en) 2012-09-29 2012-09-29 IP configuration method and apparatus under cloud computing platform

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201210379708.3A CN103716416B (en) 2012-09-29 2012-09-29 IP configuration method and apparatus under cloud computing platform

Publications (2)

Publication Number Publication Date
CN103716416A CN103716416A (en) 2014-04-09
CN103716416B true CN103716416B (en) 2017-02-22

Family

ID=50408985

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201210379708.3A Active CN103716416B (en) 2012-09-29 2012-09-29 IP configuration method and apparatus under cloud computing platform

Country Status (1)

Country Link
CN (1) CN103716416B (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104111862A (en) * 2014-07-17 2014-10-22 湖南昇云科技有限公司 Method and system for obtaining IP (Internet Protocol) address of virtual machine in cloud computing platform
CN104378455B (en) * 2014-11-13 2018-02-09 新华三技术有限公司 IP address distribution method and device
CN105915660A (en) * 2015-10-22 2016-08-31 乐视致新电子科技(天津)有限公司 Method for detecting successful setting of static IP and device thereof
CN105872130A (en) * 2016-06-14 2016-08-17 浪潮电子信息产业股份有限公司 Method for distributing IP (Internet Protocol) addresses and cloud management platform
CN106790735A (en) * 2016-11-15 2017-05-31 国云科技股份有限公司 Virtual machine static network setting method using serial port and DHCP protocol communication
CN107277189A (en) * 2017-06-20 2017-10-20 郑州埃文计算机科技有限公司 A kind of sorting technique for full IP application scenarios
CN107613044B (en) * 2017-10-26 2021-10-01 郑州云海信息技术有限公司 Method and device for updating virtual machine IP address in SDN network
CN110113445B (en) * 2019-05-10 2022-02-15 广东电网有限责任公司 IP resource on-line management method, device and equipment for enterprise network

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101662511A (en) * 2009-10-10 2010-03-03 中国电信股份有限公司 Network address distributing method, DHCP server, access system and method thereof
CN102315968A (en) * 2011-09-19 2012-01-11 华中科技大学 Network configuration method in virtual machine environment
CN102316447A (en) * 2011-09-14 2012-01-11 福建星网锐捷网络有限公司 Internet protocol (IP) address allocation and sending method, wireless access device, server and system
WO2012079461A1 (en) * 2010-12-13 2012-06-21 联想(北京)有限公司 Method, device and system for allocating ip address

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8185107B2 (en) * 2007-03-29 2012-05-22 Marvell International Ltd. IP address allocation in evolved wireless networks

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101662511A (en) * 2009-10-10 2010-03-03 中国电信股份有限公司 Network address distributing method, DHCP server, access system and method thereof
WO2012079461A1 (en) * 2010-12-13 2012-06-21 联想(北京)有限公司 Method, device and system for allocating ip address
CN102316447A (en) * 2011-09-14 2012-01-11 福建星网锐捷网络有限公司 Internet protocol (IP) address allocation and sending method, wireless access device, server and system
CN102315968A (en) * 2011-09-19 2012-01-11 华中科技大学 Network configuration method in virtual machine environment

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
"IP地址管理系统设计和实现";曹忠;《电脑学习》;20031230(第6期);全文 *

Also Published As

Publication number Publication date
CN103716416A (en) 2014-04-09

Similar Documents

Publication Publication Date Title
CN103716416B (en) IP configuration method and apparatus under cloud computing platform
US10715485B2 (en) Managing dynamic IP address assignments
JP2019509529A5 (en)
CN108287660A (en) Date storage method and equipment
US11249788B2 (en) Cloud management platform, and virtual machine management method and system
CN109981493B (en) Method and device for configuring virtual machine network
EP2696555B1 (en) Method and system for identifying storage device
JP2005332220A5 (en)
CN107105061A (en) A kind of service registry method and device
JP2004046661A (en) Method and apparatus for unifying temporary storage of multiple network storages
CN108028827B (en) Certificate management method and device in network function virtualization architecture
US20220100550A1 (en) Accelerator Loading Method, System, and Apparatus
WO2019001480A1 (en) Virtual machine management
US11822970B2 (en) Identifier (ID) allocation in a virtualized computing environment
CN104506654A (en) Cloud computing system and backup method of dynamic host configuration protocol server
US10126969B1 (en) Mechanism for non-disruptive virtual tape libraries removal and reconfiguration
WO2015192583A1 (en) Internet protocol (ip) address allocation method and apparatus, server and terminal
CN114489931B (en) Container creation method and system for function instance
CN112019577B (en) Exclusive cloud storage implementation method and device, computing equipment and computer storage medium
WO2020233002A1 (en) Container instance ip switching method and apparatus, computer device, and storage medium
CN105095354A (en) Data updating method and data updating device
WO2017193764A1 (en) Method, device, and data storage medium for processing image file
CN107566505A (en) Data storage resource management method, host node, system, device and storage medium
CN107566470A (en) The method and apparatus that virtual machine is managed in cloud data system
WO2024174717A1 (en) Dynamic storage allocation method and apparatus, electronic device, and storage medium

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CP02 Change in the address of a patent holder

Address after: 100086 11, 1101, 3 building, 2 South Road, Haidian District Academy of Sciences, Beijing.

Patentee after: Internet Information Service Co., Ltd of Beijing Sohu

Address before: 100084 Beijing Haidian District Zhongguancun East Road 1 hospital 9 building Sohu cyber building 15 Floor

Patentee before: Internet Information Service Co., Ltd of Beijing Sohu

CP02 Change in the address of a patent holder