Container-based subnet management system, method and equipment and storage medium

Through an automated subnet management system on the Kubernetes platform, the problem of unreasonable allocation of IP address resources is solved, network resource utilization and communication stability are improved, and management complexity is reduced.

CN119316264AActive Publication Date: 2025-01-14JINAN INSPUR DATA TECH CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

In the Kubernetes platform, the IP address resources of the container subnet are limited, and manual management is difficult to adapt to dynamic changes, resulting in unreasonable allocation of IP address resources, which may cause network failures and the problem of devices being unable to connect.

Method used

Provide a container-based subnet management system, including subnet creation, query and deletion modules. Through automated and dynamic life cycle management, the creation, update and deletion of subnets can be realized, and the IP address is automatically allocated and released. Avoid configuration errors and resource waste.

Benefits of technology

It improves the utilization rate of network resources, communication stability and security, reduces maintenance costs and management complexity, and provides technical guarantees for the continuous and stable operation of the business system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119316264A_ABST
    Figure CN119316264A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a subnet management system, method and equipment based on a container and a storage medium, and relates to the technical field of the container, the system comprises a subnet creation module, a subnet query module and a subnet deletion module, the subnet creation module is used for obtaining first network information in response to a subnet creation request, and sending the first network information to the subnet query module; creating a target subnet based on the first network information, calculating a first allocation address in the target subnet and generating first storage information of the first allocation address; the subnet query module is used for obtaining a target allocation address and first storage information of the target allocation address in response to the address query request, and modifying an allocation identifier in the first storage information; the subnet deleting module is used for responding to the subnet deleting request, if the allocated mark does not exist in the allocation identifier in the first storage information, the target subnet is deleted, the first allocation address and the first storage information are released, and the utilization rate of network resources is increased through automatic management.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

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

[0003] In the process of providing services on the Kubernetes platform, the IP address (Internet Protocol address) resources available for allocation in the container subnet are limited. When IP addresses are occupied or allocated but not recovered in time, these IP addresses may conflict with other containers, causing abnormal network communication and unnecessary resource occupation. In a large network environment, the configuration and management of IP address resources can only be set manually by the administrator, and the addition, deletion and movement 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 wasteful allocation of IP address resources, causing network failures, device connection failures and other problems. Summary of the invention

[0004] The purpose of the embodiments of the present 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 to achieve lifecycle management of subnets. Through automated and dynamic subnet lifecycle management, the utilization rate of network resources, the stability and security of network communications are significantly improved. The specific technical solutions are as follows:

[0005] In a first aspect of the present invention, a container-based subnet management system is provided, the system comprising: a subnet creation module, a subnet query module and a subnet deletion module, the subnet query module is respectively connected to the subnet creation module and the subnet deletion module, wherein:

[0006] The subnet creation module is used to respond to the 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 in the target subnet, and generate first storage information for each of the first allocated addresses;

[0007] The subnet query module is used to obtain a target allocated address and first storage information of the target allocated address from the first allocated address in response to an address query request for the target subnet, and to modify an 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, delete the target subnet if there is no allocated mark in the allocation identifier, and release the first allocated 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 obtain first network information corresponding to the subnet creation request, wherein the first network information at least includes a network type, an Internet Protocol address, and a subnet mask;

[0011] The target subnet check submodule is used to calculate the first address range of the target subnet based on the first network information, compare the first address range with the second address range of the preset network segment, and obtain the first overlap result of the target subnet; if the first overlap result is that there is no overlap, then detect whether the first allocated address of the target subnet is empty; if the first overlap result is that there is an overlap, or if the first allocated address is empty, the creation check result of the target subnet is unqualified; if the first allocated address is not empty, the creation check 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, the subnet update module is respectively connected to the subnet creation module and the subnet deletion module in communication, and 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 the subnet update request for the target subnet and acquire second network information corresponding to the subnet update request, wherein the second network information includes an updated Internet Protocol address and an 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 is that there is no overlap, or if the allocation identifier meets the update condition of the target subnet, then 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;

