Array sensing edge container elastic expansion and contraction method and system, storage medium and computer equipment
By predicting load conditions and optimizing container scaling strategies in the multi-container cluster edge cloud framework of substations, the response delay and resource imbalance of the container cluster management system during scaling is solved, and more efficient resource utilization and cluster performance are achieved.
Patent Information
- Application Number
- CN202310906840.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-21
- Publication Date
- 2025-04-08
AI Technical Summary
The existing container cluster management system has problems of response delay and resource imbalance when expanding and shrinking capacity, resulting in reduced service quality and resource fragmentation.
By aggregating the Pod replica set load of a container in a pre-built substation multi-container cluster edge cloud framework, predicting future load conditions, calculating the number of expected replicas, and controlling at time nodes where capacity expansion or reduction is required, the capacity reduction strategy is optimized to ensure resource balance.
It realizes rapid capacity expansion during peak load, avoids response delays, and optimizes resource utilization during capacity reduction, reduces resource fragmentation generation, and improves the overall performance and scalability of the cluster.
Smart Images

Figure CN119781894A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to an array sensing edge container elastic expansion and contraction method, a storage medium and a computer device, and belongs to the technical field of intelligent operation and inspection. Background Art
[0002] As an important basic equipment in the construction of the power Internet of Things, the substation is responsible for the exchange of voltage and current, receiving and distributing electric energy. A large number of heterogeneous electrical equipment for the operation of the substation network are deployed in the substation, such as switchgear, transformer equipment, busbars, switches, etc. The data information received and generated by these devices needs to be controlled and processed in a timely manner. At the same time, the substation facilities and resources also need to be adjusted, communicated and dispatched in a timely and efficient manner to ensure that users obtain safe and high-quality electricity.
[0003] The level of grid intelligence of power supply companies in various regions is improving year by year, and the number of intelligent substations is increasing rapidly. A smart substation refers to a substation that can perform remote data collection, operation monitoring, and remote operation and control in a power communication network environment after deploying intelligent electrical equipment. Based on the technical characteristics of smart substations, power supply companies can use computer software to collect operation information and remotely control resources of substations based on the power communication network. Since the business scope of substation power information management is relatively wide, including power information collection and remote control operations of various electrical facilities, different electrical equipment power data information types and control operation types have certain differences. The massive heterogeneous data generated in the process has brought great pressure to the perception of substation arrays and communication networks, and also brought challenges to the resource scheduling of substation equipment. There are still deficiencies in the overall construction and application of power substation networks.
[0004] First, the business lacks real-time performance. Most array sensors need to transmit the collected data to the background to realize cross-disciplinary and cross-system data sharing applications or related calculations. The data often needs to be delayed for several hours or more than a day from the source to cross-disciplinary applications, which cannot meet the high requirements for business immediacy.
[0005] Second, the substation DCS control system and power automation monitoring system, power grid dispatching automation platform and other substation-related business management systems operate independently, and the interaction between system data requires frequent switching operations by substation managers, which has poor real-time performance. The inherent functional software and hardware coupling between substation equipment and the poor flexibility of resource scheduling are not conducive to the expansion of new businesses.
[0006] Distributed edge computing is considered to be a supplement and extension of cloud computing. By sinking the computing power of the cloud to the vicinity of users, it can effectively alleviate the computing load of the cloud center and the bandwidth pressure of the core backbone network. At the same time, the combination of edge data centers and edge intelligent devices expands the computing power of the edge and increases scalability. It is very suitable for the dynamic expansion of large-scale array devices in the substation area and the high immediacy requirements. Container technology, as a virtualization technology, is considered to be the underlying technical foundation for the realization of edge computing in the future. Container technology isolates the operating environment of different substation power system services and encapsulates each user service in a container to form a container image to achieve flexible and convenient service start and stop, elastic expansion and reduction. The edge container formed by the combination of edge computing and container technology can be understood as setting containerization as the standard for edge computing platforms. Containerized edge applications are easy to distribute and are very suitable for edge computing solutions. Compared with traditional cloud containers, edge containers can be deployed in parallel to different geographical points of presence to achieve a higher level of availability.
[0007] Docker is an open source application container engine and the most widely used container technology. Compared with virtual machines, it effectively improves resource utilization. More importantly, Docker uses image technology and rich image repositories to solve the problem of inconsistent software stack environments, greatly improving the efficiency of software development and operation and maintenance. However, Docker only focuses on providing containers and images, so a container cluster management system is needed to coordinate the management of all containers on the cluster.
[0008] The current mainstream open source management system is Kubernetes, a large-scale container management system developed by Google. An important feature of Kubernetes is automatic elastic scaling, and the system's ability to automatically adjust resource supply according to changes in application load. When the load is too high, the system automatically increases resource supply to ensure the service quality of the application. When the load decreases, idle resources are promptly recovered to reduce costs and improve resource utilization. Kubernetes implements automated scaling services by periodically checking the load status of the application and dynamically adjusting the resource supply of the application according to certain scaling strategies. However, there are certain problems with Kubernetes' existing automatic scaling services, which are mainly manifested in the following two aspects. In the expansion stage, when the application load increases and the resource supply needs to be increased, there is a response delay problem. This is manifested in the fact that there is a certain lag in increasing the resource supply, which causes the application request response time to increase over a period of time, resulting in a decrease in service quality. In the reduction stage, when the application is relatively idle and the resource supply needs to be reduced, the impact of reduction on the balance of cluster resources is not considered, resulting in an imbalance in the overall resource use of the cluster and an increase in the possibility of resource fragmentation in the cluster.
[0009] Many universities and research institutions at home and abroad have conducted extensive research and experiments on automatic scaling technology. Harild Lim and Shivnath Babu studied the limitations of static thresholds in "Automated control in cloud computing: challenges and opportunities" [The Workshop on Automated Control for Datacenters & Clouds. 2009: 13-18] and proposed a dynamic threshold solution to the problem of reduced resource utilization caused by static thresholds. Pawel Koperek and Wlodzimierz Funika studied the impact of different indicators on scaling effects in "Dynamic Business Metrics-driven Resource Provisioning in Cloud Environments" [International Conference on Parallel Processing and Applied Mathematics. Springer-Verlag, 2011: 171-180]. Masum Z Hasan and Edgar Magana proposed a multi-threshold scaling method in "Integrated and autonomic cloud resource scaling" [2012IEEE Network Operations and Management Symposium, 2012, pp.1327-1334, doi:10.1109 / NOMS.2012.6212070], which expands the traditional method of setting only two thresholds, upper and lower. The advantages of the threshold-based scaling method are simple implementation and strong adaptability, but it also has obvious disadvantages. It requires users to have an in-depth understanding of application characteristics and platform infrastructure, and have certain professional knowledge to select appropriate indicators and thresholds and define post-trigger response actions.Enda Barrett, Enda Howley, and Jim Duggan applied reinforcement learning theory to the formulation of scaling strategies in "Applying reinforcement learning towards automating resource allocation and application scalability in the cloud" [Concurrency and computation: practice and experience, 2013, 25(12): 1656-1674]. The advantage of the scaling method based on reinforcement learning is that it avoids users from defining scaling plans themselves and shows a certain degree of intelligence for long-running applications. The disadvantage of this method is that it takes a lot of time to summarize experience and has poor adaptability to emergencies. Load prediction uses linear regression algorithm and string matching algorithm, and automatically switches between the two algorithms according to the system resource usage. When the cluster resource utilization is low, the high-complexity KMP string matching algorithm is used, and when the resource utilization is high, the low-complexity linear regression algorithm is used. This method takes into account the adaptability of the prediction method to resources but does not take into account the complexity of the load itself. A single linear regression algorithm or KMP algorithm has certain limitations.
[0010] Currently, most container cluster scaling strategies use threshold-based responsive scaling methods. During the expansion phase, it takes a certain amount of time from when the indicator reaches the threshold to trigger expansion to when a new resource copy is created and services are provided. When user service requests surge, the container management platform may not be able to respond to all requests quickly, causing request congestion and reducing service experience. At the same time, the existing scaling strategy does not take into account the impact of deleting copies on cluster load balancing. Improper deletion of resource copies may affect the nodes that are currently serving. Summary of the invention
[0011] The purpose of the present invention is to provide an array-aware edge container elastic scaling method, system, storage medium and computer equipment to realize the automatic expansion and contraction function of the container, reduce the delay in responding to user requests during expansion, and reduce the impact on cluster load balancing during contraction.
[0012] An array-aware edge container elastic scaling method, the method comprising:
[0013] Obtain container-specific resource information from the Pod replica set load of the aggregated container in the pre-built substation multi-container cluster edge cloud framework;
[0014] Calculate the load data of the Pod replica set based on the specific resource information of the container;
[0015] Calculate the optimal predicted time for the container to generate all Pod replica sets;
[0016] Predict the load forecast value of the Pod replica set in the next phase based on the historical load data composed of the load data of the Pod replica set and the optimal forecast time of the Pod replica set;
[0017] According to the load forecast value of the Pod replica set in the next phase, the expected number of replicas and the time point when capacity expansion or reduction is required are calculated; and at the time point when capacity expansion or reduction is required, the expansion or reduction of the container is controlled according to the expected number of replicas.
[0018] Furthermore, the method for calculating the expected number of replicas and the time point at which capacity expansion or contraction is required includes:
[0019] According to the abnormal judgment criteria, calculate the abnormal load time point sequence and abnormal load value sequence in the load forecast value of the Pod replica set in the next stage;
[0020] Grey models are established for the abnormal load time point sequence and the abnormal load value sequence respectively. The abnormal load time point sequence predicts the next abnormal load time point, and the grey model of the abnormal load value sequence predicts the next abnormal load value.
[0021] Determine the time point when capacity expansion or reduction is required based on the predicted next abnormal load time point; determine the expected number of replicas based on the predicted next abnormal load value.
[0022] Furthermore, the method for implementing the container scaling operation according to the expected number of replicas includes:
[0023] Get all replicas in the Pod replica set in the container at the current moment; determine the number of replicas that need to be deleted based on the expected number of replicas and all replicas in the Pod replica set in the container at the current moment;
[0024] Determine the priority of each copy and sort the copies according to their priority;
[0025] Filter according to the sorting results of each replica, and select the replicas that match the number of replicas to be deleted in order of the smallest priority to the largest priority as the replicas to be deleted.
[0026] Further, determining the priority of each copy includes:
[0027] The state priority of the replica is used as the priority of the replica;
[0028] When the status priorities of multiple replicas are equal, the cluster load balancing strategy is used to calculate the first weight of each replica, and the replicas are sorted according to the size of their first weights. The replica with the smallest first weight has the smallest priority.
[0029] When the first weights of the replicas are equal, the node multi-dimensional resource balancing strategy is used to calculate the second weights of the replicas. The replicas are sorted according to their second weights. The replica with the smallest second weight has the smallest priority.
[0030] When the second weights of all replicas are equal, if all replicas are ready, they are sorted according to the early and late ready times of each replica, and the replica with the latest ready time has a lower priority;
[0031] Furthermore, the method for determining the status priority of the replica includes:
[0032] According to whether each copy is ready, it is divided into unready copies and ready copies. The status priority of unready copies is lower than that of ready copies.
[0033] For unready replicas, they are divided into unscheduled replicas and scheduled replicas according to whether they have been scheduled. The status priority of unscheduled replicas is lower than that of scheduled replicas.
[0034] For scheduled replicas, they are divided into Pending, Unknown, and Running states according to their states. The state priority of a replica in the Pending state is lower than that of a replica in the Unknown state, and the state priority of a replica in the Unknown state is lower than that of a replica in the Running state.
[0035] Further, determining the priority of each replica includes: sorting each replica according to the number of restarts of the container corresponding to each replica, wherein the replica with the largest number of restarts has the smallest priority;
[0036] Furthermore, determining the priority of each replica includes: sorting the replicas according to the creation time of each replica, and the replica with the latest creation time has the smallest priority.
[0037] Furthermore, the cluster load balancing strategy is used to calculate the first weight of each replica, including: using the resource utilization of the node after deleting the replica as the resource weight of deleting the replica, wherein the resource utilization is calculated as follows: assuming that the resource dimension of the node is R(1,2,...,r), and the total resource amount of the node is S(s1,s2,...,s r ), the node has been allocated resources A(a1,a2,...,a r ), the resource quota of the replica is D(d1,d2,...,d r ), for the replica to be deleted, the formula is as follows:
[0038] r is the dimension of resources;
[0039] Calculate the resource utilization U(u1,u2,...,u r ), calculate the average resource utilization Will As the first weight of the replica to be deleted.
[0040] Furthermore, the second weight of each replica is calculated using the node multi-dimensional resource balancing strategy, including:
[0041] Calculate the variance S of each copy 2 , variance S 2 The calculation formula is as follows:
[0042]
[0043] Furthermore, the method for predicting the load prediction value of the Pod replica set in the next stage includes:
[0044] According to the historical load data and the optimal prediction time of the Pod replica set, a grey-exponential smoothing model is established, and the grey-exponential smoothing model is used to predict the load prediction value of the Pod replica set in the next stage.
[0045] An array-aware edge container elastic scaling system, the system comprising:
[0046] The substation multi-container cluster edge cloud framework is used to aggregate the Pod replica set load of the container and obtain the specific resource information of the container;
[0047] The container monitoring module is used to calculate the load data of the Pod replica set based on the specific resource information of the container;
[0048] The container status analysis module is used to calculate the optimal predicted time for the container to generate all Pod replica sets.
[0049] The container load prediction module is used to predict the load prediction value of the Pod replica set in the next stage based on the historical load data composed of the load data of the Pod replica set and the optimal prediction time of the Pod replica set.
[0050] The container scaling module is used to calculate the expected number of replicas based on the load forecast value of the Pod replica set in the next phase, and to control the expansion or reduction of the container according to the expected number of replicas at the time point when expansion or reduction is required.
[0051] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements any of the array-aware edge container elastic scaling methods described in the above methods.
[0052] A computer device comprising:
[0053] A memory for storing instructions;
[0054] The processor is used to execute the instructions so that the device performs operations to implement the above-mentioned array-aware edge container elastic scaling method.
[0055] Compared with the prior art, the present invention has the following beneficial effects: the method proposed in the present invention can complete capacity expansion before the peak load arrives by predicting the future load status of the replica set, thereby avoiding the response delay caused by the Pod initialization process and ensuring that the load of the replica set is moderate and in the target state;
[0056] The optimized scaling-down strategy considering cluster resource factors proposed in the present invention pre-calculates the resource utilization of the node after deleting the replica and the balance of resources in each dimension during scaling-down. This can avoid the problem of reduced application operating efficiency due to competition for resources between replicas caused by the aggregation of node replicas after the scaling-down action is executed. At the same time, weighing the balance of resources in each dimension can prevent the generation of a large amount of resource fragments. BRIEF DESCRIPTION OF THE DRAWINGS
[0057] Figure 1 This is a schematic diagram of the multi-container cluster edge cloud framework model built in the present invention;
[0058] Figure 2 It is a schematic diagram of the overall architecture of the container expansion strategy based on load prediction in the present invention;
[0059] Figure 3 This is a structural diagram of a monitoring module in a container expansion architecture based on load prediction in the present invention;
[0060] Figure 4 It is a logic flow chart of the state analysis module in the container expansion architecture based on load prediction in the present invention;
[0061] Figure 5 It is a logic flow chart of the prediction module in the container expansion architecture based on load prediction in the present invention;
[0062] Figure 6 This is a logic flow chart of the scaling module in the container expansion architecture based on load prediction in the present invention. DETAILED DESCRIPTION
[0063] In order to make the technical means, creative features, objectives and effects achieved by the present invention easy to understand, the present invention is further explained below in conjunction with specific implementation methods.
[0064] First aspect:
[0065] The present invention discloses an array-aware edge container elastic scaling method, the method comprising:
[0066] An array-aware edge container elastic scaling method, the method comprising:
[0067] Obtain container-specific resource information from the Pod replica set load of the aggregated container in the pre-built substation multi-container cluster edge cloud framework;
[0068] Calculate the load data of the Pod replica set based on the specific resource information of the container;
[0069] Calculate the optimal predicted time for the container to generate all Pod replica sets;
[0070] Predict the load forecast value of the Pod replica set in the next phase based on the historical load data composed of the load data of the Pod replica set and the optimal forecast time of the Pod replica set;
[0071] According to the load forecast value of the Pod replica set in the next phase, the expected number of replicas and the time point when capacity expansion or reduction is required are calculated; and at the time point when capacity expansion or reduction is required, the expansion or reduction of the container is controlled according to the expected number of replicas.
[0072] According to the abnormal judgment criteria, calculate the abnormal load time point sequence and abnormal load value sequence in the load forecast value of the Pod replica set in the next stage;
[0073] Grey models are established for the abnormal load time point sequence and the abnormal load value sequence respectively. The abnormal load time point sequence predicts the next abnormal load time point, and the grey model of the abnormal load value sequence predicts the next abnormal load value.
[0074] The time point at which capacity expansion or contraction is required is determined based on the predicted next abnormal load time point; the expected number of replicas is determined based on the predicted next abnormal load value. The scaling module compares the current number of replicas with the expected number of replicas. If the current number of replicas is greater than the expected number of replicas, capacity expansion is performed; otherwise, capacity contraction is performed.
[0075] Furthermore, the method for implementing the container scaling operation according to the expected number of replicas includes:
[0076] Get all replicas in the Pod replica set in the container at the current moment; determine the number of replicas that need to be deleted based on the expected number of replicas and all replicas in the Pod replica set in the container at the current moment;
[0077] Determine the priority of each copy and sort the copies according to their priority;
[0078] Filter according to the sorting results of each copy, and select the copies that match the number of copies to be deleted as the copies to be deleted in order of the smallest priority to the largest priority.
[0079] Further, determining the priority of each copy includes:
[0080] The state priority of the replica is used as the priority of the replica;
[0081] When the status priorities of multiple replicas are equal, the cluster load balancing strategy is used to calculate the first weight of each replica, and the replicas are sorted according to the size of their first weights. The replica with the smallest first weight has the smallest priority.
[0082] When the first weights of the replicas are equal, the node multi-dimensional resource balancing strategy is used to calculate the second weights of the replicas. The replicas are sorted according to their second weights. The replica with the smallest second weight has the smallest priority.
[0083] When the second weights of all replicas are equal, if all replicas are ready, they are sorted according to the early and late ready times of each replica, and the replica with the latest ready time has a lower priority;
[0084] Furthermore, the method for determining the status priority of the replica includes:
[0085] According to whether each copy is ready, it is divided into unready copies and ready copies. The status priority of unready copies is lower than that of ready copies.
[0086] For unready replicas, they are divided into unscheduled replicas and scheduled replicas according to whether they have been scheduled. The status priority of unscheduled replicas is lower than that of scheduled replicas.
[0087] For scheduled replicas, they are divided into Pending, Unknown, and Running states according to their states. The state priority of a replica in the Pending state is lower than that of a replica in the Unknown state, and the state priority of a replica in the Unknown state is lower than that of a replica in the Running state.
[0088] Further, determining the priority of each replica includes: sorting each replica according to the number of restarts of the container corresponding to each replica, wherein the replica with the largest number of restarts has the smallest priority;
[0089] Furthermore, determining the priority of each replica includes: sorting the replicas according to the creation time of each replica, and the replica with the latest creation time has the smallest priority.
[0090] Furthermore, the cluster load balancing strategy is used to calculate the first weight of each replica, including: using the resource utilization of the node after deleting the replica as the resource weight of deleting the replica, wherein the resource utilization is calculated as follows: assuming that the resource dimension of the node is R(1,2,...,r), and the total resource amount of the node is S(s1,s2,...,s r ), the node has been allocated resources A(a1,a2,...,a r ), the resource quota of the replica is D(d1,d2,...,d r ), for the replica to be deleted, the formula is as follows:
[0091] r is the dimension of resources;
[0092] Calculate the resource utilization U(u1,u2,...,u r ), calculate the average resource utilization Will As the first weight of the replica to be deleted.
[0093] Furthermore, the second weight of each replica is calculated using the node multi-dimensional resource balancing strategy, including:
[0094] Calculate the variance S of each copy 2 , variance S 2 The calculation formula is as follows:
[0095]
[0096] Going a step further, methods for calculating the expected number of replicas and the time nodes when capacity needs to be expanded or reduced include:
[0097] Based on the historical load data and the optimal prediction time of the Pod replica set, a grey-exponential smoothing model is established, and the grey-exponential smoothing model is used to predict the load prediction value of the Pod replica set in the next stage;
[0098] Further detailed introduction to the above method:
[0099] The automatic scaling strategy that comes with Kubernetes is a responsive scaling strategy, which essentially calculates the scaling amount based on the current load of the Pod replica. The time required from the overload of the replica set triggering the expansion to the new Pod replica providing services is called the Pod initialization time. When service requests surge, a large number of user requests may accumulate during the Pod initialization time, resulting in an increase in user request time.
[0100] The container expansion strategy based on load prediction proposed in the present invention can complete the expansion before the load peak arrives by predicting the future load status of the replica set, thereby avoiding the response delay caused by the Pod initialization process and ensuring that the load of the replica set is moderate and in the target state.
[0101] Step 1-1: Get all replicas in the current scaling replica set and determine the number of replicas that need to be deleted.
[0102] Step 1-2: Traverse each replica in the replica set, establish the status priority of all replicas, and sort the replica set according to the status priority strategy. The status priority strategy is: according to whether the replica is ready, it is divided into unready replicas and ready replicas, and the priority of unready replicas is lower than that of ready replicas; for unready replicas, according to whether they have been scheduled, they are divided into unscheduled replicas and scheduled replicas, and the priority of unscheduled replicas is lower than that of scheduled replicas; for scheduled replicas, according to their status, they are divided into Pending state, Unknown state, and Running state, and the priority of Pending state is lower than that of Unknown state, and the priority of Unknown state is lower than that of Running state.
[0103] Step 1-3: For replicas with the same status priority, use the cluster load balancing strategy to calculate their weights, and then sort them according to the weights. The cluster load balancing strategy is: the resource utilization of the node where the replica is located after deletion is used as the resource weight of the replica. The resource utilization calculation method is: let the resource dimension of the node be R(1,2,...,r), and the total resource volume of the node be S(s1,s2,...,s r ), the node has been allocated resources A(a1,a2,...,a r ), the resource quota of the replica is D(d1,d2,...,d r ). For the replica to be deleted, based on formula (1.1)
[0104]
[0105] Calculate the resource utilization U(u1,u2,...,u r ), and then calculate the average resource utilization Will As the cluster load balancing weight of the replica, the smaller the value, the heavier the burden on the node, so replicas on nodes with heavier burdens are limitedly deleted.
[0106] Step 1-4: For replicas with equal cluster load balancing weights, use the node multi-dimensional resource balancing strategy to calculate their weights, and then sort them according to the weights. The node multi-dimensional resource balancing strategy is as follows: calculate the balance of resources in each dimension of the node after deleting the replica, and use the calculated resource balance as the resource weight of the replica to be deleted. Use variance to measure the balance of resources. Variance S 2 The calculation formula is shown in (1.2):
[0107]
[0108] The variance is used as the multi-dimensional resource balancing weight of the replica node. The smaller the value, the more balanced the resources of the node in each dimension will be after deleting the replica. The replicas on the nodes with smaller variance will be deleted first.
[0109] Step 1-5: For replicas with equal multi-dimensional resource balancing weights, if all replicas are ready, they are sorted according to the earliest time of readiness, and the later replicas have a lower priority.
[0110] Step 1-6: Sort the replicas according to the number of times the containers in the replicas are restarted. The replicas with more restart times have lower priority.
[0111] Step 1-7: Sort the copies according to their creation time, with the copies with later creation time being smaller first.
[0112] Step 1-8: Filter the replicas according to the sorting results obtained in the previous steps 1-1 to 1-7, and select the replicas with lower priority for deletion.
[0113] The existing Kubernetes scaling-down strategy selects replicas to be deleted based on the priority of the replica status. This strategy ignores the impact of deleting Pods on cluster resources. Pods corresponding to various types of applications are distributed on Kubernetes cluster nodes, so the distribution of Pods directly determines the resource allocation status of each node in the cluster.
[0114] The optimized scaling-down strategy considering cluster resource factors proposed by the present invention pre-calculates the resource utilization of the node where the replica is located after deletion and the balance of resources in each dimension during scaling-down. Resource utilization and the balance of resources in each dimension are added as new indicators to the existing Kubernetes replica priority sorting strategy. This can avoid the problem of reduced application operation efficiency due to competition for resources between replicas caused by the aggregation of node replicas after the scaling-down action is executed, and weighing the balance of resources in each dimension can prevent the generation of a large amount of resource fragments.
[0115] Second aspect:
[0116] The present invention also discloses an array-sensing edge container elastic expansion and contraction system, the system comprising:
[0117] The substation multi-container cluster edge cloud framework is used to aggregate the Pod replica set load of the container and obtain the specific resource information of the container;
[0118] The container monitoring module is used to calculate the load data of the Pod replica set based on the specific resource information of the container;
[0119] The container status analysis module is used to calculate the optimal predicted time for the container to generate all Pod replica sets.
[0120] The container load prediction module is used to predict the load prediction value of the Pod replica set in the next stage based on the historical load data composed of the load data of the Pod replica set and the optimal prediction time of the Pod replica set.
[0121] The container scaling module is used to calculate the expected number of replicas based on the load forecast value of the Pod replica set in the next phase, and control the expansion or reduction of the container according to the expected number of replicas at the time point when expansion or reduction is required.
[0122] Furthermore, the predicted load forecast value of the Pod replica set in the next stage is obtained by modeling and predicting the historical load data based on the grey-exponential smoothing combination model.
[0123] Furthermore, the optimal prediction time of the Pod replica set is predicted based on a quadratic exponential smoothing model.
[0124] Furthermore, the substation multi-container cluster edge cloud framework is obtained by virtualizing the substation physical resources based on the Docker application container engine and the Kubernetes container management system.
[0125] The above system is described in detail as follows:
[0126] As attached Figure 1As shown in the figure, a substation multi-container cluster edge cloud framework is built, including a central cloud, a collaborative layer, an edge cloud cluster, and applications. The application is the carrier of the services that the substation array equipment needs to provide, and the edge cloud is the carrier of the application. The application exists in the edge cloud cluster in the form of a container. The edge cloud cluster uses the container compilation engine to manage the edge nodes, achieves a high degree of autonomy within the cluster, and provides a management structure for the collaborative layer. It accepts resource scheduling instructions from the collaborative layer and supports direct response to user requests. The collaborative layer consists of several high-performance servers, which play a connecting role in the entire architecture. The collaborative layer itself can decide whether to participate in the workload based on computing power, and connect to the central cloud to interact with it, and manage all edge cloud clusters in the region to perform resource scheduling. The number of edge clusters connected to the collaborative layer can be changed at will according to the geographical location characteristics. The function of the central cloud is to manage the collaborative layer, send application deployment, deletion, and update commands to the collaborative layer, and perform global data analysis.
[0127] Establish a container management module, including container monitoring module, container status analysis module, container load prediction module and container scaling module. The interaction between them is shown in the attached figure. Figure 2 Among them, the container monitoring module is responsible for monitoring the Pod load information, mainly completing data collection and load calculation. Its workflow is shown in the attached Figure 3 As shown in the figure, cAdvisor, a container monitoring tool in the deployment and work nodes, collects and aggregates container information in the Pod, and then obtains specific resource information of the containers in the Pod through the container cluster monitoring tool Heapster. At the same time, Heapster also obtains the resource usage of the Pod from the load calculation module. By comparing the two, it can be determined whether the resources are fully utilized at this time; the container status analysis module is mainly used to determine the prediction time, that is, how long it will take for the load change of the Pod replica set after predictive expansion. In order to meet the initialization time of different types of Pods, the average initialization time of all Pods in the ready state in the replica set is selected as the optimal prediction time. The flow chart is shown in the attached figure. Figure 4 As shown in the figure, the container load prediction module is responsible for predicting the future load changes of the Pod replica set. It first obtains the Pod replica load data from the monitoring module and saves it to form the historical load data. Then, the prediction time is calculated according to the state analysis module. Then, the gray-exponential smoothing combination model is used to model the historical load data to predict the load changes of the replica set in the next stage. The flowchart is shown in the attached figure. Figure 5 As shown in the figure, the scaling module model is responsible for calculating the expected number of replicas, obtaining the load prediction value from the prediction module, and calculating the expected number of replicas based on the prediction value. The flowchart is shown in the attached figure. Figure 6 shown.
[0128] Predictive expansion predicts the load of the Pod replica set, and expands the capacity by calculating the replica scaling amount based on the prediction results. Load prediction predicts future data through existing historical load data, so a time series prediction algorithm can be used. At the same time, because edge resources are limited, the time complexity and resource consumption of the prediction algorithm should also be considered. The Kubernetes automatic scaler works periodically, so each prediction needs to predict the load status of the replica set after the Pod initialization time, so the prediction algorithm should be applicable to short-term prediction. In summary, the load prediction model selected by the present invention is a quadratic exponential smoothing model and a gray prediction model, wherein the quadratic exponential smoothing method is a prediction method for short-term time series, which has a small amount of calculation, high prediction accuracy, and can make full use of all historical data, and can better mine data rules. The gray prediction theory is an algorithm for predicting small samples with some sample information known and some sample information positions. It has good adaptability to samples with small sample size and unclear change rules. At the same time, the gray prediction method has a small amount of calculation and its quantitative analysis results are consistent with the qualitative analysis results.
[0129] Assume the original historical load sequence is X (0) ={x (0) (t1),x (0) (t2),...,x (0) (t m )}, the corresponding time point sequence is T (0) ={t1,t2,...,t m}. First, according to the original historical load sequence X (0) Build an exponential smoothing model and predict the load value for the next period.
[0130] According to the abnormal judgment standard, the abnormal load time point sequence and the abnormal load value sequence are determined. and abnormal load value sequences
[0131] The grey model is established for the abnormal load time point sequence and the abnormal load value sequence respectively, and the next abnormal load time point and abnormal load value are predicted. Assume that the prediction result of the grey model shows that the load will i The corresponding abnormal load value is Use Replace i Exponentially smoothed forecast value at a time point.
[0132] The automatic scaling strategy that comes with Kubernetes is a responsive scaling strategy, which essentially calculates the scaling amount based on the current load of the Pod replica. The time required from the overload of the replica set triggering the expansion to the new Pod replica providing services is called the Pod initialization time. When service requests surge, a large number of user requests may accumulate during the Pod initialization time, resulting in an increase in user request time.
[0133] The container expansion strategy based on load prediction proposed in the present invention can complete the expansion before the load peak arrives by predicting the future load status of the replica set, thereby avoiding the response delay caused by the Pod initialization process and ensuring that the load of the replica set is moderate and in the target state.
[0134] The third aspect:
[0135] A computer-readable storage medium stores a computer program thereon, characterized in that when the computer program is executed by a processor, the array-aware edge container elastic scaling method described in any one of the embodiments is implemented.
[0136] A computer device comprising:
[0137] A memory for storing instructions;
[0138] The processor is used to execute the instruction so that the device performs operations to implement the array-aware edge container elastic scaling method described in any one of the embodiments.
[0139] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0140] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0141] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0142] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0143] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the technical principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. An array-aware edge container elastic scaling method, characterized in that: The method comprises: Obtain container-specific resource information from the Pod replica set load of the aggregated container in the pre-built substation multi-container cluster edge cloud framework; Calculate the load data of the Pod replica set based on the specific resource information of the container; Calculate the optimal predicted time for the container to generate all Pod replica sets; Predict the load forecast value of the Pod replica set in the next phase based on the historical load data composed of the load data of the Pod replica set and the optimal forecast time of the Pod replica set; According to the load forecast value of the Pod replica set in the next stage, the expected number of replicas and the time point when capacity expansion or reduction is required are calculated; and at the time point when capacity expansion or reduction is required, the expansion or reduction of the container is controlled according to the expected number of replicas.
2. The array-sensing edge container elastic scaling method according to claim 1, characterized in that: Methods for calculating the expected number of replicas and the time points when capacity needs to be expanded or reduced include: According to the abnormal judgment criteria, calculate the abnormal load time point sequence and abnormal load value sequence in the load forecast value of the Pod replica set in the next stage; Grey models are established for the abnormal load time point sequence and the abnormal load value sequence respectively. The abnormal load time point sequence predicts the next abnormal load time point, and the grey model of the abnormal load value sequence predicts the next abnormal load value. Determine the time point when capacity expansion or reduction is required based on the predicted next abnormal load time point; determine the expected number of replicas based on the predicted next abnormal load value.
3. The array-sensing edge container elastic scaling method according to claim 1, characterized in that: Methods for scaling down containers based on the expected number of replicas include: Get all replicas in the Pod replica set in the container at the current moment; determine the number of replicas that need to be deleted based on the expected number of replicas and all replicas in the Pod replica set in the container at the current moment; Determine the priority of each copy and sort the copies according to their priority; Filter according to the sorting results of each replica, and select the replicas that match the number of replicas to be deleted in order of the smallest priority to the largest priority as the replicas to be deleted.
4. The array-sensing edge container elastic scaling method according to claim 3, characterized in that: Determining the priority of each copy includes: The state priority of the replica is used as the priority of the replica; When the status priorities of multiple replicas are equal, the cluster load balancing strategy is used to calculate the first weight of each replica, and the replicas are sorted according to the size of their first weights. The replica with the smallest first weight has the smallest priority. When the first weights of the replicas are equal, the node multi-dimensional resource balancing strategy is used to calculate the second weights of the replicas. The replicas are sorted according to their second weights. The replica with the smallest second weight has the smallest priority. When the second weights of the replicas are equal, if the replicas are all ready, the replicas are sorted according to the early and late ready times of the replicas, and the replica with the latest ready time has a lower priority.
5. The array-sensing edge container elastic scaling method according to claim 3, characterized in that: The method for determining the status priority of the replica includes: According to whether each copy is ready, it is divided into unready copies and ready copies. The status priority of unready copies is lower than that of ready copies. For unready replicas, they are divided into unscheduled replicas and scheduled replicas according to whether they have been scheduled. The status priority of unscheduled replicas is lower than that of scheduled replicas. For scheduled replicas, they are divided into Pending, Unknown, and Running states according to their states. The state priority of a replica in the Pending state is lower than that of a replica in the Unknown state, and the state priority of a replica in the Unknown state is lower than that of a replica in the Running state.
6. The array-sensing edge container elastic scaling method according to claim 3, characterized in that: Determining the priority of each replica includes: sorting the replicas according to the number of restarts of the container corresponding to each replica, wherein the replica with the largest number of restarts has the smallest priority.
7. The array-sensing edge container elastic scaling method according to claim 3, characterized in that: Determining the priority of each copy includes: sorting the copies according to the creation time of each copy, and the copy with the latest creation time has the lowest priority.
8. The array-sensing edge container elastic scaling method according to claim 4, characterized in that: The method of using the cluster load balancing strategy to calculate the first weight of each replica includes: using the resource utilization of the node where the replica is located after being deleted as the resource weight of deleting the replica, wherein the resource utilization is calculated as follows: assuming that the resource dimension of the node is R(1,2,...,r), and the total resource amount of the node is S(s1,s2,...,s r ), the node has been allocated resources A(a1,a2,...,a r ), the resource quota of the replica is D(d1,d2,...,d r ), for the replica to be deleted, the formula is as follows: r is the dimension of resources; Calculate the resource utilization U(u1,u2,...,u r ), calculate the average resource utilization Will As the first weight of the replica to be deleted.
9. The array-sensing edge container elastic scaling method according to claim 8, characterized in that: The second weight of each replica is calculated using the node multi-dimensional resource balancing strategy, including: Calculate the variance S of each copy 2 , variance S 2 The calculation formula is as follows:
10. The array-sensing edge container elastic scaling method according to claim 1, characterized in that: Methods for predicting the load prediction value of the Pod replica set in the next stage include: According to the historical load data and the optimal prediction time of the Pod replica set, a grey-exponential smoothing model is established, and the grey-exponential smoothing model is used to predict the load prediction value of the Pod replica set in the next stage.
11. An array sensing edge container elastic scaling system, characterized in that: The system comprises: The substation multi-container cluster edge cloud framework is used to aggregate the Pod replica set load of the container and obtain the specific resource information of the container; The container monitoring module is used to calculate the load data of the Pod replica set based on the specific resource information of the container; The container status analysis module is used to calculate the optimal predicted time for the container to generate all Pod replica sets. The container load prediction module is used to predict the load prediction value of the Pod replica set in the next stage based on the historical load data composed of the load data of the Pod replica set and the optimal prediction time of the Pod replica set. The container scaling module is used to calculate the expected number of replicas based on the load forecast value of the Pod replica set in the next phase, and control the expansion or reduction of the container according to the expected number of replicas at the time point when expansion or reduction is required.
12. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the array-aware edge container elastic scaling method as described in any one of claims 1 to 10 is implemented.
13. A computer device, characterized in that: include: A memory for storing instructions; A processor is used to execute the instruction so that the device performs operations to implement the array-aware edge container elastic scaling method as described in any one of claims 1 to 10.
Citation Information
Cited By
Container redundancy scheduling method and system based on dynamic load
CN120066686A
Container resource allocation method and system based on AI drive and medium
CN120448135A