Serverless starting system, method and device

Through container pooling technology and preheating strategies, combined with predictive algorithms and real-time monitoring, the size of the container pool is dynamically adjusted to solve the problem of cold start delay of Serverless functions, improve the real-time performance and response speed of the system, and optimize resource utilization.

CN118535277APending Publication Date: 2024-08-23SHANDONG INSPUR SCI RES INST CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410229497.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-02-29
Publication Date
2024-08-23

AI Technical Summary

Technical Problem

Traditional serverless functions have latency issues during cold start, which limits their widespread application.

Method used

Adopt container pooling technology and preheating strategy, pre-start and maintain container instances through preset container pools, prediction modules, preheating controllers, real-time monitoring systems and dynamic adjustment modules, and combine prediction algorithms and real-time monitoring to dynamically adjust the container pool size to reduce cold start latency.

Benefits of technology

It significantly reduces the cold start delay time of Serverless functions, improves the real-time performance and response speed of the system, and efficiently utilizes computing resources and reduces costs when the load fluctuates.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118535277A
    Figure CN118535277A
Patent Text Reader

Abstract

The invention relates to the technical field of cloud computing, and discloses a Serverless starting system, method and device, and the system comprises a preset container pool, a prediction module, a preheating controller, a real-time monitoring system and a dynamic adjustment module. A preset container pool comprises a plurality of container instances, the container pool is configured to start a set number of container instances in advance when a system is started, and the container instances comprise required operating environments and infrastructures. The prediction module is configured to predict a future load of the system using a prediction algorithm to calculate the number of container instances that need to be preheated as a preheating number. The pre-heat controller is configured to pre-heat container instances of the container pool and maintain the container instances in a thermal state according to the pre-heat quantity. According to the method and the device, a mode of combining container pooling and a preheating strategy is adopted, so that the delay time of traditional Serverless cold start is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of cloud computing technology, and in particular to a system, method, and device for Serverless startup. Background Art

[0002] Serverless, also known as serverless, does not mean that there is no need to rely on servers and other resources. Instead, developers no longer have to worry too much about server issues and can focus more on product code. There is no need to manage and operate cloud or local servers. At the same time, computing resources also begin to appear as services rather than as servers.

[0003] Serverless is a complete process for building and managing a microservices-based architecture, allowing users to manage their application deployments at the service deployment level rather than the server deployment level. Unlike traditional architectures, it is completely managed by a third party, triggered by events, stateless, and temporarily stored (perhaps only during a single call) within a computing container.

[0004] Serverless truly enables automatic building, deployment, and startup of services without involving more infrastructure construction when deploying applications.

[0005] The rise of Serverless architecture has brought about flexible and elastic computing methods, but the latency problem of traditional Serverless functions during cold starts has always been an obstacle to its widespread application.

[0006] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of this application, and therefore may include information that does not constitute prior art known to ordinary technicians in this field. Summary of the Invention

[0007] In order to provide a basic understanding of some aspects of the disclosed embodiments, a brief summary is given below. The summary is not an extensive review, nor is it intended to identify key / critical elements or delineate the scope of protection of these embodiments, but rather serves as a prelude to the detailed description that follows.

[0008] The embodiments of the present disclosure provide a system, method, and apparatus for Serverless startup. This disclosure aims to reduce the cold start latency of Serverless functions and improve the real-time nature and performance of the system through container pooling technology combined with a preheating strategy.

[0009] In some embodiments, the system for Serverless startup includes a preset container pool, a prediction module, a preheating controller, a real-time monitoring system, and a dynamic adjustment module.

[0010] The preset container pool includes multiple container instances. The container pool is configured to pre-start a set number of container instances when the system starts. The container instances contain the required operating environment and infrastructure.

[0011] The prediction module is configured to predict the future load of the system using a prediction algorithm to calculate the number of container instances that need to be preheated as the preheating number.

[0012] The preheating controller is configured to preheat the container instances in the container pool according to the preheating quantity and keep the container instances in a hot state.

[0013] The real-time monitoring system is configured to monitor the system's load, response time, and request volume.

[0014] The dynamic adjustment module is configured to dynamically adjust the size of the container pool according to monitoring information fed back by the real-time monitoring system.

[0015] Optionally, based on the nature of the task, the task allocation object is determined, and the allocation object includes the container instance and Serverless function in the container pool.

[0016] Optionally, implement tasks with longer lifecycles, state retention requirements, or large resource demands as containers; for short-lived, stateless tasks, continue to use Serverless functions.

[0017] In some embodiments, the method comprises:

[0018] Preset container pool: when the system starts, a set number of container instances are pre-started;

