Cold start optimization method, system, device and medium for server non-sensing framework
By adopting a preset function service call prediction model and an optimal resource preheating strategy in the server's non-inductive computing framework, the cold start problem and the impact of sudden loads on service delays are solved, and efficient resource scheduling and rapid response are achieved. Stable service latency.
Patent Information
- Application Number
- CN202410116318.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-26
- Publication Date
- 2025-01-24
- Estimated Expiration
- 2044-01-26
AI Technical Summary
The existing technology is difficult to effectively optimize the cold start problem in the server sensingless computing framework, especially in the absence of function services and burst loads with historical call data, and it is impossible to quickly deal with fast steady-state ensuring service delays.
The preset function service call prediction model is used to analyze the historical call data of function services in the server-insensitive framework, and the function service call pattern is predicted based on the data dependencies of the function workflow. Calculate the optimal resource preheating based on the predicted calling pattern, obtain the function service request of the current workload and perform resource scheduling to ensure the fast steady state of function service delay.
The prediction accuracy of the function service call mode has been improved, the function of the function of the serverless framework is reduced, and the fine particle -size control of the preheating resources can be achieved. It can cope with the emergency load and ensure the rapid and steady state of the service delay.
Smart Images

Figure CN117931316B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of cloud computing technology, and in particular to a cold start optimization method, system, device and medium for a server non-sensing framework. Background Art
[0002] The architecture of server-less computing has been applied in various fields from Web applications to the Internet of Things. Based on its characteristics, it provides cloud service applications with powerful resource expansion capabilities and lower resource costs. Application scenarios include intelligent transportation systems, real-time geospatial analysis, emergency management systems, telemedicine and health care, etc. The common point of these application scenarios is the real-time demand for service requests. The response of cloud services to service requests needs to ensure fast service delay to meet application requirements.
[0003] The dynamic preheating pool solution based on function call patterns in the prior art uses a fixed-size function instance preheating pool in the server-insensitive computing framework, analyzes the historical function call data, and extracts the function call pattern through statistical analysis, deep learning, and function dependency techniques. According to the periodicity of function service requests, the number of function service requests within a certain period of time is predicted based on the function call pattern. The performance of cold start problem optimization depends to a large extent on the prediction accuracy of the function call pattern. The prior art cannot effectively implement prediction-based resource preheating for function services that lack historical call data. In addition, when a burst load occurs in the request service, the preheating resource scheduling cannot respond quickly to ensure a fast steady state of service delay. Summary of the invention
[0004] The present invention aims to solve at least one of the technical problems existing in the prior art. To this end, the present invention proposes a cold start optimization method, system, device and medium of a server-insensitive framework, which can realize fine-grained control and caching of preheating resources, can cope with burst loads, and ensure the rapid steady state of function service delay.
[0005] In a first aspect, an embodiment of the present invention provides a cold start optimization method for a server-insensitive framework, and the cold start optimization method for a server-insensitive framework includes:
[0006] A preset function service call prediction model is used to analyze the historical call data of the function service in the server-insensitive framework, and the function service call mode is predicted according to the data dependency of the function workflow; wherein the function workflow includes multiple function services;
[0007] Calculating optimal resource preheating based on the predicted function service call pattern to obtain an optimal resource scheduling strategy;
[0008] Obtain a function service request of the current workload, and search for a surviving function executor according to the function service request;
[0009] Obtaining function service execution time, function service failure rate and computing resource allocation from the function executor;
[0010] Get the current actual function service delay based on the function service status sent periodically by the gateway;
[0011] If the current actual function service delay is less than or equal to the expected function service delay, the optimal resource scheduling strategy is used for resource scheduling based on the function service execution time, the function service failure rate and the computing resource allocation to achieve cold start optimization of the server-insensitive framework.
[0012] Compared with the prior art, the first aspect of the present invention has the following beneficial effects:
[0013] This method uses a preset function service call prediction model to analyze the historical call data of function services in the server-insensitive framework, and predicts the function service call mode according to the data dependency of the function workflow. The function service call mode is predicted based on the historical call data and data dependency by using the preset function service call prediction model, which can improve the accuracy of the prediction; the optimal resource preheating is calculated based on the predicted function service call mode to obtain the optimal resource scheduling strategy, which can reduce the function cold start frequency of the server-insensitive framework and realize fine-grained control of the preheating resources; the function service request of the current workload is obtained, and according to The function service request looks for a surviving function executor, obtains the function service execution time, function service failure rate and computing resource allocation from the function executor, and obtains the current actual function service delay based on the function service status sent periodically by the gateway. If the current actual function service delay is less than or equal to the expected function service delay, then based on the function service execution time, function service failure rate and computing resource allocation, the optimal resource scheduling strategy is used for resource scheduling to achieve cold start optimization of the server-insensitive framework, which can cope with burst loads, realize the controllable service delay of complex function workflows under dynamic workloads, and ensure the rapid steady state of function service delay.
[0014] According to some embodiments of the present invention, the calculating the optimal resource preheating based on the predicted function service call pattern to obtain the optimal resource scheduling strategy includes:
[0015] Initialize the resource scheduling strategy record table including status and resource preheating behavior;
[0016] Obtain the resource situation and workload size allocated by the current function service call mode, and determine the current state according to the resource situation and the workload size;
[0017] Calculating a reward value of a previous state according to the current state, and updating the resource scheduling strategy record table based on the reward value to obtain a new resource scheduling strategy record table;
[0018] If the current state is in the new resource scheduling strategy record table, a resource preheating behavior corresponding to the current state is selected from the new resource scheduling strategy record table to obtain an optimal resource scheduling strategy.
[0019] According to some embodiments of the present invention, obtaining the optimal resource scheduling strategy includes:
[0020] If the current state is not in the new resource scheduling strategy record table, a greedy algorithm is used to select the optimal resource preheating behavior to obtain the optimal resource scheduling strategy.
[0021] According to some embodiments of the present invention, after obtaining the current actual function service delay according to the function service status periodically sent by the gateway, the cold start optimization method of the server-insensitive framework further includes:
[0022] If the current actual function service delay is greater than the expected function service delay, a difference calculation is performed between the current actual function service delay and the expected function service delay to obtain a difference result;
[0023] According to the difference result, a resource scheduling strategy of PID control is calculated, and the resource scheduling strategy of PID control is adopted to perform resource scheduling, so as to achieve cold start optimization of the server senseless framework.
[0024] According to some embodiments of the present invention, a resource scheduling strategy for PID control is calculated according to the difference result in the following manner:
[0025] output=K p *error+K i *integral+K d *derivative
[0026] Among them, output represents the resource scheduling strategy of PID control, K p Represents the proportionality coefficient, K i Indicates the integral coefficient, K d Represents the differential coefficient, error represents the difference result, integral represents the cumulative historical error value integral, and derivative represents the future error differential.
[0027] According to some embodiments of the present invention, when the optimal resource scheduling strategy is adopted for resource scheduling, the cold start optimization method of the server-insensitive framework further includes:
[0028] Get the container corresponding to each function in the server-insensitive framework;
[0029] Calculate the weight of each container according to the calling frequency, recent non-use time, initialization overhead and resource occupancy size when the optimal resource scheduling strategy is used for resource scheduling;
[0030] Several containers with low weights are paused according to the weights, and the remaining containers are cached.
[0031] According to some embodiments of the present invention, the weight of each container is calculated according to the calling frequency, the recent unused time, the initialization overhead and the resource occupied size when the optimal resource scheduling strategy is used for resource scheduling in the following manner:
[0032]
[0033] Among them, Weight represents the weight of each container, Frequency represents the calling frequency, Expense represents the initialization cost, Size represents the resource occupation size, and Unused represents the recent unused time.
[0034] In a second aspect, an embodiment of the present invention further provides a cold start optimization system of a server-insensitive framework, and the cold start optimization system of the server-insensitive framework includes:
[0035] A function service call prediction unit, used to use a preset function service call prediction model to perform data analysis on the historical call data of the function service in the server-insensitive framework, and predict the function service call mode according to the data dependency relationship of the function workflow; wherein the function workflow includes multiple function services;
[0036] An optimal resource preheating calculation unit, used to calculate the optimal resource preheating based on the predicted function service call mode to obtain an optimal resource scheduling strategy;
[0037] A function service request acquisition unit, used to acquire the function service request of the current workload and find a surviving function executor according to the function service request;
[0038] A first data acquisition unit, used to acquire function service execution time, function service failure rate and computing resource allocation status from the function executor;
[0039] A second data acquisition unit, used to obtain the current actual function service delay according to the function service status periodically sent by the gateway;
[0040] A cold start optimization unit is used to adopt the optimal resource scheduling strategy to perform resource scheduling based on the function service execution time, the function service failure rate and the computing resource allocation if the current actual function service delay is less than or equal to the expected function service delay, so as to achieve cold start optimization of the server-insensitive framework.
[0041] In the third aspect, an embodiment of the present invention also provides a cold start optimization device for a server-aware framework, comprising at least one control processor and a memory for communicating with the at least one control processor; the memory stores instructions that can be executed by the at least one control processor, and the instructions are executed by the at least one control processor so that the at least one control processor can execute a cold start optimization method for a server-aware framework as described above.
[0042] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable a computer to execute the cold start optimization method of a server-insensitive framework as described above.
[0043] It can be understood that the beneficial effects of the second to fourth aspects compared with the related art are the same as the beneficial effects of the first aspect compared with the related art. Please refer to the relevant description in the first aspect, and no further details will be given here. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] The above and / or additional aspects and advantages of the present invention will become apparent and easily understood from the description of the embodiments in conjunction with the following drawings, in which:
[0045] Figure 1 It is a flow chart of a cold start optimization method of a server non-sensing framework according to an embodiment of the present invention;
[0046] Figure 2 Schematic diagram of a controller-based function cold start optimization method according to an embodiment of the present invention;
[0047] Figure 3 is a flowchart of Algorithm 3 according to an embodiment of the present invention;
[0048] Figure 4 is a flowchart of Algorithm 4 according to an embodiment of the present invention;
[0049] Figure 5 It is a schematic diagram of a function container caching method based on a greedy algorithm according to an embodiment of the present invention;
[0050] Figure 6is a schematic diagram of an intelligent transportation system application architecture based on a cold start optimization method according to another embodiment of the present invention;
[0051] Figure 7 It is a structural diagram of a cold start optimization system of a server non-sensing framework according to an embodiment of the present invention;
[0052] Figure 8 It is a structural schematic diagram of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0053] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and cannot be understood as limiting the present invention.
[0054] In the description of the present invention, if there is a description of first, second, etc., it is only for the purpose of distinguishing technical features, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features or implicitly indicating the order of the indicated technical features.
[0055] In the description of the present invention, it should be understood that descriptions involving orientation, such as orientation or positional relationship indicated as up, down, etc., are based on the orientation or positional relationship shown in the drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be understood as a limitation on the present invention.
[0056] In the description of the present invention, it should be noted that, unless otherwise clearly defined, terms such as setting, installing, connecting, etc. should be understood in a broad sense, and technicians in the relevant technical field can reasonably determine the specific meanings of the above terms in the present invention in combination with the specific content of the technical solution.
[0057] First, some nouns involved in this application are analyzed:
[0058] Serverless Computing: Serverless computing is a cloud service computing paradigm with fine resource granularity and high abstraction, also known as serverless computing. This computing paradigm provides developers with on-demand billing and elastically scalable cloud services, hiding the server's operation and maintenance details, so that developers cannot feel the existence of the server.
[0059] Serverless Framework: The Serverless Framework is a platform for implementing serverless computing. It provides a gateway to receive function workflows, implements management and basic scheduling of function containers, and can configure various parameters of the function. It is the optimization object of each technical point of the present invention.
[0060] Function: Function is the basic unit of server-free computing, which is responsible for encapsulating the developer's code and deploying it to the server-free framework. Functions are managed and scheduled by the server-free framework, and multiple functions can be combined to form a function workflow.
[0061] Cold Start: Cold start refers to the high startup delay phenomenon exhibited by the function managed by the server-aware framework when it is run for the first time. It is a hot issue in the research of server-aware computing architecture.
[0062] The architecture of server-less computing has been applied in various fields from Web applications to the Internet of Things. Based on its characteristics, it provides cloud service applications with powerful resource expansion capabilities and lower resource costs. Application scenarios include intelligent transportation systems, real-time geospatial analysis, emergency management systems, telemedicine and health care, etc. The common point of these application scenarios is the real-time demand for service requests. The response of cloud services to service requests needs to ensure fast service delay to meet application requirements.
[0063] The dynamic preheating pool solution based on function call patterns in the prior art uses a fixed-size function instance preheating pool in the server-insensitive computing framework, analyzes the historical function call data, and extracts the function call pattern through statistical analysis, deep learning, and function dependency techniques. According to the periodicity of function service requests, the number of function service requests within a certain period of time is predicted based on the function call pattern. The performance of cold start problem optimization depends to a large extent on the prediction accuracy of the function call pattern. The prior art cannot effectively implement prediction-based resource preheating for function services that lack historical call data. In addition, when a burst load occurs in the request service, the preheating resource scheduling cannot respond quickly to ensure a fast steady state of service delay.
[0064] To solve the above problems, the present invention uses a preset function service call prediction model to perform data analysis on the historical call data of the function service in the server-insensitive framework, and predicts the function service call mode according to the data dependency of the function workflow. The preset function service call prediction model is used to predict the function service call mode based on the historical call data and data dependency, which can improve the accuracy of the prediction; the optimal resource preheating is calculated based on the predicted function service call mode to obtain the optimal resource scheduling strategy, which can reduce the function cold start frequency of the server-insensitive framework and realize fine-grained control of the preheating resources; the function service request of the current workload is obtained , and find a surviving function executor based on the function service request, obtain the function service execution time, function service failure rate and computing resource allocation from the function executor, and obtain the current actual function service delay based on the function service status sent regularly by the gateway. If the current actual function service delay is less than or equal to the expected function service delay, then based on the function service execution time, function service failure rate and computing resource allocation, use the optimal resource scheduling strategy for resource scheduling to achieve cold start optimization of the server-insensitive framework, which can cope with burst loads, realize the controllable service delay of complex function workflows under dynamic workloads, and ensure the rapid steady state of function service delay.
[0065] Reference Figure 1 The embodiment of the present invention provides a cold start optimization method of a server-insensitive framework. The cold start optimization method of the server-insensitive framework includes but is not limited to steps S100 to S600, wherein:
[0066] Step S100: using a preset function service call prediction model to analyze historical call data of function services in the server-insensitive framework, and predicting a function service call pattern according to data dependencies of a function workflow; wherein a function workflow includes multiple function services;
[0067] Step S200: Calculate the optimal resource preheating based on the predicted function service call pattern to obtain the optimal resource scheduling strategy;
[0068] Step S300: Obtain the function service request of the current workload, and search for a surviving function executor according to the function service request;
[0069] Step S400: Obtain the function service execution time, function service failure rate and computing resource allocation from the function executor;
[0070] Step S500: obtaining the current actual function service delay according to the function service status regularly sent by the gateway;
[0071] Step S600: If the current actual function service delay is less than or equal to the expected function service delay, the optimal resource scheduling strategy is used for resource scheduling based on the function service execution time, function service failure rate and computing resource allocation to achieve cold start optimization of the server-insensitive framework.
[0072] In this embodiment, in order to improve the accuracy of the prediction, this embodiment uses a preset function service call prediction model to analyze the historical call data of the function service in the server-insensitive framework, and predicts the function service call pattern according to the data dependency of the function workflow, wherein the function workflow includes multiple function services; in order to reduce the function cold start frequency of the server-insensitive framework and realize fine-grained control of preheating resources, this embodiment calculates the optimal resource preheating based on the predicted function service call pattern to obtain the optimal resource scheduling strategy; in order to cope with burst loads, complex function workflow services under dynamic workloads are realized. The delay is controllable to ensure the rapid steady state of the function service delay. This embodiment obtains the function service request of the current workload, and searches for a surviving function executor based on the function service request, obtains the function service execution time, function service failure rate and computing resource allocation from the function executor, and obtains the current actual function service delay based on the function service status sent periodically by the gateway. If the current actual function service delay is less than or equal to the expected function service delay, the optimal resource scheduling strategy is used for resource scheduling based on the function service execution time, function service failure rate and computing resource allocation, so as to achieve cold start optimization of the server-insensitive framework.
[0073] In some embodiments, the optimal resource preheating is calculated based on the predicted function service call pattern to obtain the optimal resource scheduling strategy, including:
[0074] Initialize the resource scheduling strategy record table including status and resource preheating behavior;
[0075] Obtain the resource situation and workload size allocated by the current function service call mode, and determine the current state based on the resource situation and workload size;
[0076] Calculate the reward value of the previous state according to the current state, and update the resource scheduling strategy record table based on the reward value to obtain a new resource scheduling strategy record table;
[0077] If the current state is in the new resource scheduling strategy record table, the resource preheating behavior corresponding to the current state is selected from the new resource scheduling strategy record table to obtain the optimal resource scheduling strategy.
[0078] In this embodiment, by exploring the current service environment state (i.e., current state), each iterative agent will look for the corresponding behavior action (i.e., resource preheating behavior) to implement computing resource scheduling, and the corresponding operation reinforcement learning algorithm will calculate the reward according to the current system state, so as to find the optimal resource scheduling strategy corresponding to the current state, thereby ensuring high resource utilization while ensuring the rapid steady state of function service delay.
[0079] In some embodiments, obtaining an optimal resource scheduling strategy includes:
[0080] If the current state is not in the new resource scheduling strategy record table, a greedy algorithm is used to select the optimal resource preheating behavior to obtain the optimal resource scheduling strategy.
[0081] In this embodiment, when the current state is not in the new resource scheduling strategy record table, a greedy algorithm is used to select the optimal resource preheating behavior, thereby ensuring a rapid steady state of the function service delay.
[0082] In some embodiments, after obtaining the current actual function service delay according to the function service status periodically sent by the gateway, the cold start optimization method of the server-insensitive framework further includes:
[0083] If the current actual function service delay is greater than the expected function service delay, the difference between the current actual function service delay and the expected function service delay is calculated to obtain a difference result;
[0084] According to the difference results, the resource scheduling strategy of PID control is calculated, and the resource scheduling strategy of PID control is used to perform resource scheduling to achieve cold start optimization of the server non-sensing framework.
[0085] In some embodiments, the resource scheduling strategy for PID control is calculated based on the difference result in the following manner:
[0086] output=K p *error+K i *integra1+K d *derivative
[0087] Among them, output represents the resource scheduling strategy of PID control, K p Represents the proportionality coefficient, K i Indicates the integral coefficient, K d Represents the differential coefficient, error represents the difference result, integral represents the cumulative historical error value integral, and derivative represents the future error differential.
[0088] In this embodiment, when the current actual function service delay is greater than the expected function service delay, by analyzing the difference between the actual value and the expected value, the output signal is calculated using the proportional coefficient, integral coefficient and differential coefficient, and mapped to a resource scheduling strategy, the function service delay can be quickly stabilized.
[0089] In some embodiments, when the optimal resource scheduling strategy is used for resource scheduling, the cold start optimization method of the server-insensitive framework further includes:
[0090] Get the container corresponding to each function in the server-insensitive framework;
[0091] The weight of each container is calculated based on the call frequency, recent unused time, initialization overhead, and resource occupancy size when the optimal resource scheduling strategy is used for resource scheduling.
[0092] Several containers with low weights are paused according to the weights, and the remaining containers are cached.
[0093] In this embodiment, by comprehensively considering the characteristics of the container and the delay generated in the server-insensitive computing to manage the container cache allocation, the function cold start delay of the server-insensitive framework can be reduced and the cold start problem can be alleviated.
[0094] In some embodiments, the weight of each container is calculated according to the calling frequency, the recent unused time, the initialization cost and the resource occupied size when the optimal resource scheduling strategy is used for resource scheduling in the following manner:
[0095]
[0096] Among them, Weight represents the weight of each container, Frequency represents the calling frequency, Expense represents the initialization cost, Size represents the resource usage size, and Unused represents the recent unused time.
[0097] To facilitate understanding by those skilled in the art, a set of best embodiments is provided below:
[0098] This embodiment reduces the frequency of function cold start of the server-insensitive framework through a controller-based function cold start optimization method, and reduces the function cold start latency of the server-insensitive framework through a function container caching method based on a greedy algorithm. This embodiment implements fine-grained control of function cold start and function container metadata caching, reduces the two indicators of function cold start frequency and function cold start latency, and optimizes the impact of function cold start on the performance of the server-insensitive framework in a heterogeneous computing environment. This embodiment specifically includes the following contents:
[0099] 1. Controller-based function cold start optimization method.
[0100] The controller-based cold start frequency control method is based on the PID control algorithm, combined with the changing relationship between the server's senseless computing service delay and resource scheduling, to achieve controllable and fast stabilization of complex function workflow service delay under dynamic workload. Based on the original cold start problem optimization strategy, this algorithm further considers the dynamic characteristics of the server's senseless computing function service, and enhances the system's robustness to cold start problems caused by sudden load changes. Specifically:
[0101] from Figure 2 It can be seen that the system controller participates in two operations (2) and (7) in the process, because the system controller is divided into two modes, one is preheating based on the function call mode, and the other is resource scheduling based on the control algorithm to deal with the current load change. The specific process of the controller-based function cold start optimization method includes:
[0102] 1. The call of the server-insensitive computing function service has a certain time period change. The system analyzes the historical call data of the function service by establishing an LSTM model (i.e., the preset function service call prediction model), and predicts the function service call pattern in combination with the data dependency relationship of the function workflow. Among them, the function workflow is composed of multiple function services, and there is a certain dependency relationship between them. By extracting the function service call pattern of the function service at the head of the workflow, the next function service call pattern can be further extracted according to the dependency relationship to enhance the accuracy of the prediction.
[0103] 2. The first controller mode uses the function call pattern to make a preliminary prediction of the number of function requests within a period of time. The system controller preliminarily calculates the optimal resource preheating based on the prediction result (i.e. the predicted function service call pattern) to obtain the optimal resource scheduling strategy, thereby reducing the probability of cold start. Among them, the method of preheating computing resources based on reinforcement learning specifically includes:
[0104] This method is an algorithm for optimizing computing resource scheduling for server-insensitive computing function services. It fully explores computing resource scheduling strategies through reinforcement learning methods, combines vertical and horizontal resource scheduling methods to optimize cold start problems, ensures high resource utilization, and finds the optimal resource preheating method. Before implementing the first controller mode mentioned above, the system conducts reinforcement learning-based resource scheduling exploration for the deployed function service workflows, and uses the Q-learning algorithm to establish a resource scheduling strategy Q-table for each function service workflow to achieve stable service delays for the current workload. The reinforcement learning algorithm sets up an agent to explore the current service environment state. In each iteration, the agent will look for the corresponding behavior action to implement computing resource scheduling. The corresponding reinforcement learning algorithm will calculate the reward based on the current system state to find the optimal resource preheating method to deal with the current workload. Reference Figure 3 , is a flowchart of Algorithm 3. For the function workflow service, the reinforcement learning algorithm is used to explore the optimal resource preheating strategy for different workloads and computing resource utilization. Algorithm 3 includes:
[0105] 1) Line 1 to Line 2 in the algorithm are: Initialize a Q-table record Q(s,a), and the corresponding parameter setting values of the Q-learning algorithm. α represents the learning rate of the algorithm, which is used to balance the new knowledge and known knowledge obtained by the learning algorithm. γ represents the discount rate of the algorithm, which is used to control the influence of the next state behavior on the current update value. ∈ represents the convergence speed of the parameter control algorithm during the execution of the greedy algorithm for behavior exploration.
[0106] 2) Line 3 to Line 6 in the algorithm are: Get the resource allocation and workload size of the current function. In order to fully improve resource utilization, the state consists of CPU, memory size, number of function instances, and workload RPS service requests per second. After obtaining the current state, the agent executes the SelectAction method to select the appropriate resource warm-up behavior.
[0107] 3) Line 19 to Line 24 in the algorithm are: The agent has two behavior selection methods based on the current state. One is to select the corresponding preheating behavior in the Q-table when the current state exists in the Q-table. The other is to explore the resource preheating strategy through a greedy algorithm when the state does not exist in the Q-table.
[0108] 4) Line 7 to Line 11 in the algorithm are: Get the current function service delay, then perform stress testing until the actual service delay is greater than the expected highest function service delay, and record the current status.
[0109] 5) Line 12 in the algorithm is: Calculate the reward value r (i.e. reward) of the previous state decision for the current state. In order to fully consider resource utilization, the system analyzes the ratio of the current service delay to the expected delay during the reward calculation process, and calculates the ratio of the cost and utilization rate of the corresponding preheating resources for reward calculation.
[0110] 6) Line 13 to Line 14 in the algorithm are: based on the reward value, the Q-table is updated and the optimal Q(s,a) record is recorded as a reference for resource preheating behavior.
[0111] It should be noted that the cost and usage rate of the corresponding preheating resources in this embodiment can be automatically monitored by the server non-sensing framework.
[0112] 3. The function service request of the workload arrives at the system gateway.
[0113] 4. The system gateway receives the function service request, searches for the corresponding surviving function executor (Invoker) in the system, and assigns the function request to the corresponding executor queue to wait for execution.
[0114] 5. The function executor regularly provides feedback on the function service execution time (i.e., the average response time of the function service, including the waiting time of the service request queue and the function service execution time), the function service failure rate, and the computing resource allocation (i.e., including CPU and memory).
[0115] The resource allocation of function services is achieved through the system controller during resource scheduling. A global variable table records the function service instances that exist in the system memory. Each instance has information about the corresponding allocated computing resources. The resource allocation of the function service can be obtained by summarizing the information.
[0116] The function service failure rate is calculated by counting the timed-out function services in the function service queue or by monitoring the number of failed function service requests using the Prometheus open source component.
[0117] 6. The system gateway will collect the function service performance indicators and computing resource usage, and send the key information to the system controller to further perform resource scheduling based on the optimal resource scheduling strategy corresponding to the current load.
[0118] Function service performance indicators include the average response time of the function service in step 5, various resource allocations of the function instance (CPU and memory), and the function service request response failure rate.
[0119] The computing resource usage collation (i.e., calculating the resource usage rate of function services) mainly relies on the components of the open source framework OpenWhisk and the cloud-native component Prometheus service listener to achieve fine-grained monitoring of function service resources and obtain information on allocated resources and usage.
[0120] The function service performance indicators and resource usage information collected by the system gateway are not packaged and sent directly to the controller, but are initially sorted and key information is extracted and sent to the system controller. Key information mainly includes the average response time of the function service, the total resources allocated to the function service and resource utilization, and the number of surviving function instances. All this information needs to be integrated, summarized, and associated by the system gateway before being sent to the controller for further processing.
[0121] 7. When the actual workflow service delay is higher than the expected service delay, the second controller mode is activated, and the PID control algorithm is used to perform the difference between the actual service delay and the expected service delay, and then the difference is mapped to computing resource scheduling based on the PID control algorithm to reduce the workflow service delay and achieve rapid stability of the system. The PID control algorithm specifically includes:
[0122] The PID control algorithm is a cold start optimization algorithm based on the PID controller. This algorithm is an algorithm for server-oriented non-sensing computing function services to achieve fast and stable service delays. When the workload changes beyond the function call mode preheating, the actual function service delay will be greater than the maximum value of the expected function service delay. In order to enable the system to quickly restore the steady state, the PID control algorithm analyzes the difference between the actual value and the expected value, and uses the proportional coefficient (Kp), integral coefficient (Ki) and differential coefficient (Kd) to calculate the output signal, and maps it to computing resource scheduling. Through the feedback control of the control system based on the current state, the function service delay is quickly stabilized. Figure 4 , is a flow chart of Algorithm 4. For sudden load changes, the PID control algorithm is used to achieve fast steady-state service delay of complex function workflow. The above Algorithm 4 includes:
[0123] 1) Line 1 in the algorithm is: triggering the second controller mode for the first time, initializing the historical error value and integral accumulation value for the output calculation of the PID control signal.
[0124] 2) Line 2 in the algorithm is: the current actual function service delay is obtained through the function service status sent regularly by the gateway.
[0125] 3) Line 4 to Line 7 in the algorithm are: Calculate the PID control output signal based on the difference between the function service delay and the expected function delay. The PID control is calculated based on the actual difference, the past accumulated error integral, and the future error differential.
[0126] 4) Line 8 in the algorithm is: Map the PID output signal through the mathematical model of the relationship between service delay and allocated computing resources, and perform computing resource scheduling to reduce the frequency of cold start problems.
[0127] 5) Line 9 to Line 11 in the algorithm are: update the past error value, wait for a certain controller observation time, update the current service delay, and make a judgment for the next cycle. If the service delay is still greater than the expected value, continue to schedule resources based on PID control.
[0128] 2. Function container caching method based on greedy algorithm.
[0129] When using the server-insensitive computing framework, users can quickly deploy and run code without pre-setting or managing any servers. However, if this framework is used, cold start will be a real challenge for applications in application scenarios with high real-time requirements. This embodiment proposes a greedy container caching strategy by focusing on the relationship between the components of the entire system to alleviate the cold start problem.
[0130] To alleviate cold start delays, a common method is container caching, such as Figure 5 It is possible to keep the container alive or "hot" for a short period of time after providing a call service, so that subsequent calls do not have to go through a cold start. If the request is triggered for the first time, a newly created container will be distributed and a cold start will be experienced. This method manages the "hot" container pool dynamically based on the hardware resources of the node. The designed weight algorithm calculates the corresponding weight of each container and automatically evicts containers with lower weights when the node hardware resources reach saturation. After the service is completed, it will only be cached or destroyed.
[0131] The main point of this embodiment is to compare the container cache to the object cache. Common cache systems usually seek to improve the hit rate. However, if the size of the object is different from the loss of the miss, focusing only on the hit rate cannot improve the performance of the system. Some existing work or server-insensitive computing frameworks also use some container cache technologies to optimize cold start, but do not take into account the characteristics of the called container. Since each container has different initialization costs, resource occupancy and call frequency, in an inefficient cache strategy, caching or maintaining the container will generate additional overhead. For example, there may be containers with low call frequency but high initialization cost and containers with high call frequency but low initialization cost. The general elimination strategy (such as LRU or LFU) may directly call the low-frequency container of the former, but the delay cost caused by the cold start of the former may be much greater than the resource cost of keeping the container activated. This embodiment comprehensively considers the characteristics of the container and the delay generated in the server-insensitive computing to manage the container cache allocation, that is, the delay generated in the server-insensitive computing of the controller-based function cold start optimization method can be used to manage the container cache allocation. Therefore, the container cache strategy is a function service termination strategy based on greedy thinking. As long as the cache pool resources set by the hardware node are sufficient, the container will be kept running as much as possible, which is different from the commercial server-insensitive computing framework. The latter implements a constant survival time strategy and a constant retention time strategy, which may cause the function to be terminated even if there are available resources. If you want to start a new container, but there are insufficient resources available, the strategy of this embodiment will decide which container to terminate. The total number of containers ("hot" state + running) is limited by the total amount of server physical resources (CPU and memory). When using a controller-based function cold start optimization method, this embodiment will calculate a weight for each container based on the cold start overhead and resource usage, and terminate the container with the lowest weight.
[0132] Through the weight update strategy, the node will maintain a dynamically updated function weight list. When the node's resources are saturated and new function requests arrive, the node will eliminate the lowest few function containers according to the weight list. The following is the method for calculating weights:
[0133]
[0134] Among them, Weight represents the weight of each container, Frequency represents the calling frequency, Expense represents the initialization cost, Size represents the resource usage size, and Unused represents the recent unused time.
[0135] 1. Call frequency (Frequency): The call frequency Frequency does not only refer to the call frequency of the container. In server-insensitive computing, function services may correspond to multiple types of containers. This embodiment defines the call frequency as the total number of times the function is requested within a time interval. When all containers related to the function are destroyed, the Frequency is set to 0. The size of the weight Weight is positively correlated with the call frequency Frequency. In this strategy, the higher the call frequency of a function within a period of time, the longer its container will be kept.
[0136] 2. Initialization cost: The function container needs a series of initializations when it is called for the first time, including runtime initialization, function code fetching, etc. The cost generated by this series of initialization processes is the cold start cost, which is also the cost that this strategy needs to avoid. The greater the initialization cost, the more cold start time will be generated when the function container is restarted after being destroyed. The initialization cost Expense is positively correlated with the size of the weight. The container of the function with a larger initialization cost is more likely to be retained.
[0137] 3. Resource size (Size): This parameter refers to the memory size occupied by the container. The smaller the weight is, the inversely proportional to the resource size. The container that occupies a larger memory has a higher maintenance cost, so this strategy tends to maintain smaller containers. Larger containers will be terminated when the node resources are insufficient.
[0138] 4. Recent unused time (Unused): This retention strategy needs to update the weight in real time to avoid sudden calls to the container, which may cause the weight to be too high and unable to adjust. Therefore, the recent unused time Unused is set to balance the weight. Unused is updated after each time interval. When the container is called, the parameter is initialized to 1. When the container service ends and is in the retention state, the parameter increases over time. The recently used container may be called again. The shorter the recent unused time, the higher the weight.
[0139] Considering that a function in the server-insensitive computing framework may have multiple containers, this strategy calculates the weight at the function level and terminates at the container level. Sometimes the newly created container has a large memory requirement, and multiple containers may be evicted at one time.
[0140] To better illustrate this embodiment, an embodiment of a specific application scenario is provided below:
[0141] The architecture application of server-free computing spans various fields from Web applications to the Internet of Things. Based on its characteristics, it provides cloud service applications with powerful resource expansion capabilities and lower resource costs. Application scenarios include intelligent transportation systems, real-time geospatial analysis, emergency management systems, telemedicine and health care, etc. The common point of these application scenarios is the real-time demand for service requests. The response of cloud services to service requests needs to ensure fast service delays to meet application requirements. However, the cold start problem in server-free computing causes the cloud service delay to become unstable under bursty workloads, thereby reducing the real-time nature of service requests, affecting the performance of related applications, and causing serious security issues. The present invention focuses on the optimization of the cold start problem of server-free computing. While achieving efficient resource preheating based on the characteristics of service requests, it uses control theory algorithms to ensure the stability of service delays under bursty workloads.
[0142] Reference Figure 6 , the application scenario example analysis and introduction are introduced by taking the application of server-less computing in intelligent transportation system (ITS). Intelligent transportation system is a system that uses modern communication technology, computer technology, control technology and information processing technology to improve the efficiency, safety, comfort and environmental protection of transportation. ITS aims to make the transportation system more intelligent and efficient, and meet the growing transportation demand and improve the performance of the overall transportation system through real-time monitoring, control and optimization of traffic operation. Server-less computing can be used as the underlying application framework of the intelligent transportation system, and the functional algorithms such as real-time data processing, intelligent analysis, real-time monitoring, and intelligent decision-making in the system are deployed in the form of function services on the server-less computing platform. The system can realize elastic expansion of resources and automatically allocate and release computing resources according to the actual needs of function services, thereby reducing the cost of use, improving resource utilization, and making the entire system more flexible and scalable.
[0143] There is no doubt that the intelligent transportation system is an application that has very high requirements for real-time data processing. Therefore, optimization of the cold start problem is the key to ensuring the system can be applied on the server-free computing framework. Figure 6 The figure shows an architecture diagram of realizing the application of the intelligent transportation system based on the cold start optimization method proposed in the previous embodiment. The intelligent transportation system realizes functional services based on the server-free computing underlying framework, and the specific functional logic is split into function-level services for deployment in a cloud computing environment. The cold start optimization method is used to reduce the probability of cold start problems in function service requests in the server-free computing environment, thereby ensuring the high real-time and robustness of the intelligent transportation system.
[0144] First, traffic volume can effectively reflect the workload of the intelligent transportation system. The volume of traffic volume determines the load size for real-time data processing and intelligent road planning. Traffic volume in urban traffic is usually cyclical. The morning and evening rush hours on weekdays lead to an increase in traffic volume. In addition, some other cyclical factors also affect traffic volume, such as holidays, school dismissal times in surrounding schools, and specific activity times in commercial areas. Figure 6 As shown, the intelligent transportation system will collect historical traffic data of each road, analyze the changes in traffic volume by building a prediction model, and realize the acquisition of the function service call mode in the intelligent transportation system. Based on the function service call mode, the first controller mode described in the patent is performed to make a preliminary prediction of the number of function requests within a period of time, and the system controller preheats the required computing resources based on the preliminary calculation of the prediction results. Based on the first controller mode, it is possible to effectively cope with the workload changes caused by periodic changes in traffic volume, thereby reducing the probability of cold start problems and ensuring the high real-time performance of the server's non-sensing computing service requests. In addition, the method of the present invention proposes that the system gateway will continuously collect and detect function service performance indicators and the use of computing resources, and perform data processing to extract key information and send it to the system controller. By real-time monitoring of the performance indicators of service requests and the use of computing resources, the system controller sets a lower limit on the service delay of service requests to ensure the real-time performance of the intelligent transportation system. When the actual service delay is higher than the expected service delay, the second controller mode is activated, and the difference between the actual service delay and the expected service delay is calculated based on the PID control algorithm. The algorithm described in the patent is used to schedule computing resources according to the workload size, reduce service delays, and achieve rapid problem solving of intelligent transportation systems under changes in traffic flow of different scales, ensuring high real-time response of system services.
[0145] Reference Figure 7 The embodiment of the present invention further provides a cold start optimization system of a server-insensitive framework. The cold start optimization system of the server-insensitive framework includes a function service call prediction unit 100, an optimal resource preheating calculation unit 200, a function service request acquisition unit 300, a first data acquisition unit 400, a second data acquisition unit 500 and a cold start optimization unit 600, wherein:
[0146] The function service call prediction unit 100 is used to use a preset function service call prediction model to perform data analysis on the historical call data of the function service in the server-insensitive framework, and predict the function service call mode according to the data dependency relationship of the function workflow; wherein the function workflow includes multiple function services;
[0147] The optimal resource preheating calculation unit 200 is used to calculate the optimal resource preheating based on the predicted function service call pattern to obtain the optimal resource scheduling strategy;
[0148] The function service request acquisition unit 300 is used to acquire the function service request of the current workload and find a surviving function executor according to the function service request;
[0149] The first data acquisition unit 400 is used to acquire the function service execution time, the function service failure rate and the computing resource allocation status from the function executor;
[0150] The second data acquisition unit 500 is used to obtain the current actual function service delay according to the function service status periodically sent by the gateway;
[0151] The cold start optimization unit 600 is used to adopt the optimal resource scheduling strategy for resource scheduling based on the function service execution time, function service failure rate and computing resource allocation if the current actual function service delay is less than or equal to the expected function service delay, so as to achieve cold start optimization of the server-insensitive framework.
[0152] It should be noted that since the cold start optimization system of a server-aware framework in this embodiment and the cold start optimization method of a server-aware framework mentioned above are based on the same inventive concept, the corresponding contents in the method embodiment are also applicable to the system embodiment and will not be described in detail here.
[0153] Reference Figure 8 The embodiment of the present application further provides a cold start optimization device of a server non-sensitive framework, and the cold start optimization device of the server non-sensitive framework includes:
[0154] at least one memory;
[0155] at least one processor;
[0156] at least one program;
[0157] The program is stored in the memory, and the processor executes at least one program to implement the cold start optimization method of the server-insensitive framework implemented in the present disclosure.
[0158] The electronic device may be any intelligent terminal including a mobile phone, a tablet computer, a personal digital assistant (PDA), a car computer, etc.
[0159] The electronic device according to the embodiment of the present application is described in detail below.
[0160] The processor 1600 may be implemented by a general-purpose central processing unit (CPU), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided by the embodiments of the present disclosure;
[0161] The memory 1700 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 1700 can store an operating system and other applications. When the technical solution provided in the embodiment of this specification is implemented by software or firmware, the relevant program code is stored in the memory 1700, and the processor 1600 calls and executes the cold start optimization method of the server senseless framework of the embodiment of the present disclosure.
[0162] Input / output interface 1800, used to implement information input and output;
[0163] The communication interface 1900 is used to realize the communication interaction between the device and other devices. The communication can be realized through a wired manner (such as USB, network cable, etc.) or a wireless manner (such as mobile network, WIFI, Bluetooth, etc.);
[0164] Bus 2000 , which transmits information between various components of the device (e.g., processor 1600 , memory 1700 , input / output interface 1800 , and communication interface 1900 );
[0165] The processor 1600 , the memory 1700 , the input / output interface 1800 , and the communication interface 1900 are connected to each other in communication within the device via the bus 2000 .
[0166] The embodiment of the present disclosure also provides a storage medium, which is a computer-readable storage medium. The computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable a computer to execute the cold start optimization method of the above-mentioned server-insensitive framework.
[0167] The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a memory remotely disposed relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0168] The embodiments described in the embodiments of the present disclosure are intended to more clearly illustrate the technical solutions of the embodiments of the present disclosure and do not constitute a limitation on the technical solutions provided by the embodiments of the present disclosure. Those skilled in the art will appreciate that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided by the embodiments of the present disclosure are also applicable to similar technical problems.
[0169] Those skilled in the art will appreciate that the technical solutions shown in the figures do not limit the embodiments of the present disclosure and may include more or fewer steps than shown in the figures, or a combination of certain steps, or different steps.
[0170] The device embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separated, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0171] Those skilled in the art will appreciate that all or some of the steps in the methods disclosed above, and the functional modules / units in the systems and devices may be implemented as software, firmware, hardware, or a suitable combination thereof.
[0172] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0173] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.
[0174] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0175] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0176] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0177] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including multiple instructions to enable an electronic device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), disk or optical disk and other media that can store programs. The above is a detailed description of the embodiments of the present application in conjunction with the accompanying drawings, but the present application is not limited to the above embodiments. Within the scope of knowledge possessed by ordinary technicians in the relevant technical field, various changes can be made without departing from the purpose of the present application.
Claims
1. A cold start optimization method for a server-insensitive framework, characterized in that: The cold start optimization method of the server non-sensing framework includes: A preset function service call prediction model is used to analyze the historical call data of the function service in the server-insensitive framework, and the function service call mode is predicted according to the data dependency of the function workflow; wherein the function workflow includes multiple function services; Calculating the optimal resource preheating based on the predicted function service call pattern to obtain the optimal resource scheduling strategy; specifically including: Initialize the resource scheduling strategy record table including status and resource preheating behavior; Obtain the resource situation and workload size allocated by the current function service call mode, and determine the current state according to the resource situation and the workload size; Calculating a reward value of a previous state according to the current state, and updating the resource scheduling strategy record table based on the reward value to obtain a new resource scheduling strategy record table; If the current state is in the new resource scheduling strategy record table, then selecting a resource preheating behavior corresponding to the current state from the new resource scheduling strategy record table to obtain an optimal resource scheduling strategy; If the current state is not in the new resource scheduling strategy record table, a greedy algorithm is used to select the optimal resource preheating behavior to obtain the optimal resource scheduling strategy; Obtain a function service request of the current workload, and search for a surviving function executor according to the function service request; Obtaining function service execution time, function service failure rate and computing resource allocation from the function executor; Get the current actual function service delay based on the function service status sent periodically by the gateway; If the current actual function service delay is less than or equal to the expected function service delay, based on the function service execution time, the function service failure rate and the computing resource allocation, the optimal resource scheduling strategy is adopted to perform resource scheduling to achieve cold start optimization of the server-insensitive framework; specifically including: Get the container corresponding to each function in the server-insensitive framework; The weight of each container is calculated according to the calling frequency, recent unused time, initialization overhead and resource occupancy size when the optimal resource scheduling strategy is used for resource scheduling; wherein, The weight of each container is calculated according to the calling frequency, the recent unused time, the initialization cost and the resource occupied size when the optimal resource scheduling strategy is used for resource scheduling in the following manner: Among them, Weight represents the weight of each container, Frequency represents the calling frequency, Expense represents the initialization cost, Size represents the resource usage size, and Unused represents the recent unused time; Several containers with low weights are paused according to the weights, and the remaining containers are cached.
2. The cold start optimization method of the server non-sensing framework according to claim 1 is characterized in that: After obtaining the current actual function service delay according to the function service status periodically sent by the gateway, the cold start optimization method of the server-insensitive framework further includes: If the current actual function service delay is greater than the expected function service delay, a difference calculation is performed between the current actual function service delay and the expected function service delay to obtain a difference result; According to the difference result, a resource scheduling strategy of PID control is calculated, and the resource scheduling strategy of PID control is adopted to perform resource scheduling, so as to achieve cold start optimization of the server senseless framework.
3. The cold start optimization method of the server non-sensing framework according to claim 2 is characterized in that: The resource scheduling strategy of PID control is calculated according to the difference result in the following manner: output=K p *error+K i *integral+K d *derivative; Among them, output represents the resource scheduling strategy of PID control, K p Represents the proportionality coefficient, K i Indicates the integral coefficient, K d Represents the differential coefficient, error represents the difference result, integral represents the cumulative historical error value integral, and derivative represents the future error differential.
4. A server-insensitive framework cold start optimization system, characterized in that: The cold start optimization system of the server non-sensing framework includes: A function service call prediction unit, used to use a preset function service call prediction model to perform data analysis on the historical call data of the function service in the server-insensitive framework, and predict the function service call mode according to the data dependency relationship of the function workflow; wherein the function workflow includes multiple function services; The optimal resource preheating calculation unit is used to calculate the optimal resource preheating based on the predicted function service call mode to obtain the optimal resource scheduling strategy; specifically comprising: Initialize the resource scheduling strategy record table including status and resource preheating behavior; Obtain the resource situation and workload size allocated by the current function service call mode, and determine the current state according to the resource situation and the workload size; Calculating a reward value of a previous state according to the current state, and updating the resource scheduling strategy record table based on the reward value to obtain a new resource scheduling strategy record table; If the current state is in the new resource scheduling strategy record table, then selecting a resource preheating behavior corresponding to the current state from the new resource scheduling strategy record table to obtain an optimal resource scheduling strategy; If the current state is not in the new resource scheduling strategy record table, a greedy algorithm is used to select the optimal resource preheating behavior to obtain the optimal resource scheduling strategy; A function service request acquisition unit, used to acquire the function service request of the current workload and find a surviving function executor according to the function service request; A first data acquisition unit, used to acquire function service execution time, function service failure rate and computing resource allocation status from the function executor; A second data acquisition unit, used to obtain the current actual function service delay according to the function service status periodically sent by the gateway; A cold start optimization unit is used to adopt the optimal resource scheduling strategy to perform resource scheduling based on the function service execution time, the function service failure rate and the computing resource allocation if the current actual function service delay is less than or equal to the expected function service delay, so as to achieve cold start optimization of the server-insensitive framework; specifically including: Get the container corresponding to each function in the server-insensitive framework; The weight of each container is calculated according to the calling frequency, recent unused time, initialization overhead and resource occupancy size when the optimal resource scheduling strategy is used for resource scheduling; wherein, The weight of each container is calculated according to the calling frequency, the recent unused time, the initialization cost and the resource occupied size when the optimal resource scheduling strategy is used for resource scheduling in the following manner: Among them, Weight represents the weight of each container, Frequency represents the calling frequency, Expense represents the initialization cost, Size represents the resource usage size, and Unused represents the recent unused time; Several containers with low weights are paused according to the weights, and the remaining containers are cached.
5. A cold start optimization device for a server non-sensing framework, characterized in that: It includes at least one control processor and a memory for communicating with the at least one control processor; the memory stores instructions that can be executed by the at least one control processor, and the instructions are executed by the at least one control processor so that the at least one control processor can execute the cold start optimization method of the server-insensitive framework as described in any one of claims 1 to 3.
6. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable a computer to execute the cold start optimization method of the server-insensitive framework as described in any one of claims 1 to 3.
Citation Information
Patent Citations
Server-free computing resource elastic scaling method and system based on probability distribution
CN116541234A
Container management method and device in server-free computing
CN117093330A