[0016] The target subnet update submodule is used to update the first network information to the second network information if the update verification result is qualified, calculate the second allocated address of the updated target subnet based on the second network information, and generate second storage information for each second allocated address; use the second allocated address to update the first allocated address, and use the second storage information to update the first 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 for, if the subnet update request is the subnet expansion request, calculating the third address range of the updated target subnet based on the second network information, comparing the third address range with the second address range of the preset network segment, and obtaining the second overlap result of the updated target subnet; if the second overlap result is that there is no overlap, detecting whether the second allocated address of the updated target subnet is empty; if the second allocated address is not empty, 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, the update verification result of the target subnet is unqualified;

[0019] The shrinkage verification submodule is used to obtain the allocation identifier in the first storage information if the subnet update request is the subnet shrinkage request; if there is no allocated mark in the allocation identifier, the allocation identifier meets the update condition, and detects whether the second allocated address of the updated target subnet is empty; if there is an allocated mark in the allocation identifier, 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 mark, if the allocated address is within the fourth address range, detect whether the second allocated address of the updated target subnet is empty; if the second allocated address is empty, the update verification result of the target subnet is unqualified; if the second allocated 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 search submodule, a connection record submodule, a release address search submodule, and a release record submodule;

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

[0022] The connection recording submodule is used to obtain 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 mark of the target allocation address to an allocated mark, wherein the unit information at least includes device information and device identification;

[0023] a release address search submodule, configured to, if the address query request is a release query request for a target unit, obtain unit information of the target unit, extract an 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 mark of the target release address to an unallocated mark.

[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, and send an alarm message if the number of the first allocated addresses is less than a preset quantity threshold.

[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 obtain the allocation identifier in the first storage information in response to the subnet deletion request for the target subnet; if the allocation identifier does not contain the allocated mark, the deletion verification result of the target subnet is qualified; if the allocation identifier contains the allocated mark, 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 storage information if the deletion verification result is qualified; if the deletion verification result is unqualified, return deletion failure information.

[0030] In a second aspect of the implementation of the present invention, a container-based subnet management method is also provided, which is applied to a container-based subnet management system, wherein the container-based subnet management system comprises at least a subnet creation module, a subnet query module and a subnet deletion module, wherein the subnet query module is respectively communicated with the subnet creation module and the subnet deletion module, and the method comprises:

[0031] In response to a subnet creation request, obtaining first network information corresponding to the subnet creation request, creating a target subnet based on the first network information, calculating a first allocated address in the target subnet, and generating first storage information for each of the first allocated addresses;

[0032] In response to an address query request for the target subnet, obtaining a target allocated address and first storage information of the target allocated address from the first allocated address, and modifying an allocation identifier in the first storage information according to the address query request;

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

[0034] In a third aspect of the implementation of the present 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 execute the above-mentioned container-based subnet management method.

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

[0036] The container-based subnet management system provided by the embodiment of the present invention, through a subnet creation module, responds to a subnet creation request, obtains the first network information corresponding to the subnet creation request to create a target subnet, and calculates the first allocation address that can be used for allocation in the target subnet, and generates first storage information for each first allocation address; through a subnet query module, responds to an address query request for the target subnet, obtains the target allocation address and the first storage information of the target allocation address from the first allocation address, modifies the allocation identifier in the first storage information according to the address query request, and realizes the allocation and release of the first allocation address; through a subnet deletion module, responds to a subnet deletion request for the target subnet, obtains the allocation identifier in the first storage information, verifies the allocation address of the address in the target subnet, deletes the target subnet if the allocated address does not exist in the target subnet, and releases the first allocation address and the first storage information. The present invention automatically creates, updates and deletes subnets through a container-based subnet management system to achieve lifecycle management of subnets. The subnet creation module automatically verifies the network legitimacy of the newly created target subnet, effectively avoiding security risks caused by configuration errors or non-compliance. The subnet update module dynamically adjusts the configuration information of the subnet according to business needs to ensure the reasonable allocation and efficient use of IP addresses. The subnet deletion module executes automated process deletion to reduce human configuration errors and ensure consistency and accuracy of operations. At the same time, related IP address resources are recovered and released in real time to improve resource utilization. Through automated and dynamic subnet lifecycle management, the utilization of network resources, the stability and security of network communications are significantly improved, while the maintenance cost and management complexity are reduced, providing a solid technical guarantee for the continuous and stable operation of the business system.

[0037] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

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

[0040] Figure 2 It is a flowchart of the steps of working of a subnet creation module in a container-based subnet management system provided by an embodiment of the present invention;

[0041] Figure 3 It is a flowchart of the steps of working of a subnet query module in a container-based subnet management system provided by an embodiment of the present invention;

[0042] Figure 4 It is a flowchart of the steps of working of a subnet update module in a container-based subnet management system provided by an embodiment of the present invention;

[0043] Figure 5 It is a flowchart of the steps of working of a subnet deletion module in a container-based subnet management system provided by an embodiment of the present invention;

[0044] Figure 6 is a flowchart of a container-based subnet management method provided by an embodiment of the present invention;

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

[0046] Figure 8 It is a structural block diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0047] In order to make the above-mentioned purposes, features and advantages of the present invention more obvious and easy to understand, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0048] In order 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 illustrated 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-level environment for deploying, maintaining, and scaling applications.