[0019] The prediction algorithm infers the future load to calculate the number of container instances that need to be preheated.

[0020] Preheat the corresponding number of container instances;

[0021] Monitor system operation information, including system load, response time, and request volume;

[0022] Dynamically adjust the container pool size based on operating information.

[0023] Optionally, the number of container instances that need to be preheated is calculated by a prediction algorithm using a trained prediction model based on user usage habits and terminal device performance.

[0024] Optionally, store static or rarely changing data in the container and perform resource recycling for container instances that have been inactive for a long time.

[0025] Optionally, the container pool size is dynamically adjusted based on the operation information, including: when the load is low, reducing the number of container instances to save resources; when the load increases, increasing the number of container instances to meet demand.

[0026] In some embodiments, the apparatus for Serverless startup includes a processor and a memory storing program instructions, and the processor is configured to execute the aforementioned method for Serverless startup when running the program instructions.

[0027] The system, method, and apparatus for Serverless startup provided by the embodiments of the present disclosure can achieve the following technical effects:

[0028] This disclosure combines container pooling with a preheating strategy to reduce the cold start latency of traditional Serverless systems. Furthermore, by combining predictive algorithms with real-time monitoring, it enables real-time adjustment of the container pool size, significantly improving the system's real-time performance and responsiveness. Dynamically adjusting the container pool size ensures efficient utilization of computing resources and reduces costs during load fluctuations. Furthermore, this disclosure leverages the advantages of container technology to pre-create and maintain container instances, providing a more stable execution environment for Serverless functions.

[0029] The above general description and the following description are exemplary and explanatory only and are not intended to limit the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] One or more embodiments are exemplarily described by corresponding drawings. These exemplary descriptions and drawings do not limit the embodiments. Elements with the same reference numerals in the drawings are shown as similar elements. The drawings do not constitute a scale limitation. In addition,

[0031] Figure 1 This is a schematic diagram of a system for Serverless startup provided by an embodiment of the present disclosure;

[0032] Figure 2 This is a schematic diagram of a method for Serverless startup provided by an embodiment of the present disclosure;

[0033] Figure 3 This is a schematic diagram of a device for Serverless startup provided by an embodiment of the present disclosure. DETAILED DESCRIPTION

[0034] In order to be able to understand the features and technical content of the embodiments of the present disclosure in more detail, the implementation of the embodiments of the present disclosure is described in detail below in conjunction with the accompanying drawings. The accompanying drawings are for reference only and are not used to limit the embodiments of the present disclosure. In the following technical description, for the sake of convenience of explanation, a full understanding of the disclosed embodiments is provided through multiple details. However, one or more embodiments can still be implemented without these details. In other cases, to simplify the drawings, well-known structures and devices can be simplified for display.

[0035] In the description and claims of the embodiments of the present disclosure, as well as in the accompanying drawings, the terms "first," "second," and the like are used to distinguish similar items and are not necessarily used to describe a particular order or precedence. It should be understood that the terms used in this manner are interchangeable where appropriate to describe the embodiments of the present disclosure herein. In addition, the terms "including," "having," and any variations thereof are intended to cover non-exclusive inclusions.

[0036] Unless otherwise stated, the term "plurality" means two or more.

[0037] In the embodiment of the present disclosure, the character " / " indicates that the preceding and following objects are in an "or" relationship. For example, A / B means: A or B.

[0038] The term "and / or" describes an association between objects, indicating that three relationships can exist. For example, A and / or B means: A or B, or A and B.

[0039] The term "correspondence" may refer to an association relationship or a binding relationship. The correspondence between A and B means that there is an association relationship or a binding relationship between A and B.

[0040] Combine Figure 1 As shown, an embodiment of the present disclosure provides a system for Serverless startup, including a preset container pool, a prediction module, a preheating controller, a real-time monitoring system and a dynamic adjustment module.

[0041] The preset container pool includes multiple container instances. The container pool is configured to pre-start a set number of container instances when the system starts. The container instances contain the required operating environment and infrastructure.

[0042] The prediction module is configured to predict the future load of the system using a prediction algorithm to calculate the number of container instances that need to be preheated as the preheating number.

[0043] The preheating controller is configured to preheat the container instances in the container pool according to the preheating quantity and keep the container instances in a hot state.

[0044] The real-time monitoring system is configured to monitor the system's load, response time, and request volume.

[0045] The dynamic adjustment module is configured to dynamically adjust the size of the container pool according to monitoring information fed back by the real-time monitoring system.

[0046] Optionally, based on the nature of the task, the task allocation object is determined, and the allocation object includes the container instance and Serverless function in the container pool.

