A container-based subnet management system, method, device and storage medium

By using a container-based subnet management system, the allocation and release of IP addresses are automatically managed, solving the problem of improper IP address resource management in the Kubernetes platform, improving network resource utilization and communication stability, and reducing management complexity.

CN119316264BActive Publication Date: 2025-10-28JINAN INSPUR DATA TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411337692.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-24
Publication Date
2025-10-28
Estimated Expiration
2044-09-24

AI Technical Summary

Technical Problem

In the Kubernetes platform, IP address resources are limited and poorly managed, leading to network communication anomalies and resource waste. It is difficult to adapt to dynamic changes, and human management is prone to errors, affecting network failures and device connectivity.

Method used

This paper provides a container-based subnet management system, including subnet creation, query, and deletion modules. By automating and dynamically managing the subnet lifecycle, it enables the reasonable allocation and release of IP addresses, automatically verifies network legitimacy, dynamically adjusts configuration information, and reduces human configuration errors.

Benefits of technology

It improves network resource utilization, communication stability and security, reduces maintenance costs and management complexity, and ensures the continuous and stable operation of business systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119316264B_ABST
    Figure CN119316264B_ABST
Patent Text Reader

Abstract

This invention provides a container-based subnet management system, method, device, and storage medium, relating to the field of container technology. The system includes a subnet creation module, a subnet query module, and a subnet deletion module. The subnet creation module, in response to a subnet creation request, obtains first network information, creates a target subnet based on the first network information, calculates a first allocated address within the target subnet, and generates first storage information for the first allocated address. The subnet query module, in response to an address query request, obtains the target allocated address and the first storage information for the target allocated address, and modifies the allocation identifier in the first storage information. The subnet deletion module, in response to a subnet deletion request, deletes the target subnet and releases the first allocated address and the first storage information if the allocation identifier in the first storage information does not contain an allocated marker. Through automated management, the utilization rate of network resources is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of container technology, and in particular to a container-based subnet management system, method, device, and storage medium. Background Technology

[0002] Kubernetes, an open-source platform for container orchestration and management, supports automated deployment, scaling, and operation of application containers. With the popularization of microservice architecture and the rise of cloud-native technologies, Kubernetes has become the dominant technology for cloud business processes, driving the popularization and implementation of microservice architecture and other popular technologies. Many systems are based on the Kubernetes platform to scale or run their own businesses.

[0003] In the process of providing services on the Kubernetes platform, the available IP address (Internet Protocol address) resources in the container subnet are limited. When IP addresses are occupied or not reclaimed in a timely manner, these IP addresses may conflict with other containers, causing network communication anomalies and unnecessary resource consumption. In large network environments, the configuration and management of IP address resources can only be done manually by administrators. However, the addition, deletion, and relocation of devices will lead to changes in IP address requirements. Manual management of IP addresses is not only prone to errors but also difficult to adapt to dynamic changes. These problems may lead to unreasonable or wasted IP address resource allocation, causing network failures, device connectivity issues, and other problems. Summary of the Invention

[0004] The purpose of this invention is to provide a container-based subnet management system, method, device, and storage medium. The container-based subnet management system creates, updates, and deletes subnets, achieving lifecycle management of subnets. Through automated and dynamic subnet lifecycle management, it significantly improves network resource utilization, network communication stability, and security. The specific technical solution is as follows:

[0005] In a first aspect of this invention, a container-based subnet management system is provided. The system includes a subnet creation module, a subnet query module, and a subnet deletion module. The subnet query module is communicatively connected to both the subnet creation module and the subnet deletion module.

[0006] The subnet creation module is used to respond to a subnet creation request, obtain first network information corresponding to the subnet creation request, create a target subnet based on the first network information, calculate a first allocated address within the target subnet, and generate first storage information for each first allocated address.

[0007] The subnet query module is used to respond to an address query request for the target subnet, obtain the target allocation address and the first storage information of the target allocation address from the first allocation address, and modify the allocation identifier in the first storage information according to the address query request;

[0008] The subnet deletion module is used to respond to a subnet deletion request for the target subnet, obtain the allocation identifier in the first storage information, and if there is no allocated marker in the allocation identifier, delete the target subnet and release the first allocation address and the first storage information.

[0009] Optionally, the subnet creation module includes: a network information acquisition submodule, a target subnet verification submodule, and a target subnet creation submodule;

[0010] The network information acquisition submodule is used to respond to the subnet creation request and acquire first network information corresponding to the subnet creation request. The first network information includes at least network type, Internet Protocol address and subnet mask.

[0011] The target subnet verification submodule is used to calculate a first address range of the target subnet based on the first network information, compare the first address range with a second address range of a preset network segment, and obtain a first overlap result of the target subnet; if the first overlap result indicates no overlap, then it checks whether the first allocated address of the target subnet is empty; if the first overlap result indicates overlap, or if the first allocated address is empty, then the creation verification result of the target subnet is unqualified; if the first allocated address is not empty, then the creation verification result of the target subnet is qualified.

[0012] The target subnet creation submodule is used to create the target subnet if the creation verification result is qualified; calculate the first allocated address based on the first network information, and generate the first storage information for each first allocated address; if the creation verification result is unqualified, return creation failure information.

[0013] Optionally, the system further includes a subnet update module, which is communicatively connected to the subnet creation module and the subnet deletion module. The subnet update module includes: an update information acquisition submodule, an update verification submodule, and a target subnet update submodule.

[0014] The update information acquisition submodule is used to respond to a subnet update request for the target subnet and acquire second network information corresponding to the subnet update request. The second network information includes the updated Internet Protocol address and the updated subnet mask.