[0050] Subnet, in order to determine the network area, separates each interface of the host and router, thus generating several separate network islands, and the interface ends connect the endpoints of these independent networks. These independent network islands are called subnets.

[0051] IP address (Internet Protocol Address) refers to the Internet Protocol address, which is also translated as Internet Protocol address. IP address is a unified address format provided by the IP protocol. It assigns a logical address to each network and each host on the Internet to shield the difference in physical addresses.

[0052] Subnet Mask is an important parameter used to distinguish the network part from the host part in the network. The subnet mask is used in conjunction with the IP address to help determine the network part and the host part of an IP address, thereby achieving network division and management. For example, an IP address usually consists of two parts: the network part and the host part, where the subnet mask represents the network part and the host part of the IP address through a series of consecutive 1s and 0s.

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

[0054] The first network information refers to the basic network parameters for configuring the target subnet received in response to the subnet creation request. Exemplarily, to create the 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 configuration parameters of the updated target subnet received in response to the subnet update request. Exemplarily, to update the target subnet, the second network information may include information such as the updated IP address and the updated subnet mask.

[0056] The first allocated address refers to an available allocated address in the target subnet. The first allocated address usually refers to an available allocated address in the target subnet except the network address and the broadcast address.

[0057] The second allocated address refers to the available allocated address in the updated target subnet. After the target subnet is updated, the available allocated address in the updated target subnet is recalculated and obtained. It usually refers to the available allocated address in the updated target subnet except the network address and the broadcast address.

[0058] The first storage information refers to parameter information related to the first assigned address. After calculating the available first assigned addresses in the target subnet, storage information is generated for each first assigned address to record the parameter information of the currently available assigned addresses. This information is used to ensure the correct allocation and management of IP addresses. Exemplarily, after the target subnet is created, the first storage information may include the network type, IP address, subnet mask and other information of the first assigned address.

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

[0060] As an example, in the process of providing services on the Kubernetes platform, the IP address resources available for allocation in the container subnet are limited. When IP addresses are occupied or the allocation is not recovered in time, these IP addresses may conflict with other containers, causing abnormal network communication and unnecessary resource occupation. Especially in large-scale network environments, IP address resources are tight and invalid IP allocations can only be released manually by administrators. 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 regard, in an embodiment of the present invention, the first network information is obtained through a subnet creation module to create a target subnet, and the first allocation address that can be used for allocation in the target subnet is calculated to generate first storage information for each first allocation address. The target allocation address and the first storage information of the target allocation address are obtained from the first allocation address through a subnet query module, and the allocation identifier in the first storage information is modified to realize the allocation and release of the first allocation address. The allocation status of the IP address in the target subnet is verified through a subnet deletion module, and the first allocation address and the first storage information are released while deleting the subnet. Through a container-based subnet management system, the subnet is automatically created, updated and deleted. Through automated and dynamic subnet life cycle management, the utilization rate of network resources, the stability and security of network communications are significantly improved.

