Container dynamic management method and device for Web application, equipment and medium

By monitoring the resource load of web applications within containers in real time and dynamically adjusting CPU and memory resources, the performance bottleneck of container technology in resource management is solved, enabling efficient and stable operation of web applications.

CN120929240APending Publication Date: 2025-11-11广州三七极耀网络科技有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510835599.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-20
Publication Date
2025-11-11

AI Technical Summary

Technical Problem

Existing container technologies suffer from performance bottlenecks in resource management, making it difficult to adapt to rapidly changing application requirements and thus limiting the performance of web applications.

Method used

By acquiring real-time CPU and memory resource load data of web applications within containers, it can identify whether preset scheduling conditions are met and dynamically adjust resource allocation, including increasing or decreasing CPU and memory resources.

Benefits of technology

It improves container resource utilization, reduces resource waste, flexibly responds to changes in application load, and ensures the efficient and stable operation of web applications.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120929240A_ABST
    Figure CN120929240A_ABST
Patent Text Reader

Abstract

The invention discloses a container dynamic management method and device for a Web application, equipment and a medium, and belongs to the technical field of computers. The method comprises the steps of obtaining load data of resources of a Web application in a container; wherein the resources comprise CPU resources and / or memory resources; identifying whether the load data of the resource meets a preset resource scheduling condition; if the preset resource scheduling condition is met, dynamically allocating the resources to the container according to the load data of the resources; wherein the dynamic allocation of the resources comprises the steps of increasing or decreasing the CPU resources, and / or increasing or decreasing the memory resources. According to the technical scheme, the container resources are dynamically managed based on the load data, the load requirement can be met, the resources can be reasonably distributed and used, resource waste is avoided, and dynamic management of the container resources is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of computer technology, and specifically relates to a method, apparatus, device and medium for dynamic container management of Web applications. Background Technology

[0002] With the widespread adoption of cloud computing and microservice architectures, container technology has become a key technology for enabling rapid application deployment, scaling, and management. While container technology has achieved significant results in application encapsulation, portability, and isolation, performance limitations exist due to the constraints of container resources. The main problems facing existing container technologies include performance bottlenecks in the interaction between container runtime and network, storage, and other resources, as well as difficulty in adapting to rapidly changing application requirements, resulting in performance barriers in container-based web applications. Therefore, how to effectively manage container resources is a technical challenge that urgently needs to be solved by those skilled in the art. Summary of the Invention

[0003] This application provides a method, apparatus, device, and medium for dynamic container management of web applications. The purpose is to obtain the load data of resources such as CPU and / or memory of the web application in the container in real time, identify whether it meets the preset scheduling conditions, and dynamically increase or decrease the allocation of CPU and memory resources accordingly. This can effectively break through the performance barrier of the container, realize the intelligent allocation of resources, not only improve the utilization rate of container resources and reduce resource waste, but also flexibly respond to changes in application load and ensure the efficient and stable operation of the web application.

[0004] In a first aspect, embodiments of this application provide a method for dynamic container management of a web application, the method comprising: Obtain load data of resources of the web application within the container; wherein, the resources include CPU resources and / or memory resources; Identify whether the load data of the resource meets the preset resource scheduling conditions; If the preset resource scheduling conditions are met, the container is dynamically allocated resources based on the resource load data; wherein, dynamic resource allocation includes increasing or decreasing CPU resources, and / or increasing or decreasing memory resources.

[0005] Secondly, embodiments of this application provide a container dynamic management device for web applications, the device comprising: The load data acquisition module is used to acquire load data of the resources of the web application within the container; wherein, the resources include CPU resources and / or memory resources; The scheduling judgment module is used to identify whether the load data of the resource meets the preset resource scheduling conditions; The dynamic management module is used to dynamically allocate resources to the container based on the load data of the resources if preset resource scheduling conditions are met; wherein, dynamic resource allocation includes increasing or decreasing CPU resources, and / or increasing or decreasing memory resources.

