CN116233068A - Subnet construction method and device of virtual private cloud, electronic equipment and storage medium - Google Patents

Subnet construction method and device of virtual private cloud, electronic equipment and storage medium Download PDF

Info

Publication number
CN116233068A
CN116233068A CN202310080022.2A CN202310080022A CN116233068A CN 116233068 A CN116233068 A CN 116233068A CN 202310080022 A CN202310080022 A CN 202310080022A CN 116233068 A CN116233068 A CN 116233068A
Authority
CN
China
Prior art keywords
address
information
target
subnet
virtual private
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310080022.2A
Other languages
Chinese (zh)
Inventor
张萌萌
耿飞
王超
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Inspur Communication Technology Co Ltd
Original Assignee
Inspur Communication Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Inspur Communication Technology Co Ltd filed Critical Inspur Communication Technology Co Ltd
Priority to CN202310080022.2A priority Critical patent/CN116233068A/en
Publication of CN116233068A publication Critical patent/CN116233068A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/46Interconnection of networks
    • H04L12/4641Virtual LANs, VLANs, e.g. virtual private networks [VPN]
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/50Reducing energy consumption in communication networks in wire-line communication networks, e.g. low power modes or reduced link rate

Landscapes

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

Abstract

The invention relates to the technical field of communication, and provides a subnet construction method, device, electronic equipment and storage medium of a virtual private cloud, wherein the method comprises the following steps: acquiring first IP information corresponding to a subnet to be constructed; verifying the first IP information based on the second IP information of the target virtual private cloud to obtain a verification result; and determining target IP information based on the verification result, so as to construct a target subnet in the target virtual private cloud based on the target IP information. According to the method and the device, based on the second IP information of the target virtual private cloud, the first IP information corresponding to the subnet to be constructed is verified to obtain a verification result, so that accurate target IP information is determined based on the verification result, an accurate target subnet is constructed in the target virtual private cloud based on the target IP information, and therefore the subnet construction accuracy of the virtual private cloud is improved.

Description

