Memory management method and device, computer equipment and storage medium

By generating memory usage data prediction models and dynamically adjusting memory resources based on load information, the resource waste and insufficient caused by static allocation in traditional BMC memory management is solved, and memory usage efficiency and system stability are improved.

CN119576545APending Publication Date: 2025-03-07INSPUR SUZHOU INTELLIGENT TECH CO LTD

Patent Information

Application Number
CN202411629105.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-14
Publication Date
2025-03-07

AI Technical Summary

Technical Problem

Traditional BMC memory management adopts static allocation method and cannot be dynamically adjusted according to actual application needs, resulting in wasted or insufficient memory resources and reducing system performance.

Method used

By obtaining the historical memory usage data of the substrate management controller, a memory usage data prediction model is generated, memory resource preallocates, and dynamically adjust the preallocated memory resources according to the load information.

Benefits of technology

It realizes dynamic adjustment of memory resources according to actual needs, avoids resource waste and insufficient problems caused by static allocation, and improves memory usage efficiency and system operation stability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119576545A_ABST
    Figure CN119576545A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of computers, and discloses a memory management method and device, computer equipment and a storage medium, which are applied to a baseboard management controller, the method comprises the following steps: acquiring historical memory use data of the baseboard management controller; generating a memory usage data prediction model based on the historical memory usage data; in each preset period, inputting the memory usage data of the previous preset period of the substrate management controller into the memory usage data prediction model, and obtaining a predicted value of the memory usage data of the current preset period; based on the predicted value of the memory usage data, pre-allocating memory resources; acquiring load information of the substrate management controller; and adjusting the pre-allocated memory resources based on the load information. According to the load information of the substrate management controller, the memory resources are dynamically allocated, and the use efficiency of the memory resources is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a memory management method, device, computer equipment and storage medium. Background Art

[0002] In traditional BMC (Baseboard Management Controller) memory management, the allocation method of memory resources has an important impact on system performance and resource utilization.

[0003] In the related art, BMC memory management usually adopts a static allocation method. Specifically, when the system starts, the required memory resources are allocated at one time according to the preset configuration.

[0004] However, this static allocation method cannot be dynamically adjusted according to actual application needs, resulting in resource waste when the BMC memory demand is lower than the allocated amount, and insufficient resources when the BMC memory demand is higher than the allocated amount, thereby reducing the performance of the BMC. Summary of the invention

[0005] In view of this, the present invention provides a memory management method, apparatus, computer equipment and storage medium to solve the problem that the static allocation of memory resources in the related art cannot be dynamically adjusted according to actual application needs, resulting in resource waste when the memory demand of the BMC is lower than the allocated amount, and insufficient resources when the memory demand of the BMC is higher than the allocated amount, thereby reducing the performance of the BMC.

[0006] In a first aspect, the present invention provides a memory management method, applied to a baseboard management controller, the method comprising:

[0007] Get historical memory usage data of the baseboard management controller;

[0008] Based on the historical memory usage data, generate a memory usage data prediction model;

[0009] In each preset cycle, the memory usage data of the baseboard management controller in the previous preset cycle is input into the memory usage data prediction model to obtain the predicted value of the memory usage data in the current preset cycle;

[0010] Pre-allocating memory resources based on the predicted value of the memory usage data;

[0011] Obtaining load information of the baseboard management controller;

[0012] Based on the load information, pre-allocated memory resources are adjusted.

[0013] The memory management method provided in this embodiment generates a memory usage data prediction model based on historical memory usage data, inputs the memory usage data of the previous preset cycle of the baseboard management controller into the memory usage data prediction model in each preset cycle, obtains the predicted value of the memory usage data of the current preset cycle, pre-allocates memory resources based on the predicted value of the memory usage data, obtains the load information of the baseboard management controller, and adjusts the pre-allocated memory resources based on the load information. When pre-allocating memory resources according to the predicted value, the pre-allocated memory resources are dynamically adjusted in real time according to the load information of the baseboard management controller, so that the system can quickly adapt to different memory resource requirements, avoids the problem of resource waste and resource shortage caused by static allocation, improves memory usage efficiency and system operation stability, and also improves the flexibility of the system.

[0014] In an optional implementation, generating a memory usage data prediction model based on the historical memory usage data includes:

[0015] Dividing the historical memory usage data according to the sequence of preset periods to obtain memory usage data of multiple periods;

[0016] Based on the memory usage data of multiple cycles, the memory usage data of one cycle is used as input and the memory usage data of the next cycle of the cycle is used as a label to perform model training to obtain the memory usage data prediction model.

[0017] The memory management method provided in this embodiment utilizes historical memory usage data to generate a memory usage data prediction model, and then utilizes the memory usage data prediction model to predict future memory usage and pre-allocate memory resources, thereby avoiding resource waste and resource shortage problems caused by static allocation and achieving reasonable allocation and management of memory resources.

[0018] In an optional implementation, obtaining the memory usage data prediction model includes:

[0019] In the process of model training, model training parameters are obtained, where the model training parameters include a coefficient of determination of the model and a mean square error between a predicted value of memory usage data output by the model and an actual value of the memory usage data;

[0020] When the determination coefficient is greater than a preset determination coefficient threshold and the mean square error is less than a preset mean square error threshold, the model training is stopped to obtain the memory usage data prediction model.

[0021] The memory management method provided in this embodiment obtains a memory usage data prediction model by monitoring the determination coefficient and mean square error during the model training process and stopping the training when these two indicators meet the corresponding conditions, thereby improving the accuracy and reliability of the memory usage data prediction model.

[0022] In an optional implementation manner, the load information includes request type, request rate, average response time, CPU usage, and memory usage, and adjusting the pre-allocated memory resources based on the load information includes:

[0023] In the case where the request type is a web page request, determining whether the request rate exceeds a first request rate threshold, whether the average response time exceeds a first response time threshold, whether the CPU usage exceeds a first CPU usage threshold, and whether the memory usage exceeds a first memory usage threshold;

[0024] When the request rate exceeds a first request rate threshold, and the average response time exceeds a first response time threshold, and the CPU usage exceeds a first CPU usage threshold, and the memory usage exceeds a first memory usage threshold, determining a first memory resource to be added, and performing memory resource allocation according to the sum of the pre-allocated memory resources and the first memory resource to be added;

[0025] When the request rate does not exceed a first request rate threshold, the average response time does not exceed a first response time threshold, the CPU usage does not exceed a first CPU usage threshold, and the memory usage does not exceed a first memory usage threshold, memory resources are allocated according to the pre-allocated memory resources;

[0026] In the case where the request type is a database transaction, if the request rate exceeds a second request rate threshold, and the average response time exceeds a second response time threshold, and the CPU usage exceeds a second CPU usage threshold, and the memory usage exceeds a second memory usage threshold, then determining a second memory resource to be added, and performing memory resource allocation according to the sum of the pre-allocated memory resources and the second memory resource to be added;