[0006] Thirdly, embodiments of this application provide an electronic device including a processor, a memory, and a program or instructions stored in the memory and executable on the processor, wherein the program or instructions, when executed by the processor, implement the steps of the method described in the first aspect.

[0007] Fourthly, embodiments of this application provide a readable storage medium on which a program or instructions are stored, which, when executed by a processor, implement the steps of the method described in the first aspect.

[0008] In this embodiment, load data of resources within a web application in a container is obtained; wherein the resources include CPU resources and / or memory resources; it is identified whether the load data of the resources meets preset resource scheduling conditions; if it meets the preset resource scheduling conditions, the container is dynamically allocated resources based on the load data of the resources; wherein, dynamic resource allocation includes increasing or decreasing CPU resources, and / or increasing or decreasing memory resources. The above technical solution, by dynamically managing container resources based on load data, can both meet load requirements and rationally allocate and use resources, avoiding resource waste and achieving dynamic management of container resources. Attached Figure Description

[0009] Figure 1 This is a flowchart illustrating the container dynamic management method for a web application provided in Embodiment 1 of this application; Figure 2 This is a schematic diagram of the container dynamic management process of a Web application provided in Embodiment 2 of this application; Figure 3 This is a schematic diagram of the structure of the container dynamic management device for Web applications provided in Embodiment 3 of this application; Figure 4 This is a schematic diagram of the structure of the electronic device provided in Embodiment 4 of this application. Detailed Implementation

[0010] To make the objectives, technical solutions, and advantages of this application clearer, specific embodiments of this application will be described in further detail below with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are merely for explaining this application and not for limiting it. It should also be noted that, for ease of description, only the parts relevant to this application are shown in the drawings, not all of them. Before discussing exemplary embodiments in more detail, it should be mentioned that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although the flowcharts describe operations (or steps) as sequential processes, many of these operations can be performed in parallel, concurrently, or simultaneously. Furthermore, the order of the operations can be rearranged. The process can be terminated when its operation is completed, but may also have additional steps not included in the drawings. The process can correspond to a method, function, procedure, subroutine, subprogram, etc.

[0011] The technical solutions of the embodiments of this application will be clearly described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application are within the scope of protection of this application.

[0012] The terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such use of data can be interchanged where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first," "second," etc., are generally of the same class and the number of objects is not limited; for example, a first object can be one or more. Furthermore, in the specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.

[0013] The following description, in conjunction with the accompanying drawings, details the container dynamic management method, apparatus, device, and medium for Web applications provided in this application through specific embodiments and application scenarios.

[0014] Example 1 Figure 1 This is a flowchart illustrating the dynamic container management method for web applications provided in Embodiment 1 of this application. Figure 1 As shown, the specific steps include the following: S101, Obtain the load data of the resources of the Web application within the container; wherein, the resources include CPU resources and / or memory resources; First, this application applies to scenarios involving the dynamic management of containers for web applications. Based on this use case, it is understood that the entity executing this application can be a dynamic container management system for web applications. Specifically, this could be a server running the web application, a web application management platform, or a terminal device, etc.

[0015] Containers can be isolated environments created based on container runtimes such as Docker and Containerd, containing a complete file system and process space. They are typically managed by orchestration tools such as Kubernetes and Docker Swarm, and deployed in the form of Pods. For example, in Kubernetes, a Pod can contain multiple containers.

[0016] Web applications include, but are not limited to, HTTP services developed using languages ​​such as Node.js, Java, and Python, such as Express framework applications and Spring Boot microservices. Web applications can run in a container as a foreground process or a daemon process.

[0017] CPU resources can include the number of CPU cores, CPU time slices, such as the percentage of CPU cycles available to a container. CPU resource load data can include CPU utilization, such as 50% indicating that half of the available CPU time is being used, and CPU load, such as determining whether it is busy or idle based on the average load.