[0015] The update verification submodule is used to obtain a second overlap result based on the second network information, or to obtain the allocation identifier of the target subnet; if the second overlap result indicates no overlap, or if the allocation identifier meets the update conditions of the target subnet, then it checks whether the second allocation address of the updated target subnet is empty; if the second allocation address is empty, then the update verification result of the target subnet is unqualified; if the second allocation address is not empty, then the update verification result of the target subnet is qualified.

[0016] The target subnet update submodule is configured to, if the update verification result is qualified, update the first network information to the second network information, calculate the updated second allocation address of the target subnet based on the second network information, and generate second storage information for each second allocation address; update the first allocation address using the second allocation address, and update the first storage information using the second storage information; if the update verification result is unqualified, return update failure information.

[0017] Optionally, the subnet update request includes a subnet expansion request and a subnet reduction request, and the update verification submodule includes an expansion verification submodule and a reduction verification submodule;

[0018] The expansion verification submodule is used to, if the subnet update request is a subnet expansion request, calculate the third address range of the updated target subnet based on the second network information, compare the third address range with the second address range of the preset network segment, and obtain the second overlap result of the updated target subnet; if the second overlap result is that there is no overlap, then check whether the second allocated address of the updated target subnet is empty; if the second allocated address is not empty, then the update verification result of the target subnet is qualified; if the second overlap result is that there is overlap, or if the second allocated address is empty, then the update verification result of the target subnet is unqualified.

[0019] The scaling-down verification submodule is configured to: if the subnet update request is a subnet scaling-down request, obtain the allocation identifier in the first storage information; if the allocation identifier does not contain an allocated flag, the allocation identifier meets the update condition, and detect whether the second allocation address of the updated target subnet is empty; if the allocation identifier contains an allocated flag, calculate the fourth address range of the updated target subnet based on the second network information; compare the fourth address range with the allocated address corresponding to the allocated flag; if the allocated address is within the fourth address range, detect whether the second allocation address of the updated target subnet is empty; if the second allocation address is empty, the update verification result of the target subnet is unqualified; if the second allocation address is not empty, the update verification result of the target subnet is qualified.

[0020] Optionally, the address query request includes a connection query request and a release query request, and the subnet query module includes: a connection address lookup submodule, a connection record submodule, a release address lookup submodule, and a release record submodule;

[0021] The connection address lookup submodule is used to, if the address query request is a connection query request for a target unit, obtain the target allocated address from the allocated address pool of the target subnet in ascending order, and set the target allocated address as the Internet Protocol address associated with the target unit;

[0022] The connection recording submodule is used to obtain the unit information of the target unit, record the unit information in the third storage information corresponding to the target allocation address, and modify the allocation identifier of the target allocation address to the allocated mark. The unit information includes at least device information and device identifier.

[0023] The release address lookup submodule is used to obtain the unit information of the target unit if the address query request is a release query request for the target unit, extract the Internet Protocol address associated with the target unit from the unit information, and determine the target release address based on the Internet Protocol address;

[0024] The release record submodule is used to obtain the fourth storage information corresponding to the target release address, delete the unit information in the fourth storage information, and modify the allocation identifier of the target release address to an unallocated marker.

[0025] Optionally, the subnet query module further includes: a subnet quantity monitoring submodule;

[0026] The subnet quantity monitoring submodule is used to obtain the first allocated address of the target subnet. If the number of the first allocated addresses is less than a preset quantity threshold, an alarm message is sent.

[0027] Optionally, the subnet deletion module includes: a subnet deletion verification submodule and a target subnet deletion submodule;

[0028] The subnet deletion verification submodule is used to respond to a subnet deletion request for the target subnet by obtaining the allocation identifier in the first storage information; if there is no allocated flag in the allocation identifier, the deletion verification result of the target subnet is qualified; if there is an allocated flag in the allocation identifier, the deletion verification result of the target subnet is unqualified.

[0029] The target subnet deletion submodule is used to release the first network information and delete the first stored information if the deletion verification result is qualified; and to return deletion failure information if the deletion verification result is unqualified.

[0030] In a second aspect of the invention, a container-based subnet management method is also provided, applied to a container-based subnet management system. The container-based subnet management system includes at least a subnet creation module, a subnet query module, and a subnet deletion module. The subnet query module is communicatively connected to both the subnet creation module and the subnet deletion module. The method includes:

[0031] In response to a subnet creation request, first network information corresponding to the subnet creation request is obtained, a target subnet is created based on the first network information, a first allocated address within the target subnet is calculated, and first storage information for each first allocated address is generated;

[0032] In response to an address query request for the target subnet, the target allocation address and the first storage information of the target allocation address are obtained from the first allocation address, and the allocation identifier in the first storage information is modified according to the address query request;

[0033] In response to a subnet deletion request for the target subnet, the allocation identifier in the first storage information is obtained. If there is no allocated flag in the allocation identifier, the target subnet is deleted, and the first allocation address and the first storage information are released.

[0034] In a third aspect of the invention, an electronic device is also provided, comprising: one or more processors; a memory; and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs are configured to perform the container-based subnet management method described above.

[0035] In a fourth aspect of the present invention, a non-volatile readable storage medium is also provided, which, when the instructions in the non-volatile readable storage medium are executed by a processor of an electronic device, enables the electronic device to execute the container-based subnet management method described above.