[0027] The second memory resource to be increased is greater than the first memory resource to be increased.

[0028] The memory management method provided in this embodiment manages the load information of the baseboard controller, including the request type, request rate, average response time, CPU usage and memory usage. Under different request types, if the request rate, average response time, CPU usage and memory usage exceed the corresponding thresholds, the actual memory demand is met by increasing memory resources on the basis of pre-allocated memory resources, thereby improving system stability and reliability.

[0029] In an optional embodiment, the method further includes:

[0030] Obtaining the working status of the baseboard management controller;

[0031] When the working state is an idle state, performing comprehensive memory defragmentation;

[0032] When the working state is a normal operating state, reclaiming memory blocks that are no longer in use;

[0033] When the working state is that the load of the baseboard management controller exceeds a load threshold, the arrangement of memory fragments and the recycling of memory blocks are suspended.

[0034] The memory management method provided in this embodiment can effectively reduce memory fragmentation, optimize memory layout, and improve system performance by performing comprehensive memory defragmentation when the BMC is in an idle state.

[0035] When the BMC is in normal operation, the memory blocks that are no longer in use are recycled, so that the unused memory resources can be released in time, thereby avoiding memory waste and improving memory utilization.

[0036] When the BMC load exceeds the preset load threshold, memory defragmentation and memory block recycling operations are suspended to avoid further increasing the system burden and ensure the stable operation of key businesses and services.

[0037] In an optional embodiment, the method further includes:

[0038] monitoring a memory usage trend of the baseboard management controller;

[0039] When the memory usage trend shows an abnormal growth, determining that a memory leak occurs;

[0040] In the case of memory leakage, determining whether the memory leakage rate exceeds the memory leakage rate threshold;

[0041] When the memory leakage rate exceeds the memory leakage rate threshold, an alarm is issued.

[0042] The memory management method provided in this embodiment monitors the memory usage trend of the baseboard management controller, promptly identifies the abnormal growth of memory usage, determines that a memory leak has occurred, further determines whether the memory leakage rate exceeds the memory leakage rate threshold, and issues an alarm when the memory leakage rate threshold is exceeded, thereby reducing the impact of memory leakage on the system and improving system security.

[0043] In an optional implementation, when the memory leakage rate exceeds a memory leakage rate threshold, issuing an alarm includes:

[0044] When the memory leakage rate exceeds a first memory leakage rate threshold, determining that the degree of the memory leakage is a first degree, and issuing an alarm by logging;

[0045] When the memory leakage rate exceeds the second memory leakage rate threshold, determining that the degree of the memory leakage is the second degree, and issuing an alarm by means of instant messaging;

[0046] The second degree of memory leakage is more serious than the first degree of memory leakage, and the second memory leakage rate threshold is greater than the first memory leakage rate threshold.

[0047] The memory management method provided in this embodiment can classify the degree of memory leakage into different levels by setting a first memory leakage rate threshold and a second memory leakage rate threshold, and take corresponding alarm measures according to the severity of the memory leakage, so that operation and maintenance personnel can deal with the memory leakage in time, thereby improving the security and reliability of the system.

[0048] In a second aspect, the present invention provides a memory management device, the device comprising:

[0049] A first acquisition module is used to acquire historical memory usage data of a baseboard management controller;

[0050] A generation module, used to generate a memory usage data prediction model based on the historical memory usage data;

[0051] A second acquisition module is used to input the memory usage data of the previous preset cycle of the baseboard management controller into the memory usage data prediction model in each preset cycle to obtain the predicted value of the memory usage data of the current preset cycle;

[0052] An allocation module, configured to pre-allocate memory resources based on the predicted value of the memory usage data;

[0053] A third acquisition module, used to acquire load information of the baseboard management controller;

[0054] The adjustment module is used to adjust the pre-allocated memory resources based on the load information.

[0055] In a third aspect, the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the memory management method of the first aspect or any corresponding embodiment thereof by executing the computer instructions.

[0056] In a fourth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the memory management method of the first aspect or any corresponding embodiment thereof.

[0057] In a fifth aspect, the present invention provides a computer program product, comprising computer instructions for causing a computer to execute the memory management method of the first aspect or any corresponding embodiment thereof. BRIEF DESCRIPTION OF THE DRAWINGS

[0058] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the related technologies, the drawings required for use in the specific embodiments or the related technical descriptions will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0059] Figure 1 is a flowchart of a memory management method according to an embodiment of the present invention;

[0060] Figure 2 is a flowchart of another memory management method according to an embodiment of the present invention;

[0061] Figure 3 is a flowchart of another memory management method according to an embodiment of the present invention;

[0062] Figure 4 is a schematic diagram of a process of adjusting memory allocation according to current load according to an embodiment of the present invention;

[0063] Figure 5 is a structural block diagram of a memory management device according to an embodiment of the present invention;

[0064] Figure 6 It is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0065] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0066] In traditional BMC memory management, the way memory resources are allocated has a significant impact on system performance and resource utilization.

[0067] In the related art, BMC memory management usually adopts a static allocation method. Specifically, when the system starts, the required memory resources are allocated at one time according to a preset configuration.

[0068] However, this static allocation method lacks flexibility and cannot be dynamically adjusted according to actual application needs, resulting in resource waste when the BMC's memory demand is lower than the allocated amount, and insufficient resources when the BMC's memory demand is higher than the allocated amount, which reduces the performance of the BMC.

[0069] As the system runs, a large amount of memory fragmentation will be generated, which will affect the system's operating efficiency. In traditional BMC memory management, memory resource recycling relies on administrators to manually identify and release memory resources that are no longer in use. This manual memory resource recycling method is inefficient and prone to errors under high load or emergency conditions.

[0070] In order to solve the problem that the above-mentioned manual memory resource recycling method is inefficient and prone to errors, the relevant technology adopts an automatic recycling strategy based on the memory resource usage threshold, which automatically recycles and releases memory resources when the used memory resources exceed the memory resource usage threshold.

[0071] However, the memory resource usage threshold cannot be set precisely according to the memory resource demand, which may lead to frequent memory resource recycling and release, affecting system performance.

[0072] An embodiment of the present invention provides a memory management method, which obtains historical memory usage data of a baseboard management controller, generates a memory usage data prediction model based on the historical memory usage data, inputs the memory usage data of the baseboard management controller in the previous preset cycle into the memory usage data prediction model in each preset cycle, obtains a predicted value of the memory usage data of the current preset cycle, pre-allocates memory resources based on the predicted value of the memory usage data, obtains load information of the baseboard management controller, and adjusts the pre-allocated memory resources based on the load information to achieve real-time dynamic adjustment of the pre-allocated memory resources according to the load information of the baseboard management controller, so that the system can quickly use different memory resource requirements, thereby improving memory usage efficiency and system operation stability.