[0018] Memory resources: These can include memory capacity, memory swap space, etc. Memory resource load data can include memory usage and memory utilization rate, etc.

[0019] In this solution, resource load data can be obtained through built-in tools within the container.

[0020] S102, identify whether the load data of the resource meets the preset resource scheduling conditions; Preset resource scheduling conditions can be threshold-based or trend-based.

[0021] For example, if CPU utilization is >70% for 10 consecutive minutes or <30% for 5 consecutive minutes, then the threshold condition is met. Similarly, if memory utilization is >90% or <20%, then the threshold condition is met. Trend conditions can be determined by predicting future resource demands through machine learning. For instance, if a model predicts that CPU utilization will reach 90% within 30 minutes, then the trend condition is met.

[0022] S103, if the preset resource scheduling conditions are met, the container is dynamically allocated resources according to the resource load data; wherein, the dynamic allocation of resources includes increasing or decreasing CPU resources, and / or increasing or decreasing memory resources.

[0023] Dynamic allocation refers to flexibly allocating resources to a container based on actual conditions. For example, when the traffic to a web application increases, more CPU and memory are allocated to it; when the traffic decreases, the allocated resources are reduced.

[0024] In this solution, when the load data meets preset conditions, resource adjustments are performed. If CPU utilization is too high, CPU resources are increased for the container to allow it to handle more tasks; if memory usage is too high, memory resources are increased to provide more storage space. Conversely, if resource usage is insufficient, allocation is reduced to avoid waste.

[0025] The technical solution provided in this embodiment can automatically and flexibly allocate resources to the container by monitoring the CPU and memory usage of the web application within the container in real time and comparing it with preset rules. When the application has high access volume, resources are added in a timely manner to ensure fast application response; when the access volume is low, resources are reduced in a timely manner to avoid resource waste and reduce operating costs.

[0026] In one embodiment, optionally, after obtaining the load data of the resources of the web application within the container, the method further includes: Load prediction is performed based on the load data of the resources to obtain the load prediction results; The container is dynamically allocated resources based on the load prediction results.

[0027] Load forecasting involves analyzing historical load data, such as peak access times each day over the past week, and combining this data with mathematical models or algorithms to estimate the resource demand trends of containers over a future period. For example, predicting a significant increase in user access around 3 PM allows for the preparation of more resources in advance.

[0028] By leveraging historical load data and predictive models, such as time series analysis and machine learning algorithms, future resource demands can be calculated. For example, analyzing access data at 10:00 AM every day over the past month reveals that average CPU utilization peaks at 10:30 AM, thus predicting a similar situation at the same time tomorrow.

[0029] Adjust container resources in advance based on predicted resource demand trends. For example, if a significant increase in CPU utilization is predicted, proactively increase CPU resources for containers before the actual peak arrives, avoiding adjustments only after users experience lag.

[0030] This technical solution significantly improves the foresight and accuracy of container resource management by predicting future loads and allocating resources in advance. The system can proactively expand before peak traffic periods, avoiding performance degradation caused by sudden load increases and ensuring a smooth user experience. Simultaneously, it automatically shrinks during off-peak periods, reducing resource idleness and waste, and lowering operating costs. This solution can respond more flexibly to traffic fluctuations, enhancing overall resilience and stability, and optimizing resource utilization efficiency while reducing manual intervention.

[0031] In one embodiment, optionally, after obtaining the load data of the resources of the web application within the container, the method further includes: The container usage requirements of the web application are determined based on the load data; If the container usage requirements meet the expansion conditions, the container orchestration tool is invoked to automatically expand the container instance according to the container usage requirements.

[0032] This solution can calculate container resource requirements based on load data. For example, the conclusion may be that three container instances are needed to handle the current traffic, or that each container needs to be allocated 2GB of memory to meet peak demand.

[0033] Pre-defined rules to trigger container scaling, such as CPU average utilization exceeding 70% for 10 consecutive minutes, or request response time exceeding 500 milliseconds.