[0047] Optionally, implement tasks with longer lifecycles, state retention requirements, or large resource demands as containers; for short-lived, stateless tasks, continue to use Serverless functions.

[0048] As an example, the system mainly includes the following aspects:

[0049] 1. Container pooling and preheating

[0050] By creating and maintaining the container pool in advance and combining it with the preheating strategy of real-time monitoring and prediction algorithms, the container pooling and preheating process is realized.

[0051] Specifically, when the system starts, a certain number of container instances are started in advance, which contain the required operating environment and infrastructure. This avoids resource preparation operations during cold start, thereby shortening the startup time and improving the response speed.

[0052] Keep containers hot: Ensure that containers remain responsive through regular health checks and lightweight tasks to reduce the impact of cold starts on system performance.

[0053] Using a predictive model, you can predict future load before the load increases, so you can calculate the number of containers that need to be preheated in advance, implement an intelligent preheating strategy, and reduce cold start delays.

[0054] 2. Dynamically adjust the size of the container pool

[0055] By real-time monitoring of the system's load, response time, and request volume, combined with measures to dynamically adjust the size of the container pool, flexible management of the container pool is achieved.

[0056] The system dynamically adjusts the size of the container pool based on actual load. When load is low, the number of container instances is reduced to conserve resources; when load increases, the number of container instances is increased to meet demand. This dynamic adjustment ensures efficient resource utilization, avoids resource waste or shortages, and improves system resilience and efficiency.

[0057] 3. Flexible management of containers

[0058] Flexible management of containers is achieved by implementing caching strategies and resource recycling strategies.

[0059] The caching strategy stores static or rarely changing data in the container based on the caching policy, reducing startup preparation and improving initialization speed. The resource recycling strategy reclaims resources from container instances that have been inactive for a long time, for example, shutting down containers that have been idle for too long to free up resources. This flexible management helps optimize resource utilization and improve system efficiency.

[0060] 4. Mixing containers and stateless functions

[0061] Through task separation and flexible task scheduling, a strategy of mixed use of containers and stateless functions is implemented.

[0062] Implement tasks with long lifecycles, state retention requirements, or large resource demands as containers; for short-lived, stateless tasks, continue to use Serverless functions.

[0063] By using task separation, we select the appropriate execution method based on the nature of the task, improving task execution efficiency. Furthermore, through flexible task scheduling, we choose to assign tasks to container instances in the container pool or process them through Serverless functions, maintaining system flexibility and efficiency.

[0064] 5. Use of prediction algorithms

[0065] By using prediction algorithms and real-time adjustments, the system can more accurately predict future loads and adjust the container pool in real time. Using prediction algorithms such as machine learning models, we can more accurately predict future loads. Combined with real-time monitoring and adjustments, we can adjust the size of the container pool in real time, improving the system's real-time performance and responsiveness while minimizing the impact of cold starts on the user experience.

[0066] The number of container instances that need to be preheated is calculated by the prediction algorithm based on the user's usage habits and terminal device performance input into the trained prediction model.

[0067] Combine Figure 2 As shown, an embodiment of the present disclosure provides a method for Serverless startup, including:

[0068] S01, preset container pool, pre-starts a set number of container instances when the system starts;

[0069] S02: Use a prediction algorithm to deduce the future load and calculate the number of container instances that need to be preheated.

[0070] S03: Preheat a corresponding number of container instances;

[0071] S04, monitoring system operation information, including system load, response time and request volume;

[0072] S05: Dynamically adjust the size of the container pool based on the operation information.

[0073] For example, when the system boots, a certain number of container instances are pre-started, including the required operating environment and infrastructure. Health check requests are regularly sent to the containers to keep them running, and lightweight tasks are used to keep them hot.

[0074] Use the prediction algorithm to predict future load, calculate the number of containers that need to be preheated, and trigger the preheating of the corresponding number of container instances.

[0075] Use monitoring tools to monitor system load, response time, and request volume in real time. Dynamically adjust the size of the container pool based on actual load. When load is low, reduce the number of container instances; when load increases, increase the number of container instances.

[0076] Implement appropriate caching strategies and store static or rarely changing data in containers based on the caching strategy.

[0077] For container instances that have been inactive for a long time, resource recovery policies are implemented, such as shutting down containers that have been idle for too long to release resources.

[0078] Implement tasks with long lifecycles, state retention requirements, or large resource demands as containers.

[0079] For short-lived, stateless tasks, continue to use Serverless functions and choose the appropriate execution method based on the nature of the task.

[0080] Leverage predictive algorithms, such as machine learning models, to more accurately forecast future loads.

