Method and device for cloud platform to allocate floating address and electronic equipment
By allocating floating addresses in the external network of the cloud platform and binding the subnet of the default router, the problem of public network address waste is solved, and more efficient address utilization and network management is achieved.
Patent Information
- Application Number
- CN202411875538.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-18
- Publication Date
- 2025-03-28
AI Technical Summary
When a traditional cloud platform allocates a floating address, it will unconditionally occupy an actual available public network address, resulting in waste of public network addresses and causing property losses to customers.
By determining two subnets in the external network of the cloud platform, one for assigning floating addresses and the other for binding the default router as gateways, the need and waste of public network addresses is reduced.
Effectively utilize public network addresses, reduce unnecessary public network address consumption, improve network design flexibility, simplify network management and troubleshooting, and increase network security.
Smart Images

Figure CN119728645A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to a method, device and electronic device for allocating floating addresses on a cloud platform. Background Art
[0002] Cloud computing is a model for increasing, using and delivering related services based on the Internet, usually involving the provision of dynamic, scalable and often virtualized resources through the Internet. Cloud computing platforms are also called cloud platforms. In order to achieve communication between cloud platforms and external networks, in traditional strategies, floating addresses are allocated through a subnet under the external network of the cloud platform, and at the same time, the default router corresponding to the virtual private cloud of the cloud platform is bound to this subnet as the gateway.
[0003] However, when a subnet is assigned a floating address and bound to a router as a gateway, binding the subnet to a router as a gateway will unconditionally occupy an actually available public network address, resulting in a waste of an operator's public network address and causing useless property losses to customers. Summary of the invention
[0004] In order to overcome the problems existing in the related art, the present disclosure provides a method, device and electronic device for allocating floating addresses on a cloud platform. The technical solution of the present disclosure is as follows: According to a first aspect of an embodiment of the present disclosure, a method for allocating a floating address on a cloud platform is provided, comprising: Determine a first subnetwork and a second subnetwork from an external network of the cloud platform; Allocate a floating address for the cloud platform according to the first sub-network, wherein the floating address occupies the public network address of the operator and communicates with the network outside the cloud; The second sub-network is bound to a default router corresponding to the virtual private cloud of the cloud platform as a gateway to obtain a gateway address; the gateway address is used for the external network to communicate with the virtual private cloud.
[0005] Optionally, it also includes: A labeling operation is performed on the subnetwork in the external network for matching the operator to obtain a subnetwork carrying the operator label; the address in the subnetwork matching the operator can directly communicate with the network outside the cloud; When the user permission is scoped to the current virtual data center, determining the first subnet and the second subnet from the external network of the cloud platform includes: The subnetwork carrying the operator tag is determined as a first subnetwork, and the subnetwork not carrying the operator tag is determined as a second subnetwork.
[0006] Optionally, when the scope of the user permission is all virtual data centers of the system, determining the first sub-network and the second sub-network from the external network of the cloud platform includes: Determine the subnetwork carrying the operator label and / or the subnetwork not carrying the operator label as a first subnetwork; The subnetwork carrying the operator tag and / or the subnetwork not carrying the operator tag is determined as a second subnetwork.
[0007] Optionally, it also includes: Purchasing the floating address from the operator; The cloud platform communicates with the external cloud network through the purchased floating address.
[0008] Optionally, it also includes: Creating subnetworks of different network categories in the external network, wherein the network category is determined according to an address protocol version; Determining the first subnetwork and the second subnetwork from the external network of the cloud platform includes: From different network categories, determine one or more target network categories; In the case that there are at least two subnetworks corresponding to the target network category, a first target subnetwork corresponding to the target network category is determined as a first subnetwork, and a second target subnetwork corresponding to the target network category and different from the first target subnetwork is determined as a second subnetwork; wherein the first subnetwork is different from the second subnetwork; In the case that there is only one subnetwork corresponding to the target network category, the subnetwork corresponding to the target network category is determined as a first subnetwork, and the subnetwork corresponding to the target network category is determined as a second subnetwork; wherein the first subnetwork and the second subnetwork are the same.
[0009] Optionally, the virtual private cloud includes multiple virtual private cloud networks, and further includes: Each of the virtual private cloud networks is connected to the default router, so that each of the virtual private cloud networks can be interconnected through the default router.
[0010] Optionally, the second subnetworks correspond to a network segment respectively; the step of binding the second subnetwork to a default router corresponding to the virtual private cloud of the cloud platform as a gateway to obtain a gateway address includes: The gateway address is automatically generated from the network segment corresponding to the second sub-network; or a fixed address is designated from the network segment corresponding to the second sub-network, and the fixed address is determined as the gateway address.
[0011] Optionally, it also includes: Determining a target virtual private cloud network from the virtual private cloud; Creating a target network card corresponding to the virtual private cloud through the target virtual private cloud network; Binding the floating address to the target network card; The cloud platform communicates with the external cloud network through the target network card.
[0012] According to a second aspect of an embodiment of the present disclosure, a device for allocating a floating address on a cloud platform is provided, comprising: A determination module, used to determine the first sub-network and the second sub-network from an external network of the cloud platform; an allocation module, configured to allocate a floating address to the cloud platform according to the first sub-network, wherein the floating address occupies the public network address of the operator and communicates with the network outside the cloud; A binding module is used to bind the second sub-network to the default router corresponding to the virtual private cloud of the cloud platform as a gateway to obtain a gateway address; the gateway address is used for the external network to communicate with the virtual private cloud.
[0013] According to a third aspect of an embodiment of the present disclosure, there is provided an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the computer program is executed by the processor, the steps of the method for allocating floating addresses by a cloud platform as described in the first aspect are implemented.
[0014] According to a fourth aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the method for allocating floating addresses on a cloud platform as described in the first aspect are implemented.
[0015] According to a fifth aspect of an embodiment of the present disclosure, a computer program product is provided, including a computer program, which, when executed by a processor, implements the steps of the method for allocating floating addresses on a cloud platform as described in the first aspect.
[0016] The present disclosure can reduce the demand for public network addresses by using different subnets in the external network to allocate floating addresses and bind routers as gateways, can more effectively utilize public network addresses, and reduce unnecessary public network address consumption. By distributing floating addresses and gateway addresses in different subnets, greater flexibility can be provided for the network design of the cloud platform, which helps to simplify network management and troubleshooting. Different subnets can have different security policies and access controls. By physically or logically configuring floating addresses and gateway addresses separately, the security of the network can be increased. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the drawings required for use in the description of the embodiments of the present disclosure will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0018] Figure 1 It is a schematic diagram of steps of a method for allocating floating addresses on a cloud platform according to an embodiment of the present disclosure; Figure 2 It is a schematic diagram of cloud intranet communication shown in an embodiment of the present disclosure; Figure 3 It is a block diagram of a device for allocating floating addresses on a cloud platform shown in an embodiment of the present disclosure; Figure 4 It is a schematic diagram of an electronic device shown in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0019] The following will be combined with the drawings in the embodiments of the present disclosure to clearly and completely describe the technical solutions in the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, rather than all of the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present disclosure.
[0020] The terms "first", "second", etc. in the specification and claims of the present disclosure are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable when appropriate, so that the embodiments of the present disclosure can be implemented in an order other than those illustrated or described herein, and the objects distinguished by "first", "second", etc. are generally of the same type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.
[0021] Cloud computing is a model for increasing, using and delivering related services based on the Internet, usually involving the provision of dynamic, scalable and often virtualized resources through the Internet. Cloud computing platforms, also known as cloud platforms, are services based on hardware resources and software resources, providing computing, network and storage capabilities. Cloud computing platforms can be divided into three categories: storage-based cloud platforms that focus on data storage, computing-based cloud platforms that focus on data processing, and comprehensive cloud computing platforms that take both computing and data storage processing into account. Cloud computing breaks down huge data computing and processing programs into countless small programs, and then processes and analyzes these small programs through a system composed of multiple servers, obtains results and returns them to users. Therefore, cloud computing can complete the processing of tens of thousands of data in a very short time, thereby achieving powerful network services. At this stage, cloud services are no longer just a type of distributed computing, but the result of the hybrid evolution and leap of computer technologies such as distributed computing, utility computing, load balancing, parallel computing, network storage, hot backup redundancy and virtualization.
[0022] In addition, cloud computing services include infrastructure as a service, platform as a service and software as a service. In a broad sense, cloud computing brings together many computing resources and implements automated management through software, which only requires a small number of people to participate and quickly provide resources.
[0023] The core concept of cloud computing is to provide fast and secure cloud computing services and data storage on the website with the Internet as the center, so that everyone who uses the Internet can use the huge computing resources and data centers on the network.
[0024] In the cloud platform, the external network and the virtual private cloud (VPC) are divided. The virtual private cloud builds an isolated virtual network environment for the elastic cloud server, which is configured and managed by the user. The virtual private cloud includes the default router, network, etc. to achieve network isolation or interconnection.
[0025] In order to achieve communication between the cloud external network and the cloud platform, in traditional technology, the same subnet under the cloud platform's external network is usually used as a gateway to allocate floating addresses and bind the router of the virtual private cloud. However, this method will unconditionally occupy an actually available address, resulting in a waste of public network addresses. Since public network addresses require users to invest financial resources to purchase, the waste of public network addresses will cause useless property losses to customers.
[0026] In order to solve the above technical problems, the present disclosure proposes a method for allocating floating addresses on a cloud platform, which can effectively avoid the waste of public network addresses.
[0027] In the network design of the cloud platform, the concept of packaging layering is divided into the top-level control plane and the bottom-level network base. The functional design and usage model exposed to the user are all controlled by the top-level control plane, and the corresponding data is sent according to the design of the bottom-level network base. Specifically, the control plane sends corresponding data to the bottom-level network base according to the user operation. In this disclosure, the top-level control plane is the front-end and back-end modules used to directly interact with the user in the cloud platform, and the bottom-level network base can use various third-party open source components. Therefore, the method of allocating floating addresses on the cloud platform proposed in this disclosure can be that the user operates on the top-level control plane, and the operation information corresponding to the user operation is sent to the bottom-level network base for specific execution.
[0028] Figure 1 Schematic diagram of the steps of a method for allocating floating addresses on a cloud platform according to an embodiment of the present disclosure. Figure 1 As shown, the method for allocating floating addresses on the cloud platform may specifically include the following steps: Step S11: Determine a first sub-network and a second sub-network from an external network of the cloud platform.
[0029] The cloud platform can be divided into external networks and virtual private clouds. The external network is used for communication between the cloud platform and the outside of the cloud. The external network includes multiple subnetworks, and any subnetwork corresponds to a network segment. The subnetwork can be used to create a NAT gateway or allocate a floating address.
[0030] A first subnetwork and a second subnetwork are determined from the subnetworks included in the external network. There may be one or more first subnetworks, and there may also be one or more second subnetworks.
[0031] Step S12: allocating a floating address to the cloud platform according to the first sub-network, wherein the floating address occupies the public network address of the operator to communicate with the network outside the cloud.
[0032] According to the network segment corresponding to the first sub-network, a floating address is allocated to the cloud platform from this network segment. The floating address allows the network outside the cloud to access the resources in the cloud platform through a stable public network address. The floating address occupies the public network address of the operator and needs to be purchased by the user.
[0033] Step S13: Bind the second sub-network to the default router corresponding to the virtual private cloud of the cloud platform as a gateway to obtain a gateway address; the gateway address is used for the external network to communicate with the virtual private cloud.
[0034] A virtual private cloud is an isolated network space created on a cloud platform that allows users to run their applications and services securely in the cloud. A corresponding default router is included in the virtual private cloud.
[0035] Determine the virtual private cloud that the cloud outside network needs to access, and then determine the default router corresponding to the virtual private cloud. Bind the second sub-network to the default router corresponding to the virtual private cloud of the cloud platform as a gateway to obtain a gateway address. When the second sub-network is bound to the default router as a gateway, a gateway address is determined from the network segment corresponding to the second sub-network.
[0036] The gateway address is used for the external network to communicate with the virtual private cloud. When the network outside the cloud accesses the cloud platform through the floating address, the network outside the cloud can further access the virtual private cloud through the gateway address.
[0037] By adopting the embodiments of the present disclosure, the waste of public network addresses is avoided by separating the subnets for allocating floating addresses and binding routers as gateways. Since floating addresses are specifically used for communication between the cloud platform and external networks, while gateway addresses focus on processing routing and data exchange between the virtual private cloud and external networks, this separation helps reduce communication bottlenecks and delays. By separating the floating address allocation and gateway binding functions into different subnets, the network can be more easily monitored and managed. In traditional strategies, since the floating address and the gateway are bound to the same subnet, once the subnet fails, both the external communication and internal routing of the cloud platform may be affected. The present disclosure reduces the risk of single point failure by separating these two functions.
[0038] Among them, in an optional embodiment, the second subnetwork corresponds to a network segment respectively; the second subnetwork is bound to the default router corresponding to the virtual private cloud of the cloud platform as a gateway to obtain the gateway address, including: automatically generating the gateway address from the network segment corresponding to the second subnetwork; or, specifying a fixed address from the network segment corresponding to the second subnetwork, and determining the fixed address as the gateway address.
[0039] Each subnet under the external network corresponds to a network segment, and the available address range in the network segment can be determined. When any subnet is determined as the second subnet and the second subnet is bound to the default router as the gateway, a gateway address will be determined from the network segment corresponding to the second subnet and bound to the default router, so as to bind the second subnet to the default router as the gateway.
[0040] When determining the gateway address from the network segment corresponding to the second subnet, a gateway address can be automatically generated from the network segment according to a preset rule or algorithm, for example, the first or last available address in the network segment is selected as the gateway address; when the administrator wishes to use a specific address as the gateway, the gateway address can also be a fixed address specified by the user, and if the fixed address is in the network segment corresponding to the second subnet and is available, the fixed address is used as the gateway address obtained when the default router is bound to the second subnet.
[0041] After obtaining the gateway address, bind the gateway address to the default router corresponding to the virtual private cloud of the cloud platform.
[0042] By adopting the embodiments of the present disclosure, the gateway address is automatically generated from the network segment corresponding to the second subnet, which can reduce the burden on the administrator, improve configuration efficiency, and reduce the possibility of human error. In addition to automatic generation, the administrator is allowed to specify a fixed address from the network segment corresponding to the second subnet as the gateway address, which meets the needs in specific scenarios. A variety of options are provided to meet the needs of different customers, ensuring that the system can adapt to various complex network environments and configuration requirements.
[0043] Among them, in an optional embodiment, the virtual private cloud includes multiple virtual private cloud networks, and also includes: connecting each of the virtual private cloud networks to the default router, so that each of the virtual private cloud networks is interconnected through the default router.
[0044] A virtual private cloud includes multiple virtual private cloud networks and a default router. Each virtual private cloud network included in the virtual private cloud is connected to the default router, and each virtual private cloud network is interconnected through the default router.
[0045] Bind the subnet in the external network to the default router as the gateway to the virtual private cloud. You can use the gateway to access the various virtual private cloud networks included in the virtual private cloud.
[0046] By adopting the embodiments of the present disclosure, the default router is used as the central node, which simplifies the network architecture design, makes network management and configuration more intuitive and efficient, and reduces complexity. All subnets are interconnected, allowing resources to be flexibly scheduled and used between different subnets, thereby improving resource utilization. When it is necessary to expand the network or add a new subnet, it is only necessary to connect the new subnet to the default router without reconfiguring complex routing rules, making network maintenance and expansion more convenient.
[0047] Among them, in an optional embodiment, it also includes: determining the target virtual private cloud network from the virtual private cloud; creating a target network card corresponding to the virtual private cloud through the target virtual private cloud network; binding the floating address to the target network card; the cloud platform communicates with the network outside the cloud through the target network card.
[0048] A virtual private cloud is used within the cloud to provide network connectivity or network isolation for resources within the cloud. It is usually mounted on a cloud host, router, load balancer, cloud physical machine, etc. as a network card or interface. You can use the virtual private cloud network under a virtual private cloud to create cloud resources.
[0049] Any virtual private cloud network can be determined from the virtual private cloud as the target virtual private cloud network, and the target virtual private cloud network is used as the target network card of the virtual private cloud. A floating address is bound to the target network card to achieve communication between the cloud platform and the network outside the cloud.
[0050] By adopting the embodiments of the present disclosure, it is supported to dynamically add and configure network resources in a virtual private cloud, which can easily cope with changing network requirements and improve the scalability and adaptability of the system.
[0051] Among them, in an optional embodiment, a labeling operation is performed on the subnetwork in the external network for matching the operator to obtain a subnetwork carrying the operator label; the address in the subnetwork matching the operator can directly communicate with the network outside the cloud; when the user authority is scoped to the current virtual data center, the first subnetwork and the second subnetwork are determined from the external network of the cloud platform, including: determining the subnetwork carrying the operator label as the first subnetwork, and determining the subnetwork not carrying the operator label as the second subnetwork.
[0052] The external network of the cloud platform includes one or more subnetworks, including a subnetwork for matching an operator and a common subnetwork.
[0053] The subnet used to match the operator is specifically used to match the public network address segment purchased by the user from the operator. The public network address assigned by the operator to the user can be used to facilitate direct communication with the external network. The ordinary network segment corresponding to the ordinary subnet can be used for different types of traffic, providing flexible network connection options.
[0054] Subnets in the external network can be tagged or untagged. Tagging is performed on the subnets that match the operator to obtain subnets that carry the operator tag. In specific implementation, tagging can be performed on some or all of the subnets that match the operator. The tag content can be the line type of the operator, which can be used to indicate which operator the purchase is from. For ordinary subnets, no tagging is performed. By tagging the subnets that match the operator, you can accurately identify which subnets can communicate directly with the network outside the cloud.
[0055] When the user configures the communication between the cloud platform and the network outside the cloud, the user identity is determined first. User identities include system administrators, virtual data center administrators, and virtual data center users; the permissions of virtual data center administrators and virtual data center users are at the same level, and the permissions of system administrators are higher than those of virtual data center administrators and virtual data center users. When the user identity is a virtual data center administrator or a virtual data center user, it means that the user only has permissions to the resources in the current virtual data center, and the scope is limited to the current virtual data center. When the user identity is a system administrator, it means that the user has the highest system permissions and permissions to all resources, and the scope is all virtual data centers in the system.
[0056] In the case where the user authority is the current virtual data center, the subnetwork carrying the operator tag is determined as a first subnetwork, and the subnetwork not carrying the operator tag is determined as a second subnetwork.
[0057] In the case where the user authority is the current virtual data center, the subnet carrying the operator tag is determined as the first subnet, which can ensure that the allocated floating address is currently available, and the public network address provided by the operator can be used to achieve communication between the cloud platform and the network outside the cloud. In the case where the user authority is the current virtual data center, the subnet without the operator tag is determined as the second subnet, which can effectively avoid the consumption of public network addresses.
[0058] By adopting the embodiments of the present disclosure, by labeling the subnets in the external network used to match the operator, it is possible to clearly identify which subnets can communicate directly with the network outside the cloud and belong to a specific operator, simplifying the complexity of configuring the network and effectively avoiding the waste of public network addresses caused by blind allocation. According to the scope of user permissions, the first subnet and the second subnet are determined from the external network of the cloud platform, which can achieve fine-grained access control and improve the security of the network. Determining the subnet that does not carry the operator label as the second subnet can avoid the meaningless consumption of public network addresses.
[0059] Among them, in an optional embodiment, when the user authority is scoped to all virtual data centers of the system, the first subnetwork and the second subnetwork are determined from the external network of the cloud platform, including determining the subnetwork carrying the operator label and / or the subnetwork not carrying the operator label as the first subnetwork; and determining the subnetwork carrying the operator label and / or the subnetwork not carrying the operator label as the second subnetwork.
[0060] When the user's scope is all virtual data centers of the system, the first subnet and the second subnet can be freely determined from the subnets carrying the operator tag and the subnets not carrying the operator tag. Specifically, the first subnet can be a subnet carrying the operator tag and / or a subnet not carrying the operator tag, and the second subnet can also be a subnet carrying the operator tag and / or a subnet not carrying the operator tag.
[0061] Since the user's scope is all virtual data centers of the system, the user can be allowed to select a subnet with an operator label as the second subnet bound to the default router. In this case, the public network address can be used as the gateway address, which can meet actual needs and improve the flexibility of the system.
[0062] Since the user's scope is all virtual data centers of the system, the user can be allowed to select a subnet without an operator label as the first subnet to allocate a floating address. Although the floating address in this case is not a public network address and cannot immediately realize communication between the cloud platform and the network outside the cloud, it can be used as an alternative solution for single point damage.
[0063] By adopting the embodiments of the present disclosure, when the user authority is scoped to all virtual data centers of the system, a subnet with or without an operator tag can be flexibly selected as the first subnet or the second subnet according to actual needs, which can better meet the communication needs between different virtual data centers. Since the user scope is all virtual data centers of the system, the user can be allowed to use a subnet with an operator tag to bind a default router, consuming a public network address, and use a subnet without an operator tag to allocate a floating address, to build a backup communication solution, making the system more flexible and meeting the needs of various scenarios.
[0064] Here are the steps on how to use the alternate communication scheme.
[0065] Among them, in an optional embodiment, it also includes: purchasing the floating address from the operator; the cloud platform communicates with the external cloud network through the purchased floating address.
[0066] Since the subnet of the subnet that does not carry the operator label is determined as the first subnet, when the floating address is allocated to the cloud platform according to the first subnet, the floating address is not purchased from the operator. Therefore, the floating address is not a public network address. After the allocation is completed, the cloud platform cannot immediately communicate with the network outside the cloud.
[0067] However, the floating address can be used as a backup address. In the event of errors in other floating addresses, the floating address can be converted into a public network address by purchasing it from the operator. The floating address can be used to achieve communication between the cloud platform and the external network. After the floating address is allocated, the routing accessibility between the cloud platform internal network and the floating address can be tested without relying on the public network address, and the stability and reliability of the data transmission route between the cloud platform and the external network can be verified to ensure that it can be quickly enabled when needed.
[0068] It can monitor the status of the communication between the cloud platform and the network outside the cloud in real time, including indicators such as network delay and packet loss rate, and detect the usage and error rate of other floating addresses used for communication between the cloud platform and the network outside the cloud. When other floating addresses fail or cannot meet communication requirements, the activation mechanism of the backup address is triggered.
[0069] By adopting the embodiments of the present disclosure, it is allowed to allocate floating addresses using subnets that do not carry operator tags, which can provide greater flexibility and scalability, and can dynamically add or adjust network configurations when needed without immediately incurring additional costs. By delaying the purchase of floating addresses from operators, cloud platforms can pay fees only when needed, thereby saving unnecessary expenses. Using floating addresses obtained using subnets that do not carry operator tags as backup addresses can enhance the reliability of the system.
[0070] Among them, in an optional embodiment, it also includes: creating subnetworks of different network categories in the external network, and the network category is determined according to the address protocol version; determining the first subnetwork and the second subnetwork from the external network of the cloud platform, including: determining one or more target network categories from different network categories; when there are at least two subnetworks corresponding to the target network category, determining the first target subnetwork corresponding to the target network category as the first subnetwork, and determining the second target subnetwork corresponding to the target network category that is different from the first target subnetwork as the second subnetwork; wherein the first subnetwork is different from the second subnetwork; when there is one subnetwork corresponding to the target network category, determining the subnetwork corresponding to the target network category as the first subnetwork, and determining the subnetwork corresponding to the target network category as the second subnetwork; wherein the first subnetwork is the same as the second subnetwork.
[0071] In the external network, each subnet is created according to the address protocol version. The subnets can be divided into different categories according to the address protocol version. For example, for the IPv4 network category, one or more IPv4 subnets are created, and for the IPv6 network category, one or more IPv6 subnets are created.
[0072] First, one or more target network categories are determined from the created network categories, and a first subnetwork and a second subnetwork are determined from the subnetworks under each target network category.
[0073] If a target network category includes at least two subnetworks, the first target subnetwork and the second target subnetwork are determined according to whether the subnetwork under the target network category carries an operator label. The first target subnetwork may be a subnetwork carrying an operator label. The first target subnetwork and the second target subnetwork are different subnetworks. The first target subnetwork may be one or more subnetworks, and the second target subnetwork may also be one or more subnetworks.
[0074] After determining the first target subnet and the second target subnet, the first target subnet is determined as the first subnet for allocating a floating address, and the second target subnet is determined as the second subnet for binding a default router as a gateway. Since the first target subnet and the second target subnet are different subnets, the first subnet and the second subnet are different subnets under different external networks.
[0075] In a specific example, if there are only two subnets under the target network category, one of which is a subnet for matching the operator and the other is a common subnet, then the subnet matching the operator is used as the first target subnet, and the first target subnet is used as the first subnet to allocate a floating address, and the other common subnet is used as the second target subnet as the second subnet to bind the default router as the gateway. In actual use, users can create two IPv4 subnets and two IPv6 subnets under an external network, one IPv4 subnet and one IPv6 subnet are both subnets matching the operator. One of the two IPv4 subnets is used to bind the default router as the gateway, and the other is used to allocate IPv4 floating addresses. One of the two IPv6 subnets is used to bind the default router as the gateway, and the other is used to allocate IPv6 floating addresses, so that the subnet to allocate the floating address and the subnet to bind the default router as the gateway are different subnets, so that no additional public network address is occupied when binding the default router as the gateway.
[0076] If there is only one subnet under a target network category, this subnet is determined as the first target subnet and the second target subnet, and the first target subnet and the second target subnet are the same subnet; the first target subnet is determined as the first subnet for allocating floating addresses, and the second target subnet is determined as the second subnet. Since the first target subnet and the second target subnet are the same subnet, the first subnet and the second subnet are the same subnet. In actual use, some users only use one IPv4 subnet and one IPv6 subnet in the external network. When allocating floating addresses and binding the default router as the gateway, the same subnet can be used. By reserving this permission, various actual needs of users can be met as much as possible, with high flexibility.
[0077] By adopting the embodiments of the present disclosure, it is allowed to create subnets based on different address protocol versions in the external network, which can adapt to the network needs of different customers. For each target network category, if the number of corresponding subnets is at least two, different subnets are selected as the first subnet and the second subnet, which can effectively avoid the waste of public network addresses; if the number of corresponding subnets is one, it is also allowed that the first subnet and the second subnet correspond to the same subnet, which can meet the actual needs of different users, and has higher flexibility, so that the system can operate normally even when network resources are limited.
[0078] Figure 2 This is a schematic diagram of a cloud intranet communication shown in an embodiment of the present disclosure. Figure 2 As shown in the figure, the cloud platform includes two parts: the cloud external network and the virtual private cloud.
[0079] Each virtual private cloud network included in the virtual private cloud is connected to the virtual interface of the default router, and a cloud host can be created through the virtual private cloud, and the cloud host has a virtual network card. The external network includes two different types of subnetworks; subnetwork A1, subnetwork A2, subnetwork A3, etc. as a network category; subnetwork B1, subnetwork B2, subnetwork B3, etc. as a network category. Among them, subnetwork A2 and subnetwork B1 are subnetworks carrying operator labels.
[0080] In order to realize the communication between the cloud platform and the network outside the cloud, floating addresses can be allocated through the subnet under the external network, and the communication between the cloud platform and the network outside the cloud can be realized through the floating addresses. The two categories in the external network are determined as the target network categories, and the first subnet corresponding to each category is determined in each target network category; in the class A subnet, the subnet A2 carrying the operator label is determined as the first subnet; in the class B subnet, the subnet B1 carrying the operator label is determined as the first subnet. The floating address is allocated through the first subnet, and the floating address is bound to the virtual network card to realize the communication between the cloud platform and the network outside the cloud.
[0081] In order to access the data of the virtual private cloud, it is also necessary to determine the second subnet from the subnets under each target network category. In the A-class subnet, the subnet A3 without the operator tag is determined as the second subnet; in the B-class subnet, the subnet B3 without the operator tag is determined as the second subnet. The second subnet is bound to the default router of the virtual private cloud as the gateway, and a gateway address is obtained at the same time. Through the gateway address, the data in the virtual private cloud can be used by the external network.
[0082] Figure 3 1 is a block diagram of a device for allocating floating addresses on a cloud platform according to an embodiment of the present disclosure. Figure 3 As shown, the device comprises: A determination module 310, configured to determine a first sub-network and a second sub-network from an external network of the cloud platform; An allocation module 320, configured to allocate a floating address to the cloud platform according to the first sub-network, wherein the floating address occupies the public network address of the operator and communicates with the network outside the cloud; The binding module 330 is used to bind the second sub-network to the default router corresponding to the virtual private cloud of the cloud platform as a gateway to obtain a gateway address; the gateway address is used for the external network to communicate with the virtual private cloud.
[0083] Optionally, the device further comprises: A label module, used to label the sub-network in the external network for matching the operator, so as to obtain a sub-network carrying the operator label; the address in the sub-network matching the operator can directly communicate with the network outside the cloud; When the user authority is scoped to the current virtual data center, the determination module is specifically used to execute: The subnetwork carrying the operator tag is determined as a first subnetwork, and the subnetwork not carrying the operator tag is determined as a second subnetwork.
[0084] Optionally, when the scope of the user authority is all virtual data centers of the system, the determination module is specifically used to execute: Determine the subnetwork carrying the operator label and / or the subnetwork not carrying the operator label as a first subnetwork; The subnetwork carrying the operator tag and / or the subnetwork not carrying the operator tag is determined as a second subnetwork.
[0085] Optionally, the device further comprises: A purchasing module, used to purchase the floating address from the operator; A communication module is used for the cloud platform to communicate with the external cloud network through the purchased floating address.
[0086] Optionally, the device further comprises: A category module, used for creating sub-networks of different network categories in the external network, wherein the network category is determined according to an address protocol version; The determination module is specifically used to execute: From different network categories, determine one or more target network categories; In the case that there are at least two subnetworks corresponding to the target network category, a first target subnetwork corresponding to the target network category is determined as a first subnetwork, and a second target subnetwork corresponding to the target network category and different from the first target subnetwork is determined as a second subnetwork; wherein the first subnetwork is different from the second subnetwork; In the case that there is only one subnetwork corresponding to the target network category, the subnetwork corresponding to the target network category is determined as a first subnetwork, and the subnetwork corresponding to the target network category is determined as a second subnetwork; wherein the first subnetwork and the second subnetwork are the same.
[0087] Optionally, the virtual private cloud includes multiple virtual private cloud networks, and the device further includes: The interconnection module is used to connect each of the virtual private cloud networks to the default router, so that each of the virtual private cloud networks can be interconnected through the default router.
[0088] Optionally, each of the second sub-networks corresponds to a network segment, and the binding module is specifically used to execute: The gateway address is automatically generated from the network segment corresponding to the second sub-network; or a fixed address is designated from the network segment corresponding to the second sub-network, and the fixed address is determined as the gateway address.
[0089] Optionally, the device further comprises: A private cloud determination module, used to determine a target virtual private cloud network from the virtual private cloud; A creation module, used to create a target network card corresponding to the virtual private cloud through the target virtual private cloud network; The address binding module is used to bind the floating address to the target network card so that the cloud platform can communicate with the external cloud network through the target network card.
[0090] It should be noted that the system embodiment is similar to the method embodiment, so the description is relatively simple, and the relevant parts can be referred to the method embodiment.
[0091] The present disclosure also provides an electronic device, referring to Figure 4 , Figure 4 is a schematic diagram of an electronic device shown in an embodiment of the present disclosure. Figure 4 As shown, the electronic device 400 includes: a memory 410 and a processor 420. The memory 410 and the processor 420 are connected via a bus communication. A computer program is stored in the memory 410. The computer program can be run on the processor 420 to implement the steps in the method of allocating floating addresses on a cloud platform disclosed in the embodiment of the present disclosure.
[0092] The embodiment of the present disclosure further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps in the method for allocating floating addresses on a cloud platform disclosed in the embodiment of the present disclosure are implemented.
[0093] The embodiments of the present disclosure also provide a computer program product, including a computer program, which implements the steps in the method for allocating floating addresses on a cloud platform as disclosed in the embodiments of the present disclosure.
[0094] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0095] It should be understood by those skilled in the art that the embodiments of the present disclosure may be provided as methods, devices or computer program products. Therefore, the embodiments of the present disclosure may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the embodiments of the present disclosure may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0096] The embodiments of the present disclosure are described with reference to the flowcharts and / or block diagrams of the methods, apparatuses, electronic devices, and computer program products according to the embodiments of the present disclosure. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0097] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0098] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0099] Although some embodiments of the present disclosure have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiment and all changes and modifications that fall within the scope of the present disclosure.
[0100] The above is a detailed introduction to a method, device and electronic device for allocating floating addresses on a cloud platform provided by the present disclosure. Specific examples are used in this article to illustrate the principles and implementation methods of the present disclosure. The description of the above embodiments is only used to help understand the method and core idea of the present disclosure. At the same time, for general technical personnel in this field, according to the idea of the present disclosure, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present disclosure.
Claims
1. A method for allocating floating addresses on a cloud platform, characterized in that: include: Determine a first subnetwork and a second subnetwork from an external network of the cloud platform; Allocate a floating address for the cloud platform according to the first sub-network, wherein the floating address occupies the public network address of the operator and communicates with the network outside the cloud; The second sub-network is bound to a default router corresponding to the virtual private cloud of the cloud platform as a gateway to obtain a gateway address; the gateway address is used for the external network to communicate with the virtual private cloud.
2. The method according to claim 1, characterized in that Also includes: A labeling operation is performed on the subnetwork in the external network for matching the operator to obtain a subnetwork carrying the operator label; the address in the subnetwork matching the operator can directly communicate with the network outside the cloud; When the user permission is scoped to the current virtual data center, determining the first subnet and the second subnet from the external network of the cloud platform includes: The subnetwork carrying the operator tag is determined as a first subnetwork, and the subnetwork not carrying the operator tag is determined as a second subnetwork.
3. The method according to claim 2, characterized in that When the user authority is scoped to all virtual data centers of the system, determining the first sub-network and the second sub-network from the external network of the cloud platform includes: Determine the subnetwork carrying the operator label and / or the subnetwork not carrying the operator label as a first subnetwork; The subnetwork carrying the operator tag and / or the subnetwork not carrying the operator tag is determined as a second subnetwork.
4. The method according to claim 3, characterized in that Also includes: Purchasing the floating address from the operator; The cloud platform communicates with the external cloud network through the purchased floating address.
5. The method according to claim 1, characterized in that Also includes: Creating subnetworks of different network categories in the external network, wherein the network category is determined according to an address protocol version; Determining the first subnetwork and the second subnetwork from the external network of the cloud platform includes: From different network categories, determine one or more target network categories; In the case that there are at least two subnetworks corresponding to the target network category, a first target subnetwork corresponding to the target network category is determined as a first subnetwork, and a second target subnetwork corresponding to the target network category and different from the first target subnetwork is determined as a second subnetwork; wherein the first subnetwork is different from the second subnetwork; In the case that there is only one subnetwork corresponding to the target network category, the subnetwork corresponding to the target network category is determined as a first subnetwork, and the subnetwork corresponding to the target network category is determined as a second subnetwork; wherein the first subnetwork and the second subnetwork are the same.
6. The method according to claim 1, characterized in that The virtual private cloud includes multiple virtual private cloud networks and further includes: Each of the virtual private cloud networks is connected to the default router, so that each of the virtual private cloud networks can be interconnected through the default router.
7. The method according to claim 1, characterized in that The second sub-networks correspond to a network segment respectively; the second sub-networks are bound to a default router corresponding to a virtual private cloud of the cloud platform as a gateway to obtain a gateway address, including: The gateway address is automatically generated from the network segment corresponding to the second sub-network; or a fixed address is designated from the network segment corresponding to the second sub-network, and the fixed address is determined as the gateway address.
8. The method according to claim 1, characterized in that Also includes: Determining a target virtual private cloud network from the virtual private cloud; Creating a target network card corresponding to the virtual private cloud through the target virtual private cloud network; Binding the floating address to the target network card; The cloud platform communicates with the external cloud network through the target network card.
9. A device for allocating floating addresses on a cloud platform, characterized in that: include: A determination module, used to determine the first sub-network and the second sub-network from an external network of the cloud platform; an allocation module, configured to allocate a floating address to the cloud platform according to the first sub-network, wherein the floating address occupies the public network address of the operator and communicates with the network outside the cloud; A binding module is used to bind the second sub-network to the default router corresponding to the virtual private cloud of the cloud platform as a gateway to obtain a gateway address; the gateway address is used for the external network to communicate with the virtual private cloud.
10. An electronic device, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor. When the computer program is executed by the processor, the steps of the method for allocating floating addresses on a cloud platform as described in any one of claims 1 to 8 are implemented.