[0062] Reference Figure 1 , showing 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 communicated with the subnet creation module 110 and the subnet deletion module 130 respectively.

[0063] The subnet creation module 110 is used to respond to the 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 in the target subnet, and generate first storage information of each first allocated address;

[0064] A user can create a new container subnet according to network planning. When the subnet controller listens to a subnet creation request, it can receive the first network information and send a subnet creation request to the subnet management system, wherein the creation request for creating the 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 a network legitimacy check based on the acquired first network information. When the first network information passes the network legitimacy check, the subnet creation action continues. When the first network information fails the legitimacy check, creation failure information is returned, indicating that the creation of the new subnet 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 a possible embodiment, in combination with the subnet creation process implemented by the subnet creation module 110, the submodules included in the subnet creation module 110 are further described, referring to Figure 2 , showing a flowchart of the steps of the subnet creation module in a container-based subnet management system provided by an embodiment of the present invention, wherein the network information acquisition submodule responds to the subnet creation request to obtain the 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, and exemplarily, the first network information may include the network type, Internet Protocol address and subnet mask.

[0067] The first network information is verified for network legitimacy by the target subnet verification submodule. 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, the network configuration information of the preset network segment is obtained to calculate the second address range of the preset network segment. Exemplarily, the preset network segment may include a host network segment, an existing subnet network segment, and a reserved subnet network segment. By comparing the first address range with the second address range, a first overlap result of the target subnet can be obtained. The first overlap result can be used to indicate whether the target subnet overlaps with 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 cause 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 check, and the creation check 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 target subnet can be verified to see whether the available first allocated address is contained in the target subnet. Specifically, the first allocated address available in the target subnet can be verified by calculating the IP address range, and the network address, broadcast address and available IP address of the target subnet can be obtained by calculation based on the first network information, wherein 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 range and boundary of the target subnet can be identified by the network address and the broadcast address, and the IP address between the network address and the broadcast address is the available IP address, which is also the first allocated address. If the first allocated address in the target subnet is detected to be empty, then the creation verification result of the target subnet is confirmed to be unqualified; if the first allocated address in the target subnet is detected to be not empty, then the creation verification result of the target subnet is confirmed to be qualified.

[0068] The target subnet creation submodule determines whether to create the target subnet according to the creation verification result of the target subnet. Specifically, if the creation verification result is qualified, the subnet creation process is executed to create the target subnet, and the first allocated address available for allocation in the target subnet is calculated based on the acquired first network information, and first storage information is generated for each first allocated address, wherein the first storage information can record relevant parameter information of the current first allocated address, such as network type, IP address, subnet mask, etc.; if the creation verification result is unqualified, creation failure information is returned, and the creation of the new container subnet fails.

[0069] In a possible embodiment, the subnet management system may further include a subnet update module 140 that is respectively connected to the subnet creation module 110 and the subnet deletion module 130 in communication. The subnet update module 140 is used to dynamically adjust the configuration information of the subnet according to business needs. In combination with the subnet update process implemented by the subnet update module 140, each submodule included in the subnet update module 140 is further described. Figure 3 , showing a flowchart of the steps of the subnet update module in a container-based subnet management system provided by an embodiment of the present invention, wherein the subnet update module 140 may include an update information acquisition submodule, an update verification submodule, and a target subnet update submodule.

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

[0071] The update check submodule can be used to check the network legitimacy of the second network information. Specifically, the update check submodule can calculate the third address range of the target subnet based on the second network information, and obtain the second overlapping result, and confirm the update check result of the target subnet in combination with the second overlapping result; in another way, the update check submodule can also detect the address allocation information in the target subnet by obtaining the allocation identifier of the target subnet, and further obtain the update check result of the target subnet. By checking 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 the compliance and stability of the network.

[0072] Preferably, in the dynamic allocation of resources, the created subnet may have the problem that the address range is too small to meet the allocation requirements, or the address range 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 reduction request. Accordingly, the update verification submodule may include: an expansion verification submodule and a reduction verification submodule.

