Subnet allocation method, device, equipment and storage medium

By determining the network segment to be allocated, subnet allocation units and demand sizes, and using the subnet allocation module for IP subnet allocation, the problems of waste and low utilization of IP subnet allocation are solved, and flexible allocation and efficient utilization of large IP network segments are realized.

CN118233430BActive Publication Date: 2025-08-12GUANGZHOU DULING TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202410349464.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-03-25
Publication Date
2025-08-12
Estimated Expiration
2044-03-25

AI Technical Summary

Technical Problem

In the prior art, IP subnet allocation has problems such as waste and low utilization, especially in large IP network segments, it is difficult to flexibly allocate subnets of various sizes.

Method used

By determining the requirements of the network segment to be allocated, subnet allocation units and demand subnets, the subnet allocation module is used for allocation, the subnet allocation unit and allocation state management are introduced, and the subnet allocation process is optimized.

Benefits of technology

It improves the allocation efficiency and utilization rate of IP subnets, and realizes flexible allocation and reduction of large IP network segments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118233430B_ABST
    Figure CN118233430B_ABST
Patent Text Reader

Abstract

The present disclosure provides a subnet allocation method, apparatus, device, and storage medium, relating to the fields of computer technology, particularly virtual networks and cloud data processing technology, and can be used in cloud computing and cloud services. A specific implementation scheme comprises: determining a network segment to be allocated, a subnet allocation unit for the network segment to be allocated, and the required size of a desired subnet; and allocating the network segment to be allocated based on the subnet allocation unit and the required size to obtain a target subnet corresponding to the desired subnet. This technical solution improves subnet allocation efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, in particular to the field of virtual networks and cloud data processing technology, and can be used for cloud computing and cloud services. Background Art

[0002] In virtual networking, it's often necessary to allocate IP subnets of varying sizes within a large Internet Protocol (IP) network segment. Traditional allocation schemes typically rely on manual allocation of specific subnet sizes based on business needs, which can lead to wasted IP segments. Furthermore, allocated IP subnets are often fragmented, making it difficult to scale down large IP segments, resulting in low IP utilization. Therefore, an efficient IP subnet allocation method is urgently needed. Summary of the Invention

[0003] The present disclosure provides a subnet allocation method, apparatus, device and storage medium.

[0004] According to one aspect of the present disclosure, a subnet allocation method is provided, the method comprising:

[0005] Determining a network segment to be allocated, a subnet allocation unit of the network segment to be allocated, and a required size of a required subnet;

[0006] The network segment to be allocated is allocated according to the subnet allocation unit and the demand size to obtain a target subnet corresponding to the demand subnet.

[0007] According to another aspect of the present disclosure, a subnet allocation device is provided, the device comprising:

[0008] An information determination module, configured to determine a network segment to be allocated, a subnet allocation unit of the network segment to be allocated, and a required size of a required subnet;

[0009] The subnet allocation module is used to allocate the network segment to be allocated according to the subnet allocation unit and the demand size, and obtain a target subnet corresponding to the demand subnet.

[0010] According to another aspect of the present disclosure, an electronic device is provided, the electronic device comprising:

[0011] at least one processor; and

[0012] a memory communicatively connected to the at least one processor; wherein,

[0013] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the subnet allocation method described in any embodiment of the present disclosure.

[0014] According to another aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable a computer to execute the subnet allocation method described in any embodiment of the present disclosure.

[0015] According to another aspect of the present disclosure, a computer program product is provided, including a computer program, which implements the subnet allocation method described in any embodiment of the present disclosure when executed by a processor.

[0016] According to the technology disclosed in the present invention, the allocation efficiency of subnets can be improved.

[0017] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present disclosure, nor are they intended to limit the scope of the present disclosure. Other features of the present disclosure will become readily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] The accompanying drawings are provided to facilitate a better understanding of the present invention and do not constitute a limitation of the present disclosure.

[0019] Figure 1 is a flow chart of a subnet allocation method provided according to an embodiment of the present disclosure;

[0020] Figure 2 is a flow chart of another subnet allocation method provided according to an embodiment of the present disclosure;

[0021] Figure 3 is a flowchart of another subnet allocation method provided according to an embodiment of the present disclosure;

[0022] Figure 4 is a structural diagram of a subnet allocation device provided according to an embodiment of the present disclosure;

