Dynamic balance distribution method, system and equipment for application resources and storage medium
By obtaining and analyzing the resource usage data of the game client, and using the resource prediction model to generate a dynamic allocation strategy, the resource inequality and bottleneck problems caused by static allocation are solved, and the balanced allocation of resources and user experience improvement are achieved.
Patent Information
- Application Number
- CN202510316565.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-18
- Publication Date
- 2025-07-22
AI Technical Summary
Traditional resource management strategies adopt static allocation methods, and cannot dynamically adjust according to real-time changes in resource usage, resulting in uneven resource allocation and serious waste, especially during peak game periods, which affects game fluency and user experience.
By obtaining resource usage data for CPU, memory and network bandwidth, preprocessing and analyzing timing characteristics, and using resource prediction models to predict demand, generating dynamic resource allocation strategies, and dynamically adjusting resource allocation to meet future needs.
It realizes balanced allocation of resources, avoids resource bottlenecks, improves the smoothness and response speed of the game, and improves the user experience.
Smart Images

Figure CN120353575A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of application resource allocation, and particularly to a method, system, device, and storage medium for dynamically balancing the allocation of application resources. Background Art
[0002] With the development of the game industry, resource management technology plays a crucial role in the stable operation of game clients and the guarantee of user experience. In the operating environment of game clients, the efficient utilization and reasonable allocation of resources such as CPU, memory, and network bandwidth are key factors to ensure game fluency and response speed.
[0003] However, most traditional resource management strategies adopt static allocation methods, that is, fixed resource shares are pre-allocated to each game process or application. This allocation method may be feasible in scenarios where resource requirements are relatively stable, but in modern game environments, with the increasing richness of game content, frequent user interactions, and the growing demand for multiple applications to run simultaneously, the static allocation strategy has become difficult to meet actual needs. The main drawback of the static allocation strategy is that it cannot dynamically adjust according to the real-time changes in resource usage. During the operation of the game, the resource requirements of each process or application will fluctuate over time and scenarios, and the static allocation strategy cannot respond to these changes in a timely manner, resulting in frequent problems such as uneven resource allocation, resource waste, and application lag. Especially during peak game hours, the sharp increase in resource requirements often causes the static allocation strategy to fall into a resource bottleneck, seriously affecting the user experience. The above problems need to be solved. Summary of the Invention
[0004] The main purpose of this application is to overcome the deficiencies of the prior art and provide a method, system, device, and storage medium for dynamically balancing the allocation of application resources, which can achieve balanced resource allocation and improve the overall utilization rate of resources.
[0005] To achieve the above object, this application adopts the following technical solutions:
[0006] In the first aspect, this application provides a method for dynamically balancing the allocation of application resources, including the following steps:
[0007] Obtain the resource usage data of CPU, memory, and network bandwidth;
[0008] Analyze the resource usage data and obtain the temporal characteristics of each resource usage data;
[0009] Input the temporal characteristics of each resource usage data into a pre-established resource prediction model for demand prediction to obtain the predicted resource usage data requirements;
[0010] Generate a resource allocation strategy based on the predicted resource requirements and the preset resource allocation goals;
[0011] Dynamically adjust the resource allocations of CPU, memory, and network bandwidth according to the resource allocation strategy.
[0012] As a preferred technical solution, after obtaining the resource usage data of CPU, memory, and network bandwidth, it further includes preprocessing the resource usage data;
[0013] The preprocessing of the resource usage data includes data cleaning, denoising, and missing value processing of the resource usage data.
[0014] As a preferred technical solution, the analysis of the resource usage data includes:
[0015] Analyze the CPU usage rate, CPU load, and CPU temperature within each preset time period;
[0016] Analyze the total memory usage, memory occupancy of each process or application, and memory leakage situation within each preset time period;
[0017] Analyze the usage of uplink bandwidth and downlink bandwidth, network latency, and packet loss rate within each preset time period.
[0018] As a preferred technical solution, it further includes:
[0019] Based on the analysis of the resource usage data, obtain the temporal characteristics of each resource usage data, and integrate the temporal characteristics of each resource usage data to obtain a multi-dimensional feature vector of a time segment.
[0020] As a preferred technical solution, the obtaining of the temporal characteristics of each resource usage data and the integration of the temporal characteristics of each resource usage data to obtain a multi-dimensional feature vector of a time segment includes:
[0021] Calculate the average value, maximum value, minimum value, and standard deviation of the CPU usage rate, load, and temperature within a preset time period respectively as the CPU temporal characteristics;
[0022] Calculate the average value, maximum value, minimum value, and standard deviation of the total memory usage, memory occupancy of each process or application, and the detection index of memory leakage within a preset time period respectively as the memory temporal characteristics;
[0023] Calculate the average value, maximum value, minimum value, and standard deviation of the usage of uplink and downlink bandwidth, network latency, and packet loss rate within a preset time period respectively as the network bandwidth temporal characteristics;
[0024] Integrate the CPU timing characteristics, the memory timing characteristics, and the network bandwidth timing characteristics into a multi-dimensional timing feature vector according to the time series.
[0025] As a preferred technical solution, inputting the timing characteristics of the resource usage data into a pre-established resource prediction model for demand prediction to obtain the predicted resource usage data requirements includes:
[0026] Using the multi-dimensional timing feature vector as the input of the resource prediction model;
[0027] The resource prediction model analyzes the multi-dimensional timing feature vector to obtain the timing dependence relationship between the feature vectors;
[0028] Based on the timing dependence relationship between the feature vectors, predict the usage trends of the resource usage data for a period of time in the future.
[0029] As a preferred technical solution, generating a resource allocation strategy based on the predicted resource demand and the preset resource allocation target includes:
[0030] Based on the usage trends of the resource usage data for a period of time in the future and the preset resource allocation target, generate a resource allocation strategy that meets the target through a linear programming optimization algorithm;
[0031] Or optimize through a genetic algorithm based on the usage trends of the resource usage data for a period of time in the future and the preset resource allocation target, and generate a resource allocation strategy that meets the target.
[0032] In a second aspect, the present application provides an application resource dynamic balance allocation system applied to the application resource dynamic balance allocation method described above, including a data acquisition module, a data analysis module, a prediction module, a generation allocation strategy module, and a dynamic adjustment module;
[0033] The data acquisition module is used to acquire the resource usage data of the CPU, memory, and network bandwidth;
[0034] The data analysis module is used to analyze the resource usage data and obtain the timing characteristics of the resource usage data;
[0035] The prediction module is used to input the timing characteristics of the resource usage data into a pre-established resource prediction model for demand prediction to obtain the predicted resource usage data requirements;
[0036] The generation allocation strategy module is used to generate a resource allocation strategy based on the predicted resource demand and the preset resource allocation target;
[0037] The dynamic adjustment module is used to dynamically adjust the resource allocation of the CPU, memory, and network bandwidth according to the resource allocation policy.
[0038] In a third aspect, the present application provides an electronic device, which includes:
[0039] At least one processor; and a memory communicatively connected to the at least one processor;
[0040] Wherein, the memory stores computer program instructions executable by the at least one processor, and the computer program instructions are executed by the at least one processor so that the at least one processor can execute the application resource dynamic balance allocation method described above.
[0041] In a fourth aspect, the present application provides a computer-readable storage medium storing a program, and when the program is executed by a processor, the application resource dynamic balance allocation method described above is implemented.
[0042] In summary, compared with the prior art, the effective effects brought by the technical solution provided by the present application at least include:
[0043] The present application proposes an application resource dynamic balance allocation method. By obtaining the resource usage data of the CPU, memory, and network bandwidth; analyzing the resource usage data and obtaining the temporal characteristics of each resource usage data; inputting the temporal characteristics of each resource usage data into a pre-established resource prediction model for demand prediction to obtain the predicted resource usage data demand; generating a resource allocation policy based on the predicted resource demand and the preset resource allocation target; and dynamically adjusting the resource allocation of the CPU, memory, and network bandwidth according to the resource allocation policy. The present application first obtains the resource usage data of the CPU, memory, and network bandwidth in real time, and then the resource prediction model can predict the resource demand trend in the future period of time. According to the resource demand trend and the preset resource allocation target, a reasonable resource allocation policy is generated, avoiding the uneven resource allocation and resource waste caused by the fixed resource allocation under the static allocation policy, and improving the overall utilization rate of resources; finally, dynamically adjusting the allocation of resources such as the CPU, memory, and network bandwidth according to the resource allocation policy, ensuring that the game can obtain sufficient resource support during peak periods, realizing the balanced allocation of resources, and avoiding the lag phenomenon caused by resource bottlenecks. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the following drawings are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0045] Figure 1 Flow chart of a method for dynamically balancing and allocating application resources provided by an embodiment of the present application;
[0046] Figure 2 Flow chart for analyzing resource usage data provided by an embodiment of the present application;
[0047] Figure 3 Flow chart for generating a multi-dimensional feature vector of time segments provided by an embodiment of the present application;
[0048] Figure 4 Flow chart for obtaining predicted resource usage data requirements provided by an embodiment of the present application;
[0049] Figure 5 Flow chart for generating a resource allocation strategy provided by an embodiment of the present application;
[0050] Figure 6 Block diagram of an application resource dynamic balance allocation system provided by an embodiment of the present application;
[0051] Figure 7 Structural diagram of an electronic device provided by an embodiment of the present application. Detailed implementation manners
[0052] In order to enable those skilled in the art of the present technology to better understand the solutions of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative efforts fall within the scope of protection of the present application.
[0053] Referring to "embodiment" in the present application means that the specific features, structures or characteristics described in connection with the embodiment may be included in at least one embodiment of the present application. The phrase appears in various positions in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment mutually exclusive with other embodiments. Those skilled in the art explicitly and implicitly understand that the embodiments described in the present application may be combined with other embodiments.
[0054] In the game industry, the effective application of resource management technology is crucial for ensuring the smooth operation of game clients and enhancing user experience. However, most traditional resource management strategies rely on static allocation methods, that is, fixed resource shares are preset for each game process or application. This static allocation method may be able to meet the basic operation requirements in scenarios where resource demands are relatively stable, but it faces many challenges in the modern game environment. With the continuous enrichment of game content, the increasing frequency of user interactions, and the growing demand for multiple applications to run simultaneously, the static allocation strategy seems inadequate. Its main drawback is the inability to dynamically adjust according to the real-time changes in resource usage, resulting in uneven resource allocation, serious resource waste, and even resource bottlenecks during peak game hours, severely affecting the smoothness of the game and user experience.
[0055] To address the above problems, this application proposes an application resource dynamic balance allocation method. This method obtains the usage data of resources such as CPU, memory, and network bandwidth in real time, and uses a resource prediction model to accurately predict the resource demands in the next period of time. Based on these prediction results and preset resource allocation goals, it can generate reasonable resource allocation strategies and dynamically adjust the resource allocation of CPU, memory, and network bandwidth accordingly, ensuring that the game can obtain sufficient resource support during peak hours, achieving balanced resource allocation, thus effectively avoiding the problems caused by resource bottlenecks under the static allocation strategy, and further improving the smoothness and response speed of the game, and then enhancing the user experience.
[0056] The following will, in conjunction with the accompanying drawings, elaborate in detail on the technical solutions provided by the embodiments in this application.
[0057] Please refer to Figure 1 , in an embodiment of this application, an application resource dynamic balance allocation method is provided, including:
[0058] S1. Obtain the resource usage data of CPU, memory, and network bandwidth.
[0059] Furthermore, this application monitors the resource usage of the game client through Prometheus, that is, the resource usage data of CPU, memory, and network bandwidth, regularly collects the metric data of these resources, and stores them in a time series database. Then, through Grafana, the resource usage data of CPU, memory, and network bandwidth is visually displayed.
[0060] Prometheus is an open-source system monitoring toolkit, which is used in this application to monitor the resource usage of the client; Grafana is an open-source data visualization and monitoring platform.
[0061] Furthermore, after obtaining the resource usage data of CPU, memory and network bandwidth, the resource usage data is also preprocessed; wherein, the preprocessing of resource usage data includes data cleaning, denoising and missing value processing of resource usage data. Specifically, since the data may be affected by various factors during the collection process, such as equipment failure, network fluctuation, etc., which may lead to problems such as outliers, duplicate values or inconsistent formats in the data, data cleaning is to correct these problems to ensure the accuracy and consistency of the data. For example, for CPU usage data, it is necessary to remove abnormally high or abnormally low data points caused by equipment failure. In resource usage data, noise refers to data fluctuations that are irrelevant to resource usage or affect analysis. Noise may come from small fluctuations in the device itself, errors in data collection, etc. Through denoising, data fluctuations can be smoothed so that the data can more truly reflect resource usage. Due to various reasons, such as equipment failure, abnormal data collection program, etc., missing values may appear in resource usage data. If the missing values are not processed, it will affect the subsequent analysis. Therefore, it is necessary to select appropriate missing value processing methods according to the actual situation, such as interpolation and mean filling, to ensure the integrity and continuity of the data. Preprocessing resource usage data can ensure the accuracy, consistency and integrity of the data, and provide a reliable data basis for subsequent analysis.
[0062] S2. Analyze the resource usage data and obtain the time series characteristics of each resource usage data.
[0063] S21. Analyze resource usage data. Figure 2 The analysis includes:
[0064] S21.1. Analyze the CPU usage, CPU load and CPU temperature in each preset time period.
[0065] The CPU usage refers to the percentage of CPU usage in a certain period of time. For example, if the CPU usage in a certain period of time is very high, it means that the system is executing a large number of computing tasks in this period of time.
[0066] CPU load refers to the number of tasks or queue length that the CPU is processing.
[0067] Furthermore, by analyzing the CPU usage, CPU load and CPU temperature in each preset time period through time series, we can have a deeper understanding of the fluctuation trend, peak value and usage pattern of CPU load in different time periods; among which, the usage pattern refers to the usage of CPU resources in different time periods. For example, if the CPU usage in a certain time period is very low, it indicates that the system is idle in this time period.
[0068] S21.2. Analyze the total memory usage, memory occupancy of each process or application, and memory leakage within each preset time period.
[0069] Furthermore, by using time series analysis to analyze the total memory usage, memory occupancy of each process or application, and memory leakage within each preset time period, the change in memory requirements can be predicted and applications with abnormal growth or continuous high occupancy of memory usage can be identified.
[0070] Among them, memory leakage refers to the situation where the program fails to correctly release the allocated memory during operation, resulting in a continuous increase in memory usage. By analyzing memory leakage, potential memory management problems can be discovered and repaired in a timely manner.
[0071] S21.3. Analyze the usage of uplink bandwidth and downlink bandwidth, network latency, and packet loss rate within each preset time period.
[0072] Among them, uplink bandwidth refers to the rate of sending data from the local network to an external network (such as the Internet), while downlink bandwidth is the rate of receiving data from the external network. Monitoring the usage of uplink bandwidth and downlink bandwidth helps to understand the flow direction and size of network traffic, as well as whether there is overuse or insufficiency.
[0073] Network latency refers to the time required for a data packet to travel from the sender to the receiver; packet loss rate refers to the proportion of data packets lost during network transmission.
[0074] Furthermore, by using time series analysis method and frequency domain analysis method to analyze the usage of uplink and downlink bandwidth, network latency, and packet loss rate within each preset time period, the peak period and bottleneck of network traffic can be detected to evaluate the allocation efficiency of network resources. Time series analysis can reveal the peak period and trough period of network traffic, as well as potential bottleneck problems; in network bandwidth, frequency domain analysis can be used to identify the periodic components and non-periodic components of network traffic. By analyzing the spectrum (i.e., the relationship between frequency and amplitude), the volatility and stability of network traffic can be understood, as well as whether there are abnormal frequency components (such as interference caused by specific events or devices); finally, by combining the results of time series analysis and frequency domain analysis, the allocation efficiency of network resources can be evaluated.
[0075] S22. It also includes: after analyzing the resource usage data, obtaining the time series characteristics of each resource usage data, and integrating the time series characteristics of each resource usage data to obtain a multi-dimensional feature vector of the time segment. Please refer to Figure 3 , and its steps include:
[0076] S22.1. Calculate the average value, maximum value, minimum value, and standard deviation of the CPU usage rate, load condition, and temperature within a preset time period as the memory time series characteristics;
[0077] Furthermore, based on the average value, maximum value, minimum value, and standard deviation of the CPU usage rate, load condition, and temperature within a preset time period, the fluctuation trend, peak value, and usage patterns in different time periods of the CPU load can be obtained.
[0078] S22.2: Calculate the average value, maximum value, minimum value, and standard deviation of the total memory usage, memory occupancy of each process or application, and memory leak detection metrics within a preset time period as memory time series characteristics.
[0079] Furthermore, by calculating the average value, maximum value, minimum value, and standard deviation of the total memory usage and memory occupancy of each process or application within a preset time period, as well as the memory leak detection metrics, applications with abnormal growth or continuous high occupancy of memory usage in each preset time period can be obtained.
[0080] S22.3: Calculate the average value, maximum value, minimum value, and standard deviation of the usage of uplink and downlink bandwidth, network latency, and packet loss rate within a preset time period as network bandwidth time series characteristics.
[0081] Furthermore, by calculating the average value, maximum value, minimum value, and standard deviation of the usage of uplink and downlink bandwidth, network latency, and packet loss rate within a preset time period, the allocation efficiency of network resources within the preset time period can be evaluated.
[0082] S22.4: Integrate the CPU time series characteristics, the memory time series characteristics, and the network bandwidth time series characteristics into a multi-dimensional time series feature vector according to the time series.
[0083] Among them, each feature vector contains the time series characteristics of all resource usage data within a preset time period.
[0084] The preset time period can be 1 minute, 5 minutes, 15 minutes, etc.
[0085] S3: Input the time series characteristics of the respective resource usage data into a pre-established resource prediction model for demand prediction to obtain the predicted resource usage data requirements.
[0086] Furthermore, the resource prediction model of the present application uses a long short-term memory network (LSTM), which can capture the time dependence and long-term trend of resource usage data.
[0087] Please refer to Figure 4 , input the time series characteristics of the respective resource usage data into a pre-established resource prediction model for demand prediction to obtain the predicted resource usage data requirements, and its steps include:
[0088] S31. Use the multi-dimensional time series feature vector as the input of the resource prediction model.
[0089] Further, the input layer of the long short-term memory network receives the multi-dimensional time series feature vector and transmits the multi-dimensional time series feature vector to the hidden layer.
[0090] S32. The resource prediction model analyzes the multi-dimensional time series feature vector to obtain the time series dependence relationship between the feature vectors.
[0091] Further, the hidden layer analyzes the multi-dimensional time series feature vector through the internal memory unit and forget gate mechanism to obtain the time series dependence relationship between the feature vectors; wherein, the hidden layer includes multiple LSTM units.
[0092] In the hidden layer, each LSTM unit gradually analyzes the input feature vector and updates its internal state according to the memory unit and forget gate mechanism. As the analysis goes deeper, the LSTM network can gradually capture the time series dependence relationship between the feature vectors.
[0093] S33. According to the time series dependence relationship between the feature vectors, predict the usage trends of each resource usage data within a future period of time.
[0094] Further, in the output layer of the LSTM network, the resource usage data within a future period of time will be predicted according to the time series dependence relationship captured in the hidden layer to reflect the future change trend of the resource usage data.
[0095] S4. Generate a resource allocation strategy based on the predicted resource requirements and the preset resource allocation target.
[0096] Further, please refer to Figure 5 , generating a resource allocation strategy based on the predicted resource requirements and the preset resource allocation target, the steps include:
[0097] S41. Based on the usage trends of each resource usage data within the future period of time and the preset resource allocation target, generate a resource allocation strategy that meets the target through a linear programming optimization algorithm.
[0098] Furthermore, pre-define the goals of resource allocation, such as maximizing resource utilization and minimizing resource waste, and transform the goals into a mathematical expression, namely the objective function; the objective function is a linear function of decision variables. Determine the decision variables according to the usage trends of various resource usage data over a future period of time; where the decision variables represent the allocation amounts of various resources in different time periods or tasks. Secondly, determine all the constraint conditions affecting resource allocation, such as the total resource limit, the resource requirements of tasks, etc.; finally, according to the objective function, constraint conditions, and decision variables, use the linear programming solution algorithm to solve, and obtain the values of the decision variables that satisfy the constraint conditions and optimize the objective function (maximize or minimize), that is, the optimal resource allocation strategy.
[0099] S42. Or, based on the usage trends of various resource usage data over the future period of time and the preset resource allocation goals, optimize through a genetic algorithm to generate a resource allocation strategy that satisfies the objective function.
[0100] The genetic algorithm (GA) is an optimization algorithm based on the principles of natural selection and genetics, used to find the optimal solution or approximate optimal solution to a problem. In the resource allocation problem of this application, the genetic algorithm can continuously optimize the resource allocation strategy by simulating natural selection and genetic mechanisms, making it gradually approach the preset resource allocation goal.
[0101] This application generates a resource allocation strategy based on the predicted resource requirements and the preset resource allocation goals. For example, if it is predicted that the CPU usage rate will increase by 20% within the next 5 minutes, the memory requirement will increase by 15%, and the network bandwidth requirement will increase by 10%, then according to this prediction and the preset resource allocation goals, obtain an allocation strategy, such as pre-allocating additional CPU resources, increasing memory allocation, and adjusting network bandwidth allocation to cope with the upcoming high load.
[0102] S5. Dynamically adjust the resource allocation of the CPU, memory, and network bandwidth according to the resource allocation strategy.
[0103] In summary, by using the resource prediction model to accurately predict the resource requirements over a future period of time, based on these prediction results and the preset resource allocation goals, a reasonable resource allocation strategy can be generated, and accordingly, the resource allocation of the CPU, memory, and network bandwidth can be dynamically adjusted, ensuring that the game can obtain sufficient resource support during peak hours, achieving balanced resource allocation, thus effectively avoiding the problems caused by resource bottlenecks under the static allocation strategy, such as the lag phenomenon caused by fixed resource allocation, and further improving the fluency and response speed of the game, and then enhancing the user experience.
[0104] It should be noted that for the foregoing method embodiments, for the sake of simplicity of description, they are all expressed as a series of action combinations. However, those skilled in the art should be aware that this application is not limited by the described action sequence, because according to this application, certain steps can be performed in other sequences or simultaneously.
[0105] Based on the same idea as the application resource dynamic balance allocation method in the above embodiment, this application also provides an application resource dynamic balance allocation system, which can be used to execute the above application resource dynamic balance allocation method. For the sake of convenience of description, in the structural schematic diagram of an embodiment of the application resource dynamic balance allocation system, only the parts related to the embodiments of this application are shown. Those skilled in the art can understand that the illustrated structure does not constitute a limitation on the system, and it may include more or fewer components than those shown, or combine certain components, or have different component arrangements.
[0106] Please refer to Figure 6 , in another embodiment of this application, an application resource dynamic balance allocation system is provided. The system includes a data acquisition module 101, a data analysis module 102, a prediction module 103, a generation of allocation strategy module 104, and a dynamic adjustment module 105;
[0107] The data acquisition module 101 is used to acquire the resource usage data of the CPU, memory, and network bandwidth;
[0108] The data analysis module 102 is used to analyze the resource usage data and obtain the temporal characteristics of each resource usage data;
[0109] The prediction module 103 is used to input the temporal characteristics of each resource usage data into a pre-established resource prediction model for demand prediction to obtain the predicted resource usage data demand;
[0110] The generation of allocation strategy module 104 is used to generate a resource allocation strategy based on the predicted resource demand and the preset resource allocation target;
[0111] The dynamic adjustment module 105 is used to dynamically adjust the resource allocation of the CPU, memory, and network bandwidth according to the resource allocation strategy.
[0112] Preferably, it further includes a preprocessing module. The preprocessing module is used to, after acquiring the resource usage data of the CPU, memory, and network bandwidth, further preprocess the resource usage data; the preprocessing of the resource usage data includes data cleaning, denoising, and missing value processing of the resource usage data.
[0113] Preferably, the data analysis module 102 is specifically used for:
[0114] Analyze the CPU usage rate, CPU load, and CPU temperature within each preset time period;
[0115] Analyze the total memory usage, memory occupation of each process or application, and memory leakage situation within each preset time period;
[0116] Analyze the usage of the uplink bandwidth and downlink bandwidth, network latency, and packet loss rate within each preset time period.
[0117] Preferably, it further includes an integration feature module, and the integration feature module is used for:
[0118] Calculate the average value, maximum value, minimum value, and standard deviation of the CPU usage rate, load, and temperature within the preset time period respectively, as the CPU time series features;
[0119] Calculate the average value, maximum value, minimum value, and standard deviation of the detection indexes of the total memory usage, memory occupation of each process or application, and memory leakage within the preset time period respectively, as the memory time series features;
[0120] Calculate the average value, maximum value, minimum value, and standard deviation of the usage of the uplink and downlink bandwidth, network latency, and packet loss rate within the preset time period respectively, as the network bandwidth time series features;
[0121] Integrate the CPU time series features, the memory time series features, and the network bandwidth time series features into a multi-dimensional time series feature vector according to the time series.
[0122] Preferably, the prediction module 103 is specifically used for:
[0123] Use the multi-dimensional time series feature vector as the input of the resource prediction model;
[0124] The resource prediction model analyzes the multi-dimensional time series feature vector to obtain the time series dependence relationship between the feature vectors;
[0125] Predict the usage trend of each resource usage data in the future period of time according to the time series dependence relationship between the feature vectors.
[0126] Preferably, the generation and allocation strategy module 104 is specifically used for:
[0127] Based on the usage trend of each resource usage data in the future period of time and the preset resource allocation target, generate a resource allocation strategy that meets the target through a linear programming optimization algorithm;
[0128] Or, based on the usage trends of the resource usage data within the future period of time and the preset resource allocation target, it is optimized through a genetic algorithm to generate a resource allocation strategy that meets the target.
[0129] It should be noted that an application resource dynamic balance allocation system of the present application corresponds one-to-one with an application resource dynamic balance allocation method of the present application. The technical features and beneficial effects described in the embodiments of the above application resource dynamic balance allocation method are all applicable to the embodiments of an application resource dynamic balance allocation system. For specific content, reference can be made to the description in the method embodiments of the present application, which will not be repeated here. This is hereby declared.
[0130] In addition, in the implementation manner of the application resource dynamic balance allocation system in the above embodiments, the logical division of each program module is only an example. In actual applications, according to needs, for example, considering the configuration requirements of the corresponding hardware or the convenience of software implementation, the above functions can be allocated to different program modules, that is, the internal structure of the application resource dynamic balance allocation system is divided into different program modules to complete all or part of the functions described above.
[0131] Please refer to Figure 7 , in another embodiment, an electronic device for implementing an application resource dynamic balance allocation method is provided, including a processor, a memory, and a bus, and may further include a computer program stored in the memory and executable on the processor.
[0132] Exemplarily, in this embodiment, the computer program may be divided into one or more modules. The one or more modules are stored in the memory and executed by the processor to complete the present application. The one or more module elements may be a series of computer program instruction segments capable of performing specific functions, and these instruction segments are used to describe the execution process of the computer program in the device.
[0133] The electronic device may be a computing device such as a desktop computer, a notebook, a palm computer, and a cloud server. The device may include, but is not limited to, a processor and a memory.
[0134] In some embodiments, the processor may be composed of an integrated circuit. For example, it may be composed of a single packaged integrated circuit, or it may be composed of multiple packaged integrated circuits with the same or different functions, including one or more central processing units (CPUs). It may also be other general-purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor, etc. The processor is the control center of the device, connecting various components of the entire device through various interfaces and circuits; by running or executing programs or modules stored in the memory, and calling data stored in the memory, it performs various functions of the electronic device and processes data.
[0135] The memory can be used to store the computer programs and / or modules. The processor realizes various functions of the device by running or executing the computer programs and / or modules stored in the memory, and calling the data stored in the memory. The memory mainly includes a program storage area and a data storage area. Among them, the program storage area can store an operating system, application programs required for at least one function, etc. In addition, the memory can include high-speed random access memory, and can also include non-volatile memory, such as a hard disk, memory, plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, at least one magnetic disk storage device, flash device, or other volatile solid-state storage devices.
[0136] Among them, in some embodiments, the memory may be an internal storage unit of the electronic device, such as the mobile hard disk of the electronic device. In some other embodiments, the memory may also be an external storage device of the electronic device, such as a plug-in mobile hard disk, a Smart Media Card (SMC), a Secure Digital (SD) card, a Flash Card, etc. equipped on the electronic device. Further, the memory may also include both the internal storage unit and the external storage device of the electronic device. The memory can be used not only to store application software installed in the electronic device and various types of data, such as the code of the application resource dynamic balancing allocation program, but also to temporarily store data that has been output or will be output.
[0137] Figure 7 Only the electronic device with components is shown. Those skilled in the art can understand that Figure 7 The shown structure does not constitute a limitation on the electronic device, and it may include fewer or more components than shown, or combine certain components, or have different component arrangements.
[0138] An application resource dynamic balancing allocation program stored in the memory of the electronic device is a combination of multiple instructions. When running in the processor, it can achieve:
[0139] Obtain the resource usage data of the CPU, memory, and network bandwidth;
[0140] Analyze the resource usage data and obtain the timing characteristics of each resource usage data;
[0141] Input the timing characteristics of each resource usage data into a pre-established resource prediction model for demand prediction to obtain the predicted resource usage data demand;
[0142] Generate a resource allocation strategy based on the predicted resource demand and the preset resource allocation target;
[0143] Dynamically adjust the resource allocation of the CPU, memory, and network bandwidth according to the resource allocation strategy.
[0144] Correspondingly, the present application also provides a computer-readable storage medium. The computer-readable storage medium includes a stored computer program. Among them, when the computer program runs, it controls the device where the computer-readable storage medium is located to execute an application resource dynamic balancing allocation method described in any one of the above embodiments.
[0145] The computer program includes computer program code, which may be in the form of source code, object code, executable files, or some intermediate forms, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording media, USB flash drives, mobile hard disks, magnetic disks, optical disks, computer memories, read-only memories (ROMs), random access memories (RAMs), flash memories, mobile hard disks, multimedia cards, card-type memories (such as SD or DX memories, etc.), magnetic memories, magnetic disks, optical disks, and so on.
[0146] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The program can be stored in a non-volatile computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above methods. Among them, any reference to a memory, storage, database, or other medium used in the various embodiments provided in this application can include non-volatile and / or volatile memories. Non-volatile memories can include read-only memories (ROMs), programmable ROMs (PROMs), electrically programmable ROMs (EPROMs), electrically erasable programmable ROMs (EEPROMs), or flash memories. Volatile memories can include random access memories (RAMs) or external cache memories. By way of illustration and not limitation, RAMs are available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and Rambus dynamic RAM (RDRAM), etc.
[0147] The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity of description, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered as the scope recorded in this specification.
[0148] The above embodiments are the preferred embodiments of this application, but the embodiments of this application are not limited to the above embodiments. Any other changes, modifications, substitutions, combinations, and simplifications made without departing from the spirit and principle of this application should be equivalent replacement methods and are all included in the protection scope of this application.
Claims
1. A method for dynamically balancing and allocating application resources, characterized in that Including the following steps: Obtain the resource usage data of CPU, memory, and network bandwidth; Analyze the resource usage data and obtain the temporal characteristics of each resource usage data; Input the temporal characteristics of each resource usage data into a pre-established resource prediction model for demand prediction to obtain the predicted resource usage data demand; Generate a resource allocation strategy based on the predicted resource demand and a preset resource allocation target; Dynamically adjust the resource allocation of CPU, memory, and network bandwidth according to the resource allocation strategy.
2. The method for dynamically balancing and allocating application resources according to claim 1, wherein, After obtaining the resource usage data of CPU, memory, and network bandwidth, it also includes preprocessing the resource usage data; The preprocessing of the resource usage data includes data cleaning, denoising, and missing value processing of the resource usage data.
3. The method for dynamically balancing and allocating application resources according to claim 1, wherein The analysis of the resource usage data includes: Analyze the CPU usage rate, CPU load, and CPU temperature within each preset time period; Analyze the total memory usage, memory occupancy of each process or application, and memory leakage within each preset time period; Analyze the usage of upstream and downstream bandwidth, network latency, and packet loss rate within each preset time period.
4. The method for dynamically balancing and allocating application resources according to claim 3, wherein It also includes: Based on the analysis of the resource usage data, obtain the temporal characteristics of each resource usage data, and integrate the temporal characteristics of each resource usage data to obtain a multi-dimensional feature vector of a time segment.
5. The dynamic balance allocation method of application resources according to claim 4, wherein, The obtaining of the temporal characteristics of each resource usage data and the integration of the temporal characteristics of each resource usage data to obtain a multi-dimensional feature vector of a time segment includes: Calculate the average value, maximum value, minimum value, and standard deviation of the CPU usage rate, load, and temperature within a preset time period respectively as the CPU temporal characteristics; Calculate the average value, maximum value, minimum value, and standard deviation of the total memory usage, memory occupancy of each process or application, and the detection index of memory leakage within a preset time period respectively as the memory temporal characteristics; Calculate the average value, maximum value, minimum value, and standard deviation of the usage of upstream and downstream bandwidth, network latency, and packet loss rate within a preset time period respectively as the network bandwidth temporal characteristics; Integrate the CPU temporal characteristics, the memory temporal characteristics, and the network bandwidth temporal characteristics into a multi-dimensional temporal feature vector according to the time series.
6. The dynamic balance allocation method of application resources according to claim 5, characterized in that, The inputting of the temporal characteristics of each resource usage data into a pre-established resource prediction model for demand prediction to obtain the predicted resource usage data demand includes: Use the multi-dimensional temporal feature vector as the input of the resource prediction model; The resource prediction model analyzes the multi-dimensional temporal feature vector to obtain the temporal dependence relationship between each feature vector; According to the temporal dependence relationship between each feature vector, predict the usage trend of each resource usage data in the future for a period of time.
7. The method for dynamically balancing and allocating application resources according to claim 6, wherein, The generating of a resource allocation strategy based on the predicted resource demand and a preset resource allocation target includes: Based on the usage trend of each resource usage data in the future for a period of time and a preset resource allocation target, generate a resource allocation strategy that meets the target through a linear programming optimization algorithm; Or, based on the usage trends of the resource usage data within the future period of time and the preset resource allocation goals, it is optimized through a genetic algorithm to generate a resource allocation strategy that meets the goals.
8. A dynamic balance allocation system for application resources, characterized in that It includes a data acquisition module, a data analysis module, a prediction module, a generation of allocation strategy module, and a dynamic adjustment module; The data acquisition module is used to acquire the resource usage data of the CPU, memory, and network bandwidth; The data analysis module is used to analyze the resource usage data and obtain the temporal characteristics of each resource usage data; The prediction module is used to input the temporal characteristics of the resource usage data into a pre-established resource prediction model for demand prediction to obtain the predicted resource usage data requirements; The generation of allocation strategy module is used to generate a resource allocation strategy based on the predicted resource requirements and the preset resource allocation goals; The dynamic adjustment module is used to dynamically adjust the resource allocation of the CPU, memory, and network bandwidth according to the resource allocation strategy.
9. An electronic device, characterized in that, The electronic device includes: At least one processor; and a memory communicatively connected to the at least one processor; Wherein, the memory stores computer program instructions executable by the at least one processor, and the computer program instructions are executed by the at least one processor so that the at least one processor can execute the application resource dynamic balance allocation method according to any one of claims 1-7.
10. A computer-readable storage medium stores a program, characterized in that, When the program is executed by the processor, it implements the application resource dynamic balance allocation method according to any one of claims 1-7.