[0034] Container orchestration tools are software used to automate the management of container clusters, which can automatically create, delete, or adjust the number of container instances according to instructions.

[0035] This solution specifically analyzes load data, such as current CPU utilization and request concurrency, and combines this with preset rules or historical experience to calculate the number of containers or resource configuration required to meet application performance. For example, if it is found that the current two containers cannot handle all requests, it is necessary to increase to five containers.

[0036] When container usage meets the scaling requirements, instructions are automatically sent to the container orchestration tool to create new container instances and add them to the service cluster. For example, scaling from 2 container instances to 5 can distribute the load of user requests.

[0037] This technical solution analyzes the load data of web applications within containers to accurately determine container usage requirements. Combined with scaling conditions, it uses container orchestration tools to automate the elastic scaling of container instances. This enables the system to rapidly scale up during peak traffic periods, preventing service lag or crashes due to insufficient resources and ensuring a smooth user experience. Simultaneously, it allows for timely scaling down during off-peak traffic periods, reducing resource idleness and operational costs. The entire process requires minimal manual intervention, significantly improving operational efficiency and achieving intelligent dynamic container management.

[0038] In one embodiment, optionally, before determining the container usage requirements of the web application based on the load data, the method further includes: An auto-scaling strategy is constructed to determine whether the container usage requirements of the web application meet the scaling conditions based on the auto-scaling strategy.

[0039] An auto-scaling strategy is a predefined set of rules used to determine when to scale up container instances. For example: a metric-based strategy: trigger scaling when CPU utilization exceeds 70% for 5 minutes. A time-based strategy: automatically add 2 container instances every day at 10 AM. A hybrid strategy: combine multiple metrics for a comprehensive assessment.

[0040] This solution can identify key metrics for triggering expansion, such as CPU utilization, memory utilization, and request queue length. It sets trigger conditions for each metric and specifies the time during which the key metric must continuously meet the threshold, such as the number of container instances to be expanded if it lasts for 5 minutes.

[0041] This solution provides a standardized intelligent decision-making framework for container elastic scaling by constructing an automatic scaling strategy. Based on preset multi-dimensional indicators, it can automatically and accurately determine when container instances need to be scaled, avoiding the subjectivity and delays of manual intervention. This solution can quickly respond to real traffic peaks while effectively filtering out misjudgments caused by short-term fluctuations, thereby ensuring service response speed, reducing resource waste, and significantly enhancing container performance.

[0042] In one embodiment, optionally, after obtaining the load data of the resources of the web application within the container, the method further includes: If the load data of the current container is lower than the set resource reclamation threshold, the resources of the current container are reclaimed.

[0043] The current container refers to the container that is currently running the web application.

[0044] Setting a resource reclamation threshold is a pre-defined standard value used to determine when resources should be reclaimed. For example, when CPU utilization is below 20% or memory usage is less than 30% of the total capacity, resources are considered ready for reclamation. This means releasing temporarily unused resources from the container and returning them to the system, including CPU cores and memory space.

[0045] This solution can collect real-time resource usage data of the web application within the container, compare the collected load data with a predefined resource reclamation threshold, and trigger resource reclamation if the CPU utilization is only 15%, below the set 20% threshold. It automatically releases excess resources within the container. For example, it reduces the number of CPU cores allocated to the container or frees up some idle memory space, allowing these resources to be used by other containers that need them more.

[0046] This technical solution adds a resource reclamation function to container resource management by setting a resource reclamation threshold. When container load decreases and resources are idle, the system can automatically identify and reclaim redundant resources, avoiding resource waste. This solution improves resource utilization, reduces operating costs, and also reduces the workload of operations and maintenance personnel. In a multi-container cluster environment, it can better ensure dynamic resource balance, allowing the system to maintain efficient operation even under low load, and achieving fine-grained management and optimized configuration of resources.