[0023] Figure 5 It is a block diagram of an electronic device used to implement the subnet allocation method according to an embodiment of the present disclosure. DETAILED DESCRIPTION

[0024] The following description of exemplary embodiments of the present disclosure is made in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding. These details should be considered as merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.

[0025] It should be noted that the terms "first," "second," "target," and the like in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or precedence. It should be understood that the numbers used in this way are interchangeable where appropriate so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having," as well as any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or apparatus comprising a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units that are not explicitly listed or that are inherent to these processes, methods, products, or apparatus.

[0026] In addition, it should be noted that in the technical solution of the present invention, the collection, storage, use, processing, transmission, provision and disclosure of relevant data such as subnets and network segments involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0027] Figure 1 This is a flow chart of a subnet allocation method provided according to an embodiment of the present disclosure. This method is applicable to the situation of how to flexibly allocate subnets to a large network segment, and is particularly applicable to the situation of allocating IP subnets of various sizes in a large IP network segment. This method can be executed by a subnet allocation device, which can be implemented in software and / or hardware and can be integrated into an electronic device that carries the subnet allocation function, such as a server. Figure 1 As shown, the subnet allocation method of this embodiment may include:

[0028] S101, determining a network segment to be allocated, a subnet allocation unit of the network segment to be allocated, and a required size of a required subnet.

[0029] In this embodiment, the network segment to be allocated refers to the network segment used for subnet allocation, for example, it can be a large IP network segment; optionally, the network segment to be allocated includes at least one subnet allocation unit. The subnet allocation unit refers to the smallest subnet allowed to be allocated in the network segment to be allocated. The so-called required subnet refers to the subnet that needs to be allocated. The so-called required size refers to the subnet size of the required subnet. It should be noted that the required size is greater than the network segment size of the network segment to be allocated; the network segment size refers to the subnet size of the network segment to be allocated. For example, if the network segment to be allocated is 10.0.0.0 / 8, that is, the network segment size is 8, and the binary representation of IP is 32 bits, then 2^24 IP addresses can be allocated in the network segment to be allocated, that is, there is 24 bits of available space for subnet allocation.

[0030] It should be noted that the subnet size is expressed in the number of bits in the subnet's IP network number. For example, the subnet size of IP subnet 10.1.2.0 / 24 is 24, and the subnet size of IP subnet 10.1.0.0 / 16 is 16.

[0031] Specifically, an IP network segment can be selected based on service requirements as the network segment to be allocated. Furthermore, a subnet allocation unit within the network segment to be allocated can be determined based on the network segment to be allocated and / or service requirements. Furthermore, the required size of the requested subnet in the subnet allocation request is obtained. A subnet allocation request is a request for initiating subnet allocation.

[0032] S102: Allocate the network segments to be allocated according to the subnet allocation unit and the required size to obtain a target subnet corresponding to the required subnet.

[0033] In this embodiment, the target subnet refers to the IP subnet allocated to the demand subnet from the to-be-allocated network segment. It should be noted that the subnet size of the target subnet may be larger than the required size of the demand subnet, or may be smaller than the required size of the demand subnet.

[0034] In an optional manner, based on the demand size of the demand subnet, an appropriate number of subnet allocation units are determined from the network segment to be allocated, and these subnet allocation units are used as target subnets corresponding to the demand subnet.

[0035] The technical solution provided by the disclosed embodiments determines the network segment to be allocated, the subnet allocation unit for the segment, and the required size of the desired subnet. Then, based on the subnet allocation unit and the required size, the segment to be allocated is allocated to obtain the target subnet corresponding to the required subnet. This technical solution, by introducing the subnet allocation unit for subnet allocation, can rationally allocate IP subnets of different sizes, thereby improving IP utilization within the IP pool.

[0036] Figure 2 This is a flow chart of another subnet allocation method provided according to an embodiment of the present disclosure. Based on the above embodiment, this embodiment further optimizes "allocating the to-be-allocated network segments according to the subnet allocation unit and the demand size to obtain the target subnet corresponding to the demand subnet" and provides an optional implementation scheme. Figure 2 As shown, the subnet allocation method of this embodiment may include:

[0037] S201, determining a network segment to be allocated, a subnet allocation unit of the network segment to be allocated, and a required size of a required subnet.

[0038] S202: Determine the required number of units of the subnet allocation unit according to the required size and the unit size of the subnet allocation unit.