[0073] According to an embodiment of the present invention, a memory management method embodiment is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0074] In this embodiment, a memory management method is provided, which can be used for a baseboard management controller of a server, for example, in scenarios with high memory requirements such as big data processing and network communication. Figure 1 is a flowchart of a memory management method according to an embodiment of the present invention. Figure 1 As shown, the process includes the following steps:

[0075] Step S101, obtaining historical memory usage data of a baseboard management controller.

[0076] The BMC obtains the historical memory usage data from the baseboard management controller through the historical memory usage data acquisition function get_memory_usage_history().

[0077] It should be noted that the memory usage data is the memory usage rate, and the historical memory usage data can be the peak memory usage rate in different historical time periods.

[0078] For example, in this embodiment, the memory usage data of the BMC every hour in the past month is obtained. Some historical memory usage data is shown in Table 1.

[0079] Table 1

[0080] Timestamp Memory usage (%) XXXX-XX-XX-00:00 20 XXXX-XX-XX-01:00 19 XXXX-XX-XX 02:00 18 XXXX-XX-XX 03:00 17 XXXX-XX-XX 04:00 19 XXXX-XX-XX 05:00 18 XXXX-XX-XX 06:00 21 XXXX-XX-XX 07:00 25 XXXX-XX-XX 08:00 27 XXXX-XX-XX-09:00 25 XXXX-XX-XX 10:00 28 XXXX-XX-XX 11:00 31 XXXX-XX-XX 12:00 30 … …

[0081] Step S102: Generate a memory usage data prediction model based on historical memory usage data.

[0082] After obtaining the historical memory usage data, a memory usage data prediction model is generated using the historical memory usage data.

[0083] It should be noted that, since the linear regression model is relatively simple and suitable for continuous numerical prediction, this embodiment uses the linear regression model as a prediction tool to generate a memory usage data prediction model.

[0084] Step S103, in each preset period, inputting the memory usage data of the baseboard management controller in the previous preset period into the memory usage data prediction model to obtain the predicted value of the memory usage data in the current preset period.

[0085] Among them, a preset cycle can be one hour. In each hour, the memory usage data of the BMC in the previous hour is input into the generated memory usage data prediction model using the memory demand prediction function predict_memory_usage(history), and the memory usage data prediction model outputs the predicted value of the memory usage data of the hour.

[0086] Step S104: pre-allocate memory resources based on the predicted value of the memory usage data.

[0087] Among them, in each hour, the memory allocation function allocate_memory(predicted_memory) is used to pre-allocate corresponding memory resources for the BMC according to the predicted value of the memory usage data.

[0088] Step S105, obtaining load information of the baseboard management controller.

[0089] After the corresponding memory resources are pre-allocated for the BMC, the load information of the baseboard management controller is obtained in real time through the load acquisition function get_current_workload() within each hour.

[0090] Step S106: adjusting the pre-allocated memory resources based on the load information.

[0091] When the load information of the BMC is obtained in real time, the pre-allocated memory resources are adjusted in real time based on the obtained load information of the BMC.

[0092] The memory management method provided in this embodiment generates a memory usage data prediction model based on historical memory usage data, inputs the memory usage data of the previous preset cycle of the baseboard management controller into the memory usage data prediction model in each preset cycle, obtains the predicted value of the memory usage data of the current preset cycle, pre-allocates memory resources based on the predicted value of the memory usage data, obtains the load information of the baseboard management controller, and adjusts the pre-allocated memory resources based on the load information. When pre-allocating memory resources according to the predicted value, the pre-allocated memory resources are dynamically adjusted in real time according to the load information of the baseboard management controller, so that the system can quickly adapt to different memory resource requirements, avoids the problem of resource waste and resource shortage caused by static allocation, improves memory usage efficiency and system operation stability, and also improves the flexibility of the system.

[0093] In this embodiment, a memory management method is provided, which can be used in a baseboard management controller. Figure 2 is a flowchart of a memory management method according to an embodiment of the present invention. Figure 2 As shown, the process includes the following steps:

[0094] Step S201, obtain historical memory usage data of the baseboard management controller. For details, see Figure 1 Step S101 of the illustrated embodiment will not be described in detail here.

[0095] Step S202: Generate a memory usage data prediction model based on historical memory usage data.

[0096] Specifically, the above step S202 includes:

[0097] Step S2021, dividing the historical memory usage data according to the sequence of preset cycles to obtain memory usage data of multiple cycles.

[0098] As mentioned above, the historical memory usage data is divided according to the chronological order to obtain the memory usage data for each hour.

[0099] Step S2022, based on the memory usage data of multiple cycles, the memory usage data of one cycle is used as input and the memory usage data of the next cycle of the cycle is used as a label, and model training is performed to obtain a memory usage data prediction model.

[0100] After obtaining the memory usage data for each hour, the memory usage data for one hour is used as input and the memory usage data for the next hour of the hour is used as a label to train a linear regression model to obtain a memory usage data prediction model.

[0101] That is to say, one hour of memory usage data is used as a data point for model training, and the target variable is the memory usage data of the next hour of that hour.

[0102] Step S203: In each preset cycle, the memory usage data of the previous preset cycle of the baseboard management controller is input into the memory usage data prediction model to obtain the predicted value of the memory usage data of the current preset cycle. Figure 1 Step S103 of the illustrated embodiment will not be described in detail here.

[0103] Step S204: pre-allocate memory resources based on the predicted value of memory usage data. Figure 1 Step S104 of the illustrated embodiment will not be described in detail here.

[0104] Step S205, obtain the load information of the baseboard management controller. Figure 1 Step S105 of the illustrated embodiment will not be described in detail here.

[0105] Step S206: Based on the load information, adjust the pre-allocated memory resources. Figure 1 Step S106 of the illustrated embodiment will not be described in detail here.

[0106] The memory management method provided in this embodiment utilizes historical memory usage data to generate a memory usage data prediction model, and then utilizes the memory usage data prediction model to predict future memory usage and pre-allocate memory resources, thereby avoiding resource waste and resource shortage problems caused by static allocation and achieving reasonable allocation and management of memory resources.

[0107] In some optional implementations, the above step S2022 includes:

[0108] Step a1, during the model training process, obtain model training parameters, the model training parameters including the determination coefficient of the model and the mean square error between the predicted value of the memory usage data output by the model and the actual value of the memory usage data.

[0109] The model is trained using a training set, a validation set, and a test set. The test set can be the memory usage data for the last 7 days of historical memory usage data, and the test set is used to verify the prediction ability of the model.

[0110] When the model is evaluated using the test set, the model training parameters are obtained. The model training parameters include the coefficient of determination (R 2 ) and mean square error (MSE).