[0036] The container-based subnet management system provided in this embodiment of the invention, through a subnet creation module, responds to a subnet creation request by obtaining first network information corresponding to the subnet creation request to create a target subnet, and calculates a first allocation address available for allocation within the target subnet, generating first storage information for each first allocation address; through a subnet query module, responds to an address query request for the target subnet by obtaining the target allocation address and the first storage information of the target allocation address from the first allocation address, and modifies the allocation identifier in the first storage information according to the address query request to realize the allocation and release of the first allocation address; through a subnet deletion module, responds to a subnet deletion request for the target subnet by obtaining the allocation identifier in the first storage information, verifying the allocation address of the address within the target subnet, and if there is no allocated address within the target subnet, deleting the target subnet and releasing the first allocation address and the first storage information. This invention utilizes a container-based subnet management system to automatically create, update, and delete subnets, achieving lifecycle management. The subnet creation module automatically verifies the network legitimacy of newly created target subnets, effectively avoiding security risks caused by configuration errors or non-compliance. The subnet update module dynamically adjusts subnet configuration information based on business needs, ensuring the rational allocation and efficient utilization of IP addresses. The subnet deletion module executes automated deletion processes, reducing human configuration errors and ensuring operational consistency and accuracy. Simultaneously, it reclaims and releases related IP address resources in real time, improving resource utilization. Through automated and dynamic subnet lifecycle management, it significantly improves network resource utilization, network communication stability and security, while reducing maintenance costs and management complexity, providing a solid technical guarantee for the continuous and stable operation of business systems.

[0037] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit the invention. Attached Figure Description

[0038] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0039] Figure 1This is a structural block diagram of a container-based subnet management system provided in an embodiment of the present invention;

[0040] Figure 2 This is a flowchart illustrating the steps of a subnet creation module in a container-based subnet management system provided in an embodiment of the present invention.

[0041] Figure 3 This is a flowchart illustrating the steps involved in the operation of a subnet query module in a container-based subnet management system, as provided in an embodiment of the present invention.

[0042] Figure 4 This is a flowchart illustrating the steps of a subnet update module in a container-based subnet management system according to an embodiment of the present invention.

[0043] Figure 5 This is a flowchart illustrating the steps of a subnet deletion module in a container-based subnet management system according to an embodiment of the present invention.

[0044] Figure 6 This is a flowchart illustrating the steps of a container-based subnet management method provided in an embodiment of the present invention.

[0045] Figure 7 This is a schematic diagram illustrating an exemplary application scenario of a container-based subnet management system provided in an embodiment of the present invention;

[0046] Figure 8 This is a structural block diagram of an electronic device provided in an embodiment of the present invention. Detailed Implementation

[0047] To make the above-mentioned objects, features, and advantages of the present invention more apparent and understandable, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0048] To enable those skilled in the art to better understand the technical solutions in the embodiments of the present invention, some technical features involved in the embodiments of the present invention are explained and described below:

[0049] Kubernetes, or K8s for short, is an open-source container orchestration platform designed to automate the deployment, scaling, and management of containerized applications. K8s provides a production-grade environment for deploying, maintaining, and scaling applications.

[0050] A subnet is a separate network island created by separating each interface of a host and router to define a network area. The interfaces connect to the endpoints of these independent networks. These independent network islands are called subnets.

[0051] An IP address (Internet Protocol address) is a standardized address format provided by the IP protocol. It assigns a logical address to every network and every host on the Internet, thereby masking the differences in physical addresses.

[0052] A subnet mask is an important parameter used in a network to distinguish between the network portion and the host portion. Used in conjunction with an IP address, the subnet mask helps determine the network and host portions of an IP address, thereby enabling network segmentation and management. For example, an IP address typically consists of two parts: a network portion and a host portion. The subnet mask uses a series of consecutive 1s and 0s to represent the network and host portions of the IP address.

[0053] In Kubernetes (k8s), a Pod is the smallest deployable and manageable unit. A Pod represents a collection of one or more containers in a cluster that share the same network namespace, storage volumes, and IP addresses.

[0054] The first network information refers to the basic network parameters received in response to the subnet creation request for configuring the target subnet. For example, to create a target subnet, the first network information may include information such as network type, IP address, and subnet mask.

[0055] The second network information refers to the updated configuration parameters of the target subnet received in response to the subnet update request. For example, to update the target subnet, the second network information may include the updated IP address, the updated subnet mask, and other information.

[0056] The first allocated address refers to the available allocated address within the target subnet. The first allocated address usually refers to the available allocated address within the target subnet other than the network address and broadcast address.

[0057] The second allocation address refers to the available allocation address within the updated target subnet. After updating the target subnet, the available allocation address within the updated target subnet is recalculated. It usually refers to the available allocation address within the updated target subnet excluding network address and broadcast address.

[0058] The first stored information refers to the parameter information related to the first allocated address. After calculating the available first allocated addresses within the target subnet, the stored information is generated for each first allocated address to record the parameter information of the currently available allocated addresses. This information is used to ensure the correct allocation and management of IP addresses. For example, after the target subnet is created, the first stored information may include information such as the network type, IP address, and subnet mask of the first allocated address.

[0059] The second storage information refers to the parameter information related to the second allocation address. After the target subnet is updated, the storage information generated for each recalculated second allocation address is used to record the parameter information of the currently available allocation address. After the target subnet is updated, the second storage information may include information such as the network type, IP address, and subnet mask of the second allocation address.

[0060] As an example, in the process of providing services on the Kubernetes platform, the available IP address resources in the container subnet are limited. When IP addresses are occupied or not reclaimed in a timely manner, these IP addresses may conflict with other containers, causing abnormal network communication and unnecessary resource consumption. Especially in large network environments, where IP address resources are scarce, administrators can only manually release invalid IP allocations. Manual management of IP addresses is not only prone to errors but also difficult to adapt to dynamic changes. These problems may lead to unreasonable or wasteful allocation of IP address resources.

[0061] In this embodiment of the invention, a subnet creation module obtains first network information to create a target subnet, calculates the first allocation address available for allocation within the target subnet, generates first storage information for each first allocation address, and uses a subnet query module to obtain the target allocation address and its first storage information from the first allocation address. The allocation identifier in the first storage information is modified to achieve the allocation and release of the first allocation address. A subnet deletion module verifies the allocation status of IP addresses within the target subnet, and releases the first allocation address and first storage information while deleting the subnet. Through a container-based subnet management system, subnets are automatically created, updated, and deleted. This automated and dynamic subnet lifecycle management significantly improves network resource utilization, network communication stability, and security.