[0039] In this embodiment, the required number of units refers to the number of subnet allocation units required by the demand subnet.

[0040] In an optional manner, the required size may be divided by the unit size of the subnet allocation unit, the obtained quotient may be rounded up, and the obtained result may be used as the required number of units of the subnet allocation unit.

[0041] S203 , allocating the network segments to be allocated according to the required number of units and the subnet allocation unit, and obtaining the target subnet corresponding to the required subnet.

[0042] In an optional manner, a required number of subnet allocation units is determined from the network segment to be allocated, and used as the target subnet corresponding to the required subnet.

[0043] The technical solution provided by the embodiments of the present disclosure determines the network segment to be allocated, the subnet allocation unit of the network segment to be allocated, and the required size of the required subnet. Then, based on the required size and the unit size of the subnet allocation unit, the required number of units of the subnet allocation unit is determined. Then, based on the required number of units and the subnet allocation unit, the network segment to be allocated is allocated to obtain the target subnet corresponding to the required subnet. The above technical solution allocates the network segment to be allocated based on the required number of units and the subnet allocation unit to obtain the target subnet, which can quickly and reasonably obtain the target subnet corresponding to the required subnet.

[0044] Based on the above embodiment, as an optional method of the present disclosure, the unit requirement quantity of the subnet allocation unit is determined according to the demand size and the unit size of the subnet allocation unit, including: if the demand size is greater than or equal to the unit size, then the unit requirement quantity of the subnet allocation unit is determined to be 1; if the demand size is less than the unit size, then the unit requirement quantity of the subnet allocation unit is determined according to the difference between the unit size and the demand size.

[0045] Specifically, the demand size and the unit size can be compared, and the required number of units for the subnet allocation unit can be determined based on the comparison result. For example, if the demand size is greater than or equal to the unit size, the required number of units for the subnet allocation unit is determined to be 1. If the demand size is less than the unit size, the difference between the unit size and the demand size is determined, and the difference is raised to the power of 2 as the required number of units for the subnet allocation unit.

[0046] It is understandable that determining the required number of units of the subnet allocation unit by comparing the unit size of the subnet allocation unit with the required size of the required subnet can improve the accuracy of determining the required number of units, thereby facilitating subsequent allocation of the to-be-allocated network segments.

[0047] On the basis of the above embodiments, as an optional method of the present disclosure, the network segment to be allocated is allocated according to the unit demand quantity and the subnet allocation unit to obtain the target subnet corresponding to the demand subnet, including: multiplying the unit demand quantity and the unit size of the subnet allocation unit to obtain the target size of the target subnet; determining the subnet of the target size from the network segment to be allocated as the target subnet corresponding to the demand subnet.

[0048] The target size refers to the subnet size of the target subnet.

[0049] Specifically, the unit requirement quantity can be multiplied by the unit size of the subnet allocation unit, and the product can be used as the target size of the target subnet. Then, starting from the low-order address in the network segment to be allocated, a subnet of the target size can be determined as the target subnet corresponding to the requirement subnet.

[0050] It is understandable that by determining the target subnet through the subnet allocation unit and the required number of units, a target subnet that meets the required subnet can be allocated without occupying too many other IP addresses in the network segment to be allocated.

[0051] Based on the above embodiment, a specific example is provided. If 10.0.0.0 / 8 (decimal) is selected as the network segment to be allocated, i.e., the large IP network segment, and the unit size of the subnet allocation unit of the network segment to be allocated is determined to be 24, then if a request is made to allocate an IP subnet with a required size of 24 (i.e., the demand subnet), 10.0.0.0 / 24 will be allocated; if a request is made to allocate an IP subnet with a required size of 22 (i.e., the demand subnet), 10.0.4.0 / 22 will be allocated; if a request is made to allocate an IP subnet with a required size of 26 (i.e., the demand subnet), 10.0.1.0 / 26 will be allocated.

[0052] Figure 3 This is a flow chart of another subnet allocation method provided according to an embodiment of the present disclosure. Based on the above embodiment, this embodiment further optimizes "allocating the to-be-allocated network segments according to the unit demand quantity and the subnet allocation unit to obtain the target subnet corresponding to the demand subnet" and provides an optional implementation scheme. Figure 3 As shown, the subnet allocation method of this embodiment may include:

[0053] S301, determining a network segment to be allocated, a subnet allocation unit of the network segment to be allocated, and a required size of a required subnet.