[0111] The mean square error is calculated by calculating the error between the predicted value of the memory usage data output by the model and the actual value of the memory usage data, squaring each error to obtain multiple square differences, and finding the average of the multiple square differences, i.e., the mean square error. For example, the error between the predicted value of the memory usage data output by the model, i.e., the predicted memory usage rate, and the actual value of the memory usage data, i.e., the actual memory usage rate, is shown in Table 2.

[0112] Table 2

[0113]

[0114]

[0115] Step a2: when the determination coefficient is greater than the preset determination coefficient threshold and the mean square error is less than the preset mean square error threshold, stop model training and obtain the memory usage data prediction model.

[0116] The preset determination coefficient threshold and the preset mean square error threshold are set by the technicians. Generally speaking, the closer the determination coefficient is to 1, the better the model can explain the variability in the data and the training can be stopped. If the mean square error is lower than the preset mean square error threshold, it can be considered that the prediction accuracy of the model is high enough and the training can be stopped. The preset mean square error threshold is often determined according to the specific application scenario and business needs. If the prediction of memory usage has a greater impact on system performance, a lower mean square error threshold is set.

[0117] In this embodiment, through simulation experiments on the test set, the model shows a high prediction accuracy, with a mean square error of 1.2 and a determination coefficient of 0.9, indicating that the model can effectively predict memory usage data. The model training is completed and a memory usage data prediction model is obtained.

[0118] The memory management method provided in this embodiment obtains a memory usage data prediction model by monitoring the determination coefficient and mean square error during the model training process and stopping the training when these two indicators meet the corresponding conditions, thereby improving the accuracy and reliability of the memory usage data prediction model.

[0119] In some optional implementations, the load information includes request type, request rate, average response time, CPU usage, and memory usage. The above step S206 includes:

[0120] Step b1, when the request type is a web page request, determine whether the request rate exceeds the first request rate threshold, whether the average response time exceeds the first response time threshold, whether the CPU usage exceeds the first CPU usage threshold, and whether the memory usage exceeds the first memory usage threshold.

[0121] The load information may include at least one of request type, request rate, average response time, CPU usage, and memory usage. In this embodiment, the load information includes request type, request rate, average response time, CPU usage, and memory usage.

[0122] The request type can be a classified request, such as a web page (Web) request, a database transaction, a computing task, etc. The request rate is the number of requests per unit time, such as the number of requests per second (RPS). The average response time is the average time required to process a request. The CPU usage is the current CPU usage. The memory usage is the current memory usage.

[0123] It should be noted that the first request rate threshold, the first response time threshold, the first CPU usage threshold and the first memory usage threshold are determined by technical personnel based on actual experience.

[0124] Step b2, when the request rate exceeds the first request rate threshold, and the average response time exceeds the first response time threshold, and the CPU usage exceeds the first CPU usage threshold, and the memory usage exceeds the first memory usage threshold, determine the first memory resource to be added, and allocate memory resources according to the sum of the pre-allocated memory resources and the first memory resource to be added.

[0125] Among them, when the request rate exceeds the first request rate threshold, the average response time exceeds the first response time threshold, the CPU usage exceeds the first CPU usage threshold, and the memory usage exceeds the first memory usage threshold, the pre-allocated memory resources may be insufficient. At this time, the allocated memory resources are increased to achieve stable operation of the business. The value of the first resource to be increased is determined by the technician based on experience.

[0126] It should be noted that, when any target load information exceeds the corresponding load threshold, the first memory resource to be added is determined, and the memory resource is allocated according to the sum of the pre-allocated memory resource and the first memory resource to be added.

[0127] The target load information may be a request rate, an average response time, a CPU usage rate, and a memory usage rate. When the request type is a web page request, if any one of the following conditions is met: the request rate exceeds a first request rate threshold, the average response time exceeds a first response time threshold, the CPU usage rate exceeds a first CPU usage rate threshold, and the memory usage rate exceeds a first memory usage rate threshold, memory resources are allocated according to the sum of the pre-allocated memory resources and the first memory resources to be added.

[0128] By dynamically increasing memory resources when any target load information exceeds the corresponding load threshold, the performance and stability of the system can be effectively improved.

[0129] Step b3, when the request rate does not exceed the first request rate threshold, the average response time does not exceed the first response time threshold, the CPU usage does not exceed the first CPU usage threshold, and the memory usage does not exceed the first memory usage threshold, memory resources are allocated according to the pre-allocated memory resources.

[0130] It can be understood that, when the request type is a web page request, if the request rate does not exceed the first request rate threshold, the average response time does not exceed the first response time threshold, the CPU usage does not exceed the first CPU usage threshold, and the memory usage does not exceed the first memory usage threshold, the pre-allocated memory resource allocation is maintained.

[0131] Step b4, when the request type is a database transaction, if the request rate exceeds the second request rate threshold, and the average response time exceeds the second response time threshold, and the CPU usage exceeds the second CPU usage threshold, and the memory usage exceeds the second memory usage threshold, then determine the second memory resources to be added, and allocate memory resources according to the sum of the pre-allocated memory resources and the second memory resources to be added.

[0132] Among them, the second request rate threshold, the second response time threshold, the second CPU usage threshold, and the second memory usage threshold are set by technical personnel based on experience.

[0133] It should be noted that when the request type is a database transaction, if any one of the following conditions is met: the request rate exceeds the second request rate threshold, the average response time exceeds the second response time threshold, the CPU usage exceeds the second CPU usage threshold, and the memory usage exceeds the second memory usage threshold, then memory resources are allocated according to the sum of the pre-allocated memory resources and the second memory resources to be added.

[0134] It can be understood that, when the request type is a database transaction, if the request rate does not exceed the second request rate threshold, the average response time does not exceed the second response time threshold, the CPU usage does not exceed the second CPU usage threshold, and the memory usage does not exceed the second memory usage threshold, the pre-allocated memory resource allocation is maintained.

[0135] It should be noted that different request types have different corresponding memory allocation weights. For example, database transactions may require more memory than web requests. Therefore, the second memory resource to be increased is greater than the first memory resource to be increased.

[0136] Furthermore, in the case where the request type is a computing task, if the request rate exceeds the third request rate threshold, and the average response time exceeds the third response time threshold, and the CPU usage exceeds the third CPU usage threshold, and the memory usage exceeds the third memory usage threshold, then the third memory resources to be added are determined, and memory resources are allocated according to the sum of the pre-allocated memory resources and the third memory resources to be added.

[0137] The third request rate threshold, the third response time threshold, the third CPU usage threshold, and the third memory usage threshold are set by technicians based on experience. The third memory resource to be increased is greater than the second memory resource to be increased.

[0138] It should be noted that when the request type is a computing task, if any one of the following conditions is met: the request rate exceeds the third request rate threshold, the average response time exceeds the third response time threshold, the CPU usage exceeds the third CPU usage threshold, and the memory usage exceeds the third memory usage threshold, then memory resources are allocated according to the sum of the pre-allocated memory resources and the third memory resources to be added.