[0073] Among them, when the subnet update request is a subnet expansion request, the network legitimacy is verified by the expansion verification submodule for 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 the updated subnet mask in the second network information, and compare the third address range with the second address range of the preset network to obtain the second overlapping result of the updated target subnet. Exemplarily, the target subnet can be expanded by expanding the range of the first address range, then the updated third address The range can include the first address range, such as the first address range is 192.168.1.1 to 192.168.1.254, and the third address range after expansion is 192.168.0.1 to 192.168.255.254. The target subnet can also be expanded by obtaining a third address range outside the first address range. It can be understood as deleting the target subnet and recreating a larger subnet. It can be achieved through the subnet deletion module and the subnet creation module in the subnet management system, and the present invention will not be elaborated 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 target subnet conflicts with the existing network configuration after the update, which may cause resource allocation errors or other potential network failures. Therefore, it can be confirmed that the second network information has not passed the network legitimacy 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 target subnet does not conflict with the existing network configuration after the update, and the update check result of the updated target subnet can be entered. Whether the available second allocated address is included in the updated target subnet can be checked. Specifically, the available second allocated address in the updated target subnet can be checked by calculating the IP address range, and the calculation is performed based on the second network information to obtain the updated network address, broadcast address and available IP address. The IP address between the updated network address and the updated broadcast address is the second allocated address. If the second allocated address in the updated target subnet is detected to be empty, the update check result of the target subnet is confirmed to be unqualified; if the second allocated address in the updated target subnet is detected 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 reduction request, the first storage information is obtained from the target subnet through the reduction verification submodule, and multiple allocation identifiers are extracted from the first storage information, the allocation identifier is used to mark the allocation status of the current first allocated address, and the allocation identifier may include an allocated tag and an unallocated tag; by traversing and matching the allocation identifiers, the allocation information of the IP address in the target subnet is obtained. For example, if there is no allocated tag in the multiple allocation identifiers of the target subnet, it means that the target subnet does not contain an allocated IP address, and the detection of the second allocated address in the updated target subnet can be started; if there is an allocated tag in the multiple allocation identifiers of the target subnet, it means that before the update, the target subnet contains an allocated IP address, and the updated target subnet needs to be further verified. 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 mark, confirm whether the updated target subnet still contains the allocated IP address. When 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 on the target subnet will not affect the allocated IP address. The detection of the second allocated address in the updated target subnet can be entered. When 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 on the target subnet will cause the allocated IP address in the target subnet to no longer be in the target subnet, which may cause 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 the allocated IP address, or the updated target subnet still contains the pre-allocated IP address, the detection of the second allocated address in the updated target subnet can be started. The verification of the available second allocated address in the updated target subnet can be achieved by calculating the IP address range. The updated network address and the updated broadcast address are calculated based on the second network information. The detection result of the second allocated address can be confirmed by the updated network address and the updated broadcast address. When the second allocated address is found to be empty, it can be confirmed that the update verification result of the target subnet is unqualified; when the second allocated address is found to be not empty, it can be confirmed that the update verification result of the target subnet is qualified.

[0077] The target subnet update submodule determines whether to update the target subnet based on the update verification result of the target subnet. Specifically, if the update verification result is qualified, the subnet update process is executed to update the target subnet. The first network information can be updated to the second network information, and the second allocated address of the updated target subnet is recalculated based on the second network information, and second storage information is generated for each second allocated address, wherein the second storage information can re-record relevant parameter information of the current second allocated address, such as network type, IP address, subnet mask, etc.; after recalculation, the second allocated address is used to update the first allocated address, and the second storage information is used to update the first storage information to obtain a new target subnet; if the update verification result is unqualified, update failure information is returned, indicating that the update operation on the target subnet has failed.

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

[0079] After the target subnet is created, the user can connect and disconnect the computing unit with the target subnet through the subnet query module 120. When the user creates a new computing unit, that is, a new pod, the subnet query module 120 can be used to request the IP address of the target subnet for connection. When the user deletes the pod, the corresponding IP address can be released through the subnet query module 120, thereby realizing the corresponding addition and deletion of the device and performing corresponding dynamic management on the subnet. The subnet query module 120 may include: a connection address search submodule, a connection record submodule, a release address search submodule, and a release record submodule. In addition, the subnet query module 120 can also be used to continuously monitor and push information to the target subnet. The subnet query module may also include a subnet quantity monitoring submodule.