[0054] S302: Determine the required number of units of the subnet allocation unit according to the required size and the unit size of the subnet allocation unit.

[0055] S303: Determine the allocation status of the subnet allocation unit.

[0056] In this embodiment, the allocation status refers to whether the subnet allocation unit has been allocated. Optionally, the allocation status includes unallocated and allocated. It should be noted that a bitset can be used to record the allocation status of each subnet allocation unit in the network segment to be allocated.

[0057] Specifically, the allocation status of each subnet allocation unit in the to-be-allocated network segment may be determined from the bitset.

[0058] S304: Allocate the network segments to be allocated according to the required number of units, the subnet allocation unit, and the allocation status, and obtain the target subnet corresponding to the required subnet.

[0059] An optional method is to first determine that the allocation status of the subnet allocation units in the network segment to be allocated is unallocated subnet allocation units, then multiply the unit demand quantity by the unit size of these subnet allocation units, and use the product as the target size of the target subnet. Then, from the unallocated subnet allocation units in the network segment to be allocated, determine a subnet of the target size as the target subnet corresponding to the demand subnet.

[0060] The technical solution provided by the disclosed embodiments determines the network segment to be allocated, the subnet allocation unit for the network segment to be allocated, and the required size of the required subnet. Based on the required size and the unit size of the subnet allocation unit, the required number of units for the subnet allocation unit is determined, and the allocation status of the subnet allocation unit is determined. Based on the required number of units, the subnet allocation unit, and the allocation status, the network segment to be allocated is allocated to obtain the target subnet corresponding to the required subnet. This technical solution, which introduces the subnet allocation unit and its allocation status to perform subnet allocation, can quickly and accurately obtain the desired target subnet without the problem of duplicate subnet allocation.

[0061] On the basis of the above embodiments, as an optional method of the present disclosure, the network segment to be allocated is allocated according to the unit demand quantity, the subnet allocation unit and the allocation status to obtain the target subnet corresponding to the demand subnet, including: using the multiple of the unit demand quantity as the index, searching from the low-order side of the address of the network segment to be allocated, and determining the continuous unit demand quantity subnet allocation units with the allocation status of unallocated; and forming the target subnet corresponding to the demand subnet by the continuous unit demand quantity subnet allocation units.

[0062] Specifically, using the multiple of the required number of units as the index, start searching from the address position side of the network segment to be allocated, that is, search from the low position to the high position in the bitset, and find the required number of consecutive subnet allocation units with an allocation status of unallocated, that is, the required number of consecutive unallocated subnet allocation units, and group these consecutive subnet allocation units into the target subnet corresponding to the required subnet.

[0063] It can be understood that starting subnet allocation from the low-order side of the address in the to-be-allocated network segment can ensure that the allocated IP subnets are concentrated on the high-order side of the address in the to-be-allocated network segment, which is conducive to the future contraction of large network segments.

[0064] Based on the above embodiment, as an optional manner of the present disclosure, the method further includes: updating the allocation status of the subnet allocation unit corresponding to the target subnet to allocated.

[0065] Specifically, after the target subnet is allocated, the allocation status of the subnet allocation unit corresponding to the target subnet is updated to allocated in the bitset.

[0066] It is understandable that updating the allocation status of the subnet allocation unit corresponding to the target subnet to allocated can facilitate subsequent allocation of other subnets to avoid duplicate allocation of subnets.

[0067] Based on the above embodiment, as an optional method of the present disclosure, it also includes: when a subnet recycling request is identified, determining the subnet to be recycled; updating the allocation status of the subnet allocation unit corresponding to the subnet to be recycled to unallocated to complete the subnet recycling.

[0068] The subnet reclaim request is a request for reclaiming a subnet; optionally, the subnet reclaim request includes a subnet to be reclaimed. The so-called subnet to be reclaimed is a subnet that needs to be reclaimed.

[0069] Specifically, when a subnet recycling request is identified, the subnet to be recycled is determined from the subnet recycling request, and then the allocation state of the subnet allocation unit corresponding to the subnet to be recycled is updated to unallocated in the bitset to release the corresponding subnet space and complete the subnet recycling.

[0070] It is understandable that by updating the allocation status of the subnet allocation unit of the subnet to be reclaimed to unallocated, the subnet reclaim can be completed quickly, thereby achieving the reduction of the large IP network segment.

