IP address allocation method, device and equipment for edge node
By obtaining the number of nodes and pods in the edge computing scenario, configuring the initial IP address pool, and prioritizing the allocation of IP addresses according to load and delay, the resource waste and complexity problems of traditional IP address management methods in the edge computing scenario are solved, and more efficient IP address usage and network performance improvement are achieved.
Patent Information
- Application Number
- CN202510241474.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-03
- Publication Date
- 2025-06-24
AI Technical Summary
In the edge computing scenario, traditional IP address management methods lead to increased network resource waste and management complexity due to limited resources and dynamic changes in the network.
By obtaining the total number of nodes and average number of pods of multiple edge nodes in the edge computing scenario, determine the IP address of the target number, and configure the initial IP address pool. According to the load metrics and network latency data of each edge node, it determines its priority and assigns the IP address according to the priority.
Optimizes the efficiency of IP address usage in edge nodes, enhances network performance and reliability, and reduces resource waste and management complexity.
Smart Images

Figure CN120201007A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular, to an IP address allocation method, device, and equipment for edge nodes. Background Art
[0002] With the development of the Internet of Things (IoT) and edge computing, more and more applications are deployed to edge nodes to reduce latency and improve response speed. In the edge computing environment, Kubernetes is widely used to manage distributed containers. However, due to the limited resources and dynamic network changes of edge nodes, traditional IP address management methods perform poorly in edge computing scenarios, resulting in waste of network resources and increased management complexity. Summary of the Invention
[0003] The present invention provides an IP address allocation method, device, and equipment for edge nodes, which optimize the IP address usage efficiency in edge nodes and enhance network performance and reliability.
[0004] On the one hand, the present invention provides an IP address allocation method for edge nodes, the method comprising: Obtaining the total number of nodes of multiple edge nodes in an edge computing scenario and the average number of Pods running on each edge node; Determining the target number of IP addresses required for the edge computing scenario according to the total number of nodes, the average number of Pods, and the reserved IP address ratio, and configuring an initial IP address pool according to the target number of IP addresses; Grouping the multiple edge nodes according to the geographical location, service type, or device function corresponding to each edge node to obtain multiple edge node groups; each edge node in each edge node group corresponds to the same network segment; Determining an IP address set corresponding to each edge node group according to the network segment where each IP address in the initial IP address pool is located; Determining the priority of each edge node according to the load metric value and network latency data corresponding to each edge node; Allocating an IP address for each edge node according to the IP address corresponding to each edge node group and the priority of each edge node.
[0005] In an exemplary embodiment, the allocating an IP address for each edge node according to the IP address corresponding to each edge node group and the priority of each edge node includes: Obtaining the load metric value and network latency data corresponding to each edge node; the load metric includes at least one of CPU usage rate and memory usage rate; Determine the priority of each edge node according to the load metric value and network latency data corresponding to each edge node; Allocate IP addresses to each edge node in descending order of priority.
[0006] In an exemplary embodiment, the determining the priority of each edge node according to the load metric value and network latency data corresponding to each edge node includes: Set the CPU usage threshold, memory usage threshold, and network latency threshold; Determine the first edge nodes with the first priority whose real-time CPU usage in the load metric value is greater than the CPU usage threshold, real-time memory usage is greater than the memory usage threshold, and real-time network latency value is greater than the network latency threshold; Determine the second edge nodes with the second priority for the edge nodes other than the first edge nodes among the multiple edge nodes; the first priority is higher than the second priority.
[0007] In an exemplary embodiment, the allocating IP addresses to each edge node in descending order of priority includes: Obtain the IP address allocation requests sent by multiple edge nodes in the same time period; Determine the IP address allocation order of each edge node according to the priority corresponding to each edge node to obtain the edge node order result; the allocation order of the first edge nodes is before that of the second edge nodes; Allocate IP addresses to each edge node in descending order of priority according to the edge node order result.
[0008] In an exemplary embodiment, after determining the priority of each edge node according to the load metric value and network latency data corresponding to each edge node, the method further includes: Determine the priority of each Pod according to the importance of each Pod; the priority of a Pod with a higher importance is higher than that of a Pod with a lower importance; Obtain the IP address allocation requests sent by multiple Pods in the same time period; Obtain the available resource data of each edge node based on the IP address allocation request; For the target Pod with a high importance among the multiple Pods, determine the target edge nodes among the multiple edge nodes whose available resource data is higher than the preset threshold and is load-balanced; Allocate an IP address to the target Pod using the target edge nodes.
[0009] In an exemplary embodiment, after allocating the IP address of each edge node according to the IP address corresponding to each edge node group and the priority of each edge node, the method further includes: Invoking the network interface information of the operating system to obtain the real-time IP address allocation status of each edge node; using network packet sniffing technology to collect the real-time network latency data and real-time throughput corresponding to each edge node as the real-time network performance metrics of each edge node; Inputting the real-time IP address allocation status and the real-time network performance metrics corresponding to each edge node into a network performance prediction model for IP address demand prediction and traffic pattern prediction to obtain the predicted IP address demand and predicted traffic pattern corresponding to each edge node; the network performance prediction model is obtained by training a machine learning model based on the historical IP address allocation status and historical network performance metrics of historical edge nodes.
[0010] In an exemplary embodiment, after inputting the real-time IP address allocation status and the real-time network performance metrics corresponding to each edge node into a network performance prediction model for IP address demand prediction and traffic pattern prediction to obtain the predicted IP address demand and predicted traffic pattern corresponding to each edge node, the method further includes: Obtaining idle IP addresses; In response to a creation request for a new Pod, screening out screened edge nodes with lower load and sufficient IP address resources from multiple edge nodes according to the predicted IP address demand and predicted traffic pattern corresponding to each edge node; Creating a new Pod in the screened edge nodes and allocating the idle IP addresses to the new Pod.
[0011] On the other hand, an IP address allocation device for edge nodes is provided, and the device includes: A Pod average number determination module, configured to obtain the total number of nodes of multiple edge nodes in an edge computing scenario and the average number of Pods running on each edge node; An initial IP address pool determination module, configured to determine the target number of IP addresses required for the edge computing scenario according to the total number of nodes, the average number of Pods, and the reserved IP address ratio, and configure an initial IP address pool according to the target number of IP addresses; An edge node group determination module, configured to group the multiple edge nodes according to the geographical location, service type, or device function corresponding to each edge node to obtain multiple edge node groups; each edge node in each edge node group corresponds to the same network segment; An IP address set determination module, configured to determine an IP address set corresponding to each edge node group according to the network segment where each IP address in the initial IP address pool is located; A priority determination module, configured to determine the priority of each edge node according to the load metric value and network latency data corresponding to each edge node; An IP address allocation module, configured to allocate an IP address for each edge node according to the IP address corresponding to each edge node group and the priority of each edge node.
[0012] In an exemplary embodiment, the IP address allocation module includes: A data acquisition unit, configured to acquire the load metric value and network latency data corresponding to each edge node; the load metrics include at least one of CPU usage rate and memory usage rate; A priority determination unit, configured to determine the priority of each edge node according to the load metric value and network latency data corresponding to each edge node; An address allocation unit, configured to allocate IP addresses for each edge node in descending order of priority.
[0013] In an exemplary embodiment, the priority determination unit includes: A threshold setting subunit, configured to set a CPU usage rate threshold, a memory usage rate threshold, and a network latency threshold; A first node determination subunit, configured to determine an edge node with a real-time CPU usage rate greater than the CPU usage rate threshold, a real-time memory usage rate greater than the memory usage rate threshold, and a real-time network latency value greater than the network latency threshold among the load metric values as a first-edge node with a first priority; A second node determination subunit, configured to determine an edge node other than the first-edge node among the multiple edge nodes as a second-edge node with a second priority; the first priority is higher than the second priority.
[0014] In an exemplary embodiment, the address allocation unit includes: A request acquisition subunit, configured to acquire IP address allocation requests sent by multiple edge nodes in the same period; An edge node order result determination subunit, configured to determine the IP address allocation order of each edge node according to the priority of each edge node, and obtain an edge node order result; the allocation order of the first-edge node is before that of the second-edge node; An address allocation subunit, configured to allocate IP addresses for each edge node in descending order of priority according to the edge node order result.
[0015] In an exemplary embodiment, the device further includes: A Pod priority determination module, configured to determine the priority of each Pod according to the importance level of each Pod; the priority of a Pod with a higher importance level is higher than that of a Pod with a lower importance level; An allocation request acquisition module, configured to acquire IP address allocation requests sent by multiple Pods during the same period; A resource data acquisition module, configured to acquire available resource data of each edge node based on the IP address allocation request; A target node determination module, configured to, for a target Pod with a higher importance level among the multiple Pods, determine a node with available resource data higher than a preset threshold and load balancing among the multiple edge nodes as a target edge node; An address allocation module, configured to use the target edge node to allocate an IP address to the target Pod.
[0016] In an exemplary embodiment, the device further includes: An allocation status acquisition module, configured to call the network interface information of the operating system to acquire the real-time IP address allocation status of each edge node; use network packet sniffing technology to collect the real-time network latency data and real-time throughput corresponding to each edge node as the real-time network performance metrics of each edge node; A prediction module, configured to input the real-time IP address allocation status and the real-time network performance metrics corresponding to each edge node into a network performance prediction model for IP address demand prediction and traffic pattern prediction, and obtain the predicted IP address demand and predicted traffic pattern corresponding to each edge node; the network performance prediction model is obtained by training a machine learning model based on the historical IP address allocation status and historical network performance metrics of historical edge nodes.
[0017] In an exemplary embodiment, the device further includes: An idle IP acquisition module, configured to acquire idle IP addresses; A screening module, configured to, in response to a creation request for a new Pod, screen out screened edge nodes with lower load and sufficient IP address resources from multiple edge nodes according to the predicted IP address demand and predicted traffic pattern corresponding to each edge node; A new Pod creation module, configured to create a new Pod in the screened edge nodes and allocate the idle IP addresses to the new Pod.
[0018] On the other hand, an electronic device is provided, which includes a processor and a memory. At least one instruction or at least one program segment is stored in the memory, and the at least one instruction or the at least one program segment is loaded and executed by the processor to implement the IP address allocation method for the edge node as described above.
[0019] On the other hand, a computer storage medium is provided. The computer storage medium stores at least one instruction or at least one program segment, and the at least one instruction or the at least one program segment is loaded and executed by a processor to implement the IP address allocation method for the edge node as described above.
[0020] On the other hand, a computer program product or a computer program is provided. The computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions so that the computer device executes to implement the IP address allocation method for the edge node as described above.
[0021] The IP address allocation method, device and equipment for the edge node provided by the present invention have the following technical effects: The present invention obtains the total number of nodes of multiple edge nodes in an edge computing scenario and the average number of Pods running on each edge node; determines the target number of IP addresses required for the edge computing scenario according to the total number of nodes, the average number of Pods and the reserved IP address ratio, and configures an initial IP address pool according to the target number of IP addresses; groups the multiple edge nodes according to the geographical location, service type or device function corresponding to each edge node to obtain multiple edge node groups; each edge node in each edge node group corresponds to the same network segment; determines the IP address set corresponding to each edge node group according to the network segment where each IP address in the initial IP address pool is located; determines the priority of each edge node according to the load metric value and network delay data corresponding to each edge node; and then allocates the IP address of each edge node according to the IP address corresponding to each edge node group and the priority of each edge node. By configuring the initial IP address pool of the edge node and integrating it into the Kubernetes cluster, the present invention optimizes the IP address usage efficiency in the edge node and enhances the network performance and reliability. Description of the Drawings
[0022] To more clearly illustrate the technical solutions and advantages in the embodiments of this specification or the prior art, the following will briefly introduce the accompanying drawings required for the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other accompanying drawings can also be obtained based on these drawings.
[0023] Figure 1 It is a schematic diagram of an IP address allocation system for an edge node provided by an embodiment of this specification; Figure 2 It is a schematic flowchart of a method for allocating IP addresses for an edge node provided by an embodiment of this specification; Figure 3 It is a schematic flowchart of a method for allocating IP addresses for each edge node according to the IP address corresponding to each edge node group and the priority of each edge node; Figure 4 It is a schematic flowchart of a method for allocating IP addresses for each edge node in descending order of priority; Figure 5 It is a schematic flowchart of a method for allocating an IP address for a target Pod using the target edge node; Figure 6 It is a schematic structural diagram of an IP address allocation device for an edge node provided by an embodiment of this specification; Figure 7 It is a schematic structural diagram of a server provided by an embodiment of this specification. Detailed implementation manners
[0024] The following will clearly and completely describe the technical solutions in the embodiments of this specification with reference to the accompanying drawings in the embodiments of this specification. Obviously, the described embodiments are only some embodiments of the present invention, rather than all embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts belong to the scope of protection of the present invention.
[0025] It should be noted that the terms "first", "second", etc. in the specification, claims and above-mentioned drawings of the present invention are used to distinguish similar objects, and do not necessarily have to be used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances, so that the embodiments of the present invention described here can be implemented in an order other than those illustrated or described here. In addition, the terms "comprising" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or server comprising a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products or devices.
[0026] Please refer to Figure 1 , Figure 1 which is a schematic diagram of an IP address allocation system for an edge node provided by an embodiment of this specification. As Figure 1 shown, the IP address allocation system for the edge node may at least include a server 01 and a client 02.
[0027] Specifically, in the embodiment of this specification, the server 01 may include an independently operating server, or a distributed server, or a server cluster composed of multiple servers, and may also be a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms. The server 01 may include a network communication unit, a processor, a memory, and so on. Specifically, the server 01 may be used to allocate the IP address of each edge node according to the IP address corresponding to each edge node group and the priority of each edge node.
[0028] Specifically, in the embodiment of this specification, the client 02 may include physical devices such as smart phones, desktop computers, tablet computers, laptop computers, digital assistants, smart wearable devices, smart speakers, vehicle terminals, smart TVs, etc., and may also include software running on the physical devices, such as web pages provided to users by some service providers, or applications provided to users by these service providers. Specifically, the client 02 may be used to query the IP address of each edge node online.
[0029] The following introduces an IP address allocation method for an edge node of the present invention. Figure 2It is a schematic flowchart of a method for allocating IP addresses of edge nodes provided by an embodiment of this specification. This specification provides method operation steps as described in the embodiment or flowchart, but based on routine or non-creative labor, it may include more or fewer operation steps. The step order listed in the embodiment is only one way among the execution orders of numerous steps and does not represent the only execution order. When the actual system or server product executes, it can be executed in the order of the method shown in the embodiment or the accompanying drawings or executed in parallel (such as in an environment of parallel processors or multi-threaded processing). Specifically, as Figure 2 shown, the method may include: S201: Obtain the total number of nodes of multiple edge nodes in the edge computing scenario and the average number of Pods running on each edge node. In the embodiment of this specification, the number of required IP addresses can be estimated according to the scale of the edge computing scenario. The total number of nodes of multiple edge nodes in the edge computing scenario and the average number of Pods running on each edge node are obtained in advance, so as to facilitate the estimation of the number of required IP addresses.
[0030] S203: Determine the target number of IP addresses required for the edge computing scenario according to the total number of nodes, the average number of Pods, and the reserved IP address ratio, and configure an initial IP address pool according to the target number of IP addresses.
[0031] In the embodiment of this specification, considering the scalability of future services, a certain proportion of spare IP addresses is reserved. Generally, it is recommended to reserve 10% - 20%. For example, if it is initially estimated that there are 100 edge node devices currently, each device is expected to run an average of 5 Pods, and each Pod requires 1 IP address, then a total of 500 IP addresses are required. According to a 20% reservation, the initially planned IP address pool should contain at least 600 available IP addresses.
[0032] S205: Group the multiple edge nodes according to the geographical location, service type, or device function corresponding to each edge node to obtain multiple edge node groups; each edge node in each edge node group corresponds to the same network segment.
[0033] In the embodiment of this specification, reasonable network segment division of IP addresses can be carried out according to geographical location, service type, or grouping by the function of edge nodes to divide different network segments. For example, edge nodes used for video surveillance services are assigned to one network segment, and edge nodes for data collection services are assigned to another network segment, which is convenient for management and troubleshooting.
[0034] S207: Determine the IP address set corresponding to each edge node group according to the network segment where each IP address in the initial IP address pool is located.
[0035] S209: Determine the priority of each edge node according to the load metric value and network latency data corresponding to each edge node.
[0036] In the embodiments of this specification, the edge nodes with lower load metric values and smaller network latency data have higher priorities.
[0037] S2011: Allocate the IP address of each edge node according to the IP address corresponding to each edge node group and the priority of each edge node.
[0038] In the embodiments of this specification, use the custom resource definition function of Kubernetes to create a resource object for managing the initial IP address pool, and manage the initial IP address pool based on the resource object; the resource object includes at least one of the start IP, end IP, and subnet mask of the initial IP address pool; Write a Kubernetes controller, and the controller is used to synchronize the attribute information of the initial IP address pool to each component of the cluster.
[0039] In the embodiments of this specification, as Figure 3 shown, the allocating the IP address of each edge node according to the IP address corresponding to each edge node group and the priority of each edge node includes: S20111: Obtain the load metric value and network latency data corresponding to each edge node; the load metrics include at least one of CPU usage rate and memory usage rate; S20113: Determine the priority of each edge node according to the load metric value and network latency data corresponding to each edge node; S20115: Allocate IP addresses to each edge node in descending order of priority.
[0040] In the embodiments of this specification, comprehensively consider the CPU usage rate and memory usage rate of the edge node as load metrics, the network latency is obtained by taking the average value through regular ping tests or other network probing tools, and the resource availability includes remaining disk space, bandwidth, etc. For example, if the CPU usage rate of an edge node is higher than 80% for a long time, the memory usage rate is higher than 70%, and the network latency exceeds 50ms, then its priority will be relatively low when allocating new IP addresses.
[0041] In the embodiments of this specification, determining the priority of each edge node according to the load metric value and network latency data corresponding to each edge node includes: Set the CPU usage threshold, memory usage threshold, and network latency threshold; Determine the first edge nodes with the first priority as the edge nodes whose real-time CPU usage in the load metric value is greater than the CPU usage threshold, real-time memory usage is greater than the memory usage threshold, and real-time network latency value is greater than the network latency threshold; Determine the second edge nodes with the second priority as the edge nodes other than the first edge nodes among the multiple edge nodes; the first priority is lower than the second priority.
[0042] In the embodiments of this specification, use the Custom Resource Definition (CRD) function of Kubernetes to create a resource object specifically for managing the IP addresses of edge nodes. This resource object contains detailed information about the IP address pool, such as the starting IP, ending IP, subnet mask, etc.
[0043] Write a Kubernetes controller that is responsible for synchronizing the IP address pool information to each component of the cluster to ensure that the cluster can identify and use these IP addresses. During the synchronization process, strict verification should be carried out to prevent cluster network failures caused by incorrect configurations. Consider the CPU usage and memory usage of edge nodes as load metrics, and the network latency is obtained by taking the average value through regular ping tests or other network probing tools. Resource availability includes remaining disk space, bandwidth, etc. For example, if the CPU usage of an edge node is consistently higher than 80% and the memory usage is higher than 70%, and the network latency exceeds 50ms, then its priority will be relatively low when allocating new IP addresses.
[0044] In the embodiments of this specification, as Figure 4 shown, allocating IP addresses to each edge node in order from highest to lowest priority includes: S201151: Obtain the IP address allocation requests sent by multiple edge nodes at the same time period; S201153: Determine the IP address allocation order of each edge node according to the priority corresponding to each edge node to obtain the edge node order result; the allocation order of the first edge node is before that of the second edge node; S201155: Allocate IP addresses to each edge node in order from highest to lowest priority according to the edge node order result.
[0045] In the embodiments of this specification, if IP address allocation requests sent by multiple edge nodes at the same time period are obtained; then according to the priority corresponding to each edge node, determine the IP address allocation order of each edge node to obtain the edge node order result; if the CPU usage rate of an edge node is higher than 80% for a long time, the memory usage rate is higher than 70%, and the network latency exceeds 50 ms, then when allocating a new IP address, its priority will be relatively low.
[0046] In the embodiments of this specification, after determining the priority of each edge node according to the load metric value and network latency data corresponding to each edge node, as Figure 5 shown, the method further includes: S501: Determine the priority of each Pod according to the importance of each Pod; the priority of a Pod with a higher importance is higher than that of a Pod with a lower importance; S503: Obtain IP address allocation requests sent by multiple Pods at the same time period; S505: Obtain the available resource data of each edge node based on the IP address allocation request; S507: For the target Pod with a higher importance among the multiple Pods, determine the node with available resource data higher than the preset threshold and load balancing among the multiple edge nodes as the target edge node; S509: Use the target edge node to allocate an IP address for the target Pod.
[0047] In the embodiments of this specification, for the priority of Pods, they are classified according to the importance of the service. For example, the priority of Pods for critical services is set to high, that for ordinary services is set to medium, and that for test services is set to low. When allocating IP addresses, the requirements of Pods with high priorities are preferentially met. When a Pod with a high priority has an IP address request, if multiple edge nodes all have available resources, preferentially select a node with abundant resources and load balancing to allocate the IP address.
[0048] In the embodiments of this specification, after allocating the IP address of each edge node according to the IP address corresponding to each edge node group and the priority of each edge node, the method further includes: Call the network interface information of the operating system to obtain the real-time IP address allocation status of each edge node; use network packet sniffing technology to collect the real-time network latency data and real-time throughput corresponding to each edge node as the real-time network performance metrics of each edge node; Input the real-time IP address allocation status corresponding to each edge node and the real-time network performance metrics into a network performance prediction model for IP address demand prediction and traffic pattern prediction, to obtain the predicted IP address demand and predicted traffic pattern corresponding to each edge node; the network performance prediction model is obtained by training a machine learning model based on the historical IP address allocation status and historical network performance metrics of historical edge nodes.
[0049] In the embodiments of this specification, the IP address usage and network performance metrics of edge nodes are monitored in real time. Machine learning algorithms are used to analyze historical data to predict future IP address demands and traffic patterns.
[0050] A network performance prediction model can be obtained by training a machine learning model with the historical IP address allocation status and historical network performance metrics of historical edge nodes; obtain the historical IP address allocation status and historical network performance metrics of historical edge nodes, where the historical edge nodes are labeled with sample IP address demand labels and sample traffic pattern labels, input the historical IP address allocation status and historical network performance metrics into the machine learning model, extract sample IP address demand features and sample traffic pattern features, predict the sample IP address demand results based on the sample IP address demand features, and predict the sample traffic pattern results based on the sample traffic pattern features; finally, determine the target loss data according to the difference between the sample IP address demand results and the sample IP address demand labels and the difference between the sample traffic pattern results and the sample traffic pattern labels, and then adjust the model parameters of the machine learning model according to the target loss data until the training end condition is met, and determine the machine learning model at the end of training as the network performance prediction model.
[0051] Select Prometheus combined with a custom Exporter to specifically collect the IP address usage and network performance metrics of edge nodes. The Exporter can obtain the IP address allocation status by calling the network interface information of the operating system, and collect performance data such as network latency and throughput using network packet sniffing technology. Deploy the monitoring tool to edge nodes in a containerized manner to ensure its stable operation and compatibility with the operating system environment of edge nodes. At the same time, configure the connection with the central monitoring server and report the collected data in a timely manner.
[0052] In some embodiments, for the usage of IP addresses, a shorter collection interval is set, such as collecting once every 30 seconds. Since the allocation and release of IP addresses are relatively frequent and the real-time requirement is high, this can promptly detect the idle or tight situation of IP addresses. For network performance metrics, the collection interval can be set according to the sensitivity of the service to network fluctuations. If the service is very sensitive to network latency changes, such as real-time video transmission service, then the network latency data collection interval can be set to once every 10 seconds; for services that are relatively insensitive to network fluctuations, such as periodic data reporting services, the collection interval can be extended to once every 2 minutes. Collect historical data for at least one week as the training set, including information such as the number of IP address allocations, network traffic peaks, and valleys in different time periods. Use time series prediction algorithms, such as ARIMA (Autoregressive Integrated Moving Average Model) or LSTM (Long Short-Term Memory Network). Taking ARIMA as an example, by identifying features such as the trend and seasonality of the data, a prediction model is constructed to predict the IP address demand trend in different time periods within the next day, week, or even month, and make preparations in advance for possible IP address tight situations.
[0053] In the embodiments of this specification, after inputting the real-time IP address allocation status and the real-time network performance metrics corresponding to each edge node into the network performance prediction model for IP address demand prediction and traffic pattern prediction, and obtaining the predicted IP address demand and predicted traffic pattern corresponding to each edge node, the method further includes: Obtain idle IP addresses; In response to the creation request of a new Pod, according to the predicted IP address demand and predicted traffic pattern corresponding to each edge node, screen out screened edge nodes with lower load and sufficient IP address resources from multiple edge nodes; Create a new Pod in the screened edge nodes and allocate the idle IP addresses to the new Pod.
[0054] In the embodiments of this specification, the efficient utilization of addresses reduces resource waste. Combining with load balancing technology, it ensures the uniform distribution of traffic between edge nodes and avoids single point of failure. If a certain edge node fails, the system can quickly transfer the traffic to other available nodes to ensure the continuity of the service.
[0055] When there is a new Pod creation request, the system makes a decision based on the real-time monitoring of the edge node status and forecast data. If it is predicted that a certain edge node will have a low load in the next period of time and has sufficient IP address resources, the IP address will be allocated to the new Pod on the node first. Combined with the QoS (quality of service) requirements of the business, for services with high bandwidth requirements, they are allocated to edge nodes with sufficient network bandwidth, and ensure that other services on the node do not excessively occupy bandwidth resources. For example, for high-definition video streaming services, when allocating IP addresses, select edge nodes with bandwidth reservations of at least 10Mbps and current utilization rates below 50%.
[0056] Scan the Pod status on the edge nodes regularly, and detect those Pods that have stopped running or have been in the Terminated state for more than a certain period of time (such as 5 minutes) by interacting with the Kubernetes API, and mark the IP addresses they occupy as recyclable. Prioritize the recycling of IP addresses that have been idle for a long time (such as 30 minutes). During the recycling process, ensure that there is no ongoing network connection using the IP address to avoid data loss or connection interruption.
[0057] Use software defined network (SDN) technology to achieve intelligent load balancing. The SDN controller monitors the load of edge nodes in real time, including CPU, memory, network bandwidth, etc. When it is found that the load of an edge node is too high (such as CPU utilization exceeding 90%), the new traffic request is dynamically routed to the node with lower load. If an edge node fails, the edge node regularly sends heartbeat packets to the cluster control plane using the heartbeat detection mechanism. Once the control plane does not receive the heartbeat packet of a node within a certain period of time (such as 3 heartbeat cycles), the failover process is immediately started. The services running on the failed node are quickly migrated to other available nodes. By modifying the DNS record or updating the backend node list of the load balancer, the continuity of the service is guaranteed. The entire failover process must be completed within seconds.
[0058] As can be seen from the technical solutions provided in the embodiments of this specification above, the embodiments of this specification obtain the total number of nodes of multiple edge nodes in an edge computing scenario and the average number of Pods running on each edge node; determine the target number of IP addresses required for the edge computing scenario according to the total number of nodes, the average number of Pods, and the reserved IP address ratio, and configure an initial IP address pool according to the target number of IP addresses; group the multiple edge nodes according to the geographical location, service type, or device function corresponding to each edge node to obtain multiple edge node groups; each edge node in each edge node group corresponds to the same network segment; determine the IP address set corresponding to each edge node group according to the network segment where each IP address in the initial IP address pool is located; determine the priority of each edge node according to the load metric value and network latency data corresponding to each edge node; and then allocate the IP address of each edge node according to the IP address corresponding to each edge node group and the priority of each edge node. The present invention optimizes the IP address usage efficiency in edge nodes and enhances network performance and reliability by configuring the initial IP address pool of edge nodes and integrating it into the Kubernetes cluster.
[0059] The embodiments of this specification also provide an IP address allocation device for edge nodes, as Figure 6 shown, the device includes: A Pod average number determination module 610, configured to obtain the total number of nodes of multiple edge nodes in an edge computing scenario and the average number of Pods running on each edge node; An initial IP address pool determination module 620, configured to determine the target number of IP addresses required for the edge computing scenario according to the total number of nodes, the average number of Pods, and the reserved IP address ratio, and configure an initial IP address pool according to the target number of IP addresses; An edge node group determination module 630, configured to group the multiple edge nodes according to the geographical location, service type, or device function corresponding to each edge node to obtain multiple edge node groups; each edge node in each edge node group corresponds to the same network segment; An IP address set determination module 640, configured to determine the IP address set corresponding to each edge node group according to the network segment where each IP address in the initial IP address pool is located; A priority determination module 650, configured to determine the priority of each edge node according to the load metric value and network latency data corresponding to each edge node; An IP address allocation module 660, configured to allocate the IP address of each edge node according to the IP address corresponding to each edge node group and the priority of each edge node.
[0060] In an exemplary embodiment, the IP address allocation module includes: A data acquisition unit configured to acquire the load metric value and network latency data corresponding to each edge node; the load metrics include at least one of CPU usage rate and memory usage rate; A priority determination unit configured to determine the priority of each edge node according to the load metric value and network latency data corresponding to each edge node; An address allocation unit configured to allocate IP addresses to each edge node in descending order of priority.
[0061] In an exemplary embodiment, the priority determination unit includes: A threshold setting subunit configured to set a CPU usage rate threshold, a memory usage rate threshold, and a network latency threshold; A first node determination subunit configured to determine, as a first edge node with a first priority, an edge node whose real-time CPU usage rate in the load metric values is greater than the CPU usage rate threshold, real-time memory usage rate is greater than the memory usage rate threshold, and real-time network latency value is greater than the network latency threshold; A second node determination subunit configured to determine, as a second edge node with a second priority, an edge node other than the first edge node among the multiple edge nodes; the first priority is higher than the second priority.
[0062] In an exemplary embodiment, the address allocation unit includes: A request acquisition subunit configured to acquire IP address allocation requests sent by multiple edge nodes in the same period; An edge node order result determination subunit configured to determine the IP address allocation order of each edge node according to the priority corresponding to each edge node, and obtain an edge node order result; the allocation order of the first edge node is before that of the second edge node; An address allocation subunit configured to allocate IP addresses to each edge node in descending order of priority according to the edge node order result.
[0063] In an exemplary embodiment, the apparatus further includes: A Pod priority determination module configured to determine the priority of each Pod according to the importance level of each Pod; the priority of a Pod with a higher importance level is higher than that of a Pod with a lower importance level; An allocation request acquisition module configured to acquire IP address allocation requests sent by multiple Pods in the same period; A resource data acquisition module configured to acquire the available resource data of each edge node based on the IP address allocation request; A target node determination module, configured to determine, for a target Pod with a high degree of importance among the multiple Pods, a node with available resource data higher than a preset threshold and load balancing among the multiple edge nodes as a target edge node; An address allocation module, configured to allocate an IP address to the target Pod by using the target edge node.
[0064] In an exemplary embodiment, the apparatus further includes: An allocation status acquisition module, configured to call the network interface information of the operating system to obtain the real-time IP address allocation status of each edge node; use the network packet sniffing technology to collect the real-time network delay data and real-time throughput corresponding to each edge node as the real-time network performance metrics of each edge node; A prediction module, configured to input the real-time IP address allocation status and the real-time network performance metrics corresponding to each edge node into a network performance prediction model for IP address demand prediction and traffic pattern prediction, and obtain the predicted IP address demand and predicted traffic pattern corresponding to each edge node; the network performance prediction model is obtained by training a machine learning model based on the historical IP address allocation status and historical network performance metrics of historical edge nodes.
[0065] In an exemplary embodiment, the apparatus further includes: An idle IP acquisition module, configured to acquire idle IP addresses; A screening module, configured to, in response to a creation request for a new Pod, screen out screening edge nodes with low load and sufficient IP address resources from multiple edge nodes according to the predicted IP address demand and predicted traffic pattern corresponding to each edge node; A new Pod creation module, configured to create a new Pod in the screening edge nodes and allocate the idle IP addresses to the new Pod.
[0066] The apparatus in the apparatus embodiment and the method embodiment are based on the same inventive concept.
[0067] An embodiment of this specification provides an electronic device, which includes a processor and a memory. At least one instruction or at least one program segment is stored in the memory, and the at least one instruction or at least one program segment is loaded and executed by the processor to implement the IP address allocation method for edge nodes provided in the above method embodiment.
[0068] An embodiment of the present invention further provides a computer storage medium, which can be set in a terminal to store at least one instruction or at least one segment of program related to an IP address allocation method for an edge node in a method embodiment. The at least one instruction or at least one segment of program is loaded and executed by the processor to implement the IP address allocation method for the edge node provided in the above method embodiment.
[0069] An embodiment of the present invention further provides a computer program product or a computer program, which includes computer instructions stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes to implement the IP address allocation method for the edge node provided in the above method embodiment.
[0070] Optionally, in the embodiment of the present specification, the storage medium may be located in at least one network server among multiple network servers of a computer network. Optionally, in this embodiment, the above storage medium may include, but is not limited to, various media that can store program codes such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk, or an optical disc.
[0071] The memory in the embodiment of the present specification can be used to store software programs and modules. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory. The memory mainly includes a program storage area and a data storage area. Among them, the program storage area can store an operating system, application programs required for functions, etc.; the data storage area can store data created according to the use of the device, etc. In addition, the memory may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other volatile solid-state storage devices. Correspondingly, the memory may further include a memory controller to provide the processor with access to the memory.
[0072] The method embodiment for allocating an IP address of an edge node provided in the embodiment of the present specification can be executed on a mobile terminal, a computer terminal, a server, or a similar computing device. Taking running on a server as an example, Figure 7 is a hardware structure block diagram of a server for the IP address allocation method of an edge node provided in the embodiment of the present specification. As Figure 7As shown, the server 700 can vary significantly due to configuration or performance differences, and may include one or more central processing units (CPUs) 710 (the central processing unit 710 may include, but is not limited to, processing devices such as microprocessor MCUs or programmable logic devices FPGAs), a memory 730 for storing data, and one or more storage media 720 for storing application programs 723 or data 722 (such as one or more mass storage devices). Among them, the memory 730 and the storage media 720 can be transient storage or persistent storage. The programs stored in the storage media 720 may include one or more modules, and each module may include a series of instruction operations on the server. Further, the central processing unit 710 can be set to communicate with the storage media 720 and execute a series of instruction operations in the storage media 720 on the server 700. The server 700 may also include one or more power supplies 760, one or more wired or wireless network interfaces 750, one or more input / output interfaces 740, and / or one or more operating systems 721, such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSD TM, and so on.
[0073] The input / output interface 740 can be used to receive or send data via a network. Specific examples of the above network may include a wireless network provided by the communication provider of the server 700. In one example, the input / output interface 740 includes a network interface controller (NIC), which can be connected to other network devices through a base station and thus communicate with the Internet. In one example, the input / output interface 740 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0074] Those of ordinary skill in the art can understand that Figure 7 The structure shown is only schematic and does not limit the structure of the above electronic device. For example, the server 700 may also include more or fewer components than those Figure 7 shown, or have a different configuration from that Figure 7 shown.
[0075] As can be seen from the embodiments of the IP address allocation method, device, electronic device, or storage medium for edge nodes provided by the present invention described above, the present invention obtains the total number of nodes of multiple edge nodes in an edge computing scenario and the average number of Pods running on each edge node; determines the target number of IP addresses required for the edge computing scenario according to the total number of nodes, the average number of Pods, and the reserved IP address ratio, and configures an initial IP address pool according to the target number of IP addresses; groups the multiple edge nodes according to the geographical location, service type, or device function corresponding to each edge node to obtain multiple edge node groups; each edge node in each edge node group corresponds to the same network segment; determines the IP address set corresponding to each edge node group according to the network segment where each IP address in the initial IP address pool is located; determines the priority of each edge node according to the load metric value and network latency data corresponding to each edge node; and then allocates the IP address of each edge node according to the IP address corresponding to each edge node group and the priority of each edge node. By configuring the initial IP address pool of edge nodes and integrating it into the Kubernetes cluster, the present invention optimizes the IP address usage efficiency in edge nodes and enhances network performance and reliability.
[0076] It should be noted that: the above order of the embodiments of this specification is only for description and does not represent the advantages and disadvantages of the embodiments. And the above specific embodiments of this specification have been described. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims can be executed in a different order than in the embodiments and still achieve the desired result. Additionally, the processes depicted in the figures do not necessarily require the specific order or sequential order shown to achieve the desired result. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0077] Each embodiment in this specification is described in a progressive manner. The same or similar parts among the embodiments can be referred to each other, and the key points of each embodiment are the differences from other embodiments. In particular, for the embodiments of the device, equipment, and storage medium, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments.
[0078] Those of ordinary skill in the art can understand that all or part of the steps to implement the above embodiments can be completed by hardware, or can be completed by a program instructing relevant hardware. The program can be stored in a computer storage medium. The storage medium mentioned above can be a read-only memory, a disk, or an optical disc, etc.
[0079] The above are only the preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present invention shall be included within the protection scope of the present invention.
Claims
1. A method for allocating IP addresses to edge nodes, characterized in that: The method comprises: Get the total number of nodes of multiple edge nodes in the edge computing scenario and the average number of Pods running on each edge node; Determine the target number of IP addresses required for the edge computing scenario according to the total number of nodes, the average number of Pods, and the proportion of reserved IP addresses, and configure an initial IP address pool according to the target number of IP addresses; The plurality of edge nodes are grouped according to the geographical location, service type or device function corresponding to each edge node to obtain a plurality of edge node groups; each edge node in each edge node group corresponds to the same network segment; Determine an IP address set corresponding to each edge node group according to the network segment where each IP address in the initial IP address pool is located; Determine the priority of each edge node based on the load index value and network delay data corresponding to each edge node; The IP address of each edge node is allocated according to the IP address corresponding to each edge node group and the priority of each edge node.
2. The method according to claim 1, characterized in that The allocating an IP address of each edge node according to the IP address corresponding to each edge node group and the priority of each edge node includes: Obtaining a load index value and network delay data corresponding to each edge node; the load index includes at least one of CPU usage and memory usage; Determine the priority of each edge node based on the load index value and network delay data corresponding to each edge node; IP addresses are assigned to each edge node in descending order of priority.
3. The method according to claim 2, characterized in that Determining the priority of each edge node according to the load index value and network delay data corresponding to each edge node includes: Set CPU usage threshold, memory usage threshold, and network latency threshold; Determine an edge node whose real-time CPU usage in the load index value is greater than the CPU usage threshold, whose real-time memory usage is greater than the memory usage threshold, and whose real-time network delay value is greater than the network delay threshold as a first edge node with a first priority; Determine edge nodes other than the first edge node among the plurality of edge nodes as second edge nodes with a second priority; the first priority is lower than the second priority.
4. The method according to claim 3, characterized in that The step of allocating an IP address to each edge node in descending order of priority includes: Obtain IP address allocation requests sent by multiple edge nodes in the same period; Determine the IP address allocation order of each edge node according to the priority corresponding to each edge node, and obtain the edge node order result; the allocation order of the first edge node is before the second edge node; According to the edge node sequence result, an IP address is allocated to each edge node in order from high to low priority.
5. The method according to any one of claims 1 to 4, characterized in that: After determining the priority of each edge node according to the load index value and network delay data corresponding to each edge node, the method further includes: Determine the priority of each Pod based on its importance; Pods with higher importance have higher priority than Pods with lower importance; Get IP address allocation requests sent by multiple Pods in the same period; Acquire available resource data of each edge node based on the IP address allocation request; For a target Pod with high importance among the multiple Pods, determine a node among the multiple edge nodes whose available resource data is higher than a preset threshold and whose load is balanced as a target edge node; The target edge node is used to assign an IP address to the target Pod.
6. The method according to claim 1, characterized in that After allocating the IP address of each edge node according to the IP address corresponding to each edge node group and the priority of each edge node, the method further includes: Call the network interface information of the operating system to obtain the real-time IP address allocation status of each edge node; use network packet sniffing technology to collect the real-time network delay data and real-time throughput corresponding to each edge node as the real-time network performance indicator of each edge node; The real-time IP address allocation status corresponding to each edge node and the real-time network performance index are input into the network performance prediction model to perform IP address demand prediction and traffic pattern prediction, so as to obtain the predicted IP address demand and predicted traffic pattern corresponding to each edge node; the network performance prediction model is obtained by training the machine learning model based on the historical IP address allocation status of historical edge nodes and historical network performance indicators.
7. The method according to claim 1, characterized in that After inputting the real-time IP address allocation status corresponding to each edge node and the real-time network performance index into the network performance prediction model to perform IP address demand prediction and traffic pattern prediction, and obtaining the predicted IP address demand and predicted traffic pattern corresponding to each edge node, the method further includes: Get an idle IP address; In response to the creation request of a new Pod, the edge nodes with low load and sufficient IP address resources are selected from multiple edge nodes according to the predicted IP address demand and predicted traffic pattern corresponding to each edge node; A new Pod is created in the screening edge node, and the idle IP address is allocated to the new Pod.
8. An IP address allocation device for an edge node, characterized in that: The device comprises: The module for determining the average number of Pods is used to obtain the total number of nodes of multiple edge nodes in the edge computing scenario and the average number of Pods running on each edge node. An initial IP address pool determination module is used to determine the target number of IP addresses required for the edge computing scenario according to the total number of nodes, the average number of Pods, and the proportion of reserved IP addresses, and configure an initial IP address pool according to the target number of IP addresses; An edge node group determination module, used to group the plurality of edge nodes according to the geographical location, service type or device function corresponding to each edge node, to obtain a plurality of edge node groups; each edge node in each edge node group corresponds to the same network segment; An IP address set determination module, used to determine an IP address set corresponding to each edge node group according to the network segment where each IP address in the initial IP address pool is located; A priority determination module, used to determine the priority of each edge node according to the load index value corresponding to each edge node and the network delay data; The IP address allocation module is used to allocate an IP address to each edge node according to the IP address corresponding to each edge node group and the priority of each edge node.
9. An electronic device, characterized in that: The device includes: a processor and a memory, wherein the memory stores at least one instruction or at least one program, and the at least one instruction or at least one program is loaded and executed by the processor to implement the IP address allocation method for the edge node as described in any one of claims 1-7.
10. A computer storage medium, characterized in that: The computer storage medium stores at least one instruction or at least one program, and the at least one instruction or at least one program is loaded and executed by a processor to implement the IP address allocation method for an edge node as described in any one of claims 1-7.