Automatic scaling method and system based on mobile edge computing server cluster
By using the automatic telescopic method of load prediction and multi -smart optimization algorithm in the mobile edge computing server cluster, the existing technology cannot effectively respond to the problem of emerging load changes, and achieve more efficient resource utilization and user experience improvement.
Patent Information
- Application Number
- CN202411476926.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-22
- Publication Date
- 2025-01-28
AI Technical Summary
The prior art cannot effectively deal with sudden service load changes when dealing with the automatic scaling of mobile edge computing server clusters, resulting in resource waste and service level agreement (SLA) defaults, affecting user experience.
The automatic telescopic method based on load prediction is adopted, and the load of the working node in the parallel prediction model predicts the work node is used to predict the work node in the server cluster, and the resource automatic scaling strategy of the cluster edge node is determined through the multi -smart closetic strategy optimization algorithm.
The SLA satisfaction and the efficiency of cluster resource utilization of application services have been improved, the efficiency of cluster resource utilization has been reduced, and the waste of resources has been reduced, and the user service experience has been enhanced.
Smart Images

Figure CN119383664A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of mobile communications, and in particular, to an automatic scaling method and system based on a mobile edge computing server cluster. Background Art
[0002] Mobile edge computing (MEC) achieves low-latency and high-bandwidth data transmission by placing computing and storage resources at the edge of the network, providing faster response time and high-quality user experience. A MEC server cluster refers to a group of servers deployed at the edge of the network, which can improve computing performance and processing capabilities through distributed computing and collaborative processing. The servers in the cluster can jointly handle complex tasks and distribute the computing load to multiple nodes, thereby improving overall computing efficiency and throughput. At present, MEC server clusters based on container virtualization technology have the advantages of efficient deployment and strong scalability, simplifying the deployment and operation and maintenance process of applications. Among them, the commonly used container virtualization technology is Kubernetes. In the MEC server cluster implemented by Kubernetes, each instance that uses resources is called a Pod, and each node that provides resources is called a Node. The computing resources in Kubernetes are mainly central processing units (CPUs) and memory. When Kubernetes schedules these two computing resources, it mainly schedules the Pods that apply for these two resources to the optimal cluster node. Kubernetes auto-scaling is mainly horizontal pod auto-scaler (HPA), which refers to dynamically adjusting the number of Pod replicas according to environmental changes. It is a key research direction for dynamic resource management in Kubernetes. In addition, the scheduler is one of the core components of Kubernetes. The scheduler allocates Pods to appropriate nodes according to preset scheduling policies and conditions to achieve balanced allocation and optimal utilization of resources. At present, the existing HPA auto-scaling mechanism makes scaling decisions after obtaining indicator change information, which cannot handle sudden service load changes well, resulting in resource waste, violating service level agreements (SLAs), and reducing user service experience. To address this problem, some technical solutions have proposed active scaling methods based on prediction. However, most active scaling research relies on traditional optimization methods or basic reinforcement learning frameworks, which have limitations in capturing dynamic network changes and heterogeneity of cluster edge nodes. In contrast, multi-agent reinforcement learning (MARL) is more effective in dealing with these changes, making it a better method to solve the problem of automatic scaling of MEC server clusters.
[0003] In the MEC server cluster, the research on horizontal automatic scaling involves the changes in node workload and the consideration of cluster resource utilization efficiency. Currently, horizontal automatic scaling in MEC clusters faces the following difficulties:
[0004] 1) Most current technical solutions are dedicated to improving Kubernetes' native responsive scaling mechanism, which performs scaling operations only after detecting changes in indicators, which may cause service delays and affect user experience.
[0005] 2) Some technical solutions attempt to perform predictive scaling through a single machine learning or deep learning model, but these models often have difficulty accurately predicting application load changes. In order to improve the accuracy of predictions, some solutions combine different prediction models to form a combined prediction model. This combined prediction model can make more accurate predictions based on the various characteristics of the application load, thereby optimizing scaling decisions, reducing service delays, and improving user service experience. Server cluster load resources are a set of time series data with long-term dependencies. For time series data with long-term dependencies, the network structure of a single prediction model needs to be combined to improve prediction accuracy.
[0006] 3) Existing technical solutions often rely on traditional single-agent reinforcement learning algorithms to handle automatic scaling decision-making problems. Such solutions do not fully consider the mutual cooperation and competition between cluster edge nodes in resource allocation. This limitation may lead to inefficient resource allocation and fail to meet the real-time and dynamic requirements of edge computing environments.
[0007] Therefore, how to provide an automatic scaling method based on a mobile edge computing server cluster that can save question-and-answer time and reduce work costs has become an urgent problem to be solved in this field. Summary of the invention
[0008] In response to the above problems, the present application proposes an automatic scaling method based on load prediction in a mobile edge computing server cluster. The method uses a parallel prediction model to predict the load of the working nodes in the server cluster. Based on the load prediction results, a multi-agent proximal strategy optimization algorithm is used to obtain an automatic scaling strategy for resource instances in the edge nodes of the cluster, so as to improve the service level agreement of the application and the efficiency of cluster resource utilization.
[0009] The present application proposes an automatic scaling method based on a mobile edge computing server cluster, comprising the following steps: initializing a scaling cooling time and a scaling period T, and verifying whether the scaling cooling time condition is currently met; if the scaling cooling time condition is currently met, obtaining information on edge nodes of all service clusters participating in scaling in the server cluster; obtaining load indicators based on information requests of all service cluster edge nodes; inputting the obtained load indicators into a TSBA model for load prediction to obtain prediction results; determining an automatic scaling strategy based on the prediction results; and making decisions and calculating dynamic resource adjustments based on the automatic scaling strategy.
[0010] As above, obtaining the information of all service cluster edge nodes participating in the scaling in the server cluster includes determining the CPU resource utilization of node m. It is expressed as:
[0011]
[0012] Among them I t is the total number of instructions corresponding to the user requests processed by the node in this cycle, F m Indicates the CPU frequency of the node, I m Indicates the number of instructions that a single-core CPU can process, C m Indicates the number of CPU cores, and T is the elastic scaling period.
[0013] As above, for any elastic scaling period, the memory resource utilization of node m is It is expressed as:
[0014]
[0015] Where W t It is the total memory-time product of the node in this cycle.
[0016] As mentioned above, before obtaining the load index according to the edge node information request of all service clusters, it also includes collecting the load index of the Pod list and storing it in the internal database.
[0017] As mentioned above, the prediction results are obtained by firstly extracting global features from the time series data of the load index through a time convolutional network, and then extracting temporal features from the time series data of the load index through a bidirectional gated recurrent unit, and using an attention mechanism to fuse spatial features and temporal features.
[0018] An automatic scaling system based on a mobile edge computing server cluster specifically comprises: an initialization unit, an acquisition unit, a load index acquisition unit, a prediction unit, an automatic scaling strategy determination unit, and a decision and dynamic resource adjustment unit; the initialization unit is used to initialize a scaling cooling time and a scaling period T, and to verify whether the scaling cooling time condition is currently met; if the scaling cooling time condition is currently met, the acquisition unit acquires information of all service cluster edge nodes participating in scaling in the server cluster; the load index acquisition unit is used to request the acquisition of load indexes according to the information of all service cluster edge nodes; the prediction unit is used to input the acquired load index into a TSBA model for load prediction and obtain a prediction result; the automatic scaling strategy determination unit is used to determine the automatic scaling strategy according to the prediction result; the decision and dynamic resource adjustment unit is used to perform decision-making and dynamic resource adjustment calculations according to the automatic scaling strategy.
[0019] As above, the acquisition unit acquires information of all service cluster edge nodes participating in the scaling in the server cluster, including determining the CPU resource utilization of node m. It is expressed as:
[0020]
[0021] Among them I t is the total number of instructions corresponding to the user requests processed by the node in this cycle, F m Indicates the CPU frequency of the node, I m Indicates the number of instructions that a single-core CPU can process, C m Indicates the number of CPU cores, and T is the elastic scaling period.
[0022] As above, in the acquisition unit, for any elastic scaling cycle, the memory resource utilization of node m It is expressed as:
[0023]
[0024] Where W t It is the total memory-time product of the node in this cycle.
[0025] As described above, before the load indicator acquisition unit obtains the load indicator according to the information request of all service cluster edge nodes, it also includes collecting the load indicators of the Pod list and storing them in the internal database.
[0026] As mentioned above, the prediction unit obtains the prediction result, including that the time series data of the load indicator first passes through the time convolution network to extract global features, and at the same time, the time series data of the load indicator extracts temporal features through a bidirectional gated recurrent unit, and uses the attention mechanism to fuse spatial features and temporal features.
[0027] This application has the following beneficial effects:
[0028] (1) This application focuses on the MEC server cluster deployed based on Kubernetes. Based on the Kubernetes native system framework, it expands the automatic scaling and scheduling mechanism and proposes a joint design solution for high-precision node load prediction and node automatic scaling decision-making.
[0029] (2) This application can improve the system resource utilization efficiency of the server cluster and better meet the SLA requirements of application services. It can adjust resource preferences and model structures according to application scenarios, thereby improving system resource utilization efficiency and user service experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present application. For ordinary technicians in this field, other drawings can also be obtained based on these drawings.
[0031] Figure 1 It is a flowchart of an automatic scaling method based on a mobile edge computing server cluster provided according to an embodiment of the present application;
[0032] Figure 2 It is a schematic diagram of a model structure for performing prediction according to an embodiment of the present application;
[0033] Figure 3 It is a schematic diagram of the internal structure of an automatic scaling system based on a mobile edge computing server cluster provided according to an embodiment of the present application;
[0034] Figure 4 It is a schematic diagram of the internal structure of a cluster center node provided according to an embodiment of the present application. DETAILED DESCRIPTION
[0035] The following is a clear and complete description of the technical solutions in the embodiments of the present application in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present application.
[0036] The present application proposes an automatic scaling method based on parallel prediction and multi-agent reinforcement learning. Multi-agent reinforcement learning (MARL) provides a more advanced method that can more accurately simulate and adapt to the complex interactions between cluster edge nodes. MARL simulates the behavior of each cluster edge node as an independent agent, so that the entire system can respond to changes in the network environment in real time, while taking into account the synergy and potential competition between nodes. Under the MARL framework, each agent has the ability of distributed observation and can make decisions based on local information, and the decisions of each agent are centrally coordinated through the interaction between agents to achieve the global optimization goal. This method can not only improve the efficiency of resource allocation, but also improve the system's adaptability to dynamic changes and overall performance. Therefore, the horizontal automatic scaling problem in the server cluster needs to consider the way in which the cluster edge nodes make independent decisions to optimize the system benefits.
[0037] Embodiment 1
[0038] like Figure 1As shown, this embodiment provides an automatic scaling method based on a mobile edge computing server cluster, which specifically includes the following steps:
[0039] Step S110: Initialize the telescopic cooling time and the telescopic cycle T, and check whether the telescopic cooling time condition is currently met.
[0040] If the condition of the expansion and contraction cooling time is currently met, step S120 is executed, otherwise the process exits.
[0041] The expansion and contraction cooling time may be a pre-set time, and the specific value is not limited here.
[0042] Step S120: Obtain information on all service cluster edge nodes participating in scaling in the server cluster.
[0043] The information of all service cluster edge nodes participating in the scaling in the server cluster is obtained, including the name of each node, the computing resources of each node, and the number of Pods deployed on each node, and the resource usage and performance indicators of each node and Pod in the service cluster are collected.
[0044] Specifically, the cluster edge node set is defined as M = {1, 2, ..., M}, each cluster edge node has different computing capabilities, and the attributes of node m are represented as a tuple [F m ,I m ,W m ,C m ], where F m ,I m , W m , C m are the CPU frequency of the node, the number of instructions that a single-core CPU can process, the memory size, and the number of CPU cores. The set of Pods deployed on node m is defined as N m ={1,2,…,N}. The attributes of a Pod are represented as a tuple [C pod ,W pod ], C pod , W pod They represent the requirements of the deployment unit Pod for the node CPU and memory resources respectively. The unified elastic scaling cycle size in the cluster is T. For any scaling cycle t, the total number of Pods deployed by the application service in the cluster is N(t), and the number of Pods deployed on node m is N m (t), the number of Pods that node m obtains during this period is Q m (t), then the number of Pods on node m after the cycle is completed is recorded as N m (t+1).
[0045] The cluster edge node set is defined as M = {1, 2, ..., M}. Each cluster edge node has different computing capabilities. The attributes of node m are represented as tuples [F m ,I m ,W m ,C m ], where F m ,I m , W m , C m are the CPU frequency of the node, the number of instructions that a single-core CPU can process, the memory size, and the number of CPU cores. The set of Pods deployed on node m is defined as N m ={1,2,...,N}. The attributes of a Pod are represented as a tuple [C pod ,W pod ], C pod , W pod They represent the requirements of the deployment unit Pod for the node CPU and memory resources respectively. The unified elastic scaling cycle size in the cluster is T. For any scaling cycle t, the total number of Pods deployed by the application service in the cluster is N(t), and the number of Pods deployed on node m is N m (t), the number of Pods that node m obtains during this period is Q m (t), then the number of Pods on node m after the cycle is completed is recorded as N m (t+1).
[0046] The load of the application service at period t reflects the user demand for the application service at that moment. In this automatic scaling solution, the cluster load indicator is composed of the number of user requests X in the service unit scaling period. t The attribute of the number of service requests is represented as a tuple [I,M], where I and M represent the number of instructions and memory consumption corresponding to a unit request, respectively. This solution predicts the number of requests for a single application service in the future scaling cycle to cope with the scenario of a burst number of requests. Resource utilization considers the weighted value of the system CPU resource and memory resource utilization. For cycle t, the CPU resource utilization of node m is It is expressed as:
[0047]
[0048] Among them I t is the total number of instructions corresponding to the user requests processed by the node in this cycle, F m ,I m ,C m are the CPU frequency of the node, the number of instructions that a single-core CPU can process, and the number of CPU cores, respectively. T is the elastic scaling period. In a server environment, memory utilization refers to the ratio of the memory allocated to a node in a period of time to the total memory. For period t, the memory resource utilization of node m is It is expressed as:
[0049]
[0050] Where W t is the total memory time product of the node in this cycle. Thus, the resource utilization rate H of the node is obtained m for:
[0051]
[0052] Among them, ω1 and ω2 represent the cluster's preference for CPU and memory resources. ω1+ω2=1. The larger the value, the greater the impact of the resource on the cluster. In addition, set H target is the ideal resource utilization rate when the cluster reaches a stable state. The value is set to 70%. The average resource utilization rate of the cluster in period t is obtained by comparing it with the set target value H target The difference:
[0053]
[0054] A request queue is maintained for each node. When an application service request is assigned to a node, it first enters the waiting queue. When a request arrives, it needs to wait for the previous request to be completed. The remaining computing amount required to complete the request in the waiting queue is I s , the waiting time of a unit request on a node is:
[0055]
[0056] Similarly, the processing time of the request on the node is:
[0057]
[0058] Request response delay of application service on a single node T m It is composed of service request waiting delay and processing delay, ignoring communication delay and indicator monitoring delay:
[0059] T m =T waiting +T computing (7)
[0060] SLA defines the quality of service that a cloud service provider guarantees to its users. Here, SLA is defined as the upper limit of the application response time, T max , the SLA breach level of the cluster is T vio Consider the ratio of service default time to service response time of all nodes:
[0061]
[0062] The automatic elastic scaling problem considered in this embodiment is: the automatic scaling strategy should reduce the SLA breach degree of the service and improve the overall resource utilization of the cluster in period t. This problem can be defined as an optimization problem of the objective function under multiple constraints:
[0063] Min(αH diff +βT vio )
[0064] C1:N m (t)C pod ≤C m
[0065] C2:N m (t)W pod ≤W m
[0066] C3:α+β=1 (9)
[0068] Among them, α, β∈(0,1) represent the cluster's trade-offs for multiple objectives. Constraint C1 indicates that the sum of the CPU requirements of all Pods on node m cannot exceed the total CPU volume of the node. Constraint C2 indicates that the sum of the memory requirements of all Pods on node m cannot exceed the total memory volume of the node. Constraint C3 indicates that the sum of the weighted values of the two optimization objectives is 1.
[0069] Step S130: Obtain load indicators according to information requests of all service cluster edge nodes.
[0070] Before requesting to obtain the load index, the load index of the Pod list is collected and stored in the internal database. The corresponding load index can be obtained by sending a request to the database.
[0071] Step S140: input the acquired load index into the TSBA model to perform load forecasting and obtain a forecast result.
[0072] The main purpose of load prediction is to predict the node load at the next time point based on the currently acquired load indicators. Specifically, the prediction model TSBA is used to preprocess the acquired load resource data, and then the processed data is put into the TSBA prediction model for prediction. After finding the optimal parameters of the load model, the load prediction model is trained and the prediction results at the next time point are output. After obtaining the prediction results, the prediction results are uploaded to the database to provide data-level support for subsequent elastic scaling.
[0073] The time series data of the load indicator first passes through the temporal convolutional network (TCN) network to extract global features, and at the same time, the data passes through the bidirectional gated recurrent unit (BiGRU) to extract temporal features. The attention mechanism is used to fuse spatial and temporal features. By calculating the attention weights, the model pays more attention to important features and then performs feature enhancement and fusion. Finally, it passes through the fully connected layer for high-precision prediction.
[0074] The model structure for prediction is as follows Figure 2 As shown, specifically including:
[0075] A. Input layer: This layer is mainly used to prepare and construct input data for the model, estimate and separate noise components, thereby improving the decomposition accuracy and obtaining load time series data.
[0076] B. Branch 1: Through the TCN model network based on squeeze-and-excitation networks (SENet), the weights of channel features are adaptively adjusted, so that the model can automatically learn the importance of different channels and extract important spatial features related to the prediction target in multi-feature sequences.
[0077] C. Branch 2: Pass the multi-feature sequence data through the BiGRU network based on Attention optimization. At each time step, the attention mechanism calculates a weight vector to indicate the degree of attention paid by the model to each part of the input sequence, and then applies these weights to the feature representation of the BiGRU output. By weighting the features at all positions, the model can focus on important time domain features more specifically.
[0078] D. Output layer: This layer mainly processes the prediction results obtained after a series of operations of the model. The spatial features and global time domain features extracted by the two branches are stacked and fused, so that the model can better integrate feature representations at different levels.
[0079] Wherein step S140 specifically includes the following sub-steps:
[0080] Step S1401: pre-processing the input user request number time series.
[0081] Since the load metric is measured by the number of user requests within the scaling period of the service unit, the input user request number time series is preprocessed, mainly to separate the noise and avoid the occurrence of extreme values or monotonic trends.
[0082] Step S1402: Initialize the network parameters such as the TSBA model sliding window length, batch size, and learning rate.
[0083] Step S1403: Input the time series of the number of user requests into the TCN network to extract data space features, and input it into the BiGRU branch to extract time domain features.
[0084] Step S1404: The TCN network output is adjusted through the SENet module to adjust the feature weight, and the BiGRU output is calculated through the Attention module to calculate the weight.
[0085] Step S1405: stack and fuse the extracted spatial and temporal features to obtain the prediction result X t+1 .
[0086] Step S150: Determine an automatic scaling strategy according to the prediction result.
[0087] Combined with the Kubernetes horizontal autoscaler, it makes elastic scaling decisions based on the above-mentioned prediction results and the pre-set scaling strategy. The listener will continue to monitor the prediction result information stored in the database to check if there are any updates; when new prediction results are written to the database, the listener will use the MAPPO algorithm to determine whether the application needs to be elastically scaled based on the prediction results, obtain the Pod status of each node to be expanded or reduced, and pass the MAPPO network output results to the scheduling module for specific expansion and contraction operations.
[0088] In this embodiment, each cluster edge node is regarded as an intelligent agent, and the problem is modeled as a Markov decision process (MDP), which is represented as a tuple<S,A,P,R,γ> , where S represents the state space of the environment, A is the set of actions available to all agents, and each agent selects an action at each scaling interval to form a joint action A. The state of the environment is transferred according to the state transfer function P, and the reward function R is used to evaluate the quality of the decision made. The discount factor γ∈[0,1] determines the importance of future rewards.
[0089] The node state space refers to the information observed by a single agent from the server environment. m (t) Node information included: Number of node Pods N m (t), node CPU resource utilization Node memory resource utilization Number of service requests in the current scaling cycle X t and the predicted number of requests X for the next scaling cycle t+1 :
[0090]
[0091] The cluster state space is the collection of all agent state spaces:
[0092] S(t)={[S1(t),S2(t),...,S M (t)]} (11)
[0093] The action refers to the number of Pods added or removed during the scaling period. The scaling decision of the node in period t is Q m (t), the action space is defined as:
[0094] A(t)={[Q1(t),Q2(t),...,Q M (t)]}(12)
[0095] The rewards of all agents in the cluster are defined as:
[0096] r t =1-H diff -T vio (13)
[0097] This embodiment uses MAPPO based on the actor-critic framework. The algorithm adopts a centralized training and distributed execution mode. At the beginning of training, the agents pass their respective state observation data to the central controller. After receiving the global state, the central controller trains the model to obtain the optimal decentralized control strategy, and then passes the strategy back to the agent. Each agent uses a deterministic policy network to output actions. In addition, the MAPPO algorithm shares an experience replay pool, which is suitable for scenarios involving agent interactions.
[0098] The steps of the MAPPO algorithm are as follows: First, initialize the system model parameters and network parameters. Second, input the predicted value X obtained by the prediction module. t+1 , node attribute tuple [F m ,I m ,W m ,C m ] and a scaling period T, and generates requests based on the predicted values. Then the interaction between the agent and the environment is performed. Initialize the agent state S(t) and the experience buffer D. The agent uses the actor network to output the current action A(t) based on the current state. The obtained variables are input into the environment to obtain the average reward, and the system transitions to the next state S(t+1). The agent then interacts with the environment. Finally, the actor network and critic network parameters are used to update the network parameters every other round, and the model parameters are saved after the model converges, and the optimal action space A(t) is output.
[0099] Based on the above, step S150 specifically includes the following sub-steps:
[0100] Step S1501: Input the prediction results of the TSBA prediction model into the network.
[0101] Step S1502: Initialize system parameter F m ,I m , W m , C m , I, M and H diff , initialize the critic network and actor network π m , initialize buffer D.
[0102] Step S1503: Initialize the agent state S(t).
[0103] Step S1504: Obtain the current action A(t) through the actor network.
[0104] Step S1505: Obtain the average reward r corresponding to the current action t , transition to the next state S(t+1).
[0105] Step S1506: The intelligent agent interacts with the environment.
[0106] Step S1507: Update MAPPO model parameters.
[0107] Step S1508: Determine whether the MAPPO model has converged.
[0108] Step S1509: confirm whether the MAPPO model has converged, if so, output the MAPPO model; otherwise, re-initialize the agent state.
[0109] Step S160: Decision making and dynamic resource adjustment calculation are performed according to the automatic scaling strategy.
[0110] Based on the resource indicators and automatic scaling strategies collected above, decisions and dynamic resource adjustment calculations are performed according to the scheduling strategy derived from the MAPPO algorithm.
[0111] Specifically, the output of the automatic scaling policy is received, and the Pod status of each node to be expanded or reduced is obtained according to the MAPPO algorithm. The scheduler receives the configuration information of these Pods to be adjusted and notifies the API Server of the scheduling decision. The API Server updates the status information of the Pod and binds it to the selected node to complete the scheduling process.
[0112] Embodiment 2
[0113] This embodiment provides an automatic scaling system based on a mobile edge computing server cluster. Figure 3As shown, it is a structural diagram of the automatic scaling system based on the mobile edge computing server cluster provided in the embodiment of the present application. The server cluster system model includes a cluster center node (cloud center) Master and multiple cluster edge nodes Node. The cluster center node executes the automatic scaling method based on the mobile edge computing server cluster described in Example 1.
[0114] The application service is deployed in the form of Pod on each cluster edge node, and each Pod of the application service is allocated a certain CPU and memory resource quota. In order to meet user needs and adapt to environmental changes, HPA is deployed in the cluster center to dynamically adjust the number of Pods on each cluster edge node.
[0115] The cluster center node is used to execute the above automatic scaling method based on the mobile edge computing server cluster, such as Figure 4 As shown, it specifically includes: an initialization unit 401, an acquisition unit 402, a load indicator acquisition unit 403, a prediction unit 404, an automatic scaling strategy determination unit 405 and a decision and dynamic resource adjustment unit 406.
[0116] The initialization unit 401 is used to initialize the telescopic cooling time and the telescopic period T, and to check whether the telescopic cooling time condition is currently met.
[0117] If the condition of the cooling time extension is currently met, the acquisition unit 402 is executed, otherwise the process exits.
[0118] The acquisition unit 402 is used to acquire information of all service cluster edge nodes participating in scaling in the server cluster.
[0119] Acquiring information about all service cluster edge nodes participating in scaling in the server cluster includes collecting resource usage and performance indicators of each node and Pod in the service cluster.
[0120] Specifically, the cluster edge node set is defined as M = {1, 2, ..., M}, each cluster edge node has different computing capabilities, and the attributes of node m are represented as a tuple [F m ,I m ,W m ,C m ], where F m ,I m , W m , C m are the CPU frequency of the node, the number of instructions that a single-core CPU can process, the memory size, and the number of CPU cores. The set of Pods deployed on node m is defined as N m ={1,2,...,N}. The attributes of a Pod are represented as a tuple [C pod ,W pod], C pod , W pod They represent the requirements of the deployment unit Pod for the node CPU and memory resources respectively. The unified elastic scaling cycle size in the cluster is T. For any scaling cycle t, the total number of Pods deployed by the application service in the cluster is N(t), and the number of Pods deployed on node m is N m (t), the number of Pods that node m obtains during this period is Q m (t), then the number of Pods on node m after the cycle is completed is recorded as N m (t+1).
[0121] The cluster edge node set is defined as M = {1, 2, ..., M}. Each cluster edge node has different computing capabilities. The attributes of node m are represented as tuples [F m ,I m ,W m ,C m ], where F m ,I m , W m , C m are the CPU frequency of the node, the number of instructions that a single-core CPU can process, the memory size, and the number of CPU cores. The set of Pods deployed on node m is defined as N m ={1,2,...,N}. The attributes of a Pod are represented as a tuple [C pod ,W pod ], C pod , W pod They represent the requirements of the deployment unit Pod for the node CPU and memory resources respectively. The unified elastic scaling cycle size in the cluster is T. For any scaling cycle t, the total number of Pods deployed by the application service in the cluster is N(t), and the number of Pods deployed on node m is N m (t), the number of Pods that node m obtains during this period is Q m (t), then the number of Pods on node m after the cycle is completed is recorded as N m (t+1).
[0122] The load of the application service at period t reflects the user demand for the application service at that moment. In this automatic scaling solution, the cluster load is determined by the number of user requests X in the service unit scaling period. t The attribute of the number of service requests is expressed as a tuple [I,M], where I and M represent the number of instructions and memory consumption corresponding to a unit request, respectively. This solution predicts the number of requests for a single application service in the future scaling cycle to cope with the scenario of a burst number of requests. Resource utilization considers the weighted value of the system CPU resource and memory resource utilization. For cycle t, the CPU resource utilization of node m is expressed as:
[0123]
[0124] Among them I t is the total number of instructions corresponding to the user requests processed by the node in this cycle, F m ,I m ,C m are the CPU frequency of the node, the number of instructions that a single-core CPU can process, and the number of CPU cores, respectively. T is the elastic scaling period. In a server environment, memory utilization refers to the ratio of the memory allocated to a node over a period of time to the total memory. For period t, the memory resource utilization of node m is expressed as:
[0125]
[0126] Where W t is the total memory time product of the node in this cycle. Thus, the resource utilization rate H of the node is obtained m for:
[0127]
[0128] Among them, ω1 and ω2 represent the cluster's preference for CPU and memory resources. ω1+ω2=1. The larger the value, the greater the impact of the resource on the cluster. In addition, set H target is the ideal resource utilization rate when the cluster reaches a stable state. The value is set to 70%. The average resource utilization rate of the cluster in period t is obtained by comparing it with the set target value H target The difference:
[0129]
[0130] A request queue is maintained for each node. When an application service request is assigned to a node, it first enters the waiting queue. When a request arrives, it needs to wait for the previous request to be completed. The remaining computing amount required to complete the request in the waiting queue is I s , the waiting time of a unit request on a node is:
[0131]
[0132] Similarly, the processing time of the request on the node is:
[0133]
[0134] Request response delay of application service on a single node T m It is composed of service request waiting delay and processing delay, ignoring communication delay and indicator monitoring delay:
[0135] T m =T waiting +T computing(7)
[0136] SLA defines the quality of service that a cloud service provider guarantees to its users. Here, SLA is defined as the upper limit of the application response time, T max , the SLA breach level of the cluster is T vio Consider the ratio of service default time to service response time of all nodes:
[0137]
[0138] The automatic elastic scaling problem considered in the present invention is: the automatic scaling strategy should reduce the SLA breach degree of the service and improve the overall resource utilization of the cluster in period t. This problem can be defined as an optimization problem of the objective function under multiple constraints:
[0139] Min(αH diff +βT vio )
[0140] C1:N m (t)C pod ≤C m
[0141] C2:N m (t)W pod ≤W m
[0142] C3:α+β=1 (9)
[0144] Among them, α, β∈(0,1) represent the cluster's trade-offs for multiple objectives. Constraint C1 indicates that the sum of the CPU requirements of all Pods on node m cannot exceed the total CPU volume of the node. Constraint C2 indicates that the sum of the memory requirements of all Pods on node m cannot exceed the total memory volume of the node. Constraint C3 indicates that the sum of the weighted values of the two optimization objectives is 1.
[0145] The cluster edge node set is defined as M = {1, 2, ..., M}. Each cluster edge node has different computing capabilities. The attributes of node m are represented as tuples [F m ,I m ,W m ,C m ], where F m ,I m , W m , C m are the CPU frequency of the node, the number of instructions that a single-core CPU can process, the memory size, and the number of CPU cores. The set of Pods deployed on node m is defined as N m ={1,2,...,N}. The attributes of a Pod are represented as a tuple [C pod,W pod ], C pod , W pod They represent the requirements of the deployment unit Pod for the node CPU and memory resources respectively. The unified elastic scaling cycle size in the cluster is T. For any scaling cycle t, the total number of Pods deployed by the application service in the cluster is N(t), and the number of Pods deployed on node m is N m (t), the number of Pods that node m obtains during this period is Q m (t), then the number of Pods on node m after the cycle is completed is recorded as N m (t+1).
[0146] The load of the application service at period t reflects the user demand for the application service at that moment. In this automatic scaling solution, the cluster load is determined by the number of user requests X in the service unit scaling period. t The attribute of the number of service requests is expressed as a tuple [I,M], where I and M represent the number of instructions and memory consumption corresponding to a unit request, respectively. This solution predicts the number of requests for a single application service in the future scaling cycle to cope with the scenario of a burst number of requests. Resource utilization considers the weighted value of the system CPU resource and memory resource utilization. For cycle t, the CPU resource utilization of node m is expressed as:
[0147]
[0148] Among them I t is the total number of instructions corresponding to the user requests processed by the node in this cycle, F m ,I m ,C m are the CPU frequency of the node, the number of instructions that a single-core CPU can process, and the number of CPU cores, respectively. T is the elastic scaling period. In a server environment, memory utilization refers to the ratio of the memory allocated to a node over a period of time to the total memory. For period t, the memory resource utilization of node m is expressed as:
[0149]
[0150] Where W t is the total memory time product of the node in this cycle. Thus, the resource utilization rate H of the node is obtained m for:
[0151]
[0152] Among them, ω1 and ω2 represent the cluster's preference for CPU and memory resources. ω1+ω2=1. The larger the value, the greater the impact of the resource on the cluster. In addition, set H targetis the ideal resource utilization rate when the cluster reaches a stable state. The value is set to 70%. The average resource utilization rate of the cluster in period t is obtained by comparing it with the set target value H target The difference:
[0153]
[0154] A request queue is maintained for each node. When an application service request is assigned to a node, it first enters the waiting queue. When a request arrives, it needs to wait for the previous request to be completed. The remaining computing amount required to complete the request in the waiting queue is I s , the waiting time of a unit request on a node is:
[0155]
[0156] Similarly, the processing time of the request on the node is:
[0157]
[0158] Request response delay of application service on a single node T m It is composed of service request waiting delay and processing delay, ignoring communication delay and indicator monitoring delay:
[0159] T m =T waiting +T computing (7)
[0160] SLA defines the quality of service that a cloud service provider guarantees to its users. Here, SLA is defined as the upper limit of the application response time, T max , the SLA breach level of the cluster is T vio Consider the ratio of service default time to service response time of all nodes:
[0161]
[0162] The automatic elastic scaling problem considered in the present invention is: the automatic scaling strategy should reduce the SLA breach degree of the service and improve the overall resource utilization of the cluster in period t. This problem can be defined as an optimization problem of the objective function under multiple constraints:
[0163] Min(αH diff +βT vio )
[0164] C1:N m (t)C pod ≤C m
[0165] C2:N m (t)W pod ≤W m
[0166] C3:α+β=1 (9)
[0168] Among them, α, β∈(0,1) represent the cluster's trade-offs for multiple objectives. Constraint C1 indicates that the sum of the CPU requirements of all Pods on node m cannot exceed the total CPU volume of the node. Constraint C2 indicates that the sum of the memory requirements of all Pods on node m cannot exceed the total memory volume of the node. Constraint C3 indicates that the sum of the weighted values of the two optimization objectives is 1.
[0169] The load indicator acquisition unit 403 is used to acquire the load indicator according to the information request of all service cluster edge nodes.
[0170] Before requesting to obtain the load index, the load index of the Pod list is collected and stored in the internal database. The corresponding load index can be obtained by sending a request to the database.
[0171] The acquired load indicators are input into the TSBA model for load forecasting to obtain the forecast results.
[0172] The main purpose of load prediction is to predict the node load at the next time point based on the currently acquired load indicators. Specifically, the prediction model TSBA is used to preprocess the acquired load resource data, and then the processed data is put into the TSBA prediction model for prediction. After finding the optimal parameters of the load model, the load prediction model is trained and the prediction results at the next time point are output. After obtaining the prediction results, the prediction results are uploaded to the database to provide data-level support for subsequent elastic scaling.
[0173] The time series data of the load indicator first passes through the temporal convolutional network (TCN) network to extract global features, and at the same time, the data passes through the bidirectional gated recurrent unit (BiGRU) to extract temporal features. The attention mechanism is used to fuse spatial and temporal features. By calculating the attention weights, the model pays more attention to important features and then performs feature enhancement and fusion. Finally, it passes through the fully connected layer for high-precision prediction.
[0174] The model structure for prediction is as follows Figure 2 As shown, specifically including:
[0175] A. Input layer: This layer is mainly used to prepare and construct input data for the model, estimate and separate noise components, thereby improving the decomposition accuracy and obtaining load time series data.
[0176] B. Branch 1: Through the TCN model network based on squeeze-and-excitation networks (SENet), the weights of channel features are adaptively adjusted, so that the model can automatically learn the importance of different channels and extract important spatial features related to the prediction target in multi-feature sequences.
[0177] C. Branch 2: Pass the multi-feature sequence data through the BiGRU network based on Attention optimization. At each time step, the attention mechanism calculates a weight vector to indicate the degree of attention paid by the model to each part of the input sequence, and then applies these weights to the feature representation of the BiGRU output. By weighting the features at all positions, the model can focus on important time domain features more specifically.
[0178] D. Output layer: This layer mainly processes the prediction results obtained after a series of operations of the model. The spatial features and global time domain features extracted by the two branches are stacked and fused, so that the model can better integrate feature representations at different levels.
[0179] The prediction unit 404 specifically performs the following sub-steps:
[0180] Step T1: Preprocess the input application service request time series, mainly to separate noise and avoid extreme values or monotonic trends.
[0181] Step T2: Initialize the network parameters such as the sliding window length, batch size, and learning rate of the TSBA model.
[0182] Step T3: Input the time series into the TCN network to extract data space features, and input it into the BiGRU branch to extract time domain features.
[0183] Step T4: The TCN network output is passed through the SENet module to adjust the feature weights, and the BiGRU output is passed through the Attention module to calculate the weights.
[0184] Step T5: Stack and fuse the spatial and temporal features of the two branch outputs to obtain the prediction result X t+1 .
[0185] The automatic scaling strategy determining unit 405 is used to determine the automatic scaling strategy according to the prediction result.
[0186] Combined with the Kubernetes horizontal autoscaler, it makes elastic scaling decisions based on the above-mentioned prediction results and the pre-set scaling strategy. The listener will continue to monitor the prediction result information stored in the database to check if there are any updates; when new prediction results are written to the database, the listener will use the MAPPO algorithm to determine whether the application needs to be elastically scaled based on the prediction results, obtain the Pod status of each node to be expanded or reduced, and pass the MAPPO network output results to the scheduling module for specific expansion and contraction operations.
[0187] In this embodiment, each cluster edge node is regarded as an intelligent agent, and the problem is modeled as a Markov decision process (MDP), which is represented as a tuple<S,A,P,R,γ> , where S represents the state space of the environment, A is the set of actions available to all agents, and each agent selects an action at each scaling interval to form a joint action A. The state of the environment is transferred according to the state transfer function P, and the reward function R is used to evaluate the quality of the decision made. The discount factor γ∈[0,1] determines the importance of future rewards.
[0188] The node state space refers to the information observed by a single agent from the server environment. m (t) Node information included: Number of node Pods N m (t), node CPU resource utilization Node memory resource utilization Number of service requests in the current scaling cycle X t and the predicted number of requests X for the next scaling cycle t+1 :
[0189]
[0190] The cluster state space is the collection of all agent state spaces:
[0191] S(t)={[S1(t),S2(t),...,S M (t)]} (11)
[0192] The action refers to the number of Pods added or removed during the scaling period. The scaling decision of the node in period t is Q m (t), the action space is defined as:
[0193] A(t)={[Q1(t),Q2(t),...,Q M (t)]}(12)
[0194] The rewards of all agents in the cluster are defined as:
[0195] r t =1-H diff -T vio (13)
[0196] This embodiment uses MAPPO based on the actor-critic framework. The algorithm adopts a centralized training and distributed execution mode. At the beginning of training, the agents pass their respective state observation data to the central controller. After receiving the global state, the central controller trains the model to obtain the optimal decentralized control strategy, and then passes the strategy back to the agent. Each agent uses a deterministic policy network to output actions. In addition, the MAPPO algorithm shares an experience replay pool, which is suitable for scenarios involving agent interactions.
[0197] The steps of the MAPPO algorithm are as follows: First, initialize the system model parameters and network parameters. Second, input the predicted value X obtained by the prediction module. t+1 , node attribute tuple [F m ,I m ,W m ,C m ] and a scaling period T, and generates requests based on the predicted values. Then the interaction between the agent and the environment is performed. Initialize the agent state S(t) and the experience buffer D. The agent uses the actor network to output the current action A(t) based on the current state. The obtained variables are input into the environment to obtain the average reward, and the system transitions to the next state S(t+1). The agent then interacts with the environment. Finally, the actor network and critic network parameters are used to update the network parameters every other round, and the model parameters are saved after the model converges, and the optimal action space A(t) is output.
[0198] Based on the above, the automatic scaling strategy determination unit 406 specifically performs the following sub-steps:
[0199] Step P1: Input the prediction results of the TSBA prediction model into the network.
[0200] Step P2: Initialize system parameters F m ,I m , W m , C m , I, M and H diff , initialize the critic network and actor network π m , initialize buffer D.
[0201] Step P3: Initialize the agent state S(t).
[0202] Step P4: Get the current action A(t) through the actor network.
[0203] Step P5: Get the average reward r corresponding to the current action t , transition to the next state S(t+1).
[0204] Step P6: Interact between the agent and the environment.
[0205] Step P7: Update MAPPO model parameters.
[0206] Step P8: Determine whether the MAPPO model converges.
[0207] Step P9: Confirm whether the MAPPO model converges. If so, output the MAPPO model; otherwise, reinitialize the agent state.
[0208] The dynamic resource adjustment unit 406 is used to make decisions and perform calculations for dynamic resource adjustment according to the automatic scaling policy.
[0209] Based on the resource indicators and automatic scaling strategies collected above, decisions and dynamic resource adjustment calculations are performed according to the scheduling strategy derived from the MAPPO algorithm.
[0210] Specifically, the output of the automatic scaling policy is received, and the Pod status of each node to be expanded or reduced is obtained according to the MAPPO algorithm. The scheduler receives the configuration information of these Pods to be adjusted and notifies the API Server of the scheduling decision. The API Server updates the status information of the Pod and binds it to the selected node to complete the scheduling process.
[0211] This application has the following beneficial effects:
[0212] (1) This application focuses on the MEC server cluster deployed based on Kubernetes. Based on the Kubernetes native system framework, it expands the automatic scaling and scheduling mechanism and proposes a joint design solution for high-precision node load prediction and node automatic scaling decision-making.
[0213] (2) This application can improve the system resource utilization efficiency of the server cluster and better meet the SLA requirements of application services. It can adjust resource preferences and model structures according to application scenarios, thereby improving system resource utilization efficiency and user service experience.
[0214] Although the present application is described with reference to examples, this is for illustrative purposes only and is not intended to limit the present application, and changes, additions and / or deletions to the embodiments may be made without departing from the scope of the present application.
[0215] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. An automatic scaling method based on a mobile edge computing server cluster, characterized in that: The following steps are involved: Initialize the scaling cooling time and scaling cycle T, and check whether the scaling cooling time conditions are currently met; If the scaling cooldown period is met, obtain the information of all service cluster edge nodes participating in the scaling in the server cluster; Obtain load indicators based on all service cluster edge node information requests; Input the acquired load index into the TSBA model to perform load forecasting and obtain the forecast result; Determine the automatic scaling strategy based on the prediction results; Make decisions and calculate dynamic resource adjustments based on automatic scaling policies.
2. The automatic scaling method based on a mobile edge computing server cluster according to claim 1, characterized in that: Obtain information about all service cluster edge nodes participating in scaling in the server cluster, including determining the CPU resource utilization of node m It is expressed as: Among them I t is the total number of instructions corresponding to the user requests processed by the node in this cycle, F m Indicates the CPU frequency of the node, I m Indicates the number of instructions that a single-core CPU can process, C m Indicates the number of CPU cores, and T is the elastic scaling period.
3. The automatic scaling method based on a mobile edge computing server cluster according to claim 1, characterized in that: For any elastic scaling cycle, the memory resource utilization of node m It is expressed as: Where W t It is the total memory-time product of the node in this cycle.
4. The automatic scaling method based on a mobile edge computing server cluster according to claim 1, characterized in that: Before obtaining the load index according to the edge node information request of all service clusters, the load index of the Pod list is collected and stored in the internal database.
5. The automatic scaling method based on a mobile edge computing server cluster according to claim 1, characterized in that: The prediction results obtained include that the time series data of the load indicator first passes through the time convolution network to extract global features, and at the same time, the time series data of the load indicator extracts temporal features through a bidirectional gated recurrent unit, and uses the attention mechanism to fuse spatial features and temporal features.
6. An automatic scaling system based on a mobile edge computing server cluster, characterized in that: Specifically include: Initialization unit, acquisition unit, load indicator acquisition unit, prediction unit, automatic scaling strategy determination unit, and decision-making and dynamic resource adjustment unit; An initialization unit, used to initialize the telescopic cooling time and the telescopic period T, and to check whether the telescopic cooling time condition is currently met; If the condition of the scaling cooling time is currently met, the acquisition unit acquires information of all service cluster edge nodes participating in the scaling in the server cluster; A load indicator acquisition unit, used to obtain load indicators according to information requests of all service cluster edge nodes; A prediction unit, used for inputting the acquired load index into the TSBA model to perform load prediction and obtain a prediction result; An automatic scaling strategy determination unit, used to determine the automatic scaling strategy according to the prediction result; The decision-making and dynamic resource adjustment unit is used to make decisions and perform dynamic resource adjustment calculations based on the automatic scaling policy.
7. The automatic scaling system based on a mobile edge computing server cluster according to claim 6, characterized in that: The acquisition unit acquires information about all service cluster edge nodes participating in the scaling in the server cluster, including determining the CPU resource utilization of node m. It is expressed as: Among them I t is the total number of instructions corresponding to the user requests processed by the node in this cycle, F m Indicates the CPU frequency of the node, I m Indicates the number of instructions that a single-core CPU can process, C m Indicates the number of CPU cores, and T is the elastic scaling period.
8. The automatic scaling system based on a mobile edge computing server cluster according to claim 6, characterized in that: Get the memory resource utilization of node m in the unit for any elastic scaling period It is expressed as: Where W t It is the total memory-time product of the node in this cycle.
9. The automatic scaling system based on a mobile edge computing server cluster according to claim 6, characterized in that: Before the load indicator acquisition unit acquires the load indicator according to the information request of all service cluster edge nodes, the load indicator of the Pod list is collected and stored in the internal database.
10. The automatic scaling system based on mobile edge computing server cluster according to claim 6, characterized in that: The prediction unit obtains the prediction results including that the time series data of the load indicator first passes through the time convolution network to extract the global features, and at the same time, the time series data of the load indicator extracts the temporal features through the bidirectional gated recurrent unit, and uses the attention mechanism to fuse the spatial features and the temporal features.
Citation Information
Cited By
Network intrusion detection method and system, electronic equipment and medium
CN119996029A
Network intrusion detection method, system, electronic device and medium
CN119996029B
Cluster service level automatic scaling method and device, computer equipment, medium and product
CN120179417A