[0071] Figure 4 This is a schematic diagram of the structure of a subnet allocation device provided according to an embodiment of the present disclosure. This embodiment is applicable to the situation of how to flexibly allocate subnets to a large network segment, and is particularly applicable to the situation of allocating IP subnets of various sizes in a large IP network segment. The device can be implemented in software and / or hardware and can be integrated into an electronic device that carries the subnet allocation function, such as a server. Figure 4 As shown, the subnet allocation device 400 of this embodiment may include:

[0072] Information determination module 401, used to determine the network segment to be allocated, the subnet allocation unit of the network segment to be allocated, and the required size of the required subnet;

[0073] The subnet allocation module 402 is configured to allocate the network segments to be allocated according to the subnet allocation unit and the required size, and obtain a target subnet corresponding to the required subnet.

[0074] The technical solution provided by the disclosed embodiments determines the network segment to be allocated, the subnet allocation unit for the segment, and the required size of the desired subnet. Then, based on the subnet allocation unit and the required size, the segment to be allocated is allocated to obtain the target subnet corresponding to the required subnet. This technical solution, by introducing the subnet allocation unit for subnet allocation, can rationally allocate IP subnets of different sizes, thereby improving IP utilization within the IP pool.

[0075] Furthermore, the subnet allocation module 402 includes:

[0076] A unit requirement quantity determination submodule is used to determine the unit requirement quantity of the subnet allocation unit according to the requirement size and the unit size of the subnet allocation unit;

[0077] The subnet allocation submodule is used to allocate the network segments to be allocated according to the required number of units and the subnet allocation unit, and obtain the target subnet corresponding to the required subnet.

[0078] Furthermore, the subnet allocation submodule includes:

[0079] an allocation status determining unit, configured to determine an allocation status of a subnet allocation unit;

[0080] The subnet allocation unit is used to allocate the network segments to be allocated according to the unit requirement quantity, subnet allocation unit and allocation status, and obtain the target subnet corresponding to the required subnet.

[0081] Furthermore, the subnet allocation unit is specifically configured to:

[0082] Using the multiple of the required number of units as the index, search from the low-order side of the address of the network segment to be allocated, and determine the required number of consecutive subnet allocation units with the allocation status as unallocated;

[0083] The required number of consecutive units of subnet allocation units are combined into a target subnet corresponding to the required subnet.

[0084] Furthermore, the unit requirement quantity determination submodule is specifically used to:

[0085] If the demand size is greater than or equal to the unit size, the unit demand quantity of the subnet allocation unit is determined to be 1;

[0086] If the required size is less than the unit size, the required number of units for the subnet allocation unit is determined based on the difference between the unit size and the required size.

[0087] Furthermore, the subnet allocation submodule is specifically used to:

[0088] Multiply the required number of units by the unit size of the subnet allocation unit to obtain the target size of the target subnet;

[0089] Determine a subnet of the target size from the network segment to be allocated as the target subnet corresponding to the required subnet.

[0090] Furthermore, the device further includes:

[0091] The status update module is used to update the allocation status of the subnet allocation unit corresponding to the target subnet to allocated.

[0092] Furthermore, the device also includes a subnet recovery module, which is used to:

[0093] When a subnet recycling request is identified, the subnet to be recycled is determined;

[0094] The allocation status of the subnet allocation unit corresponding to the subnet to be reclaimed is updated to unallocated to complete the subnet reclamation.

[0095] Furthermore, the demand size is greater than the segment size of the network segment to be allocated.

[0096] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium, and a computer program product.

[0097] Figure 5 It is a block diagram of an electronic device used to implement the subnet allocation method according to an embodiment of the present disclosure. Figure 5 A schematic block diagram of an example electronic device 500 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are provided as examples only and are not intended to limit the implementation of the present disclosure described and / or claimed herein.

[0098] like Figure 5As shown, the electronic device 500 includes a computing unit 501, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 502 or a computer program loaded from a storage unit 508 into a random access memory (RAM) 503. Various programs and data required for the operation of the electronic device 500 can also be stored in the RAM 503. The computing unit 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.

[0099] Multiple components in the electronic device 500 are connected to the I / O interface 505, including: an input unit 506, such as a keyboard, a mouse, etc.; an output unit 507, such as various types of displays, speakers, etc.; a storage unit 508, such as a magnetic disk, an optical disk, etc.; and a communication unit 509, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 509 allows the electronic device 500 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.