[0047] In one embodiment, optionally, after obtaining the load data of the resources of the web application within the container, the method further includes: If the load data of the current container is lower than the set resource reclamation threshold, the resources of the current container will be shared with other containers.

[0048] Resource sharing involves providing resources that are not currently in use in a container, such as idle CPU cores and spare memory space, to other containers that need them, thereby achieving resource sharing and efficient utilization.

[0049] In this solution, once the conditions are met, the system automatically transfers idle resources from the current container to other resource-constrained containers. For example, excess CPU computing power and memory space are allocated to containers handling high-load tasks, allowing resources to flow between containers and maximizing efficiency.

[0050] This technical solution achieves dynamic flow and efficient allocation of container resources by setting resource reclamation thresholds and resource sharing mechanisms. When the load on a container decreases and resources become idle, the system automatically shares these redundant resources with other resource-constrained containers, significantly improving overall resource utilization. This resource allocation method not only reduces hardware resource costs but also enhances system flexibility and stability, ensuring that each container runs with sufficient resources. It is particularly suitable for application scenarios with frequent load fluctuations, making resource usage across the entire container cluster more balanced and rational.

[0051] In one embodiment, optionally, before obtaining the load data of the resources of the web application within the container, the method further includes: Start the web application container using a lightweight container runtime.

[0052] Lightweight container runtimes are software tools specifically designed to manage the lifecycle of containers. They consume fewer computer resources and start up faster, such as containerd and CRI-O.

[0053] This solution selects and uses lightweight container runtime tools to manage web application containers. This step is like choosing the right tools to assemble furniture; selecting lightweight tools makes container startup and operation more efficient. The lightweight container runtime runs the packaged web application container. For example, you can trigger container startup using command-line tools or an orchestration system.

[0054] This technical solution significantly shortens container startup time and reduces runtime resource consumption through a streamlined architecture and efficient mechanisms. This enables web applications to respond to requests faster, offering a significant advantage, especially in scenarios requiring frequent container startups. It also lays an efficient foundation for subsequent load monitoring and resource management, ultimately improving the agility and resource utilization efficiency of containerized applications.

[0055] Example 2 Figure 2 This is a schematic diagram of the container dynamic management process for a web application provided in Embodiment 2 of this application. Figure 2 As shown, the specific steps include the following: Step 1: Container performance optimization: This solution improves container performance by optimizing the container runtime, reducing startup and runtime latency. For example, it employs lightweight container runtimes, container startup acceleration technologies, and runtime performance monitoring to enhance performance. Specifically, lightweight container runtimes such as gVisor can be used to reduce container startup time.

[0056] Step 2: Dynamic resource scheduling: This solution dynamically adjusts container resource allocation based on application load to achieve optimal resource utilization. For example, resource scheduling algorithms, load prediction, and dynamic resource adjustment can be used. Specifically, CPU and memory resource allocation can be dynamically adjusted according to the actual application load.

[0057] Step 3: Dynamic expansion of the container: This solution dynamically adds or removes container instances based on application needs, enabling elastic scaling of applications. Specifically, dynamic scaling can be achieved through container orchestration, auto-scaling strategies, and health checks. For example, container orchestration tools such as Kubernetes can be used to automatically scale container instances based on application load.

[0058] Step 4: Optimize resource utilization: This solution improves resource utilization by optimizing container resource allocation and recycling mechanisms. Specifically, resource utilization can be improved through resource recycling strategies, container sharing, and resource monitoring. For example, container sharing technology reduces resource waste and increases resource utilization.

[0059] In a practical scenario requiring the construction of high-performance, dynamic web application containers, priority should be given to container performance optimization. This can be achieved by using lightweight container runtimes such as gVisor or other tools like Firecracker to reduce the startup time of the web application containers. During web application runtime, dynamic resource scheduling should be implemented, adjusting CPU and memory resource allocation based on the actual load of the web application. The Bayer scheduling algorithm can also be used for resource scheduling. Containers can be dynamically scaled as needed, such as using container orchestration tools like Kubernetes and Docker Swarm to automatically scale container instances based on the web application load. When container resource utilization is low, resource utilization optimization can be performed, specifically through container sharing technologies to reduce resource waste and improve resource utilization.