[0080] In a possible embodiment, in combination with the subnet query process implemented by the subnet query module 120, each submodule included in the subnet query module 120 is further described, referring to Figure 4, showing a flowchart of the steps of the subnet query module in a container-based subnet management system provided by an embodiment of the present invention, wherein, corresponding to different business needs of users, 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 target allocation address for allocation to the pod is selected from the IP address pool of the target subnet through the connection address search submodule. Exemplarily, the available target allocation address can be obtained from the IP address pool in ascending order from small to large, and the target allocation address is set to the IP address associated with the target unit, that is, the selected target allocation address is allocated to the target unit. Among them, the IP address pool is used to manage all available IP addresses in the target subnet. When the target subnet is successfully created and the first allocation address is calculated, all first allocation addresses enter the IP address pool and wait for selection and allocation. The allocation identifiers of the first allocation addresses in the IP address pool are all unallocated marks, and 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, and the unit information can be recorded in the third storage information corresponding to the target allocation address. The record of the unit information can be directly appended in the third storage information, such as continuing to add the 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 an allocated mark. Exemplarily, 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, which is the same as the first storage information corresponding to the unselected first allocation address, and is only used here to distinguish it from the remaining 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 search 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 is obtained through the release record submodule, the unit information in the fourth storage information is deleted, and the allocation identifier of the target release address is modified to an unallocated mark, the associated IP address is disconnected and re-enters the IP address pool, waiting for subsequent selection connection.

[0083] In one example, the subnet usage information can also be pushed in real time through the subnet query module. Specifically, the subnet query module can include a subnet quantity monitoring submodule. The first allocated address in the target subnet is obtained through the subnet quantity monitoring submodule, and the number of the first allocated addresses, that is, the number of IP addresses available for allocation in the target subnet is calculated. When the number of the first allocated addresses is less than a 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 number of 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 used to respond to a subnet deletion request for a target subnet, obtain an allocation identifier in the first storage information, delete the target subnet if there is no allocated mark in the allocation identifier, and release the first allocated address and the first storage information.

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

[0086] Specifically, the subnet deletion module 130 may include: a subnet deletion verification submodule, a target subnet deletion submodule. In a possible embodiment, in combination with the subnet deletion process implemented by the subnet deletion module 130, the submodules included in the subnet deletion module 130 are further described, with reference to Figure 6 , showing a flowchart of the steps of the subnet deletion module in a container-based subnet management system provided by an embodiment of the present invention, wherein, in response to the subnet deletion request, the subnet deletion verification submodule can verify the allocation information of the target subnet to be deleted by obtaining the allocation identifier in the first storage information; if there is no allocated mark in the allocation identifier of the target subnet, indicating that the target subnet does not contain the allocated IP address, then the deletion verification result of the target subnet is confirmed to be qualified; if there is an allocated mark in the allocation identifier of the target subnet, indicating that the target subnet still contains the allocated IP address, then the deletion verification result of the target subnet is confirmed to be unqualified; the target subnet deletion submodule determines 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, then the target subnet is deleted, and 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, then the deletion failure information is returned, indicating that the deletion of the target subnet has failed.

[0087] In one example, referring to Figure 6 The subnet management system provided by the present invention can respond to different requests from users corresponding to business needs, and automatically manage the subnet through the subnet creation module 110, the subnet update module 120, the subnet deletion module 130 and the subnet query module 140, and return information to the user based on the verification result of the subnet and the process execution status to display the management status of the subnet. When the subnet is successfully created, some storage information can be generated in the storage to record different subnets. At the same time, the subnet management system can interact with the pod for signals to realize the allocation and release of IP addresses in the subnet.