[0139] It can be understood that when the request type is a computing task, if the request rate does not exceed the third request rate threshold, the average response time does not exceed the third response time threshold, the CPU usage does not exceed the third CPU usage threshold, and the memory usage does not exceed the third memory usage threshold, the pre-allocated memory resource allocation is maintained.

[0140] Taking the load information including request type, request rate, CPU usage and memory usage as an example, the corresponding memory allocation strategy can be shown in Table 3.

[0141] Table 3

[0142]

[0143] As shown in Table 3, when the request type is a Web request, the request rate is 500, the CPU usage is 30%, and the memory usage is 40%, the memory allocation strategy is to maintain the current allocation, that is, to maintain the pre-allocated memory resource allocation. When the request type is a database transaction, the request rate is 2000, the CPU usage is 60%, and the memory usage is 60%, the increase in memory allocation is to increase the second memory resource to be increased on the basis of the pre-allocated memory resources. When the request type is a computing task, the request rate is 1000, the CPU usage is 70%, and the memory usage is 70%, the maximum memory allocation is to increase the third memory resource to be increased on the basis of the pre-allocated memory resources.

[0144] It should be noted that the memory allocation can be adjusted dynamically according to the workload by inputting the current load information into the memory allocation function adjust_memory_allocation(current_workload).

[0145] The following methods can be used to adjust memory allocation:

[0146] Paging and segmentation: Choose an appropriate memory management strategy, such as paging or segmentation, based on the memory access pattern of the application.

[0147] Memory pool: Create memory pools for specific types of tasks or objects to reduce the overhead of memory allocation and deallocation.

[0148] Cache strategy: For frequently accessed data, cache can be used to increase access speed and reduce the demand on main memory.

[0149] Memory compression: For data-intensive applications, consider using memory compression techniques to reduce memory usage.

[0150] Dynamic memory allocation: Dynamically adjust memory allocation based on real-time monitoring data to adapt to changes in workload.

[0151] Memory hierarchy: Build a memory hierarchy, such as using SSD as extended memory, to improve the efficiency of big data processing.

[0152] Memory isolation: Allocate independent memory areas to different applications or services to prevent memory leaks or overuse from affecting other services.

[0153] Performance monitoring and tuning: Continuously monitor memory usage and perform tuning based on performance indicators.

[0154] The memory management method provided in this embodiment manages the load information of the baseboard controller, including the request type, request rate, average response time, CPU usage and memory usage. Under different request types, if the request rate, average response time, CPU usage and memory usage exceed the corresponding thresholds, the actual memory demand is met by increasing memory resources on the basis of pre-allocated memory resources, thereby improving system stability and reliability.

[0155] In some optional implementations, the memory management method further includes:

[0156] Step c1, obtaining the working status of the baseboard management controller.

[0157] The system status acquisition function get_system_status() can be used to obtain the working status of the baseboard manager.

[0158] Specifically, the working status data of the baseboard management controller is collected once every minute, and the collected working status data is analyzed to determine the working status of the baseboard management controller.

[0159] Step c2, when the working state is an idle state, performing comprehensive memory defragmentation.

[0160] This embodiment uses an adaptive memory defragmentation function adaptive_memory_defragmentation (system_status) to adaptively defragment memory fragments according to the working status of the BMC.

[0161] Specifically, according to the working state of the BMC, it is determined whether to execute the corresponding memory defragmentation strategy. When the working state of the BMC is an idle state, a comprehensive memory defragmentation is executed to optimize the memory layout.

[0162] It should be noted that when the BMC is in an idle state, memory data can also be compressed to reduce memory fragmentation.

[0163] Step c3: when the working state is a normal operating state, reclaim the memory blocks that are no longer used.

[0164] Among them, the working state is a normal operating state, performing light memory defragmentation to avoid affecting system performance, and reclaiming memory blocks that are no longer used.

[0165] Step c4: when the load of the baseboard management controller exceeds the load threshold in the working state, suspending the arrangement of memory fragments and the recycling of memory blocks.

[0166] When the load of the BMC exceeds the load threshold, the working state is in a high load state. In this case, the defragmentation of memory fragments and the recovery of memory blocks are suspended to avoid affecting the system performance.

[0167] It should be noted that when the working state is at the peak operation state, the memory blocks no longer in use are urgently recycled to quickly release the memory resources.

[0168] The memory management method provided in this embodiment can effectively reduce memory fragmentation by performing comprehensive memory defragmentation when the BMC is in an idle state, thereby alleviating the burden on system administrators, avoiding problems caused by human errors, reducing maintenance costs, optimizing memory layout, and improving system performance, thereby improving the operating performance and stability of the server.

[0169] When the BMC is in normal operation, the memory blocks that are no longer in use are recycled, so that the unused memory resources can be released in time, thereby avoiding memory waste and improving memory utilization.

[0170] When the BMC load exceeds the preset load threshold, memory defragmentation and memory block recycling operations are suspended to avoid further increasing the system burden and ensure the stable operation of key businesses and services.

[0171] In some optional implementations, the memory management method further includes:

[0172] Step d1, monitoring the memory usage trend of the baseboard management controller.

[0173] The memory usage acquisition function get_current_memory_usage() is used to obtain the current memory usage of the BMC, and then determine the memory usage trend of the BMC.

[0174] Step d2: when the memory usage trend shows an abnormal growth, it is determined that a memory leak occurs.

[0175] Among them, in a system that runs for a long time, memory leaks and exception problems are often difficult to avoid. These problems need to be discovered and handled in a timely manner to prevent the system from crashing.

[0176] In this embodiment, memory leakage can be determined through memory usage trends, and the current memory usage can also be input into a memory leak detection function detect_memory_leaks(current_memory_usage) to detect possible memory leaks and send an early warning when a memory leak is detected.

[0177] Specifically, the detection method can be based on the above memory usage trend, and when the memory usage trend shows an abnormal growth, it is determined that a memory leak occurs. It can also be the following detection methods:

[0178] Reference Counts: Monitor the reference counts of objects. If the counts do not decrease after they are no longer used, it may indicate a memory leak.

[0179] Heap tracing: Records logs of heap memory allocations and deallocations, and analyzes inconsistencies to determine if memory leaks have occurred.

[0180] Garbage collector log: Analyze the garbage collector log to find objects that were not collected to determine if a memory leak has occurred.

[0181] Step d3, in the case of memory leakage, determining whether the memory leakage rate exceeds a memory leakage rate threshold.

[0182] The memory leak rate threshold is determined by technicians based on experience.

[0183] Step d4: When the memory leakage rate exceeds the memory leakage rate threshold, an alarm is issued.