[0062] Reference Figure 1 The diagram illustrates a structural block diagram of a container-based subnet management system provided in an embodiment of the present invention. The system includes a subnet creation module 110, a subnet query module 120, and a subnet deletion module 130. Specifically, the subnet query module 120 is communicatively connected to the subnet creation module 110 and the subnet deletion module 130, respectively.

[0063] The subnet creation module 110 is used to respond to a subnet creation request, obtain the first network information corresponding to the subnet creation request, create a target subnet based on the first network information, calculate the first allocated address within the target subnet, and generate the first storage information for each first allocated address;

[0064] Users can create new container subnets according to the network plan. When the subnet controller listens for the subnet creation request, it can receive the first network information and send a subnet creation request to the subnet management system. The creation request for creating a new container subnet and the first network information can be input by the user.

[0065] Specifically, in response to a subnet creation request, the subnet creation module 110 performs network validity verification based on the acquired first network information. When the first network information passes the network validity verification, the subnet creation action continues. When the first network information fails the validity verification, a creation failure message is returned, indicating that the new subnet creation has failed. The subnet creation module 110 may include: a network information acquisition submodule, a target subnet verification submodule, and a target subnet creation submodule.

[0066] In one possible embodiment, the sub-modules included in the subnet creation module 110 are further described in conjunction with the subnet creation process implemented by the subnet creation module 110, referring to... Figure 2 The diagram illustrates the steps of a subnet creation module in a container-based subnet management system according to an embodiment of the present invention. In this embodiment, the network information acquisition submodule responds to the subnet creation request by acquiring first network information for the target subnet. The first network information refers to the basic network parameters used to create and configure the target subnet. For example, the first network information may include network type, Internet Protocol address, and subnet mask.

[0067] The target subnet verification submodule performs network legitimacy verification on the first network information. Specifically, the target subnet verification submodule can calculate the first address range of the target subnet based on the IP address and subnet mask in the first network information. At the same time, it obtains the network configuration information of the preset network segment and calculates the second address range of the preset network segment. For example, the preset network segment may include the host network segment, the existing subnet segment, and the reserved subnet segment. By comparing the first address range and the second address range, the first overlap result of the target subnet can be obtained. The first overlap result can be used to indicate whether there is an overlap between the target subnet and the preset network segment. When the target subnet overlaps with the preset network segment, it indicates that the newly created subnet conflicts with the existing network configuration, which may lead to network communication problems, resource allocation errors, or other potential network failures. Therefore, it can be confirmed that the first network information has not passed the network legitimacy verification, and the creation verification result of the target subnet is unqualified. When the target subnet does not overlap with the preset network segment, it indicates that the newly created subnet does not conflict with the existing network configuration, and the verification of whether the target subnet contains a usable first allocated address can proceed. Specifically, the first available allocated address within the target subnet can be verified by calculating the IP address range. Based on the first network information, the network address, broadcast address, and available IP addresses of the target subnet are obtained. The network address can refer to the first IP address in the target subnet, and the broadcast address can refer to the last IP address in the target subnet. The network address and broadcast address identify the range and boundaries of the target subnet. The IP addresses between the network address and broadcast address are the available IP addresses, which are also the first allocated addresses. If the first allocated address within the target subnet is found to be empty, the creation verification result of the target subnet is considered unqualified; if the first allocated address within the target subnet is not found to be empty, the creation verification result of the target subnet is considered qualified.

[0068] The target subnet creation submodule determines whether to create the target subnet based on the creation verification result. Specifically, if the creation verification result is qualified, the subnet creation process is executed to create the target subnet. Based on the obtained first network information, the first allocation address that can be allocated within the target subnet is calculated, and first storage information is generated for each first allocation address. The first storage information can record relevant parameter information of the current first allocation address, such as network type, IP address, subnet mask, etc. If the creation verification result is unqualified, a creation failure message is returned, and the creation of the new container subnet fails.

[0069] In one possible embodiment, the subnet management system may further include a subnet update module 140, which is communicatively connected to the subnet creation module 110 and the subnet deletion module 130, respectively. The subnet update module 140 is used to dynamically adjust the subnet configuration information according to business needs. Based on the subnet update process implemented by the subnet update module 140, the submodules included in the subnet update module 140 will be further described, referring to... Figure 3 The diagram illustrates the steps of a subnet update module in a container-based subnet management system according to an embodiment of the present invention. The subnet update module 140 may include an update information acquisition submodule, an update verification submodule, and a target subnet update submodule.

[0070] When a user requests an update for a target subnet based on business needs, the update information acquisition submodule responds to the subnet update request for the target subnet and acquires the second network information corresponding to the subnet update request. The second network information refers to the basic network parameters used to instruct the target subnet to be updated. For example, the second network information may include the updated Internet Protocol address and the updated subnet mask of the target subnet.

[0071] The update verification submodule can perform network legitimacy verification on the second network information. Specifically, the update verification submodule can calculate the third address range of the target subnet based on the second network information and obtain the second overlap result. The update verification result of the target subnet is then confirmed based on the second overlap result. Alternatively, the update verification submodule can also detect the address allocation information in the target subnet by obtaining its allocation identifier, further obtaining the update verification result of the target subnet. By verifying the legitimacy of the second network information, it can be ensured that the updated subnet configuration does not overlap with the preset network segment, effectively avoiding subnet conflicts and network configuration errors, and ensuring network compliance and stability.

[0072] Preferably, in dynamic resource allocation, the created subnet may have an address range that is too small to meet the allocation requirements, or an address range that is too large to be fully utilized. Corresponding to the different update requirements of users for the target subnet, the subnet update request can be divided into subnet expansion request and subnet shrinkage request. Accordingly, the update verification submodule may include an expansion verification submodule and a shrinkage verification submodule.