[0060] This technical solution improves container performance by reducing startup and runtime latency through container performance optimization. It also enhances resource utilization and reduces costs through dynamic resource scheduling and utilization optimization. Finally, it improves application elasticity and scalability by dynamically scaling containers, adapting to rapidly changing application requirements.

[0061] Example 3 Figure 3 This is a schematic diagram of the structure of the container dynamic management device for a web application provided in Embodiment 3 of this application. Figure 3 As shown, the device includes: The load data acquisition module 310 is used to acquire load data of the resources of the web application within the container; wherein, the resources include CPU resources and / or memory resources; The scheduling judgment module 320 is used to identify whether the load data of the resource meets the preset resource scheduling conditions; The dynamic management module 330 is used to dynamically allocate resources to the container based on the load data of the resources if the preset resource scheduling conditions are met; wherein, the dynamic allocation of resources includes increasing or decreasing CPU resources, and / or increasing or decreasing memory resources.

[0062] In this embodiment, a load data acquisition module is used to acquire load data of resources of a web application within a container; wherein the resources include CPU resources and / or memory resources; a scheduling judgment module is used to identify whether the load data of the resources meets preset resource scheduling conditions; a dynamic management module is used to dynamically allocate resources to the container based on the load data of the resources if the preset resource scheduling conditions are met; wherein dynamic resource allocation includes increasing or decreasing CPU resources, and / or increasing or decreasing memory resources. This technical solution, by dynamically managing container resources based on load data, can both meet load requirements and rationally allocate and use resources, avoiding resource waste and achieving dynamic management of container resources.

[0063] The container dynamic management device for web applications in this application embodiment can be a device, or a component, integrated circuit, or chip in a terminal. The device can be a mobile electronic device or a non-mobile electronic device. For example, mobile electronic devices can be mobile phones, tablets, laptops, PDAs, in-vehicle electronic devices, wearable devices, ultra-mobile personal computers (UMPCs), netbooks, or personal digital assistants (PDAs), etc., while non-mobile electronic devices can be servers, network-attached storage (NAS), personal computers (PCs), televisions (TVs), ATMs, or self-service machines, etc. This application embodiment does not impose specific limitations.

[0064] The container dynamic management device for the web application in this embodiment can be a device with an operating system. This operating system can be Android, iOS, or other possible operating systems; this embodiment does not specifically limit the specific operating system used.

[0065] The container dynamic management device for Web applications provided in this application embodiment can implement the various processes implemented in embodiments one to three above. To avoid repetition, it will not be described again here.

[0066] Example 4 Figure 4 This is a schematic diagram of the structure of the electronic device provided in Embodiment 5 of this application. Figure 4As shown, this application embodiment also provides an electronic device 400, including a processor 401, a memory 402, and a program or instructions stored in the memory 402 and executable on the processor 401. When the program or instructions are executed by the processor 401, they implement the various processes of the above-described embodiment of the container dynamic management method for Web applications and achieve the same technical effect. To avoid repetition, they will not be described again here.

[0067] It should be noted that the electronic devices in the embodiments of this application include the mobile electronic devices and non-mobile electronic devices described above.

[0068] Example 5 This application also provides a readable storage medium storing a program or instructions. When the program or instructions are executed by a processor, they implement the various processes of the above-described embodiment of the container dynamic management method for web applications and achieve the same technical effect. To avoid repetition, they will not be described again here.

[0069] The processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes computer-readable storage media, such as computer read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk.

[0070] Example 6 This application embodiment also provides a chip, which includes a processor and a communication interface. The communication interface is coupled to the processor. The processor is used to run programs or instructions to implement the various processes of the above-described embodiment of the container dynamic management method for Web applications, and can achieve the same technical effect. To avoid repetition, it will not be described again here.