[0100] The computing unit 501 can be various general-purpose and / or specialized processing components with processing and computing capabilities. Some examples of the computing unit 501 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various specialized artificial intelligence (AI) computing chips, various computing units that run machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The computing unit 501 performs the various methods and processes described above, such as the subnet allocation method. For example, in some embodiments, the subnet allocation method can be implemented as a computer software program that is tangibly contained in a machine-readable medium, such as the storage unit 508. In some embodiments, part or all of the computer program can be loaded and / or installed on the electronic device 500 via the ROM 502 and / or the communication unit 509. When the computer program is loaded into the RAM 503 and executed by the computing unit 501, one or more steps of the subnet allocation method described above can be performed. Alternatively, in other embodiments, the computing unit 501 can be configured to perform the subnet allocation method by any other appropriate means (e.g., by means of firmware).

[0101] Various embodiments of the systems and techniques described above can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), system-on-chip systems (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include being implemented in one or more computer programs that are executable and / or interpreted on a programmable system that includes at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0102] The program code for implementing the method of the present disclosure can be written in any combination of one or more programming languages. These program codes can be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device so that when the program code is executed by the processor or controller, the functions / operations specified in the flow chart and / or block diagram are implemented. The program code can be executed entirely on the machine, partially on the machine, as a stand-alone software package, partially on the machine and partially on a remote machine, or entirely on a remote machine or server.

[0103] In the context of the present disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in conjunction with an instruction execution system, device or equipment. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium can include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0104] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0105] The systems and techniques described herein can be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network (LAN), a wide area network (WAN), and the Internet.

[0106] A computer system may include a client and a server. The client and server are generally remote from each other and typically interact through a communication network. The client-server relationship arises through computer programs running on the respective computers and having a client-server relationship with each other. The server may be a cloud server, a server in a distributed system, or a server integrated with a blockchain.

[0107] Artificial intelligence (AI) is the study of how computers can simulate certain human thought processes and intelligent behaviors (such as learning, reasoning, thinking, and planning). It encompasses both hardware and software technologies. AI hardware technologies generally include sensors, specialized AI chips, cloud computing, distributed storage, and big data processing. AI software technologies primarily encompass computer vision, speech recognition, natural language processing, machine learning / deep learning, big data processing, and knowledge graphs.

[0108] Cloud computing refers to a technology system that provides network access to elastically scalable shared pools of physical or virtual resources. These resources can include servers, operating systems, networks, software, applications, and storage devices, and can be deployed and managed on-demand in a self-service manner. Cloud computing technology provides efficient and powerful data processing capabilities for the application of technologies such as artificial intelligence and blockchain, as well as for model training.

[0109] It should be understood that the various forms of the processes shown above can be used to reorder, add, or delete steps. For example, the steps described in this disclosure can be performed in parallel, sequentially, or in a different order, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved. This is not a limitation herein.

[0110] The above specific embodiments do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions may be made based on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure shall be included within the scope of protection of this disclosure.

Claims

1. A subnet allocation method, comprising: Determining a network segment to be allocated, a subnet allocation unit of the network segment to be allocated, and a required size of a required subnet; The network segment to be allocated includes at least one subnet allocation unit; wherein the subnet allocation unit refers to the smallest subnet allowed to be allocated in the network segment to be allocated; determining a required number of units of the subnet allocation unit according to the required size and a unit size of the subnet allocation unit; Allocating the to-be-allocated network segment according to the unit demand quantity and the subnet allocation unit to obtain a target subnet corresponding to the demand subnet; wherein the subnet size of the target subnet is smaller than the demand size of the demand subnet; The allocating the to-be-allocated network segment according to the unit demand quantity and the subnet allocation unit to obtain a target subnet corresponding to the demand subnet includes: Determining an allocation status of the subnet allocation unit; Allocate the network segment to be allocated according to the unit requirement quantity, the subnet allocation unit and the allocation status to obtain a target subnet corresponding to the required subnet; The allocating the to-be-allocated network segment according to the required number of units, the subnet allocation unit, and the allocation status to obtain a target subnet corresponding to the required subnet includes: Using the multiple of the required number of units as an index, searching from the low-order side of the address of the to-be-allocated network segment, and determining the required number of consecutive units in the unallocated subnet allocation unit state; The required number of consecutive units and the subnet allocation units are used to form a target subnet corresponding to the required subnet.