[0073] Specifically, when the subnet update request is a subnet expansion request, the expansion verification submodule performs network legitimacy verification on the second network information. Specifically, the subnet expansion verification submodule can calculate the third address range of the updated target subnet based on the updated IP address and updated subnet mask in the second network information, and compare the third address range with the second address range of a preset network to obtain the second overlap result of the updated target subnet. For example, the target subnet can be expanded by extending the first address range, and the updated third address... The range can include the first address range, such as 192.168.1.1 to 192.168.1.254. The expanded third address range is 192.168.0.1 to 192.168.255.254. Alternatively, the target subnet can be expanded by obtaining a third address range outside the first address range. This can be understood as deleting the target subnet and recreating a larger subnet. This can be achieved through the subnet deletion module and the subnet creation module in the subnet management system, which will not be elaborated upon here.

[0074] The second overlap result can be used to indicate whether the updated target subnet overlaps with the preset network segment. When the updated target subnet overlaps with the preset network segment, it indicates that the updated target subnet conflicts with the existing network configuration, which may lead to resource allocation errors or other potential network failures. Therefore, it can be confirmed that the second network information has failed the network validity check, and the update check result of the target subnet is unqualified. When the updated target subnet does not overlap with the preset network segment, it indicates that the updated target subnet does not conflict with the existing network configuration, and the check can proceed to verify whether the updated target subnet contains a usable second allocation address. Specifically, the usable second allocation address in the updated target subnet can be verified by calculating the IP address range. Based on the second network information, the updated network address, broadcast address, and usable IP address are obtained. The IP address between the updated network address and the updated broadcast address is the second allocation address. If the second allocation address in the updated target subnet is found to be empty, the update check result of the target subnet is confirmed to be unqualified; if the second allocation address in the updated target subnet is found to be not empty, the update check result of the target subnet is confirmed to be qualified.

[0075] When the subnet update request is a subnet shrinking request, the shrinking verification submodule obtains first storage information from the target subnet and extracts multiple allocation identifiers from the first storage information. These allocation identifiers mark the current allocation status of the first allocated address and can include allocated and unallocated identifiers. By traversing and matching the allocation identifiers, the allocation information of IP addresses within the target subnet is obtained. For example, if no allocated identifier is found among the multiple allocation identifiers of the target subnet, it indicates that the target subnet does not contain allocated IP addresses, and the detection of the second allocated address within the updated target subnet can proceed. If an allocated identifier is found among the multiple allocation identifiers of the target subnet, it indicates that the target subnet contained allocated IP addresses before the update, and further verification of the updated target subnet is required. The fourth address range of the updated target subnet can be calculated based on the second network information. By comparing the fourth address range with the allocated IP address corresponding to the allocated tag, it is confirmed whether the updated target subnet still contains the allocated IP address. If the allocated IP address is still within the fourth address range, it means that the updated target subnet still contains the allocated IP address, and the update operation for the target subnet will not affect the allocated IP address. The detection of the second allocated address within the updated target subnet can then proceed. If the allocated IP address is not within the fourth address range, it means that the target subnet no longer contains the allocated IP address after the update. That is, the update operation for the target subnet will cause the allocated IP address within the target subnet to no longer be within the target subnet. This may result in resource allocation errors, data loss, or other potential network failures. Therefore, it can be confirmed that the update verification result of the target subnet is unqualified, and the target subnet is not allowed to execute this subnet update process.

[0076] When the target subnet does not contain any pre-assigned IP addresses, or when the updated target subnet still contains pre-assigned IP addresses, the detection of the second assigned address within the updated target subnet can proceed. The verification of the available second assigned address within the updated target subnet can be performed by calculating the IP address range. Based on the second network information, the updated network address and the updated broadcast address are calculated. The detection result of the second assigned address can be confirmed using the updated network address and the updated broadcast address. If the detected second assigned address is empty, the update verification result of the target subnet is confirmed as unqualified; if the detected second assigned address is not empty, the update verification result of the target subnet is confirmed as qualified.

[0077] The target subnet update submodule determines whether to update the target subnet based on the update verification result. Specifically, if the update verification result is qualified, the subnet update process is executed to update the target subnet. This involves updating the first network information to the second network information and recalculating the second allocation address of the updated target subnet based on the second network information. Second storage information is generated for each second allocation address, where the second storage information can re-record relevant parameter information of the current second allocation address, such as network type, IP address, and subnet mask. After recalculation, the first allocation address is updated using the second allocation address, and the first storage information is updated using the second storage information to obtain a new target subnet. If the update verification result is unqualified, an update failure message is returned, indicating that the update operation for the target subnet has failed.

[0078] The subnet query module 120 is used to respond to an address query request for a target subnet, obtain the target allocation address and the first storage information of the target allocation address from the first allocation address, and modify the allocation identifier in the first storage information according to the address query request;

[0079] After the target subnet is created, users can connect and disconnect computing units from the target subnet through the subnet query module 120. When a user creates a new computing unit, i.e., a new pod, they can request an IP address from the target subnet through the subnet query module 120 to establish a connection. When a user deletes a pod, they can release the corresponding IP address through the subnet query module 120, thereby enabling dynamic management of the subnet in response to device additions and deletions. The subnet query module 120 may include: a connection address lookup submodule, a connection record submodule, a release address lookup submodule, and a release record submodule. Furthermore, the subnet query module 120 can also be used for continuous real-time monitoring and information push of the target subnet. The subnet query module may also include a subnet quantity monitoring submodule.