[0081] Combining real-time monitoring and prediction algorithms, the container pool size can be adjusted in real time to ensure that the system can respond quickly before the load increases.

[0082] The disclosed system, method, and device for Serverless startup reduce the traditional Serverless cold start delay. Furthermore, by combining predictive algorithms with real-time monitoring, real-time adjustment of the container pool size is achieved, significantly improving the system's real-time performance and responsiveness. Dynamic adjustment of the container pool size ensures efficient utilization of computing resources and reduces costs during load fluctuations. Furthermore, the present disclosure leverages the advantages of container technology to pre-create and maintain container instances, providing a more stable execution environment for Serverless functions.

[0083] Specifically, the prediction algorithms that can be used in the present disclosure include: convolutional neural networks (CNNs), graph neural networks (GNNs), Transformer models, and algorithms such as BERT and its variants. In addition, there are many open source implementations of these algorithms available on the market for direct use. These implementations can usually be found in popular machine learning frameworks such as TensorFlow, PyTorch, and Keras. These frameworks provide rich documentation, tutorials, and community support to help quickly implement and deploy these algorithms. In addition, there are many related projects and code libraries developed by the community on platforms such as GitHub that can be used as reference or directly.

[0084] The implementation of the prediction algorithm in this disclosure is as follows:

[0085] Data preparation: Collect and preprocess data related to container pooling, such as historical load data and request frequency, to ensure that the data format is compatible with the selected model.

[0086] Model selection and adjustment: Select an open source model suitable for time series forecasting, such as a CNN-based model, and adjust the model structure and parameters according to specific needs.

[0087] Model training: Using data to train a model may require multiple rounds of training and parameter tuning to achieve optimal prediction performance.

[0088] Integration and deployment: Integrate the trained model into the system to predict load in real time and adjust the container pool accordingly.

[0089] Monitoring and optimization: After actual deployment, continuously monitor model performance and optimize based on actual operation conditions.

[0090] The advantages of the present disclosure compared with the prior art are:

[0091] Peak load handling capability: The container pooling technology disclosed in this disclosure is more effective in handling traffic spikes. Container pooling allows the system to quickly allocate pre-heated containers to handle sudden requests, which is particularly important in high-traffic situations.

[0092] Flexibility in resource allocation: Container pooling technology provides greater flexibility. Under different loads and demands, containers can be quickly allocated or recycled, thereby optimizing resource usage and reducing invalid or inefficient resource consumption.

[0093] System stability and reliability: By leveraging a pre-defined container pool, the disclosed method can provide a more stable service response. In contrast, some existing technologies rely on real-time prediction and scheduling, whose prediction models may be affected by data inaccuracies or inherent model limitations, and may face more challenges in extreme or unpredictable situations.

[0094] Maintenance and scalability: Container pooling simplifies system maintenance and expansion. As the business grows and changes, the container pool can be easily adjusted and expanded to meet new needs.

[0095] Combine Figure 3 As shown, an embodiment of the present disclosure provides an apparatus 300 for serverless startup, including a processor 304 and a memory 301. Optionally, the apparatus may also include a communication interface 302 and a bus 303. The processor 304, the communication interface 302, and the memory 301 may communicate with each other via the bus 303. The communication interface 302 may be used for information transmission. The processor 304 may call the logic instructions in the memory 301 to execute the serverless startup method of the above embodiment.

[0096] In addition, the logic instructions in the memory 301 can be implemented in the form of software functional units and can be stored in a computer-readable storage medium when sold or used as an independent product.

[0097] Memory 301, as a computer-readable storage medium, can be used to store software programs and computer-executable programs, such as the program instructions / modules corresponding to the methods in the embodiments of the present disclosure. Processor 304 executes the program instructions / modules stored in memory 301 to execute functional applications and process data, thereby implementing the serverless startup method in the above-mentioned embodiments.

[0098] The memory 301 may include a program storage area and a data storage area. The program storage area may store an operating system and at least one application required for a function; the data storage area may store data generated based on the use of the terminal device. Furthermore, the memory 301 may include high-speed random access memory and non-volatile memory.

[0099] An embodiment of the present disclosure provides a computer-readable storage medium storing computer-executable instructions, wherein the computer-executable instructions are configured to execute the above-mentioned method for Serverless startup.

[0100] The aforementioned computer-readable storage medium may be a transient computer-readable storage medium or a non-transitory computer-readable storage medium.

[0101] The technical solution of the embodiments of the present disclosure may be embodied in the form of a software product, which is stored in a storage medium and includes one or more instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in the embodiments of the present disclosure. The aforementioned storage medium may be a non-transitory storage medium, including: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and other media that can store program code, or a transient storage medium.