Subnet construction method and device of virtual private cloud, electronic equipment and storage medium
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a method and an apparatus for constructing a subnet of a virtual private cloud, an electronic device, and a storage medium.
Background
With the rapid development of communication technology, the application scene of the virtual private cloud is wider and wider. The virtual private cloud can effectively establish a logically isolated virtual network space on the public cloud for the user. Multiple subnets are generally constructed in a virtual private cloud to deploy cloud resources in the multiple subnets, respectively, so as to realize different services in one virtual private cloud.
Currently, the IP information corresponding to the subnet to be constructed is generally determined and input by a user, however, the IP information input by the user may not be accurate, so that an erroneous subnet is constructed in the corresponding virtual private cloud based on the IP information input by the user, for example, the IP address input by the user is not in a network segment of the virtual private cloud, thereby causing the subnet construction error of the virtual private cloud, and reducing the subnet construction accuracy of the virtual private cloud.
Disclosure of Invention
The invention provides a method, a device, electronic equipment and a storage medium for constructing a subnet of a virtual private cloud, which are used for solving the defect of low accuracy of the subnet construction of the virtual private cloud in the prior art and realizing high-accuracy subnet construction.
The invention provides a subnet construction method of a virtual private cloud, which comprises the following steps:
Acquiring first IP information corresponding to a subnet to be constructed, wherein the first IP information comprises a first IP address and first network number bit information of the first IP address, and the first network number bit information comprises a prefix or a subnet mask of a non-category inter-domain routing CIDR address block;
based on second IP information of a target virtual private cloud, verifying the first IP information to obtain a verification result, wherein the second IP information comprises a second IP address and second network number bit information of the second IP address, and the second network number bit information comprises a prefix or a subnet mask of a CIDR address block;
and determining target IP information based on the verification result so as to construct a target subnet in the target virtual private cloud based on the target IP information, wherein the target IP information comprises a target IP address of the target subnet and target network number bit information of the target IP address, and the target network number bit information comprises a prefix or a subnet mask of a CIDR address block.
According to the subnet construction method of the virtual private cloud provided by the invention, the second IP information based on the target virtual private cloud verifies the first IP information to obtain a verification result, and the method comprises the following steps:
Determining a network number bit number comparison result of the first IP address and the second IP address based on the first network number bit number information and the second network number bit number information;
determining an IP address comparison result of the first IP address and the second IP address based on the second network number bit information, the first IP address and the second IP address, where the IP address comparison result is used to characterize whether the first IP address is a subnet address of the target virtual private cloud;
and determining the verification result based on the network number bit comparison result and the IP address comparison result.
According to the subnet construction method of the virtual private cloud provided by the invention, the verification result is determined based on the network number bit comparison result and the IP address comparison result, and the method comprises the following steps:
determining that the verification result is a verification success result when the number of the network number bits of the first IP address is greater than or equal to the number of the network number bits of the second IP address and the first IP address is the subnet address of the target virtual private cloud;
and under the condition that the number of the network numbers of the first IP address is smaller than that of the second IP address or the first IP address is not the subnet address of the target virtual private cloud, determining that the verification result is a verification failure result.
According to the subnet construction method of the virtual private cloud provided by the invention, when the number of network number bits of the first IP address is greater than or equal to the number of network number bits of the second IP address and the first IP address is the subnet address of the target virtual private cloud, determining that the verification result is a verification success result comprises:
determining a constructed subnet set of the target virtual private cloud and an IP address set of the constructed subnet set under the condition that the number of the network number bits of the first IP address is greater than or equal to the number of the network number bits of the second IP address and the first IP address is the subnet address of the target virtual private cloud;
determining that the first IP address does not exist in the IP address set, determining that the verification result is a first verification success result, wherein the first verification success result represents that the first IP information is successfully verified, and the first IP information is effective IP information;
determining that the first IP address exists in the IP address set, determining that the verification result is a second verification success result, wherein the second verification success result represents that the first IP information is successfully verified, and the first IP information is invalid IP information.
According to the subnet construction method of the virtual private cloud provided by the invention, the determining of the target IP information based on the verification result comprises the following steps:
under the condition that the verification result is the first verification success result, determining the first IP information as target IP information;
updating the first IP address based on the IP address set and the second network number bit information to obtain the target IP address and determining the first network number information as the target network number bit information under the condition that the verification result is the second verification success result;
and under the condition that the verification result is the verification failure result, updating the first IP information based on the second IP information and the IP address set to obtain target IP information.
According to the subnet construction method of the virtual private cloud provided by the invention, the target IP information is determined based on the verification result, and then the method further comprises the following steps:
displaying the target IP information and acquiring a confirmation instruction about the target IP information;
determining that the confirmation instruction indicates that the target IP information is confirmed to pass, and constructing a target subnet in the target virtual private cloud based on the target IP information;
And determining that the confirmation instruction indicates that the target IP information does not pass through confirmation, updating the target IP information based on the IP address set and the second network number bit information to obtain updated IP information, determining the updated IP information as the target IP information, and returning to the step of displaying the target IP information.
According to the subnet construction method of the virtual private cloud provided by the invention, the determining the IP address comparison result of the first IP address and the second IP address based on the second network number bit information, the first IP address and the second IP address comprises the following steps:
determining a first to-be-compared number of the first IP address and a second to-be-compared number of the second IP address based on the second network number bit information;
and comparing the first number to be compared with the second number to be compared to obtain the IP address comparison result.
The invention also provides a subnet construction device of the virtual private cloud, which comprises:
the acquisition module is used for acquiring first IP information corresponding to the subnet to be constructed, wherein the first IP information comprises a first IP address and first network number bit information of the first IP address, and the first network number bit information comprises a prefix or a subnet mask of a non-category inter-domain routing CIDR address block;
The verification module is used for verifying the first IP information based on second IP information of the target virtual private cloud to obtain a verification result, wherein the second IP information comprises a second IP address and second network number bit information of the second IP address, and the second network number bit information comprises a prefix or a subnet mask of a CIDR address block;
and the determining module is used for determining target IP information based on the verification result so as to construct a target subnet in the target virtual private cloud based on the target IP information, wherein the target IP information comprises a target IP address of the target subnet and target network number bit information of the target IP address, and the target network number bit information comprises a prefix or a subnet mask of a CIDR address block.
The invention also provides an electronic device, which comprises a memory, a processor and a computer program stored on the memory and capable of running on the processor, wherein the processor realizes the subnet construction method of any one of the virtual private clouds when executing the program.
The present invention also provides a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements a subnet construction method of a virtual private cloud as described in any one of the above.
According to the subnet construction method, the device, the electronic equipment and the storage medium of the virtual private cloud, based on the second IP information of the target virtual private cloud, the first IP information corresponding to the subnet to be constructed is verified to obtain the verification result, so that the accurate target IP information is determined based on the verification result, the accurate target subnet is constructed in the target virtual private cloud based on the target IP information, and the subnet construction accuracy of the virtual private cloud is improved.
Drawings
In order to more clearly illustrate the invention or the technical solutions of the prior art, the following description will briefly explain the drawings used in the embodiments or the description of the prior art, and it is obvious that the drawings in the following description are some embodiments of the invention, and other drawings can be obtained according to the drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic flow diagram of a subnet construction method of a virtual private cloud according to the present invention;
fig. 2 is a second flow chart of a subnet construction method of a vpn cloud according to the present invention;
fig. 3 is a third flow chart of a subnet construction method of a vpn cloud according to the present invention;
Fig. 4 is a schematic structural diagram of a subnet construction device of a virtual private cloud provided by the present invention;
fig. 5 is a schematic structural diagram of an electronic device provided by the present invention.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the present invention more apparent, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings, and it is apparent that the described embodiments are some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
With the rapid development of communication technology, application scenarios of virtual private clouds (Virtual Private Cloud, VPC) are becoming wider and wider. For example, as the number of remote offices increases, each enterprise has a cloud, and each enterprise has a corresponding virtual private cloud based on the cloud. The virtual private cloud can effectively establish a logically isolated virtual network space on the public cloud for the user.
In order to scientifically and effectively utilize an address space in a virtual private cloud, the virtual private cloud is generally divided into a plurality of sub-networks with finer granularity, namely, a plurality of sub-networks are constructed in the virtual private cloud, so that cloud resources are respectively deployed in the plurality of sub-networks, and different services are realized in one virtual private cloud. And a plurality of subnets can be constructed in the same virtual private cloud, so that cloud resource cross-available-area deployment is supported, and powerful guarantee is provided for disaster recovery across the available areas.
Currently, the IP information corresponding to the subnet to be constructed is generally determined and input by a user, however, the IP information input by the user may not be accurate, so that an erroneous subnet is constructed in the corresponding virtual private cloud based on the IP information input by the user, for example, the IP address input by the user is not in a network segment of the virtual private cloud, thereby causing the subnet construction error of the virtual private cloud, and reducing the subnet construction accuracy of the virtual private cloud.
In view of the above problems, the present invention proposes the following embodiments. Fig. 1 is one of flow diagrams of a method for constructing a subnet of a virtual private cloud according to the present invention, as shown in fig. 1, where the method for constructing a subnet of a virtual private cloud includes:
step 110, obtaining first IP information corresponding to a subnet to be constructed, where the first IP information includes a first IP address and first network number bit information of the first IP address, and the first network number bit information includes a prefix or a subnet mask of a non-category inter-domain routing CIDR address block.
Here, the subnet to be constructed is a subnet to be constructed, that is, a subnet to be constructed in the target virtual private cloud, in other words, a subnet to be planned or divided in the target virtual private cloud. The first IP information is the IP information corresponding to the initial subnet to be constructed, the first IP information can be accurate IP information, namely, the accurate subnet can be constructed in the target virtual private cloud based on the first IP information, and at the moment, the IP information of the constructed subnet is the same as the IP information corresponding to the initial subnet to be constructed; the first IP information may also be inaccurate IP information, that is, an accurate subnet cannot be built in the target virtual private cloud based on the first IP information, at this time, the IP information of the built subnet is different from the IP information corresponding to the initial subnet to be built, that is, the target IP information determined based on the verification result is the accurate IP information, so that an accurate subnet is built in the target virtual private cloud based on the target IP information.
Here, the first network number bit information is used to characterize the network number bit of the first IP address.
In one embodiment, the first network number bit information is a prefix of a CIDR (class less Inter-Domain Routing) address block. For example, the first IP information is a CIDR address block, the CIDR address block is 10.10.0.0/12, the first IP address is 10.10.0.0, and the prefix of the CIDR address block is 12.CIDR is a method of categorizing IP addresses for assigning IP addresses to users and for efficiently routing IP packets over the internet.
In another embodiment, the first network number bit number information is a subnet mask. For example, the first IP address is 10.10.0.0 and the subnet mask is 255.240.0.0.
In an embodiment, the method provided in the embodiment of the present invention is applied to a front-end device, and the step 110 includes: and acquiring a subnet construction instruction, and determining first IP information corresponding to the subnet to be constructed based on the subnet construction instruction. The subnet build instruction indicates that there is the first IP information, e.g., the subnet build instruction includes the first IP information. The front-end equipment acquires the subnet construction instruction, so that the first IP information can be verified at the front-end equipment, interaction with the back-end service is not needed in the verification process, and a third-party tool is not needed, the front-end equipment verifies automatically, thereby improving the convenience and efficiency of subnet verification, and further improving the convenience and efficiency of subnet construction.
Step 120, based on the second IP information of the target virtual private cloud, verifying the first IP information to obtain a verification result, where the second IP information includes a second IP address and second network number bit information of the second IP address, and the second network number bit information includes a prefix or a subnet mask of the CIDR address block.
Here, the target virtual private cloud is the virtual private cloud of the subnet currently required to be constructed, i.e., it is the virtual private cloud of the subnet currently required to be planned or divided. The IP address space of the target virtual private cloud includes a network segment.
Here, the second network number bit information is used to characterize the network number bit of the second IP address.
In one embodiment, the second network number bit information is a prefix of the CIDR address block. For example, the second IP information is a CIDR address block, where the CIDR address block is 10.0.0.0/8, the second IP address is 10.0.0.0, the prefix of the CIDR address block is 8, and the network segment corresponding to the target virtual private cloud is 10.0.0.0/8 to 10.255.255.255/8.
In another embodiment, the second network number bit number information is a subnet mask. For example, the second IP address is 10.0.0.0, the subnet mask is 255.0.0.0, the target vpn cloud corresponds to a segment of 10.0.0.0 to 10.255.255.255, and the subnet mask of the segment is 255.0.0.0.
Here, the verification result is used to characterize whether the first IP information is accurate IP information, that is, whether the correct subnet can be built in the target virtual private cloud based on the first IP information.
In one embodiment, the following step 130 includes: under the condition that the verification result represents that the first IP information is accurate IP information, determining the first IP information as target IP information; and under the condition that the verification result represents that the first IP information is inaccurate IP information, updating the first IP information based on the second IP information to obtain target IP information, wherein the verification result corresponding to the target IP information represents that the target IP information is accurate IP information. Further, updating the first IP information based on the second IP information and an IP address set to obtain target IP information, wherein the IP address set comprises the IP address of the constructed subnet of the target virtual private cloud.
In an embodiment, determining an IP address comparison result of the first IP address and the second IP address based on the second network number bit number information, the first IP address, and the second IP address; and determining the verification result based on the IP address comparison result. The IP address comparison result is used to characterize whether the first IP address is a subnet address of the target virtual private cloud. Specifically, under the condition that the first IP address is the subnet address of the target virtual private cloud, determining that the verification result is a verification success result; and under the condition that the first IP address is not the subnet address of the target virtual private cloud, determining that the verification result is a verification failure result.
Accordingly, the following step 130 includes: under the condition that the verification result is a verification success result, determining the first IP information as target IP information; and under the condition that the verification result is a verification failure result, updating the first IP information based on the second IP information to obtain target IP information.
Further, under the condition that the first IP address is a subnet address of the target virtual private cloud, determining a constructed subnet set of the target virtual private cloud and an IP address set of the constructed subnet set; determining that a first IP address does not exist in the IP address set, determining that the verification result is a first verification success result, wherein the first verification success result represents that the first IP information is successfully verified, and the first IP information is effective IP information; determining that a first IP address exists in the IP address set, determining that the verification result is a second verification success result, wherein the second verification success result represents that the first IP information is successfully verified, and the first IP information is invalid IP information.
Accordingly, the following step 130 includes: under the condition that the verification result is a first verification success result, determining the first IP information as target IP information; under the condition that the verification result is a second verification success result, updating the first IP address based on the IP address set and the second network number bit information to obtain a target IP address, and determining the first network number information as target network number bit information; and under the condition that the verification result is a verification failure result, updating the first IP information based on the second IP information and the IP address set to obtain target IP information.
In one embodiment, the network number bit number comparison result of the first IP address and the second IP address is determined based on the first network number bit number information and the second network number bit number information. Specifically, under the condition that the number of the network number bits of the first IP address is greater than or equal to the number of the network number bits of the second IP address, determining that the verification result is a verification success result; and under the condition that the number of the network number bits of the first IP address is smaller than that of the second IP address, determining that the verification result is a verification failure result.
Accordingly, the following step 130 includes: under the condition that the verification result is a verification success result, determining the first IP information as target IP information; and under the condition that the verification result is a verification failure result, updating the first IP information based on the second IP information to obtain target IP information.
Further, under the condition that the number of the network number bits of the first IP address is greater than or equal to that of the second IP address, determining a constructed subnet set of the target virtual private cloud and an IP address set of the constructed subnet set; determining that a first IP address does not exist in the IP address set, determining that the verification result is a first verification success result, wherein the first verification success result represents that the first IP information is successfully verified, and the first IP information is effective IP information; determining that a first IP address exists in the IP address set, determining that the verification result is a second verification success result, wherein the second verification success result represents that the first IP information is successfully verified, and the first IP information is invalid IP information.
Accordingly, the following step 130 includes: under the condition that the verification result is a first verification success result, determining the first IP information as target IP information; under the condition that the verification result is a second verification success result, updating the first IP address based on the IP address set and the second network number bit information to obtain a target IP address, and determining the first network number information as target network number bit information; and under the condition that the verification result is a verification failure result, updating the first IP information based on the second IP information and the IP address set to obtain target IP information.
And 130, determining target IP information based on the verification result, wherein the target IP information comprises a target IP address of the target subnet and target network number bit information of the target IP address, and the target network number bit information comprises a prefix or a subnet mask of a CIDR address block, so as to construct a target subnet in the target virtual private cloud based on the target IP information.
Here, the target IP information is accurate IP information, that is, an accurate target subnet may be constructed in the target virtual private cloud based on the target IP information, in other words, the accurate target subnet may be planned or divided in the target virtual private cloud. The target subnet is an accurate subnet in the target virtual private cloud, and the IP information of the target subnet is target IP information.
Specifically, under the condition that the verification result represents that the first IP information is accurate IP information, the first IP information is determined to be target IP information; and under the condition that the verification result represents that the first IP information is inaccurate IP information, updating the first IP information based on the second IP information to obtain target IP information. Further, updating the first IP information based on the second IP information and an IP address set to obtain target IP information, wherein the IP address set comprises the IP address of the constructed subnet of the target virtual private cloud.
Here, the target network number bit information is used to characterize the network number bit of the target IP address.
In one embodiment, the destination network number bit information is a prefix of the CIDR address block. For example, the target IP information is a CIDR address block, the CIDR address block is 10.10.0.0/12, the target IP address is 10.10.0.0, and the prefix of the CIDR address block is 12.
In another embodiment, the target network number bit number information is a subnet mask. For example, the target IP address is 10.10.0.0 and the subnet mask is 255.240.0.0.
In some embodiments, after step 130 above, the method further comprises: displaying target IP information and receiving a confirmation instruction about the target IP information; determining that the confirmation instruction indicates that the target IP information is confirmed to pass, and constructing a target subnet in the target virtual private cloud based on the target IP information; and determining that the confirmation instruction indicates that the target IP information does not pass through confirmation, updating the target IP information based on the second network number bit information to obtain updated IP information, determining the updated IP information as the target IP information, and returning to the step of displaying the target IP information. Further, updating the target IP information based on the second network number bit information and the IP address set to obtain updated IP information, wherein the IP address set comprises the IP address of the constructed subnet of the target virtual private cloud.
In some embodiments, after step 130 above, the method further comprises: cloud resources are deployed on the target subnet. The cloud resources may include, but are not limited to, at least one of: cloud servers, cloud databases, cloud containers, and the like.
According to the subnet construction method of the virtual private cloud, based on the second IP information of the target virtual private cloud, the first IP information corresponding to the subnet to be constructed is verified to obtain the verification result, so that accurate target IP information is determined based on the verification result, an accurate target subnet is constructed in the target virtual private cloud based on the target IP information, and therefore the subnet construction accuracy of the virtual private cloud is improved.
Based on the above embodiment, fig. 2 is a second flowchart of a method for constructing a subnet of a virtual private cloud according to the present invention, as shown in fig. 2, the step 120 includes:
step 121, determining a comparison result of the number of network digits of the first IP address and the second IP address based on the first number of network digits information and the second number of network digits information.
The network number bit number comparison result includes a first network number bit number comparison result and a second network number bit number comparison result, where the first network number bit number comparison result is that the network number bit number of the first IP address is greater than or equal to the network number bit number of the second IP address, and the second network number bit number comparison result is that the network number bit number of the first IP address is less than the network number bit number of the second IP address.
Step 122, determining an IP address comparison result of the first IP address and the second IP address based on the second network number bit information, the first IP address and the second IP address, where the IP address comparison result is used to characterize whether the first IP address is a subnet address of the target virtual private cloud.
Specifically, based on the second network number bit number information, the first IP address and the second IP address are compared, and an IP address comparison result is obtained. More specifically, based on the second network number bit information, it is determined whether the first IP address is a subnet address of the second IP address.
Here, the IP address comparison result includes a first IP address comparison result and a second IP address comparison result. The first IP address is compared with the subnet address of the target virtual private cloud, that is, the first IP address is compared with the subnet address of the second IP address, that is, the first IP address is in the network segment of the target virtual private cloud. The second IP address comparison result is that the first IP address is not a subnet address of the target virtual private cloud, that is, the first IP address comparison result is that the first IP address is not a subnet address of the second IP address, in other words, the first IP address is not in a network segment of the target virtual private cloud.
Step 123, determining the verification result based on the network number bit comparison result and the IP address comparison result.
Specifically, in the case that the number of bits of the network number of the first IP address is greater than or equal to the number of bits of the network number of the second IP address, the first IP information may be subnet information of the target virtual private cloud, based on which, in the case that the first IP address is the subnet address of the target virtual private cloud, the verification result is determined to be a verification success result; under the condition that the number of the network number bits of the first IP address is smaller than that of the second IP address, the first IP information is definitely not subnet information of the target virtual private cloud, and based on the first IP information, the verification result is determined to be a verification failure result; in the case where the number of network numbers of the first IP address is greater than or equal to the number of network numbers of the second IP address, the first IP information may be subnet information of the target virtual private cloud, however, in the case where the first IP address is not a subnet address of the target virtual private cloud, the verification result is determined to be a verification failure result.
According to the subnet construction method of the virtual private cloud, whether the first IP information is the subnet information of the target virtual private cloud or not is determined based on the network number bit comparison result of the first IP address and the second IP address and the IP address comparison result of the first IP address and the second IP address, namely whether the correct target subnet can be constructed in the target virtual private cloud based on the first IP information is determined, so that a verification result is obtained, support is provided for verification of the first IP information, support is provided for determination of the verification result, whether the first IP information needs to be updated or not is determined based on the verification result later, and the first IP information needing to be updated is updated based on the verification result, so that the accurate target subnet is constructed in the target virtual private cloud based on the finally determined accurate target IP information, and therefore the subnet construction accuracy of the virtual private cloud is improved.
Based on any of the above embodiments, the method further includes the step 123 of:
determining that the verification result is a verification success result when the number of the network number bits of the first IP address is greater than or equal to the number of the network number bits of the second IP address and the first IP address is the subnet address of the target virtual private cloud;
and under the condition that the number of the network numbers of the first IP address is smaller than that of the second IP address or the first IP address is not the subnet address of the target virtual private cloud, determining that the verification result is a verification failure result.
According to the subnet construction method of the virtual private cloud, when the number of network numbers of the first IP address is greater than or equal to the number of network numbers of the second IP address and the first IP address is the subnet address of the target virtual private cloud, the first IP information is determined to be subnet information of the target virtual private cloud, the verification result is further determined to be a verification success result, the subsequently determined target IP information is further ensured to be subnet information of the target virtual private cloud, and an accurate target subnet is constructed in the target virtual private cloud based on the target IP information, so that the subnet construction accuracy of the virtual private cloud is improved; and under the condition that the number of the network number bits of the first IP address is smaller than that of the second IP address or the first IP address is not the subnet address of the target virtual private cloud, determining that the first IP information is not the subnet information of the target virtual private cloud, further determining that the verification result is a verification failure result, further ensuring that the target IP information determined later is the subnet information of the target virtual private cloud, and constructing an accurate target subnet in the target virtual private cloud based on the target IP information, thereby improving the subnet construction accuracy of the virtual private cloud.
Based on any one of the above embodiments, in the method, when the number of network number bits of the first IP address is greater than or equal to the number of network number bits of the second IP address, and the first IP address is a subnet address of the target virtual private cloud, determining that the verification result is a verification success result includes:
determining a constructed subnet set of the target virtual private cloud and an IP address set of the constructed subnet set under the condition that the number of the network number bits of the first IP address is greater than or equal to the number of the network number bits of the second IP address and the first IP address is the subnet address of the target virtual private cloud;
determining that the first IP address does not exist in the IP address set, determining that the verification result is a first verification success result, wherein the first verification success result represents that the first IP information is successfully verified, and the first IP information is effective IP information;
determining that the first IP address exists in the IP address set, determining that the verification result is a second verification success result, wherein the second verification success result represents that the first IP information is successfully verified, and the first IP information is invalid IP information.
Here, the set of constructed subnets includes constructed subnets of the target virtual private cloud, and the number of constructed subnets of the set of constructed subnets may be 0, 1, or more. The constructed subnet is a subnet that has been constructed in the target virtual private cloud prior to the current time.
Here, the IP address set includes IP addresses of the constructed subnets in the target virtual private cloud, and the number of IP addresses of the IP address set may be 0, 1 or more, that is, how many subnets have been constructed, and how many IP addresses of the IP address set have been constructed, where one constructed subnet corresponds to one IP address. The IP address in the IP address set is the IP address of the subnet already constructed in the target virtual private cloud before the current time, i.e. the subnet IP address already planned before the current time.
Here, the first verification success result represents that the first IP information is successfully verified, namely, the first IP information is characterized as subnet information of the target virtual private cloud; and the first IP information is effective, namely, the subnet corresponding to the first IP address is not constructed in the target virtual private cloud before the current moment.
Here, the second verification success result represents that the first IP information is successfully verified, namely, the first IP information is characterized as subnet information of the target virtual private cloud; and the method characterizes that the first IP information is invalid, namely characterizes that a subnet corresponding to the first IP address is constructed in the target virtual private cloud before the current moment.
In the subnet construction method of the virtual private cloud provided by the embodiment of the invention, under the condition that the number of network number bits of the first IP address is greater than or equal to the number of network number bits of the second IP address and the first IP address is the subnet address of the target virtual private cloud, determining that the first IP information is the subnet information of the target virtual private cloud, further determining whether the subnet corresponding to the first IP address is constructed in the target virtual private cloud based on the first IP information, if the subnet corresponding to the first IP address is constructed in the target virtual private cloud, determining that the verification result is a first verification success result, further ensuring that the target IP information which is determined later is the subnet information of the target virtual private cloud, and ensuring that the subnet corresponding to the target IP address is not constructed in the target virtual private cloud, so as to construct an accurate target subnet in the target virtual private cloud based on the target IP information, thereby further improving the accuracy of the subnet construction of the virtual private cloud; if the subnet corresponding to the first IP address is not constructed in the target virtual private cloud, determining that the verification result is a second verification success result, further ensuring that the target IP information determined later is subnet information of the target virtual private cloud, and ensuring that the subnet corresponding to the target IP address is not constructed in the target virtual private cloud, so that an accurate target subnet is constructed in the target virtual private cloud based on the target IP information, and further improving the subnet construction accuracy of the virtual private cloud. In summary, the embodiment of the invention not only verifies whether the first IP information is the subnet information of the target virtual private cloud, namely, performs intra-network verification, but also verifies whether the subnet corresponding to the first IP address is constructed in the target virtual private cloud, namely, performs coincidence verification, thereby further improving the accuracy of the subnet construction of the virtual private cloud.
Based on any of the above embodiments, fig. 3 is a third flowchart of a method for constructing a subnet of a vpn cloud according to the present invention, as shown in fig. 3, the step 130 includes:
and step 131, determining the first IP information as target IP information when the verification result is the first verification success result.
Specifically, when the first IP information is subnet information of the target virtual private cloud and a subnet corresponding to the first IP address is not configured in the target virtual private cloud, the first IP information is determined as target IP information, that is, the first IP address is determined as the target IP address, and the first network number bit information is determined as target network number bit information.
And step 132, updating the first IP address based on the IP address set and the second network number bit information to obtain the target IP address, and determining the first network number information as the target network number bit information when the verification result is the second verification success result.
Specifically, when the first IP information is subnet information of the target virtual private cloud and a subnet corresponding to the first IP address is built in the target virtual private cloud, the network number of the first IP address is not updated when the first IP address is updated, that is, the network number of the first IP address is not modified, based on the second network number bit information; based on the IP address set, updating the first IP address to obtain a target IP address, ensuring that the target IP address does not exist in the IP address set, further ensuring that the target IP information is subnet information of a target virtual private cloud, and ensuring that a subnet corresponding to the target IP address is not constructed in the target virtual private cloud so as to construct an accurate target subnet in the target virtual private cloud based on the target IP information, thereby further improving the subnet construction accuracy of the virtual private cloud.
In one embodiment, the first IP address is updated in such a way that the target IP address is as close as possible to the first IP address.
And step 133, updating the first IP information to obtain target IP information based on the second IP information and the IP address set if the verification result is the verification failure result.
Specifically, under the condition that the number of network number bits of the first IP address is smaller than that of the second IP address or the first IP address is not the subnet address of the target virtual private cloud, based on the second IP address of the second IP information and the second network number bit information, ensuring that the first N bits of the target IP address in the target IP information are identical to the network number of the second IP address, wherein N is the number of network number bits represented by the second network number bit information; based on the IP address set, ensuring that a subnet corresponding to the target IP address is not constructed in the target virtual private cloud.
More specifically, under the condition that the number of network number bits of the first IP address is smaller than that of the second IP address, updating the first network number bit information in the first IP information based on the second network number bit information of the second IP information so as to ensure that the number of network number bits of the target IP address is greater than or equal to that of the second IP address, further ensuring that the target IP information is the subnet information of the target virtual private cloud, and constructing an accurate target subnet in the target virtual private cloud based on the target IP information, thereby further improving the subnet construction accuracy of the virtual private cloud; at this time, the first IP address is determined as the target IP address. Under the condition that the first IP address is not the subnet address of the target virtual private cloud, updating the first IP information based on the second IP address and the second network number information of the second IP information, ensuring that the front N bits of the target IP address in the target IP information are identical to the network number of the second IP address, N is the network number represented by the second network number information, ensuring that the subnet corresponding to the target IP address is not constructed in the target virtual private cloud based on the IP address set, further ensuring that the target IP information is the subnet information of the target virtual private cloud, and ensuring that the subnet corresponding to the target IP address is not constructed in the target virtual private cloud, so that an accurate target subnet is constructed in the target virtual private cloud based on the target IP information, and further improving the subnet construction accuracy of the virtual private cloud.
In one embodiment, the first IP information is updated in such a way that the target IP information is as close as possible to the first IP information.
In the subnet construction method of the virtual private cloud provided by the embodiment of the invention, when the number of network number bits of the first IP address is greater than or equal to the number of network number bits of the second IP address, and the first IP address is the subnet address of the target virtual private cloud, and the subnet corresponding to the first IP address is not constructed in the target virtual private cloud, the first IP information is determined as the target IP information, so that the target IP information is ensured to be the subnet information of the target virtual private cloud, and the subnet corresponding to the target IP address is ensured not to be constructed in the target virtual private cloud, so that an accurate target subnet is constructed in the target virtual private cloud based on the target IP information, thereby further improving the subnet construction accuracy of the virtual private cloud; under the condition that the number of the network number bits of the first IP address is greater than or equal to the number of the network number bits of the second IP address, the first IP address is the subnet address of the target virtual private cloud, and the subnet corresponding to the first IP address is built in the target virtual private cloud, updating the first IP address based on the IP address set and the number of the second network number bits to obtain the target IP address, determining the first network number information as the number of the target network number bits information, further ensuring that the target IP information is the subnet information of the target virtual private cloud, and ensuring that the subnet corresponding to the target IP address is not built in the target virtual private cloud, so that an accurate target subnet is built in the target virtual private cloud based on the target IP information, and further improving the subnet building accuracy of the virtual private cloud; and under the condition that the number of network number bits of the first IP address is smaller than that of the second IP address or the first IP address is not the subnet address of the target virtual private cloud, updating the first IP information based on the second IP information and the IP address set to obtain target IP information, further ensuring that the target IP information is the subnet information of the target virtual private cloud, and ensuring that a subnet corresponding to the target IP address is not constructed in the target virtual private cloud, so that an accurate target subnet is constructed in the target virtual private cloud based on the target IP information, and further improving the subnet construction accuracy of the virtual private cloud.
Based on any of the above embodiments, after the step 130, the method further includes:
displaying the target IP information and acquiring a confirmation instruction about the target IP information;
determining that the confirmation instruction indicates that the target IP information is confirmed to pass, and constructing a target subnet in the target virtual private cloud based on the target IP information;
and determining that the confirmation instruction indicates that the target IP information does not pass through confirmation, updating the target IP information based on the IP address set and the second network number bit information to obtain updated IP information, determining the updated IP information as the target IP information, and returning to the step of displaying the target IP information.
It should be noted that, the target IP information is displayed for being viewed by the user, so that the user confirms the target IP information, and thus a confirmation instruction about the target IP information is generated, so that the execution subject of the embodiment of the present invention obtains the confirmation instruction.
Here, the confirmation instruction indicates whether the target IP information confirms passing.
Specifically, based on the second network number bit information, ensuring that the network number bit of the target IP address is greater than or equal to the network number bit of the second IP address when the target network number bit information is updated; based on the second network number digit information, ensuring that the first N digits of the target IP address are not updated when the target IP address is updated, namely the first N digits of the target IP address are not modified, wherein N is the network number digit represented by the second network number digit information; based on the IP address set, it is ensured that no updated target IP address exists in the IP address set. In summary, the finally updated target IP information is ensured to be the subnet information of the target virtual private cloud, and the subnet corresponding to the target IP address is ensured not to be constructed in the target virtual private cloud, so that an accurate target subnet is constructed in the target virtual private cloud based on the target IP information, thereby further improving the subnet construction accuracy of the virtual private cloud.
If the confirmation instruction indicates that the target IP information does not pass through, and the step of displaying the target IP information is returned, the updated target IP information is continuously displayed until the confirmation instruction of the final updated target IP information indicates that the target IP information passes through.
According to the subnet construction method of the virtual private cloud, provided by the embodiment of the invention, the target IP information is displayed, and the confirmation instruction about the target IP information is obtained, so that a user can confirm the target IP information, and the target IP information is prevented from being not the IP information required by the user when the target IP information is different from the first IP information, thereby improving the experience of the user; meanwhile, under the condition that the confirmation instruction indicates that the target IP information does not pass through confirmation, updating the target IP information based on the IP address set and the second network number bit information to obtain updated IP information, determining the updated IP information as target IP information, and returning to the step of displaying the target IP information, so as to finally construct a target subnet in the target virtual private cloud based on the target IP information confirmed by the user, thereby ensuring that the target subnet required by the user is constructed, further improving the subnet construction accuracy of the virtual private cloud, and improving the user experience.
Based on any one of the above embodiments, the method further includes the step 122 of:
determining a first to-be-compared number of the first IP address and a second to-be-compared number of the second IP address based on the second network number bit information;
and comparing the first number to be compared with the second number to be compared to obtain the IP address comparison result.
In one embodiment, the second network number bit information is a prefix of the CIDR address block. For example, the second IP information is a CIDR address block, where the CIDR address block is 10.0.0.0/8, the second IP address is 10.0.0.0, the prefix of the CIDR address block is 8, if the first IP address is 10.10.0.0, the first to-be-compared number is 10 (binary 00001010), the second to-be-compared number is 10 (binary 00001010), and at this time, the IP address comparison result is that the first IP address is the subnet address of the target virtual private cloud; if the first IP address is 11.10.0.0, the first to-be-compared number is 11 (binary 00001011), and the second to-be-compared number is 10 (binary 00001010), where the IP address comparison result is that the first IP address is not the subnet address of the target vpn cloud.
In another embodiment, the second network number bit number information is a subnet mask. For example, the second IP address is 10.0.0.0, the subnet mask is 255.0.0.0, if the first IP address is 10.10.0.0, the first to-be-compared number is 10 (binary 00001010), and the second to-be-compared number is 10 (binary 00001010), at this time, the IP address comparison result is that the first IP address is the subnet address of the target virtual private cloud; if the first IP address is 11.10.0.0, the first to-be-compared number is 11 (binary 00001011), and the second to-be-compared number is 10 (binary 00001010), where the IP address comparison result is that the first IP address is not the subnet address of the target vpn cloud.
The subnet construction method of the virtual private cloud provided by the embodiment of the invention determines a first to-be-compared number of a first IP address and a second to-be-compared number of a second IP address based on the second network number bit information; and comparing the first to-be-compared number with the second to-be-compared number to obtain an IP address comparison result, and providing support for determining the IP address comparison result.
In the actual application process, a user only needs to input the first IP information in the front-end graphical interface, does not need to interact with the back-end service, does not need to use a third-party tool, and the front-end can verify the first IP information and create a subnet corresponding to the target IP information by itself, so that the subnet construction is performed on the target virtual private cloud scientifically, concisely, efficiently and accurately.
The subnet construction device of the virtual private cloud provided by the invention is described below, and the subnet construction device of the virtual private cloud described below and the subnet construction method of the virtual private cloud described above can be referred to correspondingly.
Fig. 4 is a schematic structural diagram of a subnet construction device of a virtual private cloud according to the present invention, as shown in fig. 4, where the subnet construction device of the virtual private cloud includes:
an obtaining module 410, configured to obtain first IP information corresponding to a subnet to be constructed, where the first IP information includes a first IP address and first network number bit information of the first IP address, and the first network number bit information includes a prefix or a subnet mask of a non-category inter-domain routing CIDR address block;
The verification module 420 is configured to verify the first IP information based on second IP information of the target virtual private cloud to obtain a verification result, where the second IP information includes a second IP address and second network number bit information of the second IP address, and the second network number bit information includes a prefix or a subnet mask of the CIDR address block;
a determining module 430, configured to determine, based on the verification result, target IP information, for constructing a target subnet in the target virtual private cloud based on the target IP information, where the target IP information includes a target IP address of the target subnet and target network number bit information of the target IP address, and the target network number bit information includes a prefix or a subnet mask of a CIDR address block.
According to the subnet construction device of the virtual private cloud, provided by the embodiment of the invention, based on the second IP information of the target virtual private cloud, the first IP information corresponding to the subnet to be constructed is verified to obtain the verification result, so that the accurate target IP information is determined based on the verification result, and the accurate target subnet is constructed in the target virtual private cloud based on the target IP information, thereby improving the subnet construction accuracy of the virtual private cloud.
Based on any of the above embodiments, the verification module 420 includes:
a first result determining unit configured to determine a network number bit number comparison result of the first IP address and the second IP address based on the first network number bit number information and the second network number bit number information;
a second result determining unit, configured to determine an IP address comparison result of the first IP address and the second IP address based on the second network number bit information, the first IP address, and the second IP address, where the IP address comparison result is used to characterize whether the first IP address is a subnet address of the target virtual private cloud;
and a third result determining unit configured to determine the verification result based on the network number bit number comparison result and the IP address comparison result.
Based on any of the above embodiments, the third result determining unit is further configured to:
determining that the verification result is a verification success result when the number of the network number bits of the first IP address is greater than or equal to the number of the network number bits of the second IP address and the first IP address is the subnet address of the target virtual private cloud;
and under the condition that the number of the network numbers of the first IP address is smaller than that of the second IP address or the first IP address is not the subnet address of the target virtual private cloud, determining that the verification result is a verification failure result.
Based on any of the above embodiments, the third result determining unit is further configured to:
determining a constructed subnet set of the target virtual private cloud and an IP address set of the constructed subnet set under the condition that the number of the network number bits of the first IP address is greater than or equal to the number of the network number bits of the second IP address and the first IP address is the subnet address of the target virtual private cloud;
determining that the first IP address does not exist in the IP address set, determining that the verification result is a first verification success result, wherein the first verification success result represents that the first IP information is successfully verified, and the first IP information is effective IP information;
determining that the first IP address exists in the IP address set, determining that the verification result is a second verification success result, wherein the second verification success result represents that the first IP information is successfully verified, and the first IP information is invalid IP information.
Based on any of the above embodiments, the determining module 430 includes:
an information determining unit configured to determine the first IP information as target IP information, in a case where the verification result is the first verification success result;
an address updating unit, configured to update the first IP address based on the IP address set and the second network number bit information to obtain the target IP address, and determine the first network number information as the target network number bit information when the verification result is the second verification success result;
And the information updating unit is used for updating the first IP information based on the second IP information and the IP address set to obtain target IP information under the condition that the verification result is the verification failure result.
Based on any of the above embodiments, the apparatus further comprises:
the information display module is used for displaying the target IP information and acquiring a confirmation instruction about the target IP information;
the subnet construction module is used for determining that the confirmation instruction indicates that the target IP information is confirmed to pass, and constructing a target subnet in the target virtual private cloud based on the target IP information;
and the IP updating module is used for determining that the confirmation instruction indicates that the target IP information does not pass through, updating the target IP information based on the IP address set and the second network number bit information to obtain updated IP information, determining the updated IP information as the target IP information, and returning to the step of displaying the target IP information.
Based on any of the above embodiments, the second result determining unit is further configured to:
determining a first to-be-compared number of the first IP address and a second to-be-compared number of the second IP address based on the second network number bit information;
And comparing the first number to be compared with the second number to be compared to obtain the IP address comparison result.
Fig. 5 illustrates a physical schematic diagram of an electronic device, as shown in fig. 5, which may include: processor 510, communication interface (Communications Interface) 520, memory 530, and communication bus 540, wherein processor 510, communication interface 520, memory 530 complete communication with each other through communication bus 540. Processor 510 may invoke logic instructions in memory 530 to perform a subnet building method for a virtual private cloud, the method comprising: acquiring first IP information corresponding to a subnet to be constructed, wherein the first IP information comprises a first IP address and first network number bit information of the first IP address, and the first network number bit information comprises a prefix or a subnet mask of a non-category inter-domain routing CIDR address block; based on second IP information of a target virtual private cloud, verifying the first IP information to obtain a verification result, wherein the second IP information comprises a second IP address and second network number bit information of the second IP address, and the second network number bit information comprises a prefix or a subnet mask of a CIDR address block; and determining target IP information based on the verification result so as to construct a target subnet in the target virtual private cloud based on the target IP information, wherein the target IP information comprises a target IP address of the target subnet and target network number bit information of the target IP address, and the target network number bit information comprises a prefix or a subnet mask of a CIDR address block.
Further, the logic instructions in the memory 530 described above may be implemented in the form of software functional units and may be stored in a computer-readable storage medium when sold or used as a stand-alone product. Based on this understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a server, a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
In another aspect, the present invention also provides a computer program product, where the computer program product includes a computer program, where the computer program can be stored on a non-transitory computer readable storage medium, and when the computer program is executed by a processor, the computer can execute a method for constructing a subnet of a virtual private cloud provided by the above methods, and the method includes: acquiring first IP information corresponding to a subnet to be constructed, wherein the first IP information comprises a first IP address and first network number bit information of the first IP address, and the first network number bit information comprises a prefix or a subnet mask of a non-category inter-domain routing CIDR address block; based on second IP information of a target virtual private cloud, verifying the first IP information to obtain a verification result, wherein the second IP information comprises a second IP address and second network number bit information of the second IP address, and the second network number bit information comprises a prefix or a subnet mask of a CIDR address block; and determining target IP information based on the verification result so as to construct a target subnet in the target virtual private cloud based on the target IP information, wherein the target IP information comprises a target IP address of the target subnet and target network number bit information of the target IP address, and the target network number bit information comprises a prefix or a subnet mask of a CIDR address block.
In still another aspect, the present invention further provides a non-transitory computer readable storage medium having stored thereon a computer program, which when executed by a processor, is implemented to perform a method for constructing a subnet of a virtual private cloud provided by the above methods, the method comprising: acquiring first IP information corresponding to a subnet to be constructed, wherein the first IP information comprises a first IP address and first network number bit information of the first IP address, and the first network number bit information comprises a prefix or a subnet mask of a non-category inter-domain routing CIDR address block; based on second IP information of a target virtual private cloud, verifying the first IP information to obtain a verification result, wherein the second IP information comprises a second IP address and second network number bit information of the second IP address, and the second network number bit information comprises a prefix or a subnet mask of a CIDR address block; and determining target IP information based on the verification result so as to construct a target subnet in the target virtual private cloud based on the target IP information, wherein the target IP information comprises a target IP address of the target subnet and target network number bit information of the target IP address, and the target network number bit information comprises a prefix or a subnet mask of a CIDR address block.
The apparatus embodiments described above are merely illustrative, wherein the elements illustrated as separate elements may or may not be physically separate, and the elements shown as elements may or may not be physical elements, may be located in one place, or may be distributed over a plurality of network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art will understand and implement the present invention without undue burden.
From the above description of the embodiments, it will be apparent to those skilled in the art that the embodiments may be implemented by means of software plus necessary general hardware platforms, or of course may be implemented by means of hardware. Based on this understanding, the foregoing technical solution may be embodied essentially or in a part contributing to the prior art in the form of a software product, which may be stored in a computer readable storage medium, such as ROM/RAM, a magnetic disk, an optical disk, etc., including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method described in the respective embodiments or some parts of the embodiments.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present invention, and are not limiting; although the invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims (10)