[0080] In one possible embodiment, the sub-modules included in the sub-net query module 120 are further described in conjunction with the sub-net query process implemented by the sub-net query module 120, referring to... Figure 4This document illustrates a flowchart of the subnet query module's operation in a container-based subnet management system according to an embodiment of the present invention. Depending on different user business needs, the address query request may include a connection query request and a release query request. When the address query request is a connection query request for a target unit, the connection address lookup submodule selects a target allocation address from the IP address pool of the target subnet for allocation to the pod. For example, available target allocation addresses can be obtained from the IP address pool in ascending order, and the target allocation address is set as the IP address associated with the target unit, i.e., the selected target allocation address is allocated to the target unit. The IP address pool manages all available IP addresses within the target subnet. After a target subnet is successfully created and a first allocation address is calculated, all first allocation addresses enter the IP address pool, awaiting selection and allocation. The allocation identifier for the first allocation addresses in the IP address pool is always an unallocated mark. Different subnets correspond to different IP address pools.

[0081] After confirming the target allocation address, the unit information of the target unit can be obtained through the connection record submodule. The unit information is recorded in the third storage information corresponding to the target allocation address. The unit information can be directly appended to the third storage information, such as adding unit information after the subnet mask. At the same time, the allocation identifier in the third storage information corresponding to the target allocation address is modified to the allocated mark. For example, the unit information may include the device information and MAC address of the target pod. The third storage information represents the storage information corresponding to the selected target allocation address and is the same as the first storage information corresponding to the unselected first allocation address. It is only used here to distinguish it from the other first storage information.

[0082] When the address query request is a release query request for a target unit, after the target pod is successfully deleted, the unit information of the target unit can be obtained through the release address lookup submodule. The IP address associated with the target unit can be extracted from the unit information, and the target release address associated with the target pod can be determined. The fourth storage information corresponding to the target release address can be obtained through the release record submodule. The unit information in the fourth storage information can be deleted, and the allocation identifier of the target release address can be modified to the unallocated mark. The associated IP address can be disconnected and re-entered into the IP address pool to wait for subsequent connection selection.

[0083] In one example, the usage information of the subnet can also be pushed in real time through the subnet query module. Specifically, the subnet query module can include a subnet quantity monitoring sub-module. The first allocated address in the target subnet is obtained through the subnet quantity monitoring sub-module, and the quantity of the first allocated address is calculated, that is, the quantity of the IP addresses available for allocation in the target subnet. When the quantity of the first allocated address is less than the preset quantity threshold, an alarm message can be sent to the user through real-time push information. Preferably, the preset quantity threshold can be set to 5, that is, when the quantity of the IP addresses available for allocation in the target subnet is less than 5, an alarm message is pushed.

[0084] The subnet deletion module 130 is configured to, in response to a subnet deletion request for a target subnet, obtain the allocation identifier in the first storage information. If there is no allocated flag in the allocation identifier, the target subnet is deleted, and the first allocated address and the first storage information are released.

[0085] When the existing subnet is no longer used for allocation or no longer meets the allocation requirements, the user can delete the existing subnet through the subnet deletion module 130 to release the unused or invalid IP addresses, thereby ensuring the timely recovery and reallocation of IP address resources and effectively avoiding waste of resources.

[0086] Specifically, the subnet deletion module 130 can include: a subnet deletion verification sub-module and a target subnet deletion sub-module. In a possible embodiment, in combination with the subnet deletion process implemented by the subnet deletion module 130, each sub-module included in the subnet deletion module 130 is further described. Refer to Figure 6 , which shows a step flow chart of the operation of the subnet deletion module in a container-based subnet management system provided by an embodiment of the present invention. Among them, in response to the subnet deletion request through the subnet deletion verification sub-module, the allocation information of the target subnet to be deleted can be verified by obtaining the allocation identifier in the first storage information; if there is no allocated flag in the allocation identifier of the target subnet, it indicates that there are no allocated IP addresses in the target subnet, and the deletion verification result of the target subnet is confirmed to be qualified; if there is an allocated flag in the allocation identifier of the target subnet, it indicates that there are still allocated IP addresses in the target subnet, and the deletion verification result of the target subnet is confirmed to be unqualified; the target subnet deletion sub-module decides whether to execute the subnet deletion process according to the deletion verification result of the target subnet. If the deletion verification result of the target subnet is qualified, the target subnet is deleted, and at the same time, the first network information is released and the first storage information is deleted; if the deletion verification result of the target subnet is unqualified, it indicates that deleting the target subnet may cause network communication problems, resource allocation errors or other potential network failures, and the target subnet is not allowed to be deleted, and a deletion failure message is returned, indicating that the deletion of the target subnet fails.

[0087] In one example, refer to Figure 6 The subnet management system provided by this invention can respond to different user requests corresponding to business needs. It automatically manages subnets through a subnet creation module 110, a subnet update module 120, a subnet deletion module 130, and a subnet query module 140. Based on the subnet verification results and process execution status, it returns information to the user to display the subnet management status. When a subnet is successfully created, it can generate several storage information entries in the storage to record different subnets. At the same time, the subnet management system can interact with pods to allocate and release IP addresses within the subnet.

[0088] This invention utilizes a container-based subnet management system to automatically create, update, and delete subnets, achieving lifecycle management. The subnet creation module automatically verifies the network legitimacy of newly created target subnets, effectively avoiding security risks caused by configuration errors or non-compliance. The subnet update module dynamically adjusts subnet configuration information based on business needs, ensuring the rational allocation and efficient utilization of IP addresses. The subnet deletion module executes an automated deletion process, reducing human configuration errors and ensuring consistency and accuracy. Simultaneously, it reclaims and releases related IP address resources in real time, improving resource utilization. This invention automates the creation and verification of target subnets through the subnet management system, effectively simplifying the management process. It eliminates the need for manual configuration of each subnet, reducing management complexity. Especially in dynamically changing network environments, the automated process can quickly adapt to network changes. Through automated and dynamic subnet lifecycle management, it significantly improves network resource utilization, network communication stability and security, while reducing maintenance costs and management complexity, providing a solid technical guarantee for the continuous and stable operation of business systems.