[0102] The above description and the accompanying drawings fully illustrate the embodiments of the present disclosure so that those skilled in the art can practice them. Other embodiments may include structural, logical, electrical, process and other changes. The embodiments represent only possible variations. Unless explicitly required, individual components and functions are optional, and the order of operations may vary. Parts and features of some embodiments may be included in or replace parts and features of other embodiments. Moreover, the words used in this application are only used to describe the embodiments and are not used to limit the claims. As used in the description of the embodiments and claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to also include plural forms. Similarly, the term "and / or" used in this application refers to any and all possible combinations of one or more associated listings. In addition, when used in this application, the term "comprise" and its variations "comprises" and / or comprising refer to the presence of stated features, wholes, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or groups thereof. In the absence of further restrictions, an element defined by the statement "comprises a..." does not exclude the presence of other identical elements in the process, method or device that includes the element. In this article, each embodiment may focus on the differences from other embodiments, and the same and similar parts between the various embodiments can be referenced to each other. For the methods, products, etc. disclosed in the embodiments, if they correspond to the method part disclosed in the embodiments, then the relevant parts can be found in the description of the method part.

[0103] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software may depend on the specific application and design constraints of the technical solution. The technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the embodiments of the present disclosure. The technicians will clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0104] In the embodiments disclosed herein, the disclosed methods and products (including but not limited to devices, equipment, etc.) can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the units can be merely a logical functional division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, 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. 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 they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to implement this embodiment. In addition, the functional units in the embodiments of the present disclosure may be integrated into a processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0105] The flowcharts and block diagrams in the accompanying drawings show the possible implementation architectures, functions and operations of the systems, methods and computer program products according to the embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, program segment or part of the code, and the module, program segment or part of the code contains one or more executable instructions for implementing the specified logical functions. In some alternative implementations, the functions marked in the box can also occur in an order different from that marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, or they can sometimes be executed in the opposite order, which can depend on the functions involved. In the descriptions corresponding to the flowcharts and block diagrams in the accompanying drawings, the operations or steps corresponding to different boxes can also occur in an order different from that disclosed in the description, and sometimes there is no specific order between different operations or steps. For example, two consecutive operations or steps can actually be executed substantially in parallel, or they can sometimes be executed in the opposite order, which can depend on the functions involved. Each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented by a dedicated hardware-based system that performs the specified function or action, or may be implemented by a combination of dedicated hardware and computer instructions.

Claims

1. A system for Serverless startup, characterized in that: include: A preset container pool, including multiple container instances, wherein the container pool is configured to pre-start a set number of container instances when the system starts, and the container instances include the required operating environment and infrastructure; A prediction module is configured to predict a future load of the system using a prediction algorithm to calculate a number of container instances that need to be preheated as a preheating number; a preheating controller configured to preheat the container instance of the container pool according to the preheating quantity and keep the container instance in a hot state; A real-time monitoring system configured to monitor the load, response time and request volume of the system; The dynamic adjustment module is configured to dynamically adjust the size of the container pool according to the monitoring information fed back by the real-time monitoring system.

2. The system according to claim 1, characterized in that According to the nature of the task, the task allocation object is determined, and the allocation object includes the container instance and the Serverless function in the container pool.

3. The system according to claim 2, characterized in that Implement tasks with long lifecycles, state retention requirements, or large resource demands as containers; For short-lived, stateless tasks, continue to use Serverless functions.

4. A method for Serverless startup, characterized in that: include: Preset container pool, pre-start a set number of container instances when the system starts; The future load is inferred through a prediction algorithm to calculate the number of container instances that need to be preheated; Preheat the corresponding number of container instances; Monitoring system operation information, including system load, response time, and request volume; The size of the container pool is dynamically adjusted according to the operation information.

5. The method according to claim 4, characterized in that The number of container instances that need to be preheated is calculated by the prediction algorithm based on the user's usage habits and terminal device performance input into the trained prediction model.

6. The method according to claim 4 or 5, characterized in that: Storing static or rarely changing data in containers, Perform resource recycling for container instances that have been inactive for a long time.

7. The method according to claim 6, characterized in that The dynamically adjusting the size of the container pool according to the operation information includes: When the load is low, reduce the number of container instances to save resources; When the load increases, increase the number of container instances to handle the demand.

8. A device for Serverless startup, comprising a processor and a memory storing program instructions, characterized in that: The processor is configured to execute the method for Serverless startup as described in any one of claims 4 to 7 when running the program instructions.