1. The method for constructing the subnet of the virtual private cloud is characterized by comprising the following steps of:
acquiring first IP information corresponding to a subnet to be constructed, wherein the first IP information comprises a first IP address and first network number bit information of the first IP address, and the first network number bit information comprises a prefix or a subnet mask of a non-category inter-domain routing CIDR address block;
based on second IP information of a target virtual private cloud, verifying the first IP information to obtain a verification result, wherein the second IP information comprises a second IP address and second network number bit information of the second IP address, and the second network number bit information comprises a prefix or a subnet mask of a CIDR address block;
And determining target IP information based on the verification result so as to construct a target subnet in the target virtual private cloud based on the target IP information, wherein the target IP information comprises a target IP address of the target subnet and target network number bit information of the target IP address, and the target network number bit information comprises a prefix or a subnet mask of a CIDR address block.
2. The subnet construction method of the virtual private cloud according to claim 1, wherein the verifying the first IP information based on the second IP information of the target virtual private cloud to obtain a verification result includes:
determining a network number bit number comparison result of the first IP address and the second IP address based on the first network number bit number information and the second network number bit number information;
determining an IP address comparison result of the first IP address and the second IP address based on the second network number bit information, the first IP address and the second IP address, where the IP address comparison result is used to characterize whether the first IP address is a subnet address of the target virtual private cloud;
and determining the verification result based on the network number bit comparison result and the IP address comparison result.
3. The subnet construction method of the virtual private cloud according to claim 2, wherein the determining the verification result based on the network number bit comparison result and the IP address comparison result comprises:
determining that the verification result is a verification success result when the number of the network number bits of the first IP address is greater than or equal to the number of the network number bits of the second IP address and the first IP address is the subnet address of the target virtual private cloud;
and under the condition that the number of the network numbers of the first IP address is smaller than that of the second IP address or the first IP address is not the subnet address of the target virtual private cloud, determining that the verification result is a verification failure result.
4. The method for constructing a subnet of a virtual private cloud according to claim 3, wherein, when the number of network number bits of the first IP address is greater than or equal to the number of network number bits of the second IP address and the first IP address is the subnet address of the target virtual private cloud, determining that the verification result is a verification success result comprises:
determining a constructed subnet set of the target virtual private cloud and an IP address set of the constructed subnet set under the condition that the number of the network number bits of the first IP address is greater than or equal to the number of the network number bits of the second IP address and the first IP address is the subnet address of the target virtual private cloud;
Determining that the first IP address does not exist in the IP address set, determining that the verification result is a first verification success result, wherein the first verification success result represents that the first IP information is successfully verified, and the first IP information is effective IP information;
determining that the first IP address exists in the IP address set, determining that the verification result is a second verification success result, wherein the second verification success result represents that the first IP information is successfully verified, and the first IP information is invalid IP information.
5. The subnet construction method of the virtual private cloud according to claim 4, wherein the determining the target IP information based on the verification result comprises:
under the condition that the verification result is the first verification success result, determining the first IP information as target IP information;
updating the first IP address based on the IP address set and the second network number bit information to obtain the target IP address and determining the first network number information as the target network number bit information under the condition that the verification result is the second verification success result;
and under the condition that the verification result is the verification failure result, updating the first IP information based on the second IP information and the IP address set to obtain target IP information.
6. The method for constructing a subnet of a virtual private cloud according to claim 4, wherein determining the target IP information based on the verification result further comprises:
displaying the target IP information and acquiring a confirmation instruction about the target IP information;
determining that the confirmation instruction indicates that the target IP information is confirmed to pass, and constructing a target subnet in the target virtual private cloud based on the target IP information;
and determining that the confirmation instruction indicates that the target IP information does not pass through confirmation, updating the target IP information based on the IP address set and the second network number bit information to obtain updated IP information, determining the updated IP information as the target IP information, and returning to the step of displaying the target IP information.
7. The method for constructing a subnet of a virtual private cloud according to claim 2, wherein determining the IP address comparison result of the first IP address and the second IP address based on the second network number bit information, the first IP address and the second IP address comprises:
determining a first to-be-compared number of the first IP address and a second to-be-compared number of the second IP address based on the second network number bit information;
And comparing the first number to be compared with the second number to be compared to obtain the IP address comparison result.
8. A subnet construction device of a virtual private cloud, comprising:
the acquisition module is used for acquiring first IP information corresponding to the subnet to be constructed, wherein the first IP information comprises a first IP address and first network number bit information of the first IP address, and the first network number bit information comprises a prefix or a subnet mask of a non-category inter-domain routing CIDR address block;
the verification module is used for verifying the first IP information based on second IP information of the target virtual private cloud to obtain a verification result, wherein the second IP information comprises a second IP address and second network number bit information of the second IP address, and the second network number bit information comprises a prefix or a subnet mask of a CIDR address block;
and the determining module is used for determining target IP information based on the verification result so as to construct a target subnet in the target virtual private cloud based on the target IP information, wherein the target IP information comprises a target IP address of the target subnet and target network number bit information of the target IP address, and the target network number bit information comprises a prefix or a subnet mask of a CIDR address block.
9. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the method of subnet construction of a virtual private cloud according to any one of claims 1 to 7 when the program is executed by the processor.
10. A non-transitory computer readable storage medium having stored thereon a computer program, wherein the computer program when executed by a processor implements the method of subnet construction of a virtual private cloud according to any one of claims 1 to 7.
CN202310080022.2A 2023-01-29 2023-01-29 Subnet construction method and device of virtual private cloud, electronic equipment and storage medium Pending CN116233068A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310080022.2A CN116233068A (en) 2023-01-29 2023-01-29 Subnet construction method and device of virtual private cloud, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310080022.2A CN116233068A (en) 2023-01-29 2023-01-29 Subnet construction method and device of virtual private cloud, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN116233068A true CN116233068A (en) 2023-06-06