[0089] This application also provides a container-based subnet management method. (See reference...) Figure 7 This diagram illustrates a flowchart of a container-based subnet management method according to an embodiment of this application. The method is applied to a container-based subnet management system, which includes at least a subnet creation module 110, a subnet query module 120, and a subnet deletion module 130. Specifically, it may include the following steps:

[0090] Step 701: In response to the subnet creation request, obtain the first network information corresponding to the subnet creation request, create the target subnet based on the first network information, calculate the first allocated address in the target subnet, and generate the first storage information for each first allocated address;

[0091] Step 702: In response to the address query request for the target subnet, obtain the target allocation address and the first storage information of the target allocation address from the first allocation address, and modify the allocation identifier in the first storage information according to the address query request;

[0092] Step 703: In response to the subnet deletion request for the target subnet, obtain the allocation identifier in the first storage information. If there is no allocated identifier in the allocation identifier, delete the target subnet and release the first allocation address and the first storage information.

[0093] It should be noted that, for the sake of simplicity, the method embodiments are all described as a series of actions. However, those skilled in the art should understand that the embodiments of the present invention are not limited to the described order of actions, because according to the embodiments of the present invention, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions involved are not necessarily essential to the embodiments of the present invention.

[0094] refer to Figure 8 This invention also provides an electronic device, including a processor 801, a communication interface 802, a memory 803, and a communication bus 804, wherein the processor 801, the communication interface 802, and the memory 803 communicate with each other via the communication bus 804.

[0095] Memory 803 is used to store computer programs;

[0096] When processor 801 executes a program stored in memory 803, it performs the following steps:

[0097] In response to a subnet creation request, the system obtains the first network information corresponding to the subnet creation request, creates a target subnet based on the first network information, calculates the first allocated address within the target subnet, and generates the first storage information for each first allocated address.

[0098] In response to an address query request for a target subnet, the target allocation address and the first storage information of the target allocation address are obtained from the first allocation address, and the allocation identifier in the first storage information is modified according to the address query request;

[0099] In response to a subnet deletion request for a target subnet, the allocation identifier in the first storage information is obtained. If there is no allocated identifier in the allocation identifier, the target subnet is deleted, and the first allocation address and the first storage information are released.

[0100] The memory may include random access memory (RAM) or non-volatile memory, such as at least one disk storage device. Optionally, the memory may also be at least one storage device located remotely from the aforementioned processor.

[0101] The processors mentioned above can be general-purpose processors, including central processing units (CPUs), network processors (NPs), etc.; they can also be digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.

[0102] This invention also provides a non-volatile readable storage medium. When the instructions in the non-volatile readable storage medium are executed by the processor of an electronic device, the electronic device can execute the various processes of the above-described container-based subnet management method embodiments and achieve the same technical effect. To avoid repetition, further details are omitted here. The computer-readable storage medium may include read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0103] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.

[0104] Numerous specific details are set forth in the specification provided herein. However, it will be understood that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures, and techniques have not been shown in detail so as not to obscure the understanding of this specification.

[0105] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of the present invention.

[0106] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed in this invention can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.

[0107] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

Claims

1. A container-based subnet management system, characterized in that, The system includes: a subnet creation module, a subnet query module, and a subnet deletion module. The subnet query module is communicatively connected to both the subnet creation module and the subnet deletion module. The subnet creation module is used to respond to a subnet creation request, obtain first network information corresponding to the subnet creation request, create a target subnet based on the first network information, calculate a first allocated address within the target subnet, and generate first storage information for each first allocated address. The subnet query module is used to respond to an address query request for the target subnet, obtain the target allocation address and the first storage information of the target allocation address from the first allocation address, and modify the allocation identifier in the first storage information according to the address query request; The subnet deletion module is used to respond to a subnet deletion request for the target subnet, obtain the allocation identifier in the first storage information, and if there is no allocated marker in the allocation identifier, delete the target subnet and release the first allocation address and the first storage information. The address query request includes a connection query request and a release query request. The subnet query module includes: a connection address lookup submodule, a connection record submodule, a release address lookup submodule, and a release record submodule. The connection address lookup submodule is used to, if the address query request is a connection query request for a target unit, obtain the target allocated address from the allocated address pool of the target subnet in ascending order, and set the target allocated address as the Internet Protocol address associated with the target unit; The connection recording submodule is used to obtain the unit information of the target unit, record the unit information in the third storage information corresponding to the target allocation address, and modify the allocation identifier of the target allocation address to the allocated mark. The unit information includes at least device information and device identifier. The release address lookup submodule is used to obtain the unit information of the target unit if the address query request is a release query request for the target unit, extract the Internet Protocol address associated with the target unit from the unit information, and determine the target release address based on the Internet Protocol address; The release record submodule is used to obtain the fourth storage information corresponding to the target release address, delete the unit information in the fourth storage information, and modify the allocation identifier of the target release address to an unallocated marker.

2. The system according to claim 1, characterized in that, The subnet creation module includes: a network information acquisition submodule, a target subnet verification submodule, and a target subnet creation submodule; The network information acquisition submodule is used to respond to the subnet creation request and acquire first network information corresponding to the subnet creation request. The first network information includes at least network type, Internet Protocol address and subnet mask. The target subnet verification submodule is used to calculate a first address range of the target subnet based on the first network information, compare the first address range with a second address range of a preset network segment, and obtain a first overlap result of the target subnet; if the first overlap result indicates no overlap, then it checks whether the first allocated address of the target subnet is empty; if the first overlap result indicates overlap, or if the first allocated address is empty, then the creation verification result of the target subnet is unqualified; if the first allocated address is not empty, then the creation verification result of the target subnet is qualified. The target subnet creation submodule is used to create the target subnet if the creation verification result is qualified; calculate the first allocated address based on the first network information, and generate the first storage information for each first allocated address; if the creation verification result is unqualified, return creation failure information.