[0184] It should be noted that an alarm is issued when the memory usage trend shows an abnormal growth.

[0185] When the memory usage data exceeds the preset memory usage data threshold, an alarm is issued.

[0186] The preset memory usage data threshold is determined by technical personnel based on experience.

[0187] The memory management method provided in this embodiment monitors the memory usage trend of the baseboard management controller, promptly identifies the abnormal growth of memory usage, determines that a memory leak occurs, further determines whether the memory leakage rate exceeds the memory leakage rate threshold, and issues an alarm when the memory leakage rate threshold is exceeded. It can promptly detect and handle memory leaks and abnormal memory usage, reduce the impact of memory leaks on the system, prevent system crashes caused by memory problems, and improve system security and stability.

[0188] In some optional implementations, the above step d4 includes:

[0189] Step d41, when the memory leakage rate exceeds the first memory leakage rate threshold, the degree of memory leakage is determined to be the first degree, and an alarm is issued by logging.

[0190] The first level is a minor memory leak, which may not immediately affect system performance and can be reported through logging.

[0191] Step d42, when the memory leakage rate exceeds the second memory leakage rate threshold, determine that the degree of memory leakage is the second degree, and issue an alarm through instant messaging.

[0192] The second level is a serious memory leak, which requires immediate attention and processing, and an alarm is issued through instant messaging.

[0193] The second degree of memory leakage is more serious than the first degree of memory leakage, and the second memory leakage rate threshold is greater than the first memory leakage rate threshold. The first memory leakage rate threshold and the second memory leakage rate threshold are determined by technicians based on experience.

[0194] The memory management method provided in this embodiment can classify the degree of memory leakage into different levels by setting a first memory leakage rate threshold and a second memory leakage rate threshold, and take corresponding alarm measures according to the severity of the memory leakage, so that operation and maintenance personnel can deal with the memory leakage in time, thereby improving the security and reliability of the system.

[0195] In some optional implementations, the memory management method further includes:

[0196] Step e1, obtaining data access history records of a baseboard management controller.

[0197] The data access history can be obtained through a function get_data_access_history(), wherein the data access history record may include data access records of Web requests, database transactions, computing tasks, and the like.

[0198] Step e2: predicting data access based on data access history records, and preloading the predicted data into the memory.

[0199] The memory prefetch function smart_memory_prefetch (data_access_history) is used to predict the data that the BMC may access in the future. According to the prediction result, it is determined which data may be accessed in the future, and the data is preloaded into the memory.

[0200] Specifically, after obtaining the data access history records, the data access history records are cleaned and converted; useful features are extracted from the data access history records, as shown in Table 4, and the useful features may be access time, number of accesses, average duration, etc.; the prediction model is trained using the extracted features to use the trained prediction model to predict future data accesses, i.e., the predicted access time of the data; and memory prefetching is performed based on the prediction results.

[0201] Table 4

[0202]

[0203] It should be noted that preloading the predicted data into the memory includes: when the load of the BMC is lower than the load threshold, preloading the predicted data into the memory to reduce the impact on the current operation. The amount of pre-fetched data can be controlled according to the memory capacity and the data access mode.

[0204] In traditional memory management, data is read from the disk every time when it is accessed, resulting in a large amount of time wasted. The memory management method provided in this embodiment predicts the data to be accessed based on the data access history, and pre-loads the data into the memory, thereby reducing data access delay and improving system operation speed.

[0205] It should be noted that the memory management method of this embodiment can adjust the prediction and optimization strategies according to actual needs, implement personalized memory management, and improve the availability of the entire system.

[0206] In this embodiment, a memory management method is provided, which can be used in a baseboard management controller. Figure 3 is a flowchart of a memory management method according to an embodiment of the present invention. Figure 3 As shown, the process includes the following steps:

[0207] Step 1: Get historical memory usage data. For details, see Figure 2 Step S201 of the illustrated embodiment will not be described in detail here.

[0208] Step 2: Forecast future memory requirements. Figure 2 Steps S202 and S203 of the illustrated embodiment are not described in detail here.

[0209] Step 3: Allocate memory based on the prediction results. For details, see Figure 2 Step S204 of the illustrated embodiment will not be described in detail here.

[0210] Step 4: Execute the main loop. The main loop includes: obtaining the current workload and adjusting memory allocation according to the current workload. For details, see Figure 2 Steps S205 and S206 of the illustrated embodiment are not described in detail here.

[0211] Get the system status and adaptively defragment the memory. Please refer to steps c1 to c4 for details, which will not be repeated here.

[0212] Obtain data access history and perform intelligent memory prefetching. Please refer to steps e1 to e4 for details, which will not be repeated here.

[0213] Get the current memory usage, detect memory leaks and send warnings. Please refer to steps d1 to d4 for details, which will not be repeated here.

[0214] in, Figure 4 FIG. 1 is a flow chart of adjusting memory allocation according to current load according to an embodiment of the present invention. Figure 4 As shown, the following steps are included:

[0215] 1. Get the current workload and memory usage, that is, get the baseboard management controller load information and pre-allocated memory resources.

[0216] 2. Compare the current workload with the memory usage and predict the memory demand. If the current workload exceeds the pre-allocated memory resources, more memory may be required. See the detailed description of the above steps b1 to b4, which will not be repeated here.

[0217] 3. Decide whether to adjust memory allocation. In this case, determine whether to adjust memory allocation based on load information.

[0218] 4. If memory allocation needs to be adjusted, adjust the memory allocation, verify whether the memory allocation is successful, and record the memory allocation.

[0219] Among them, after adjusting the memory allocation according to the above b1 to b4 to meet the memory requirements, it is necessary to verify whether the memory allocation is successful. If successful, the current memory allocation is recorded for subsequent use and memory adjustment.

[0220] 5. If you decide not to adjust memory allocation, enter the next layer of detection logic.

[0221] That is, while maintaining the pre-allocated memory resources, the next layer of detection logic is entered, that is, the step of obtaining the system status and adaptively defragmenting the memory fragments is entered.

[0222] Step 5: When a specific stop condition is met, jump out of the main loop and end memory management.

[0223] The specific stop condition may be a system shutdown, a specific mode, etc.

[0224] It should be noted that the memory management method provided in this embodiment is not limited to the server architecture of a fixed platform, and can provide a more reliable system operating environment for the server. In addition to using historical memory usage data to predict future memory requirements, multiple machine learning methods, such as deep learning or reinforcement learning, can also be integrated to improve prediction accuracy.

[0225] The memory management method provided in this embodiment dynamically adjusts the pre-allocated memory resources in real time according to the load information of the baseboard management controller when pre-allocating memory resources according to the predicted value, so that the system can quickly adapt to different memory resource requirements, avoid resource waste and resource shortage caused by static allocation, improve memory usage efficiency and system operation stability, and also improve system flexibility. By efficiently managing and automatically recycling memory, the operation performance and stability of the server are greatly improved.