[0088] The present invention automatically creates, updates and deletes subnets through a container-based subnet management system to achieve lifecycle management of subnets. The subnet creation module automatically verifies the network legitimacy of the newly created target subnet, effectively avoiding security risks caused by configuration errors or non-compliance. The subnet update module dynamically adjusts the configuration information of the subnet according to business needs to ensure the reasonable allocation and efficient use of IP addresses. The subnet deletion module executes automated process deletion to reduce human configuration errors and ensure the consistency and accuracy of operations. At the same time, related IP address resources are recovered and released in real time to improve resource utilization. The present invention realizes automated creation and verification of target subnets through a subnet management system, effectively simplifies the management process, eliminates the need for manual configuration of each subnet, and reduces management complexity. In particular, in a dynamically changing network environment, the automated process can quickly adapt to network changes. Through automated and dynamic subnet lifecycle management, the utilization of network resources, the stability and security of network communications are significantly improved, while reducing maintenance costs and management complexity, providing a solid technical guarantee for the continuous and stable operation of business systems.

[0089] The present application embodiment also provides a container-based subnet management method. Figure 7 , shows a flowchart of a container-based subnet management method according to an embodiment of the present application, which is applied to a container-based subnet management system. The system includes at least a subnet creation module 110, a subnet query module 120, and a subnet deletion module 130, and may specifically include the following steps:

[0090] Step 701, in response to a subnet creation request, obtaining first network information corresponding to the subnet creation request, creating a target subnet based on the first network information, calculating a first allocated address in the target subnet, and generating first storage information for each first allocated address;

[0091] Step 702, in response to an address query request for a target subnet, obtaining a target allocated address and first storage information of the target allocated address from the first allocated address, and modifying an 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, and if the allocation identifier does not contain the allocated mark, delete the target subnet and release the first allocated address and the first storage information.

[0093] It should be noted that, for the sake of simplicity, the method embodiments are described as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present invention are not limited by the order of the actions described, because according to the embodiments of the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present invention.

[0094] refer to Figure 8 The embodiment of the present invention further 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 through the communication bus 804.

[0095] Memory 803, used for storing computer programs;

[0096] The processor 801 is used to execute the program stored in the memory 803, and implements the following steps:

[0097] In response to the subnet creation request, obtaining first network information corresponding to the subnet creation request, creating a target subnet based on the first network information, calculating a first allocated address in the target subnet, and generating first storage information for each first allocated address;

[0098] In response to an address query request for a target subnet, obtaining a target allocated address and first storage information of the target allocated address from the first allocated address, and modifying an allocation identifier in the first storage information according to the address query request;

[0099] In response to a subnet deletion request for a target subnet, an allocation identifier in the first storage information is obtained, and if the allocation identifier does not contain an allocated mark, the target subnet is deleted, and the first allocation address and the first storage information are released.

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

[0101] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0102] The embodiment of the present 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 the electronic device, the electronic device can execute the various processes of the above-mentioned container-based subnet management method embodiment and achieve the same technical effect. To avoid repetition, it is not repeated here. The computer-readable storage medium is, for example, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0103] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.

[0104] In the description provided herein, a large number of specific details are described. However, it is understood that embodiments of the present invention can be practiced without these specific details. In some instances, well-known methods, structures and techniques are not shown in detail so as not to obscure the understanding of this description.

[0105] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for enabling a terminal (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present invention.

[0106] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed in the embodiments of the present invention can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0107] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.

Claims