3. The system according to claim 1, characterized in that, The system also includes a subnet update module, which is communicatively connected to the subnet creation module and the subnet deletion module. The subnet update module includes: an update information acquisition submodule, an update verification submodule, and a target subnet update submodule. The update information acquisition submodule is used to respond to a subnet update request for the target subnet and acquire second network information corresponding to the subnet update request. The second network information includes the updated Internet Protocol address and the updated subnet mask. The update verification submodule is used to obtain a second overlap result based on the second network information, or to obtain the allocation identifier of the target subnet; if the second overlap result indicates no overlap, or if the allocation identifier meets the update conditions of the target subnet, then it checks whether the second allocation address of the updated target subnet is empty; if the second allocation address is empty, then the update verification result of the target subnet is unqualified; if the second allocation address is not empty, then the update verification result of the target subnet is qualified. The target subnet update submodule is configured to, if the update verification result is qualified, update the first network information to the second network information, calculate the updated second allocation address of the target subnet based on the second network information, and generate second storage information for each second allocation address; update the first allocation address using the second allocation address, and update the first storage information using the second storage information; if the update verification result is unqualified, return update failure information.

4. The system according to claim 3, characterized in that, The subnet update request includes a subnet expansion request and a subnet reduction request, and the update verification submodule includes an expansion verification submodule and a reduction verification submodule; The expansion verification submodule is used to, if the subnet update request is a subnet expansion request, calculate the third address range of the updated target subnet based on the second network information, compare the third address range with the second address range of the preset network segment, and obtain the second overlap result of the updated target subnet; if the second overlap result is that there is no overlap, then check whether the second allocated address of the updated target subnet is empty; if the second allocated address is not empty, then the update verification result of the target subnet is qualified; if the second overlap result is that there is overlap, or if the second allocated address is empty, then the update verification result of the target subnet is unqualified. The scaling-down verification submodule is configured to: if the subnet update request is a subnet scaling-down request, obtain the allocation identifier in the first storage information; if the allocation identifier does not contain an allocated flag, the allocation identifier meets the update condition, and detect whether the second allocation address of the updated target subnet is empty; if the allocation identifier contains an allocated flag, calculate the fourth address range of the updated target subnet based on the second network information; compare the fourth address range with the allocated address corresponding to the allocated flag; if the allocated address is within the fourth address range, detect whether the second allocation address of the updated target subnet is empty; if the second allocation address is empty, the update verification result of the target subnet is unqualified; if the second allocation address is not empty, the update verification result of the target subnet is qualified.

5. The system according to claim 1, characterized in that, The subnet query module also includes: a subnet quantity monitoring submodule; The subnet quantity monitoring submodule is used to obtain the first allocated address of the target subnet. If the number of the first allocated addresses is less than a preset quantity threshold, an alarm message is sent.

6. The system according to claim 1, characterized in that, The subnet deletion module includes: a subnet deletion verification submodule and a target subnet deletion submodule; The subnet deletion verification submodule is used to respond to a subnet deletion request for the target subnet by obtaining the allocation identifier in the first storage information; if there is no allocated flag in the allocation identifier, the deletion verification result of the target subnet is qualified; if there is an allocated flag in the allocation identifier, the deletion verification result of the target subnet is unqualified. The target subnet deletion submodule is used to release the first network information and delete the first stored information if the deletion verification result is qualified; and to return deletion failure information if the deletion verification result is unqualified.

7. A container-based subnet management method, characterized in that, An application is provided in a container-based subnet management system, which includes at least a subnet creation module, a subnet query module, and a subnet deletion module. The subnet query module is communicatively connected to both the subnet creation module and the subnet deletion module. The subnet query module includes: a connection address lookup submodule, a connection record submodule, a release address lookup submodule, and a release record submodule. The method includes: In response to a subnet creation request, first network information corresponding to the subnet creation request is obtained, a target subnet is created based on the first network information, a first allocated address within the target subnet is calculated, and first storage information for each first allocated address is generated; In response to an address query request for the target subnet, the target allocation address and the first storage information of the target allocation address are obtained from the first allocation address, and the allocation identifier in the first storage information is modified according to the address query request, wherein the address query request includes a connection query request and a release query request; In response to a subnet deletion request for the target subnet, the allocation identifier in the first storage information is obtained. If there is no allocated identifier in the allocation identifier, the target subnet is deleted, and the first allocation address and the first storage information are released. In response to a connection query request for a target unit, a target allocation address is obtained from the allocation address pool of the target subnet in ascending order, and the target allocation address is set as the Internet Protocol address associated with the target unit; Obtain the unit information of the target unit, record the unit information in the third storage information corresponding to the target allocation address, and modify the allocation identifier of the target allocation address to the allocated mark. The unit information includes at least device information and device identifier. In response to a release query request for a target unit, the unit information of the target unit is obtained, the Internet Protocol address associated with the target unit is extracted from the unit information, and the target release address is determined based on the Internet Protocol address; Obtain the fourth storage information corresponding to the target release address, delete the cell information in the fourth storage information, and modify the allocation identifier of the target release address to an unallocated flag.

8. An electronic device, comprising: One or more processors; Memory; One or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, the one or more programs being configured to perform the container-based subnet management method of claim 7.

9. A computer-readable storage medium having instructions stored thereon that, when executed by one or more processors, cause the processors to perform the container-based subnet management method of claim 7.

Citation Information

Patent Citations

  • IP resource management method and system

    CN108040136A

  • Subnet network resource management method and system based on virtualization platform

    CN112291078A