[0071] It should be understood that the chip mentioned in the embodiments of this application may also be referred to as a system-on-a-chip, system chip, chip system, or system-on-a-chip, etc.

[0072] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element. Furthermore, it should be noted that the scope of the methods and apparatuses in the embodiments of this application is not limited to performing functions in the order shown or discussed, but may also include performing functions substantially simultaneously or in the reverse order, depending on the functions involved. For example, the described methods may be performed in a different order than described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.

[0073] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a computer software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of this application.

[0074] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this application without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of this application.

[0075] The above description is merely a preferred embodiment and the technical principles employed in this application. This application is not limited to the specific embodiments described herein, and various obvious changes, readjustments, and substitutions that can be made by those skilled in the art will not depart from the scope of protection of this application. Therefore, although this application has been described in detail through the above embodiments, this application is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of this application, the scope of which is determined by the scope of the claims.

Claims

1. A method for dynamic container management in a web application, characterized in that, The method includes: Obtain load data of resources of the web application within the container; wherein, the resources include CPU resources and / or memory resources; Identify whether the load data of the resource meets the preset resource scheduling conditions; If the preset resource scheduling conditions are met, the container is dynamically allocated resources according to the resource load data; wherein, the dynamic allocation of resources includes increasing or decreasing CPU resources, and / or increasing or decreasing memory resources.

2. The method for dynamic container management of web applications according to claim 1, characterized in that, After obtaining the load data of the resources of the web application within the container, the method further includes: Load prediction is performed based on the load data of the resources to obtain the load prediction results; The container is dynamically allocated resources based on the load prediction results.

3. The method for dynamic container management of web applications according to claim 1, characterized in that, After obtaining the load data of the resources of the web application within the container, the method further includes: The container usage requirements of the web application are determined based on the load data; If the container usage requirements meet the expansion conditions, the container orchestration tool is invoked to automatically expand the container instance according to the container usage requirements.

4. The method for dynamic container management of web applications according to claim 3, characterized in that, Before determining the container usage requirements of the web application based on the load data, the method further includes: An auto-scaling strategy is constructed to determine whether the container usage requirements of the web application meet the scaling conditions based on the auto-scaling strategy.

5. The method for dynamic container management of web applications according to claim 1, characterized in that, After obtaining the load data of the resources of the web application within the container, the method further includes: If the load data of the current container is lower than the set resource reclamation threshold, the resources of the current container are reclaimed.

6. The method for dynamic container management of web applications according to claim 1, characterized in that, After obtaining the load data of the resources of the web application within the container, the method further includes: If the load data of the current container is lower than the set resource reclamation threshold, the resources of the current container will be shared with other containers.

7. The method for dynamic container management of web applications according to claim 1, characterized in that, Before obtaining the load data of the resources of the web application within the container, the method further includes: Start the web application container using a lightweight container runtime.

8. A container dynamic management device for a web application, characterized in that, The device includes: The load data acquisition module is used to acquire load data of the resources of the web application within the container; wherein, the resources include CPU resources and / or memory resources; The scheduling judgment module is used to identify whether the load data of the resource meets the preset resource scheduling conditions; The dynamic management module is used to dynamically allocate resources to the container based on the load data of the resources if preset resource scheduling conditions are met; wherein, dynamic resource allocation includes increasing or decreasing CPU resources, and / or increasing or decreasing memory resources.

9. An electronic device, characterized in that, It includes a processor, a memory, and a program or instructions stored in the memory and executable on the processor, wherein the program or instructions, when executed by the processor, implement the steps of the container dynamic management method for a web application as described in any one of claims 1-7.

10. A readable storage medium, characterized in that, The program or instructions are stored on the readable storage medium, and when the program or instructions are executed by a processor, they implement the steps of the container dynamic management method for a web application as described in any one of claims 1-7.