2. The method according to claim 1, wherein The determining the required number of units of the subnet allocation unit according to the required size and the unit size of the subnet allocation unit includes: If the required size is greater than or equal to the unit size, determining the required number of units of the subnet allocation unit to be 1; If the required size is smaller than the unit size, the required number of units of the subnet allocation unit is determined according to a difference between the unit size and the required size.

3. The method according to claim 1, wherein The allocating the to-be-allocated network segment according to the unit demand quantity and the subnet allocation unit to obtain a target subnet corresponding to the demand subnet further includes: Multiplying the unit requirement quantity and the unit size of the subnet allocation unit to obtain a target size of the target subnet; A subnet of a target size is determined from the network segment to be allocated as the target subnet corresponding to the required subnet.

4. The method according to any one of claims 1 to 3, further comprising: The allocation status of the subnet allocation unit corresponding to the target subnet is updated to allocated.

5. The method according to any one of claims 1 to 3, further comprising: When a subnet recycling request is identified, the subnet to be recycled is determined; The allocation state of the subnet allocation unit corresponding to the subnet to be reclaimed is updated to unallocated, so as to complete the subnet reclaiming.

6. The method according to any one of claims 1 to 3, wherein: The required size is greater than the network segment size of the network segment to be allocated.

7. A subnet allocation device, comprising: An information determination module, configured to determine a network segment to be allocated, a subnet allocation unit of the network segment to be allocated, and a required size of a required subnet; The network segment to be allocated includes at least one subnet allocation unit; wherein the subnet allocation unit refers to the smallest subnet allowed to be allocated in the network segment to be allocated; A subnet allocation module, comprising a unit requirement quantity determination submodule and a subnet allocation submodule; The unit requirement quantity determination submodule is configured to determine the unit requirement quantity of the subnet allocation unit according to the requirement size and the unit size of the subnet allocation unit; The subnet allocation submodule is configured to allocate the to-be-allocated network segment according to the unit requirement quantity and the subnet allocation unit, and obtain a target subnet corresponding to the required subnet; wherein the subnet size of the target subnet is smaller than the required size of the required subnet; Wherein, the subnet allocation submodule includes: an allocation status determining unit, configured to determine an allocation status of the subnet allocation unit; a subnet allocation unit, configured to allocate the network segment to be allocated according to the required number of units, the subnet allocation unit, and the allocation status, and obtain a target subnet corresponding to the required subnet; The subnet allocation unit is specifically configured to: Using the multiple of the required number of units as an index, searching from the low-order side of the address of the to-be-allocated network segment, and determining the required number of consecutive units in the unallocated subnet allocation unit state; The required number of consecutive units and the subnet allocation units are used to form a target subnet corresponding to the required subnet.

8. The device according to claim 7, wherein The unit requirement quantity determination submodule is specifically used for: If the required size is greater than or equal to the unit size, determining the required number of units of the subnet allocation unit to be 1; If the required size is smaller than the unit size, the required number of units of the subnet allocation unit is determined according to a difference between the unit size and the required size.

9. The device according to claim 7, wherein The subnet allocation submodule is specifically used to: Multiplying the unit requirement quantity and the unit size of the subnet allocation unit to obtain a target size of the target subnet; A subnet of a target size is determined from the network segment to be allocated as the target subnet corresponding to the required subnet.

10. The apparatus according to any one of claims 7 to 9, further comprising a status updating module, configured to: The allocation status of the subnet allocation unit corresponding to the target subnet is updated to allocated.

11. The apparatus according to any one of claims 7 to 9, further comprising a subnet recovery module configured to: When a subnet recycling request is identified, the subnet to be recycled is determined; The allocation state of the subnet allocation unit corresponding to the subnet to be reclaimed is updated to unallocated, so as to complete the subnet reclaiming.

12. The device according to any one of claims 7 to 9, wherein: The required size is greater than the network segment size of the network segment to be allocated.

13. An electronic device comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor. The instructions are executed by the at least one processor to enable the at least one processor to perform the subnet allocation method according to any one of claims 1 to 6.

14. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to enable a computer to execute the subnet allocation method according to any one of claims 1 to 6.

15. A computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements the subnet allocation method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Network creation method and device in cloud service, computer equipment and storage medium

    CN117201495A