[0226] In this embodiment, a memory management system is also provided, which includes a predictive memory allocation module, a dynamic memory adjustment module, an adaptive memory defragmentation module, an intelligent memory prefetching module, and an abnormality detection and warning module.

[0227] The predictive memory allocation module is used to execute the above steps S201 to S204 to collect the historical memory usage data of the BMC, use machine learning or deep learning algorithms to train the prediction model, predict future memory requirements, and allocate memory in advance to meet future memory requirements. The specific implementation code is as follows:

[0228] def predict_memory_usage(history):

[0229] #Use machine learning models, such as linear regression, neural networks, etc., to predict future memory requirements based on historical data

[0230] model = train_model(history)

[0231] future_memory_usage=model.predict()

[0232] return future_memory_usage

[0233] history=get_memory_usage_history()

[0234] predicted_memory=predict_memory_usage(history)

[0235] allocate_memory(predicted_memory)

[0236] The dynamic memory adjustment module is used to execute the above steps S205 and S206 to obtain the workload of the BMC in real time, dynamically adjust the memory allocated to each task, reduce memory usage, and improve memory usage efficiency. The specific implementation code is as follows:

[0237]

[0238]

[0239] The adaptive memory defragmentation module is used to execute the above steps c1 to c4 to adaptively defragment memory according to the system working status and memory usage, reduce memory fragmentation, and improve memory utilization. The specific implementation code is as follows:

[0240]

[0241] The intelligent memory prefetch module is used to execute the above steps e1 and e2 to obtain data access history, predict data that may be accessed in the future, and preload the predicted data into the memory to improve data access speed and accelerate task execution. The specific implementation code is as follows:

[0242]

[0243] The anomaly detection and warning module is used to execute the above steps b1 to b4 to monitor the BMC memory usage in real time. Once a memory leak or abnormal usage is detected, an alarm is triggered immediately to notify the system administrator to prevent memory problems from causing system operation abnormalities. The specific implementation code is as follows:

[0244]

[0245]

[0246] For detailed description, please refer to the corresponding description of the above steps, which will not be repeated here.

[0247] The memory management system provided in this embodiment avoids the resource waste and resource shortage problems caused by static allocation, and realizes the reasonable allocation and management of memory resources.

[0248] In this embodiment, a memory management device is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.

[0249] This embodiment provides a memory management device, such as Figure 5 As shown, including:

[0250] The first acquisition module 501 is used to acquire historical memory usage data of a baseboard management controller.

[0251] The generation module 502 is used to generate a memory usage data prediction model based on historical memory usage data.

[0252] The second acquisition module 503 is used to input the memory usage data of the previous preset cycle of the baseboard management controller into the memory usage data prediction model in each preset cycle to obtain the predicted value of the memory usage data of the current preset cycle.

[0253] The allocation module 504 is used to pre-allocate memory resources based on the predicted value of the memory usage data.

[0254] The third acquisition module 505 is used to acquire load information of the baseboard management controller.

[0255] The adjustment module 506 is used to adjust the pre-allocated memory resources based on the load information.

[0256] In some optional implementations, the generating module 502 includes:

[0257] The first acquisition unit is used to divide the historical memory usage data according to the sequence of preset cycles to obtain memory usage data of multiple cycles.

[0258] The second acquisition unit is used to perform model training based on the memory usage data of multiple cycles, taking the memory usage data of one cycle as input and the memory usage data of the next cycle of the cycle as a label, to obtain a memory usage data prediction model.

[0259] In some optional implementations, the second acquisition unit includes:

[0260] The third acquisition unit is used to acquire model training parameters during the model training process. The model training parameters include the determination coefficient of the model and the mean square error between the predicted value of the memory usage data output by the model and the actual value of the memory usage data.

[0261] The fourth acquisition unit is used to stop model training and obtain a memory usage data prediction model when the determination coefficient is greater than a preset determination coefficient threshold and the mean square error is less than a preset mean square error threshold.

[0262] In some optional implementations, the adjustment module 506 includes:

[0263] The first judgment unit is used to judge whether the request rate exceeds the first request rate threshold, whether the average response time exceeds the first response time threshold, whether the CPU usage exceeds the first CPU usage threshold, and whether the memory usage exceeds the first memory usage threshold when the request type is a web page request.

[0264] The first determination unit is used to determine the first memory resource to be added when the request rate exceeds the first request rate threshold, the average response time exceeds the first response time threshold, the CPU usage exceeds the first CPU usage threshold, and the memory usage exceeds the first memory usage threshold, and to allocate memory resources according to the sum of the pre-allocated memory resources and the first memory resources to be added.

[0265] The first allocation unit is used to allocate memory resources according to pre-allocated memory resources when the request rate does not exceed the first request rate threshold, the average response time does not exceed the first response time threshold, the central processing unit usage does not exceed the first central processing unit usage threshold, and the memory usage does not exceed the first memory usage threshold.

[0266] The second determination unit is used to determine the second memory resources to be added and allocate memory resources according to the sum of the pre-allocated memory resources and the second memory resources to be added if the request rate exceeds the second request rate threshold, the average response time exceeds the second response time threshold, the CPU usage exceeds the second CPU usage threshold, and the memory usage exceeds the second memory usage threshold when the request type is a database transaction.

[0267] The second memory resource to be increased is greater than the first memory resource to be increased.

[0268] In some optional implementations, the memory management device further includes:

[0269] The fourth acquisition module is used to acquire the working status of the baseboard management controller.

[0270] The defragmentation module is used to perform comprehensive memory defragmentation when the working state is idle.

[0271] The recycling module is used to recycle the memory blocks that are no longer used when the working state is a normal operating state.

[0272] The pause module is used to pause the arrangement of memory fragments and the recovery of memory blocks when the load of the baseboard management controller exceeds the load threshold in the working state.

[0273] In some optional implementations, the memory management device further includes:

[0274] The detection module is used to monitor the memory usage trend of the baseboard management controller.

[0275] The determination module is used to determine that a memory leak occurs when a memory usage trend shows an abnormal growth.

[0276] The judgment module is used to judge whether the memory leakage rate exceeds the memory leakage rate threshold when the memory leakage occurs.

[0277] The alarm module is used to generate an alarm when the memory leakage rate exceeds the memory leakage rate threshold.

[0278] In some optional implementations, the alarm module includes:

[0279] The first alarm unit is used to determine that the degree of memory leakage is a first degree when the memory leakage rate exceeds a first memory leakage rate threshold, and to issue an alarm by means of log recording.

[0280] The second alarm unit is used to determine that the degree of memory leakage is a second degree when the memory leakage rate exceeds a second memory leakage rate threshold, and to issue an alarm through instant messaging.

[0281] The second degree of memory leakage is more serious than the first degree of memory leakage, and the second memory leakage rate threshold is greater than the first memory leakage rate threshold.

[0282] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.

[0283] The memory management device in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.

[0284] The embodiment of the present invention also provides a computer device having the above Figure 5 The memory management device shown.

[0285] See also Figure 6 , Figure 6 is a schematic diagram of the structure of a computer device provided by an optional embodiment of the present invention, such as Figure 6 As shown, the computer device includes: one or more processors 601, memory 602, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components utilize different buses to communicate with each other, and can be installed on a common mainboard or installed in other ways as required. The processor can process the instructions executed in the computer device, including instructions stored in the memory or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides part of the necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 6 A processor 601 is taken as an example.

[0286] The processor 601 may be a central processing unit, a network processor or a combination thereof. The processor 601 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.

[0287] The memory 602 stores instructions executable by at least one processor 601 , so that the at least one processor 601 executes the method shown in the above embodiment.

[0288] The memory 602 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 602 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 602 may optionally include a memory remotely arranged relative to the processor 601, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0289] The memory 602 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 602 may also include a combination of the above types of memory.

[0290] The computer device also includes a communication interface 603, which is used for the computer device to communicate with other devices or a communication network.

[0291] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.

[0292] A part of the present invention may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present invention through the operation of the computer. Those skilled in the art should understand that the existence of the computer program instruction in a computer-readable medium includes, but is not limited to, a source file, an executable file, an installation package file, etc., and accordingly, the way in which the computer program instruction is executed by the computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium may be any available computer-readable storage medium or communication medium accessible to the computer.

[0293] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.

Claims

1. A memory management method, characterized in that: Applied to a baseboard management controller, the method comprises: Get historical memory usage data of the baseboard management controller; Based on the historical memory usage data, generate a memory usage data prediction model; In each preset cycle, the memory usage data of the baseboard management controller in the previous preset cycle is input into the memory usage data prediction model to obtain the predicted value of the memory usage data in the current preset cycle; Pre-allocating memory resources based on the predicted value of the memory usage data; Obtaining load information of the baseboard management controller; Based on the load information, pre-allocated memory resources are adjusted.

2. The method according to claim 1, characterized in that The generating a memory usage data prediction model based on the historical memory usage data includes: Dividing the historical memory usage data according to the sequence of preset periods to obtain memory usage data of multiple periods; Based on the memory usage data of multiple cycles, the memory usage data of one cycle is used as input and the memory usage data of the next cycle of the cycle is used as a label to perform model training to obtain the memory usage data prediction model.

3. The method according to claim 2, characterized in that The obtaining of the memory usage data prediction model comprises: In the process of model training, model training parameters are obtained, where the model training parameters include a coefficient of determination of the model and a mean square error between a predicted value of memory usage data output by the model and an actual value of the memory usage data; When the determination coefficient is greater than a preset determination coefficient threshold and the mean square error is less than a preset mean square error threshold, the model training is stopped to obtain the memory usage data prediction model.

4. The method according to claim 1, characterized in that: The load information includes request type, request rate, average response time, CPU usage and memory usage. The pre-allocated memory resources are adjusted based on the load information, including: In the case where the request type is a web page request, determining whether the request rate exceeds a first request rate threshold, whether the average response time exceeds a first response time threshold, whether the CPU usage exceeds a first CPU usage threshold, and whether the memory usage exceeds a first memory usage threshold; When the request rate exceeds a first request rate threshold, and the average response time exceeds a first response time threshold, and the CPU usage exceeds a first CPU usage threshold, and the memory usage exceeds a first memory usage threshold, determining a first memory resource to be added, and performing memory resource allocation according to the sum of the pre-allocated memory resources and the first memory resource to be added; When the request rate does not exceed a first request rate threshold, the average response time does not exceed a first response time threshold, the CPU usage does not exceed a first CPU usage threshold, and the memory usage does not exceed a first memory usage threshold, memory resources are allocated according to the pre-allocated memory resources; In the case where the request type is a database transaction, if the request rate exceeds a second request rate threshold, and the average response time exceeds a second response time threshold, and the CPU usage exceeds a second CPU usage threshold, and the memory usage exceeds a second memory usage threshold, then determining a second memory resource to be added, and performing memory resource allocation according to the sum of the pre-allocated memory resources and the second memory resource to be added; The second memory resource to be increased is greater than the first memory resource to be increased.

5. The method according to claim 1, characterized in that The method further comprises: Obtaining the working status of the baseboard management controller; When the working state is an idle state, performing comprehensive memory defragmentation; When the working state is a normal operating state, reclaiming memory blocks that are no longer in use; When the working state is that the load of the baseboard management controller exceeds a load threshold, the arrangement of memory fragments and the recycling of memory blocks are suspended.

6. The method according to claim 1, characterized in that The method further comprises: monitoring a memory usage trend of the baseboard management controller; When the memory usage trend shows an abnormal growth, determining that a memory leak occurs; In the case of memory leakage, determining whether the memory leakage rate exceeds the memory leakage rate threshold; When the memory leakage rate exceeds the memory leakage rate threshold, an alarm is issued.

7. The method according to claim 6, characterized in that When the memory leakage rate exceeds the memory leakage rate threshold, an alarm is issued, including: When the memory leakage rate exceeds a first memory leakage rate threshold, determining that the degree of the memory leakage is a first degree, and issuing an alarm by logging; When the memory leakage rate exceeds the second memory leakage rate threshold, determining that the degree of the memory leakage is the second degree, and issuing an alarm by means of instant messaging; The second degree of memory leakage is more serious than the first degree of memory leakage, and the second memory leakage rate threshold is greater than the first memory leakage rate threshold.

8. A memory management device, characterized in that: The device comprises: A first acquisition module is used to acquire historical memory usage data of a baseboard management controller; A generation module, used to generate a memory usage data prediction model based on the historical memory usage data; A second acquisition module is used to input the memory usage data of the previous preset cycle of the baseboard management controller into the memory usage data prediction model in each preset cycle to obtain the predicted value of the memory usage data of the current preset cycle; An allocation module, configured to pre-allocate memory resources based on the predicted value of the memory usage data; A third acquisition module, used to acquire load information of the baseboard management controller; The adjustment module is used to adjust the pre-allocated memory resources based on the load information.

9. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the memory management method according to any one of claims 1 to 7 by executing the computer instructions.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the memory management method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Load balancing method and system for service cluster

    CN111930523A

  • Task scheduling method and management system

    CN114764371A

  • Cloud resource automatic management and optimization system

    CN118094209A

  • Server fault prediction method and system based on BMC module edge calculation

    CN118733317A

  • Micro-service memory allocation method and device, equipment, medium and product

    CN118916161A

Cited By

  • Memory management method, system and device for memory database and memory database server

    CN120276682A