1. A container-based subnet management system, characterized in that: The system comprises: a subnet creation module, a subnet query module and a subnet deletion module, wherein the subnet query module is respectively connected to the subnet creation module and the subnet deletion module for communication, wherein: The subnet creation module is used to respond to the 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 in the target subnet, and generate first storage information for each of the first allocated addresses; The subnet query module is used to obtain a target allocated address and first storage information of the target allocated address from the first allocated address in response to an address query request for the target subnet, and to modify an 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, delete the target subnet if there is no allocated mark in the allocation identifier, and release the first allocated address and the first storage information.

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 obtain first network information corresponding to the subnet creation request, wherein the first network information at least includes a network type, an Internet Protocol address, and a subnet mask; The target subnet check submodule is used to calculate the first address range of the target subnet based on the first network information, compare the first address range with the second address range of the preset network segment, and obtain the first overlap result of the target subnet; if the first overlap result is that there is no overlap, then detect whether the first allocated address of the target subnet is empty; if the first overlap result is that there is an overlap, or if the first allocated address is empty, the creation check result of the target subnet is unqualified; if the first allocated address is not empty, the creation check 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 further comprises a subnet update module, which is respectively connected to the subnet creation module and the subnet deletion module in communication, and comprises: 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 the subnet update request for the target subnet and acquire second network information corresponding to the subnet update request, wherein the second network information includes an updated Internet Protocol address and an 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 is that there is no overlap, or if the allocation identifier meets the update condition of the target subnet, then 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; The target subnet update submodule is used to update the first network information to the second network information if the update verification result is qualified, calculate the second allocated address of the updated target subnet based on the second network information, and generate second storage information for each second allocated address; use the second allocated address to update the first allocated address, and use the second storage information to update the first 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 check submodule includes: an expansion check submodule and a reduction check submodule; The expansion verification submodule is used for, if the subnet update request is the subnet expansion request, calculating the third address range of the updated target subnet based on the second network information, comparing the third address range with the second address range of the preset network segment, and obtaining the second overlap result of the updated target subnet; if the second overlap result is that there is no overlap, detecting whether the second allocated address of the updated target subnet is empty; if the second allocated address is not empty, 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, the update verification result of the target subnet is unqualified; The shrinkage verification submodule is used to obtain the allocation identifier in the first storage information if the subnet update request is the subnet shrinkage request; if there is no allocated mark in the allocation identifier, the allocation identifier meets the update condition, and detects whether the second allocated address of the updated target subnet is empty; if there is an allocated mark in the allocation identifier, 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 mark, if the allocated address is within the fourth address range, detect whether the second allocated address of the updated target subnet is empty; if the second allocated address is empty, the update verification result of the target subnet is unqualified; if the second allocated 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 address query request includes a connection query request and a release query request, and the subnet query module includes: a connection address search submodule, a connection record submodule, a release address search submodule, and a release record submodule; The connection address search submodule is used for obtaining a target allocated address from an allocated address pool of the target subnet in ascending order if the address query request is a connection query request for a target unit, and setting the target allocated address as an Internet Protocol address associated with the target unit; The connection recording submodule is used to obtain 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 mark of the target allocation address to an allocated mark, wherein the unit information at least includes device information and device identification; a release address search submodule, configured to, if the address query request is a release query request for a target unit, obtain unit information of the target unit, extract an 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 mark of the target release address to an unallocated mark.

6. 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, and send an alarm message if the number of the first allocated addresses is less than a preset quantity threshold.

7. 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 obtain the allocation identifier in the first storage information in response to the subnet deletion request for the target subnet; if the allocation identifier does not contain the allocated mark, the deletion verification result of the target subnet is qualified; if the allocation identifier contains the allocated mark, 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 storage information if the deletion verification result is qualified; if the deletion verification result is unqualified, return deletion failure information.

8. A container-based subnet management method, characterized in that: 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 respectively communicated with the subnet creation module and the subnet deletion module, and the method includes: In response to a subnet creation request, obtaining first network information corresponding to the subnet creation request, creating a target subnet based on the first network information, calculating a first allocated address in the target subnet, and generating first storage information for each of the first allocated addresses; In response to an address query request for the target subnet, obtaining a target allocated address and first storage information of the target allocated address from the first allocated address, and modifying an allocation identifier in the first storage information according to the address query request; In response to a subnet deletion request for the target subnet, an allocation identifier in the first storage information is obtained, and if there is no allocated mark in the allocation identifier, the target subnet is deleted, and the first allocated address and the first storage information are released.

9. 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, and the one or more programs are configured to execute the container-based subnet management method in claim 8.

10. A computer-readable storage medium having instructions stored thereon, which, when executed by one or more processors, cause the processors to execute the container-based subnet management method according to claim 8.

Citation Information

Patent Citations

  • IP resource management method and system

    CN108040136A

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

    CN112291078A

  • Network layer address resource allocation method, computer device and storage medium

    CN112333731A

  • Network resource adaptive configuration method and system based on container cloud platform, and medium

    CN113660316A

  • Network address allocation method and device, electronic equipment and readable medium

    CN115801733A