Family

ID=86576185

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310080022.2A Pending CN116233068A (en) 2023-01-29 2023-01-29 Subnet construction method and device of virtual private cloud, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116233068A (en)

Similar Documents

Publication Publication Date Title
US11258667B2 (en) Network management method and related device
CN106464529B (en) Method and apparatus for isolating a portion of an online computing service
US11863447B2 (en) Route processing method and network device
CN113259394B (en) Cross-domain user authentication method, system and equipment based on routing computation
US20180217852A1 (en) System service reloading method and apparatus
US10831630B2 (en) Fault analysis method and apparatus based on data center
CN111817869A (en) Network configuration recovery method and related equipment thereof
CN112445865B (en) Method and device for automatically deploying block chain network and cloud computing platform
CN114143283A (en) Tunnel self-adaptive configuration method and device, center-end equipment and communication system
CN113612864B (en) Method, system, equipment and medium for generating IPv6 address
CN114365461B (en) System and method for providing traffic generation on a network device
CN110620706A (en) Processing method and equipment
CN110311828B (en) Network verification method and device, computer storage medium and electronic equipment
CN116233068A (en) Subnet construction method and device of virtual private cloud, electronic equipment and storage medium
CN110572321A (en) Data transmission method and device, storage medium and electronic equipment
CN109560954B (en) Equipment configuration method and device
CN113608932A (en) Database drilling method, device, equipment and storage medium
CN110995502B (en) Network configuration management method, device, switching equipment and readable storage medium
CN110661655B (en) Cluster deployment method and system, electronic device and storage medium
US11411819B2 (en) Automatic network configuration in data protection operations
CN113918326A (en) Request processing method and device
CN107317880B (en) Method and device for realizing load balance
US20220353093A1 (en) Systems and methods for assigning a cryptographic identity to node-based systems
CN112003731B (en) Configuration method and device
CN112312304B (en) Position privacy protection method and device in positioning process based on wireless access point

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination