A memory management method for cloud computing applications based on real-time content prediction and historical resource occupancy
By combining real-time memory usage prediction and historical resource records in the cloud computing environment, using LSTM and DQN models to achieve automatic memory recovery, solving the problems of memory errors and resource redundancy in cloud computing, and improving the operation efficiency and memory management of applications Effect.
Patent Information
- Application Number
- CN202210089562.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-26
- Publication Date
- 2024-12-24
- Estimated Expiration
- 2042-01-26
AI Technical Summary
In a cloud computing environment, long-running large-scale application computing tasks often lead to memory errors. The existing technology is difficult to achieve automatic real-time memory management, cannot effectively balance the performance and memory overhead of applications, and the cost of increasing physical resources is high. unnecessary.
Using a method based on real-time memory usage prediction and historical resource usage statistical recording, memory usage prediction is carried out through long and short-term memory network (LSTM), and combined with reinforcement learning model (DQN) to realize automatic memory recovery of applications, a integrated Cloud computing application memory management method.
Through real-time memory prediction and historical resource recording, the operation efficiency of applications in the cloud computing environment is improved, memory errors are avoided, memory resources are optimized and managed, and the redundancy needs of physical resources are reduced.
Smart Images

Figure CN114461538B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of cloud computing, and mainly relates to a cloud computing application memory management method based on real-time content prediction and historical resource occupancy. Background Art
[0002] As big data and cloud computing technologies mature, enterprises are increasingly demanding high-performance computing for big data processing. Various applications are deployed on the cloud to achieve efficient parallel computing and on-demand allocation of computing resources. However, in the face of the unlimited increase in data volume, number of applications, and complexity of computing tasks, physical resources are ultimately limited.
[0003] In cloud computing environments, application memory management has always been a difficult problem in the industry. Although the emergence of many big data computing platform systems has solved the technical difficulties of parallel computing. However, when processing long-running large-scale application computing tasks, memory errors often occur, which makes the developer's historical time resources and computing resources investment lose value. The best way to solve this problem is to increase the physical resources of the cloud computing environment, but doing so is not only costly but also brings unnecessary redundancy. There are also solutions to schedule resources by predicting the memory usage of applications, but such methods are not real-time enough and do not effectively balance the performance and memory overhead of applications.
[0004] Currently, there are few studies on application memory management solutions for cloud computing platforms. Invention CN113296880A provides a container-based application management method. By configuring a serverless computing system based on containers, two states are set for the application: online and low power consumption. For the needs of scaling down and expanding capacity, an application instance of the application is switched between the two states respectively. The method defines the online and low power consumption states and the switching steps in detail, but does not give the switching conditions, and cannot achieve automatic real-time memory management. Therefore, it is not suitable for enterprise cloud computing platforms with massive application data, limited physical resources, and complex computing tasks. Summary of the invention
[0005] The purpose of the present invention is to overcome the shortcomings of the prior art, combine real-time memory occupancy prediction with historical resource usage statistics, and propose a cloud computing application memory management method based on real-time content prediction and historical resource occupancy.
[0006] The purpose of the present invention is achieved through the following technical solutions. The present invention aims at the problem of application memory management in a cloud environment, realizes real-time prediction of memory at the next moment based on the memory occupancy time series data of the application in a fixed time window, combines the historical resource usage statistics of the application throughout its life cycle, and realizes an integrated cloud computing application automatic memory recovery method through a reinforcement learning model. This cloud computing application memory management method based on real-time content prediction and historical resource occupancy includes the following steps:
[0007] (1) Given an application in a cloud computing environment , set checkpoints at fixed time intervals T and record application Memory usage of the application at the last n checkpoints The memory usage record at the tth checkpoint, that is, the memory usage record at time t for:
[0008]
[0009] (2) Based on the long short-term memory network LSTM, the input is the application at time t Memory usage record of (application i) , the output is the application at time t+1 Memory usage prediction for :
[0010]
[0011] In each subsequent iterative operation, at a given time t, based on the memory usage records of the previous n checkpoints, the application is predicted to be at the next time, that is, at time t+1. The memory usage of this vector As an application in the cloud computing environment at time t The first part of the status assessment is:
[0012] ;
[0013] (3) Set up the log manager to record the resource usage of all applications throughout their life cycle, including: maximum memory usage max_memory, minimum memory usage min_memory, maximum CPU usage max_cpu, minimum CPU usage min_cpu, number of calls call_count, total run time total_time, average run time average_time, maximum run time max_time, minimum run time min_time, average interval between calls average_interval, maximum interval between calls max_interval, minimum interval between calls min_interval. Up to time t, the application History for:
[0014]
[0015] The vector As the second part of the status assessment of the cloud computing environment, that is:
[0016]
[0017] Therefore, we can get the application in the cloud computing environment at time t The status is assessed as:
[0018] ;
[0019] (4) Based on the reinforcement learning model DQN, the input of the DQN model is ,memory management for a given application in a cloud environment.
[0020] The beneficial effects of the present invention are as follows: the present invention combines real-time memory usage prediction with historical resource usage statistics, proposes an integrated application memory scaling solution, and improves the operating efficiency of applications in a cloud computing environment while avoiding memory errors. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Figure 1 It is a schematic diagram of the process of the present invention. DETAILED DESCRIPTION
[0022] The present invention will be described in detail below with reference to the accompanying drawings:
[0023] like Figure 1 As shown, the present invention proposes a cloud computing application memory management method based on real-time content prediction and historical resource occupancy, comprising the following steps:
[0024] a) Given an application in a cloud computing environment Set checkpoints at fixed time intervals T to record application Memory usage at the last n checkpoints. Memory usage record at the tth checkpoint (hereinafter referred to as time t) for:
[0025]
[0026] b) Based on the long short-term memory network LSTM (known algorithm), the input is the application at time t Memory usage record , the output is the application at time t+1 Memory usage prediction:
[0027]
[0028] In each subsequent iterative operation, at a given time t, based on the memory usage records of the previous n checkpoints, the application is predicted to be at the next time, that is, at time t+1. The memory usage of the application in the cloud computing environment at time t The first part of the status assessment is:
[0029]
[0030] c) Set up the log manager to record the resource usage of all applications throughout their life cycle, including: maximum memory usage max_memory, minimum memory usage min_memory, maximum CPU usage max_cpu, minimum CPU usage min_cpu, number of calls call_count, total running time total_time, average running time average_time, maximum running time max_time, minimum running time min_time, average interval between calls average_interval, maximum interval between calls max_interval, minimum interval between calls min_interval, and the number of calls up to time t. The historical records are:
[0031]
[0032] This vector is the second part of the status assessment of the cloud computing environment, namely:
[0033]
[0034] Therefore, we can get the application in the cloud computing environment at time t The status is assessed as:
[0035] ;
[0036] d) Based on the reinforcement learning model DQN (known method), memory management is performed for a given application in the cloud environment. The state space, action space, and reward need to be specifically stated in DQN. The definition of the continuous state space has been defined in detail in a, b, and c.
[0037] We define the memory change action space of the application as follows:
[0038] 1. No change, no processing of current memory
[0039] 2. 0.8, memory usage is reduced to 0.8 times the current value
[0040] 3. 0.6, memory usage is reduced to 0.6 times the current value
[0041] 4. 0.4, memory usage is reduced to 0.4 times the current value
[0042] 5. 0.2, memory usage is reduced to 0.2 times the current value
[0043] 6. Kill, terminate the current application and reclaim all memory.
[0044] Reward function definition:
[0045] The goal of this solution is to reduce the application's memory overhead as much as possible while ensuring the normal and efficient operation of the application. Therefore, the reward function of the application's memory management consists of the following points:
[0046] 1. Memory resource usage M, negative feedback, the less it is used, the higher the reward
[0047] 2. The running time of the application T, negative feedback, the shorter the running time, the higher the reward
[0048]
[0049] Here, rewards are normalized based on the maximum and minimum memory usage and running time in the history of different applications. and are the weights of the two rewards respectively.
[0050] The input of the DQN model is the state That is, the vector of the memory usage prediction of the application at time t for time t+1 and the historical records of the entire life cycle of the application before time t is output as a 6-dimensional vector, corresponding to the Q values of the 6 actions. When selecting an action, based on Algorithm, with The action action is randomly selected with a small probability of The action corresponding to the maximum Q value output by DQN is selected with a high probability. The DQN network is optimized based on the data experience replay collected in the experience pool. Finally, a memory recycling solution for cloud computing applications based on real-time memory prediction and historical records is implemented.
[0051] Features of the present invention: The present invention performs memory prediction through LSTM, but prediction is not the end of our task. We use the prediction result as an intermediate result. This intermediate result is ultimately used to serve the memory scaling action, and the scaling action is performed through DQN.
[0052] It is understandable that, for those skilled in the art, any equivalent replacement or change to the technical solution and inventive concept of the present invention should fall within the protection scope of the claims attached to the present invention.
Claims
1. A cloud computing application memory management method based on real-time content prediction and historical resource occupancy, characterized in that: The steps include: (1) Given an application in a cloud computing environment , set checkpoints at fixed time intervals T and record application Memory usage of the application at the last n checkpoints The memory usage record at the tth checkpoint, that is, the memory usage record at time t for: ; (2) Based on the long short-term memory network LSTM, the input is the application at time t Memory usage record , the output is the application at time t+1 Memory usage prediction for : In each subsequent iterative operation, at a given time t, based on the memory usage records of the previous n checkpoints, the application is predicted to be at the next time, that is, at time t+1. Memory usage of As an application in the cloud computing environment at time t The first part of the status assessment is: ; (3) Set up the log manager to record the resource usage of all applications throughout their life cycle, including: maximum memory usage max_memory, minimum memory usage min_memory, maximum CPU usage max_cpu, minimum CPU usage min_cpu, number of calls call_count, total run time total_time, average run time average_time, maximum run time max_time, minimum run time min_time, average interval between calls average_interval, maximum interval between calls max_interval, minimum interval between calls min_interval. As of time t, the application History for: As the second part of the status assessment of the cloud computing environment, that is: Therefore, we can get the application in the cloud computing environment at time t The status is assessed as: ; (4) Based on the reinforcement learning model DQN, the input of the DQN model is ,memory management for a given application in a cloud environment.
2. The cloud computing application memory management method based on real-time content prediction and historical resource occupancy according to claim 1, characterized in that: In the reinforcement learning model DQN, The memory change action space of the application is defined as follows: (1) No change, the current memory is not processed; (2) 0.8, memory usage is reduced to 0.8 times the current value; (3) 0.6, memory usage is reduced to 0.6 times the current value; (4), 0.4, memory usage is reduced to 0.4 times the current value; (5) 0.2, memory usage is reduced to 0.2 times the current value; (6) Kill, terminate the current application and reclaim all memory; The reward function r is defined as: The memory resource usage M and the application running time T are normalized according to the maximum and minimum memory usage and running time in the history of different applications. and are the weights of the two rewards respectively.
Citation Information
Patent Citations
Container-based application management method and device
CN113296880A
Method and device for loading starting resources
CN108228270A
Real-time character recognition method and device, computer equipment and storage medium
CN110008961A
Private cloud task scheduling method for resource prediction based on v-TGRU model
CN110389820A
