A memory dynamic adjustment method and system, electronic equipment and storage medium

By using a dual-scale temporal convolutional network model and memory pressure entropy values, combined with multi-level constraint rules, we have achieved efficient, intelligent, and adaptive dynamic adjustment of virtual machine memory resources. This solves the shortcomings of memory resource management in existing technologies and improves the efficiency and stability of memory resource management in the domestic cloud environment.

CN121187767BActive Publication Date: 2026-03-27TONGFANG KNOWLEDGE DIGITAL PUBLISHING TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-09-10
Publication Date
2026-03-27

AI Technical Summary

Technical Problem

Existing technologies lack fine-grained dynamic adjustment mechanisms in virtual machine memory resource management, making it difficult to meet the needs of efficient, intelligent, and adaptive dynamic adjustment of memory resources in the domestic cloud environment, especially in complex application scenarios with drastic load fluctuations, where fine-grained control is difficult to achieve.

Method used

A dual-scale temporal convolutional network model is adopted. Through the collaborative optimization of short-term prediction branches and long-term trend branches, combined with memory pressure entropy values ​​and multi-level constraint rules, memory adjustment instructions are generated and hot-plug operations are triggered. Abnormal adjustments are monitored and rolled back in real time to achieve dynamic adjustment of memory resources.

Benefits of technology

It significantly improves the accuracy of memory resource prediction, enhances the ability to resist anomalies and interference, ensures the stability of adjustments and intelligent management of resource conflicts, and improves the management efficiency of virtual machine memory resources and business stability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121187767B_ABST
    Figure CN121187767B_ABST
Patent Text Reader

Abstract

The application relates to the computer technical field and discloses a memory dynamic adjustment method and system, an electronic device and a storage medium, which comprise the following steps: collecting resource performance indexes of a virtual machine and a host computer, forming historical standardized time sequence data, performing normalization processing to obtain standardized time sequence data, filtering abnormal data points exceeding a preset mutation threshold, if it is identified that the virtual machine is in a non-steady-state operation, suspending a prediction process, inputting a double-scale time sequence convolution network model, outputting a future short-term memory usage rate sequence through a short-term prediction branch, outputting a memory change trend label through a long-term trend branch, calculating a memory pressure entropy value based on the future short-term memory usage rate sequence, presetting a multistage constraint rule, generating a memory adjustment instruction, correspondingly triggering a hot plug operation according to the memory adjustment instruction, and executing a rollback mechanism when an adjustment exception is detected. The application can meet the actual needs of efficient, intelligent and self-adaptive dynamic adjustment of virtual machine memory resources.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of computer technology, and in particular relates to a memory dynamic adjustment method and system, electronic equipment and storage medium. BACKGROUND

[0002] At present, with the rapid development of cloud computing and virtualization technology, dynamic management of virtual machine resources has become a key link to improve resource utilization and guarantee service quality in data centers. Memory, as an important computing resource in the running process of virtual machines, its allocation directly affects the performance and stability of the system. Traditional virtual machine memory management relies on static configuration or simple recycling mechanism based on threshold, which is difficult to adapt to complex application scenarios with severe load fluctuations.

[0003] In the prior art, patent document CN118041787B discloses a cloud collaborative container elastic scaling method, device and electronic equipment, which proposes to collect the load change data of Pods in the container cluster, construct an elastic scaling model based on dynamic threshold, and use time convolution network (TCN) to predict different frequency modal components, thereby realizing rapid expansion and delayed contraction of container resources.

[0004] Although this scheme uses TCN to realize the trend prediction of future resource demand and improves the response speed and service quality, it mainly faces CPU and overall resource scheduling in the container environment and does not deeply consider the fine-grained dynamic characteristics of memory usage at the virtual machine level, lacking modeling and analysis of key memory indicators such as memory pressure, page replacement frequency, and working set size. In addition, this method focuses on resource scaling decisions at the cluster level and does not provide personalized prediction and dynamic adjustment mechanisms for memory usage behavior of individual virtual machines, making it difficult to meet the demand for fine-grained control of memory resources in virtual environments.

[0005] Patent document CN114265913B discloses an air-time prediction algorithm based on federated learning on industrial Internet of Things edge devices, which constructs a TCN-GCN deep model locally on the edge device, combines graph convolution network (GCN) and time convolution network (TCN), realizes spatio-temporal joint prediction of sensing data, and aggregates global model parameters through federated learning.

[0006] The method realizes good prediction performance while protecting data privacy, and is suitable for state prediction of distributed devices. However, the scheme focuses on space-time modeling of industrial sensor data, and the input features are mainly physical quantities such as temperature and vibration, without involving system-level indicators related to virtual machine memory usage (such as memory occupancy, exchange rate, and dirty page ratio). At the same time, the model structure design is oriented to multi-node collaborative prediction tasks, without considering the real-time and low-delay feedback control mechanism required by virtual machine memory dynamic adjustment, and without integrating a memory resource adjustment strategy module, so it cannot be directly applied to a closed-loop control system of virtual machine memory resources.

[0007] The above problems show that existing resource prediction technologies based on TCN are mostly concentrated in the fields of container scaling or industrial sensor data prediction, and have not formed a special prediction and control framework for virtual machine memory usage characteristics. The existing schemes generally have problems such as insufficient modeling of memory behavior, lack of deep integration with virtualization platforms, and lack of integrated prediction-decision-execution control, which makes it difficult to meet the actual needs of efficient, intelligent, and adaptive dynamic adjustment of virtual machine memory resources in the signal creation cloud environment.

[0008] Therefore, the present application provides a memory dynamic adjustment method to solve the above technical problems. SUMMARY

[0009] The purpose of the present application is to provide a memory dynamic adjustment method, system, electronic device and storage medium to solve the technical problem that the prior art cannot meet the actual needs of efficient, intelligent, and adaptive dynamic adjustment of virtual machine memory resources.

[0010] To solve the above technical problems, the present application provides a memory dynamic adjustment method, comprising:

[0011] In response to periodically collected resource performance indicators of virtual machines and host computers, historical standardized time series data is formed, and the historical standardized time series data is normalized to obtain standardized time series data, wherein the resource performance indicators include memory usage and CPU load;

[0012] Anomaly detection and repair are performed on the standardized time series data, and abnormal data points exceeding a preset mutation threshold are filtered. If it is identified that the virtual machine is in a non-steady state operation, the prediction process is suspended;

[0013] The repaired standardized time series data is input into a double-scale time series convolution network model, a future short-term memory usage rate sequence is output through a short-term prediction branch, and a memory change trend label is output through a long-term trend branch;

[0014] Based on the future short-term memory usage rate sequence, a memory pressure entropy value representing the intensity of memory resource competition is calculated;

[0015] Based on the future short-term memory usage rate sequence, the memory change trend label, the memory pressure entropy value, and a preset multi-level constraint rule, a memory adjustment instruction is generated, and a hot plug operation is triggered according to the memory adjustment instruction, and a rollback mechanism is executed when an adjustment exception is detected.

[0016] In some embodiments, the standardized time series data is subjected to anomaly detection and repair, and abnormal data points exceeding a preset mutation threshold are filtered; if it is identified that the virtual machine is in a non-steady state operation, the prediction process is paused, and further comprising:

[0017] The memory change rate of adjacent sampling points is monitored in real time, and abnormal data points with a change rate exceeding a preset mutation threshold are identified;

[0018] The identified abnormal data points are replaced based on a sliding window mean algorithm to smooth data fluctuations;

[0019] The running state of the virtual machine is detected through a virtualization state interface, and if it is in a non-steady state, the prediction process is paused and a state identifier is injected;

[0020] If it returns to steady state operation, the prediction process is restarted.

[0021] In some embodiments, the repaired standardized time series data is input into a double-scale time series convolution network model, a future short-term memory usage rate sequence is output through a short-term prediction branch, and a memory change trend label is output through a long-term trend branch, further comprising:

[0022] The short-term prediction branch is based on standardized time series data of a first historical length, extracts features through a causal convolution layer with a small expansion coefficient, and outputs a future short-term memory usage rate sequence;

[0023] The long-term trend branch is based on standardized time series data of a second historical length, and outputs a memory change trend label through a causal convolution layer with a large expansion coefficient;

[0024] When the long-term trend branch outputs a continuous downward trend, expansion instructions generated by the short-term prediction branch are suppressed;

[0025] The short-term prediction branch and the long-term trend branch are associated through a feature fusion layer, and cooperatively optimize the prediction output.

[0026] In some embodiments, based on the future short-term memory usage rate sequence, a memory pressure entropy value representing the intensity of memory resource competition is calculated, further comprising:

[0027] Iterate through the virtual machines that need to be adjusted on the host machine to obtain normalized memory usage prediction values;

[0028] Based on the discrete distribution characteristics of the predicted memory usage of each virtual machine, the uncertainty of resource competition is quantified through logarithmic operations;

[0029] When the entropy value exceeds the first preset threshold, it is determined that there is a risk of resource conflict.

[0030] Select a concurrent adjustment strategy based on the entropy value, including batch parallel adjustment or time-sharing gradient adjustment according to business priority.

[0031] In some specific embodiments, the preset multi-level constraint rules include:

[0032] The host machine's global memory utilization does not exceed the safe threshold;

[0033] The amount of memory adjustment in a single instance shall not exceed the maximum proportion of the virtual machine's current memory.

[0034] The interval between two consecutive adjustments should not be less than the anti-oscillation cycle;

[0035] Adjustment is only triggered when multiple consecutive sampling points exceed the usage threshold.

[0036] When the memory pressure entropy value exceeds the conflict threshold, a gradient adjustment strategy based on business priority is activated.

[0037] In some specific embodiments, based on the future short-term memory usage sequence, memory change trend labels, memory pressure entropy values, and preset multi-level constraint rules, memory adjustment instructions are generated. Hot-plugging operations are triggered accordingly based on the memory adjustment instructions, and a rollback mechanism is executed when an adjustment anomaly is detected. Further, the method includes:

[0038] The system determines whether the adjustment conditions are met based on short-term memory usage sequences and memory change trend labels, and generates memory adjustment values ​​by combining multi-level constraint rules.

[0039] Perform uninterrupted memory hot-plugging operations through the virtualization driver interface;

[0040] Real-time monitoring of host machine memory utilization and virtual machine service health status after hot-plugging operation;

[0041] If the host machine's memory utilization exceeds the circuit breaker threshold or the service response is abnormal, the memory configuration will be rolled back to its previous state.

[0042] In some specific embodiments, the memory pressure entropy value, which characterizes the intensity of memory resource contention, is calculated. Only virtual machines whose predicted memory usage is in the high or low load range are included. The uncertainty of the usage distribution of each virtual machine is calculated by a logarithmic function, and an adjustment strategy is dynamically selected according to the entropy value. This includes batch parallel execution when there is low conflict, and adjustment operations are performed in stages according to business criticality when there is high conflict.

[0043] Based on the same concept, the application also provides a memory dynamic adjustment system, comprising:

[0044] A standardized time series data processing module is configured to form historical standardized time series data in response to periodically collected resource performance indicators of the virtual machine and the host machine, and to obtain standardized time series data by normalizing the historical standardized time series data, wherein the resource performance indicators include memory usage and CPU load.

[0045] A prediction process control module is configured to perform anomaly detection and repair on the standardized time series data, and to filter abnormal data points exceeding a preset mutation threshold; and if it is identified that the virtual machine is in a non-steady state operation, the prediction process is suspended.

[0046] A prediction model output module is configured to input the repaired standardized time series data into a double-scale time series convolution network model, output a future short-term memory usage sequence through a short-term prediction branch, and output a memory change trend label through a long-term trend branch.

[0047] An entropy value calculation module is configured to calculate a memory pressure entropy value representing the memory resource competition intensity based on the future short-term memory usage sequence.

[0048] A memory dynamic adjustment module is configured to generate a memory adjustment instruction based on the future short-term memory usage sequence, the memory change trend label, the memory pressure entropy value, and a preset multi-level constraint rule, trigger a hot plug operation according to the memory adjustment instruction, and execute a rollback mechanism when an adjustment anomaly is detected.

[0049] Based on the same concept, the application also provides an electronic device, comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory complete mutual communication through the communication bus; the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of a memory dynamic adjustment method.

[0050] Based on the same concept, the application also provides a computer readable storage medium storing a computer program executable by an electronic device, and when the computer program runs on the electronic device, the electronic device executes the steps of a memory dynamic adjustment method.

[0051] Compared with the prior art, the application has the beneficial effects that:

[0052] The application discloses a memory dynamic adjustment method and system, an electronic device and a storage medium, which have the following beneficial effects:

[0053] 1. Significant improvement in prediction accuracy: The causal dilated convolution structure of the time series convolution network (TCN) is adopted, and the short-term fluctuation capture and long-term trend adaptation are realized through the double-scale prediction mechanism. The short-term prediction accurately identifies the minute-level resource demand changes, and the long-term trend analysis avoids short-term noise interference, reduces the prediction error, and provides a reliable basis for dynamic adjustment.

[0054] 2. Strong abnormal anti-interference ability: The instantaneous data processing module is designed to build a double protection mechanism. On the one hand, the instantaneous abnormal data points are filtered through mutation threshold detection and sliding window mean repair, and on the other hand, the prediction is automatically suspended and the state identifier is injected when the virtual machine is in unstable state, avoiding invalid adjustment based on distorted data from the source.

[0055] 3. Comprehensive guarantee of adjustment stability: A multi-dimensional constraint rule system is established to establish rigid restrictions from the dimensions of single adjustment amplitude, continuous adjustment interval, and global load of host machine, effectively curbing the business shock caused by frequent adjustment and reducing the adjustment shock frequency.

[0056] 4. Intelligent management and control of resource conflicts: Based on the information entropy-based memory competition quantification model, the entropy value index accurately represents the resource conflict risk of concurrent adjustment of multiple virtual machines. Combined with the gradient adjustment strategy, the business priority hierarchical scheduling and time-sharing execution are realized, the probability of host memory overload is reduced, and the core business resource capacity is significantly enhanced.

[0057] 5. Deep adaptation of China's information creation ecology: On the premise of ensuring business stability, the virtual machine memory resources are greatly improved. BRIEF DESCRIPTION OF DRAWINGS

[0058] Other features, objects and advantages of the present application will become more apparent from the following detailed description of non-limiting embodiments made with reference to the accompanying drawings:

[0059] Figure 1 is a flowchart of a memory dynamic adjustment method in some specific embodiments of the present application;

[0060] Figure 2 is a flowchart of a memory dynamic adjustment method in another embodiment of the present application;

[0061] Figure 3 is a flowchart of a memory dynamic adjustment method in another embodiment of the present application;

[0062] Figure 4 is a flowchart of a memory dynamic adjustment method in another embodiment of the present application;

[0063] Figure 5 is a flowchart of a memory dynamic adjustment method in another embodiment of the present application;

[0064] Figure 6 is a structural schematic diagram of a memory dynamic adjustment system in some embodiments of the present application;

[0065] Figure 7 is a structural schematic diagram of an electronic device in some embodiments of the present application;

[0066] In the figure, 710 is a processor; 720 is a memory; 730 is an input device; and 740 is an output device. DETAILED DESCRIPTION

[0067] In order to make the purposes, technical solutions and advantages of the present application clearer, the present application will be further described in detail below with reference to the drawings. Obviously, the described embodiments are only some of the embodiments of the present application, but not all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work fall within the scope of the present application.

[0068] The terms used in the embodiments of the present application are only for the purpose of describing the specific embodiments, and are not intended to limit the present application. The singular forms “a”, “an” and “the” used in the embodiments of the present application and the appended claims are also intended to include the plural forms, unless the context clearly indicates otherwise. “Plural” generally includes at least two.

[0069] It should be understood that the term “and / or” used herein only describes an association relationship of associated objects, which means that there can be three relationships, for example, A and / or B can mean that A exists alone, A and B exist together, and B exists alone. In addition, the character “ / ” herein generally represents an “or” relationship between the front and rear associated objects.

[0070] It should be understood that although the terms first, second, third, etc. can be used in the embodiments of the present application to describe, these descriptions should not be limited to these terms. These terms are only used to distinguish the description. For example, without departing from the scope of the embodiments of the present application, the first can also be called the second, and similarly, the second can also be called the first.

[0071] Depending on the context, the word “if” as used herein can be interpreted as “when” or “upon” or “in response to determining” or “in response to detecting”. Similarly, depending on the context, the phrase “if it is determined” or “if (a stated condition or event) is detected” can be interpreted as “when it is determined” or “in response to determining” or “when (a stated condition or event) is detected” or “in response to detecting (a stated condition or event)”.

[0072] It is also to be noted that the terms "comprising", "including", and any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but can include other elements not expressly listed or inherent to such process, method, article, or apparatus. An element proceeded by "comprises a... " does not, without more constraints, exclude the existence of additional identical elements in the process, method, article, or apparatus that comprises the element.

[0073] In particular, it should be noted that symbols and / or numbers present in the description, if not marked in the description of the figures, are not figure references.

[0074] With reference to Figure 1 A memory dynamic adjustment method comprises:

[0075] S101, in response to periodically collected resource performance indicators of a virtual machine and a host machine, forming historical standardized time series data, and performing normalization processing on the historical standardized time series data to obtain standardized time series data, wherein the resource performance indicators include memory usage and CPU load;

[0076] S102, performing anomaly detection and repair on the standardized time series data, and filtering abnormal data points exceeding a preset mutation threshold; if it is identified that the virtual machine is in a non-steady state operation, the prediction process is suspended;

[0077] S103, inputting the repaired standardized time series data into a double-scale time series convolution network model, outputting a future short-term memory usage rate sequence through a short-term prediction branch, and outputting a memory change trend label through a long-term trend branch;

[0078] S104, calculating a memory pressure entropy value representing memory resource competition intensity based on the future short-term memory usage rate sequence;

[0079] S105, generating a memory adjustment instruction based on the future short-term memory usage rate sequence, the memory change trend label, the memory pressure entropy value, and a preset multi-level constraint rule, triggering a hot plug operation according to the memory adjustment instruction, and executing a rollback mechanism when an adjustment anomaly is detected.

[0080] Specifically, in the embodiments of the present application, the periodic collection of virtual machine and host resource performance indicators covers memory usage and CPU load, thereby forming historical time series data; the historical time series data is normalized to obtain standardized time series data. The standardized time series data is subjected to anomaly detection and repair, and abnormal data points exceeding the preset mutation threshold are identified and filtered; at the same time, the virtual machine running state is monitored through the virtualization interface, and if it is identified as non-steady state, the prediction process is suspended. The repaired data is input into a double-scale time series convolution network model, which has a short-term prediction branch and a long-term trend branch: the short-term branch outputs a future short-term memory usage sequence, and the long-term branch outputs a multi-class trend label reflecting the direction of memory change. Based on the short-term prediction sequence, the memory resource competition intensity between multiple virtual machines on the host is quantified by calculating the information entropy, and a memory pressure entropy value is obtained. The future short-term memory usage sequence, the memory change trend label, the memory pressure entropy value and the preset multi-level constraint rule are integrated to generate a memory adjustment instruction; the hot plug operation is triggered according to the instruction to realize dynamic adjustment of memory, and when the host resource exceeds the limit or the business health is abnormal after adjustment, the rollback mechanism is automatically executed to restore to the original configuration.

[0081] For example, the periodically collected virtual machine memory usage data is a percentage value within a continuous period of time, and the CPU load is a utilization percentage, which is converted to the range of 0 to 1 after Min-Max normalization processing. In anomaly detection, the change rate of memory usage of adjacent sampling points is calculated, and if the change rate of a certain point exceeds 30%, it is considered abnormal, and the average value of the sliding window of the previous and subsequent 6 sampling points is used to replace the abnormal value; if it is detected that the virtual machine is in the initial stage of startup or shutdown, the prediction is suspended and the state is marked as unstable. The processed data is input into the prediction model, the short-term branch outputs a memory usage prediction value every 10 seconds in the next 5 minutes based on 30 minutes of historical data (10 minutes interval), and the long-term branch outputs a memory change trend of "decrease" in the next 1 hour based on 6 hours of historical data. When calculating the entropy value based on the predicted usage, assuming that there are 3 virtual machines that need to be adjusted on a certain host, their normalized prediction values are 0.85, 0.82 and 0.91 respectively, and the entropy value is calculated to be about 1.35. If the preset conflict threshold is 1.2 and the current utilization rate of the host is higher than 75%, the gradient adjustment strategy is triggered: according to the business priority, first perform the expansion operation on a single database class virtual machine, then adjust the next one after 30 seconds, and so on. If the host memory utilization exceeds 85% or the virtual machine business response delay exceeds 500 milliseconds after adjustment, the memory configuration changed in this adjustment is automatically rolled back.

[0082] In some applications, the standardized time series data is subjected to anomaly detection and repair, filtering abnormal data points exceeding a preset mutation threshold; if a virtual machine is identified to be in a non-steady state operation, the prediction process is suspended, including real-time monitoring of the memory change rate of adjacent sampling points, identifying abnormal data points with a change rate exceeding a preset mutation threshold; replacing the identified abnormal data points based on a sliding window mean algorithm to smooth data fluctuations; detecting the running state of the virtual machine through a virtualization state interface, suspending the prediction process and injecting a state identifier if it is in a non-steady state; if it returns to steady state operation, restart the prediction process.

[0083] It can be understood that the memory change rate of adjacent sampling points is monitored in real time, abnormal data points with a change rate exceeding a preset mutation threshold are identified, and a sliding window mean algorithm is used to replace the identified abnormal data points to smooth data fluctuations; the running state of the virtual machine is detected through a virtualization state interface, and if it is identified to be in a non-steady state, the prediction process is suspended and a state identifier is injected; after the virtual machine returns to steady state operation, restart the prediction process.

[0084] For example, when performing anomaly detection on the standardized memory usage time series data, the memory change rate between adjacent sampling points is calculated in real time, and if it is monitored that the memory usage rate of a sampling point changes from 45% to 89%, the change rate exceeds the preset 30% mutation threshold, the point is marked as an abnormal data point; repair using a sliding window mean algorithm, take a total of 6 sampling points before and after the abnormal point (for example, the data sequence in the time window is [46.2%, 45.8%, 47.1%, 89.0%, 46.5%, 47.3%]), calculate the window mean value after excluding the abnormal value as 46.58%, and replace the abnormal point 89% with this value, the repaired sequence is [46.2%, 45.8%, 47.1%, 46.58%, 46.5%, 47.3%]; query the virtual machine state through the virtualization interface, if it is identified that the virtual machine is in the first 180 seconds after startup or in the shutdown process, it is determined to be in a non-steady state, the prediction process is suspended and an "unstable" state identifier is injected; when continuously stable operation reaches 3 consecutive sampling periods, clear the state identifier and restart the prediction process.

[0085] In some applications, the repaired standardized time series data is input into a double-scale time series convolution network model, the future short-term memory usage rate sequence is output through a short-term prediction branch, and the memory change trend label is output through a long-term trend branch. The short-term prediction branch is based on the standardized time series data of the first historical length, extracts features through a causal convolution layer with a small expansion coefficient, and outputs the future short-term memory usage rate sequence. The long-term trend branch is based on the standardized time series data of the second historical length, regresses the memory change trend label through a causal convolution layer with a large expansion coefficient. When the long-term trend branch outputs a continuous downward trend, the expansion instruction generated by the short-term prediction branch is suppressed. The short-term prediction branch and the long-term trend branch are associated through a feature fusion layer, and the prediction output is optimized cooperatively.

[0086] It can be understood that the short-term prediction branch is based on the standardized time series data of the first historical length, extracts local time series features through a causal convolution layer with a small expansion coefficient, and outputs the future short-term memory usage rate sequence. The long-term trend branch is based on the standardized time series data of the second historical length, extracts long-period dependent features through a causal convolution layer with a large expansion coefficient, and regresses a multi-class trend label representing the memory change direction. When the long-term trend branch outputs a continuous downward trend, the expansion instruction generated by the short-term prediction branch is suppressed. The short-term prediction branch and the long-term trend branch are associated through a shared feature fusion layer, and the multi-scale time series features are cooperatively optimized and the prediction output is realized.

[0087] For example, the repaired standardized time series data is input into a double-scale time series convolution network model, the short-term prediction branch is based on 30 minutes of historical data (a total of 180 sampling points, with a sampling interval of 10 seconds), the input feature dimension is 3 (including memory usage rate, CPU usage rate and host memory usage rate), the branch uses causal convolution layers with expansion coefficients r=1, 2 and 4 to capture 10-second, 20-second and 40-second local time series patterns respectively, and outputs a 5-minute (30-point) memory usage rate prediction sequence, the value of which is between 0% and 100% after inverse normalization. The long-term trend branch is based on 6 hours of historical data (a total of 72 sampling points, with a sampling interval of 5 minutes), uses causal convolution layers with expansion coefficients r=8, 16 and 32 to cover hour-level long-period dependencies, and regresses a future 1-hour memory change trend label such as “up”, “stable” or “down”. If the long-term branch continuously outputs multiple “down” labels and the cumulative decline exceeds 15%, the expansion instruction output by the short-term branch is suppressed. The two branches share the underlying features through a feature fusion layer and independently calculate the output, and the prediction result is obtained through weighted fusion after cooperative optimization.

[0088] In some applications, based on the future short-term memory usage rate sequence, a memory pressure entropy value representing the intensity of memory resource competition is calculated, including traversing the virtual machines that need to be adjusted on the host machine to obtain normalized memory usage prediction values; based on the discrete distribution characteristics of the memory usage prediction values of each virtual machine, the uncertainty of resource competition is quantified by logarithmic operation; when the entropy value exceeds a first preset threshold, it is determined that there is a resource conflict risk; according to the entropy value, a concurrent adjustment strategy is selected, including batch parallel adjustment or time gradient adjustment according to business priority.

[0089] It can be understood that the normalized memory usage prediction values of the virtual machines that need to be adjusted on the host machine are obtained; based on the discrete distribution characteristics of the memory usage prediction values of each virtual machine, the uncertainty of resource competition is quantified by logarithmic function operation; when the calculated entropy value exceeds a first preset threshold, it is determined that there is a resource conflict risk; according to the size of the entropy value, a concurrent adjustment strategy is selected, including allowing batch parallel adjustment or requiring time gradient adjustment according to business priority.

[0090] For example, based on the predicted future short-term memory usage rate sequence, the normalized memory usage prediction values of the virtual machines that need to be adjusted on the host machine are obtained, for example, there are 3 virtual machines that need to be adjusted on a certain host machine, and their normalized prediction values are 0.85, 0.82 and 0.91; based on the discrete distribution characteristics of these prediction values, they are substituted into the entropy value calculation formula for logarithmic operation to quantify the uncertainty of resource competition, and the calculated entropy value is about 1.35; if the first preset conflict risk threshold is 1.2, since 1.35>1.2, it is determined that there is a resource conflict risk; according to the entropy value, a time gradient adjustment strategy according to business priority is selected, that is, the virtual machines are sorted according to the criticality of the business they carry, and the adjustment operation is performed on each virtual machine in turn with an execution interval of no less than 30 seconds, instead of simple batch parallel adjustment.

[0091] In some applications, the preset multi-level constraint rules include that the global memory utilization rate of the host machine does not exceed a safety threshold; the single memory adjustment amplitude does not exceed the upper limit of the proportion of the current memory of the virtual machine; the interval between two consecutive adjustments is not less than an anti-shock period; only when multiple consecutive sampling points exceed the usage rate threshold, the adjustment is triggered; when the memory pressure entropy value exceeds the conflict threshold, the gradient adjustment strategy according to business priority is activated.

[0092] It can be understood that the preset multi-level constraint rule includes limiting the host global memory utilization rate to be less than the safety threshold, limiting the single memory adjustment range to be less than the upper limit of the proportion of the current memory of the virtual machine, stipulating that the time interval between two consecutive adjustment operations is not less than the anti-shock period, requiring that the memory usage of a plurality of consecutive sampling points exceeding the preset threshold can trigger the adjustment process, and stipulating that when the memory pressure entropy value exceeds the conflict threshold, the gradient adjustment strategy according to the business priority level is activated.

[0093] For example, the specific parameters of the preset multi-level constraint rule are: the safety threshold of the host global memory utilization rate is set to 80%, the upper limit of the single memory adjustment range is set to 20% of the current memory of the virtual machine, the anti-shock period is set to 15 minutes, the memory usage of three consecutive sampling points exceeding 80% is required to trigger the adjustment, and the conflict threshold of the memory pressure entropy value is set to 1.2; when the entropy value calculation result exceeds 1.2, the gradient adjustment strategy is automatically activated, and the memory adjustment operation of a single virtual machine is performed in turn according to the business priority order of database service, key application, batch processing task, etc.

[0094] In some applications, based on the future short-term memory usage sequence, the memory change trend label, the memory pressure entropy value, and the preset multi-level constraint rule, a memory adjustment instruction is generated, the hot plug operation is triggered according to the memory adjustment instruction, and a rollback mechanism is executed when an adjustment exception is detected, including determining whether the adjustment condition is met based on the short-term memory usage sequence and the memory change trend label, and generating a memory adjustment value in combination with the multi-level constraint rule; the hot plug operation of the virtualization driver interface is executed without stopping; the host memory utilization rate and the virtual machine business health state are monitored in real time after the hot plug operation; if the host memory utilization rate exceeds the fuse threshold or the business response is abnormal, the memory configuration before the adjustment is rolled back.

[0095] It can be understood that the short-term memory usage sequence and the memory change trend label are comprehensively judged to determine whether the adjustment condition is met, and the memory adjustment value meeting the limitation requirement is calculated in combination with the multi-level constraint rule; the hot plug operation of the virtualization driver interface is called to execute the adjustment instruction; the host memory utilization rate and the virtual machine business health state are monitored in real time after the hot plug operation is completed; if the host memory utilization rate exceeds the fuse threshold or the virtual machine business response state is abnormal, the rollback mechanism is automatically triggered to restore the virtual machine memory configuration to the state before the adjustment.

[0096] For example, based on the predicted future short-term memory usage rate sequence exceeding 80% for consecutive multiple sampling points, the long-term trend label being "up", and the memory pressure entropy value being 1.35, and in combination with the preset multi-level constraint rules (such as the single adjustment amplitude not exceeding 20%), an adjustment instruction is generated to expand the virtual machine memory from 8GB to 9.6GB; the online hot plug operation is executed through the Virtio-Balloon driving interface of the KVM virtualization platform to realize the non-stop adjustment; after the adjustment is completed, the host memory utilization is monitored in real time, if the utilization rate exceeds the fuse threshold of 85% within 5 seconds, or the virtual machine business response delay is detected to be continuously more than 500 milliseconds through the health check interface, it is determined that the adjustment is abnormal, and the virtual machine memory configuration is automatically rolled back to the original 8GB.

[0097] In some applications, the memory pressure entropy value representing the memory resource competition intensity is calculated, only the virtual machine with the predicted memory usage rate in the high load or low load interval is included, the uncertainty of the usage rate distribution of each virtual machine is calculated through the logarithmic function, and the adjustment strategy is dynamically selected according to the entropy value, including batch parallel execution in low conflict, and adjustment operation is executed in time according to the business criticality in high conflict.

[0098] It can be understood that when calculating the memory pressure entropy value representing the memory resource competition intensity, only the virtual machine with the predicted memory usage rate in the high load interval or the low load interval is included in the calculation range, the uncertainty of the memory usage rate distribution of each virtual machine is quantified through the logarithmic function, and the adjustment strategy is dynamically selected according to the calculated entropy value. The strategy includes adjusting the operation in a batch parallel execution mode in a low conflict situation, and adjusting the operation in a time-sharing execution mode according to the business criticality in a high conflict situation.

[0099] For example, when calculating the memory pressure entropy value, the virtual machines with the predicted memory usage rate higher than 60% or lower than 30% are selected for calculation, for example, only 3 of the 5 virtual machines on a host meet the conditions, and the normalized prediction values are 0.85, 0.82 and 0.91 respectively; the prediction values are substituted into the entropy value calculation formula for logarithmic operation to quantify the uncertainty of resource competition, and the entropy value is calculated to be about 1.35; according to the preset strategy rule, when the entropy value is lower than 0.8, the batch parallel adjustment mode is adopted, when the entropy value is between 0.8 and 1.2, the batch adjustment mode (at most 3 at a time, interval 10 seconds) is adopted, and when the entropy value is higher than 1.2, the adjustment strategy according to the business criticality is enabled; based on the calculation result 1.35, the adjustment operation is executed in turn on each virtual machine according to the priority order of database service, critical application and batch processing task, and each virtual machine is interval 30 seconds.

[0100] The following will be described in combination with Figures 2 to 5 Another embodiment of the memory dynamic adjustment method of the application is described as follows:

[0101] As Figure 2 , Figure 3 , Figure 4 and Figure 5 shown, this embodiment includes the following steps:

[0102] Data collection engine: create a collection task in the data collection engine, and add a virtual machine node list and a host node, specify the collection range and frequency, and the data collection engine collects data in real time according to the content in the node list. The architecture supported by the data collection engine includes: C86, ARM, LoongArch, SW64, for the mainstream domestic CPU architecture, develop an architecture-aware driver module, which includes a pre-compiled multi-architecture adaptation library, which obtains the architecture identifier by reading / proc / cpuinfo, and realizes the automatic identification of the underlying chip architecture of the host; develop a special data collection interface for special architectures (such as the independent instruction set of SW64) to avoid compatibility problems of general interfaces in domestic architectures. At the same time, the Libvirt-Python toolkit is encapsulated again to add adaptation logic for domestic virtualization environments; through a unified abstract interface, the underlying differences are shielded to obtain virtual machine data, avoiding interface call failures due to differences in operating systems or virtualization stacks. Then, according to the differences in data format, unit and sampling precision under different domestic architectures, first convert the original data, and unify the data units specific to each architecture to "percentage" or "GB"; then unify the virtual machine data format, and standardize the collection data of all architectures to JSON format, ensuring that the subsequent modules do not need to pay attention to the differences in the underlying architecture.

[0103] For the data collection part, the Libvirt-Python is a Python language binding toolkit based on Libvirt API, which connects the local Qemu / KVM monitor program to obtain real-time JSON data of virtual machine instance level. The returned data information includes: instance ID, host physical memory global usage status, virtual machine maximum memory, virtual machine current memory, virtual machine current CPU time, and previous sampling CPU time. In the Libvirt tool, the CPU usage of the virtual machine cannot be directly obtained, but the actual usage can be calculated through CPU TIME, and the calculation formula is:

[0104] CPU time difference: cpuTime diff =(cpuTime now -cpuTime previous )

[0105] CPU usage: %cpu = 100 * cpuTime diff / (t*cores*1e9);

[0106] where cpuTime diff represent the CPU time difference, cpuTime now represent the current CPU time, cpuTime previous represent the previous sampling CPU time, the CPU time difference, i.e., the CPU time difference between adjacent sampling points. %cpu represents the CPU usage rate, t represents the time interval, and if the collection interval is 10 seconds, the value is 10. The number of vCPUs allocated to the virtual machine is represented. The final output is three types of data, namely, the virtual machine memory usage rate, the CPU usage rate, and the host machine memory usage rate.

[0107] Abnormal data filtering: To ensure the quality of the input data, abnormal data is filtered, and non-steady-state scenarios are identified. Based on the first-order difference algorithm, the memory change rate in adjacent sampling points is calculated, and when the change rate is > 30%, an abnormality is marked. For example, a sudden change in virtual machine memory is detected, and the memory usage rate changes from 45% to 89% (change rate 97.8%> 30%), triggering an abnormality mark. The window is taken as [08:49:30-08:50:30] 6 sampling points, and the sampling result is [46.2%, 45.8%, 47.1%, 89.0%, 46.5%, 47.3%], and the abnormal point 89% needs to be filtered, and the abnormal point 89% is replaced by the window mean value (46.2+45.8+47.1+46.5+47.3) / 5=46.58%, and the corrected sequence is: [46.2%, 45.8%, 47.1%, 46.58%, 46.5%, 47.3%], wherein the weight distribution is higher for recent data (such as the weight of the 6th point in the window is 0.3, and the weight of the 5th point is 0.25).

[0108] In addition, the state of the virtual machine is identified through the domestic virtualization interface domain.state, and when the virtual machine is detected to be in the initialization stage within 180 seconds after startup or in the shutdown process, the prediction is suspended and the state identifier "state: unstable" is injected, and after 3 consecutive sampling points are stable, the prediction is resumed, thereby ensuring the stable state of the virtual machine.

[0109] MIN-MAX normalization processing: TCN captures long-term dependencies through a cavity convolution, and the range of input data fluctuates greatly, which may cause the convolution kernel to be difficult to effectively learn local patterns. According to the three types of feature data obtained in the data collection engine, Min-Max normalization is performed on each feature, and the formula is as follows: x=(x-min) / (max-min), the range is between [0, 1]. The formula is as follows, wherein Max is the maximum value of the sample data, and Min is the minimum value of the sample data. An example of data preprocessing is as follows:

[0110]

[0111] Dual-scale TCN prediction: The normalized data is input into a dual-branch causal empty cavity convolutional network composed of a shared feature layer and an independent output layer. The network architecture uses causal convolution and dilated convolution to build a time series feature extraction basis, ensuring that the prediction only relies on historical data, avoiding future information leakage, and ensuring time domain unidirectionality. By configuring different dilated coefficients to capture multi-scale features: the short-term prediction branch sets the dilated coefficient r = 1, 2, 4, respectively, to capture 10-second local dynamics and minute-level periodic fluctuations; the long-term trend branch sets larger dilated coefficients r = 8, 16, 32 to cover hour-level long-period time series dependencies.

[0112] The short-term prediction branch is based on 30 minutes of historical data (180 sampling points, 10 seconds per point), and the input includes 3-dimensional features of memory usage, CPU usage, and host memory usage. The future 5-minute memory usage sequence (30 points) is calculated and output through the branch convolution layer; the long-term trend branch is based on 6 hours of historical data (72 sampling points, 5 minutes per point), which is suitable for the long-period fluctuation characteristics of domestic applications, and the regression output is the future 1-hour memory change trend label (up / stable / down). The dual-branch is associated through the feature fusion layer, and when the long-term trend is continuously decreasing, the expansion instruction execution of the short-term branch is suppressed.

[0113] Prediction error optimization: In virtual machine memory management, high load (such as usage > 80%) may cause resource shortage and business lag, and low load (such as usage < 20%) may cause resource waste. By amplifying the error weight of these key intervals through weighted MAE, the model is forced to prioritize reducing the prediction bias in key scenarios to improve the prediction accuracy of the model in these key intervals and avoid invalid expansion / contraction caused by inaccurate prediction. The formula of weighted MAE is as follows.

[0114]

[0115] where n is the total number of time steps, refers to the true value, refers to the predicted value, refers to the error, that is, the absolute difference between the predicted value and the true value, ω i is the weight of the th time step; according to whether the true value is in the high load or low load interval, the formula is dynamically adjusted as follows:

[0116]

[0117] High load interval (> 80%) weight 2.0, low load interval (< 20%) weight 1.5, normal interval (20% ≤ usage ≤ 80%) weight 1.0. By amplifying the error weight of the key interval, let the model prioritize optimizing the prediction accuracy of the key area during the training process. And the penalty weight in the high load interval should be higher than that in the low load interval because the system is close to the resource bottleneck, and prediction errors can cause service degradation, response delay, or even crash, which may trigger memory overflow errors when the model underestimates the memory requirements in the high load interval, usually requiring manual intervention, service restart, etc. While long-term idling of resources will cause waste, but compared to the urgent risk of high load, the consequences are relatively light. When overestimating the memory requirements in the low load, it will lead to low resource utilization but will not immediately affect service availability. Therefore, in actual business scenarios, high load scenarios have a higher risk priority to ensure the superior performance of the model in predicting high load.

[0118] Memory pressure entropy value calculation and conflict risk verification: based on memory pressure entropy value management and concurrent adjustment, solve the resource conflict problem when multiple virtual machines are adjusted at the same time. Calculate the memory pressure entropy value H Calculation formula:

[0119]

[0120] Traverse the virtual machines that need to be adjusted on the host machine, get the normalized memory prediction value ui, only include virtual machines with predicted usage > 60% or < 30%, and when ui < 0.05, truncate it to 0.05 (to prevent log calculation overflow). Example: the host machine needs to adjust 3 VMs, the normalized predicted usage is u1 = 0.85, u2 = 0.82, u3 = 0.91, and H = 1.35. The gradient execution strategy is divided into three levels. When H ≤ 0.8, the execution mode is batch parallel execution, i.e. adjusting all target virtual machines at the same time; when 0.8 < H ≤ 1.2, the execution mode is batch execution, with an interval of 10 seconds, and adjusting ≤ 3 virtual machines at a time; when H > 1.2 and the host utilization is greater than 75%, the execution mode is gradient execution, with an interval of 30 seconds. The priority sorting rules are database class virtual machines, key application services, batch processing tasks, and descending order of predicted values within the same level.

[0121] Multi-level constraint rule system: combine prediction results with constraint rules to calculate a reasonable memory adjustment scheme. The single adjustment amplitude should be ≤ 20% of the current memory and the continuous adjustment interval should be ≥ 15 minutes, the global memory utilization of the host should be ≤ 80%, and the continuous 3 sampling points should be > 80% to trigger adjustment. The above rules can effectively curb the business shock caused by frequent adjustments and reduce the adjustment shock frequency.

[0122] Memory dynamic adjustment and fault-tolerant control: the memory dynamic adjustment engine makes a multi-dimensional comprehensive decision based on the real-time memory utilization of the host, the short-term memory utilization sequence and the long-term trend label output by the TCN timing prediction model, and the preset resource policy of the virtual machine: when the short-term prediction sequence exceeds 80% for 3 consecutive sampling points, and the long-term trend is "up", the expansion process is triggered; when 3 consecutive sampling points are less than 20%, and the long-term trend is "down", the shrinkage process is triggered. Before memory adjustment, start multi-level hardware protection verification: first, verify whether the target memory value is within the MaxMemory and MinMemory range defined in the virtual machine XML configuration, and the single adjustment amplitude is less than or equal to 20% of the current memory; then get the available memory capacity through the host memory manager, ensure that the global memory utilization of the host after adjustment is less than or equal to 80%, and reserve an emergency memory pool of more than 5%; finally, check the Virtio-Balloon driver state and Libvirt interface connectivity.

[0123] After verification, the engine calls the virDomainSetMemoryFlags interface of Libvirt to send a hot adjustment instruction, relies on the Virtio-Balloon driver to dynamically adjust the memory balloon size, and realizes non-stop allocation through memory page online migration: if the host utilization is greater than 85% within 5 seconds after adjustment, or the virtual machine internal business health monitoring (such as response delay > 500ms) triggers an exception, the engine immediately executes virsh setmem<virtual machine name><original memory value> --live to roll back to the configuration before adjustment.

[0124] For the method steps disclosed in the above embodiments, the method steps are described as a series of action combinations for the purpose of simple description, but those skilled in the art should know that the embodiments of the present application are not limited by the order of the described actions, because according to the embodiments of the present application, certain steps can be performed in other order or simultaneously. Secondly, those skilled in the art should know that the embodiments described in the specification all belong to preferred embodiments, and the actions involved are not necessarily necessary for the embodiments of the present application.

[0125] As shown in Figure 6 The present application also provides a memory dynamic adjustment system, comprising:

[0126] A standardized timing data processing module 201 is configured to form historical standardized timing data in response to periodically collected resource performance indicators of virtual machines and hosts, and to obtain standardized timing data by normalizing the historical standardized timing data, wherein the resource performance indicators include memory utilization and CPU load.

[0127] The prediction process control module 202 is configured to perform anomaly detection and repair on the standardized time series data, filter out abnormal data points exceeding a preset mutation threshold, and pause the prediction process if it is identified that the virtual machine is in a non-steady state.

[0128] The prediction model output module 203 is configured to input the repaired standardized time series data into a double-scale time series convolution network model, output a future short-term memory usage rate sequence through a short-term prediction branch, and output a memory change trend label through a long-term trend branch.

[0129] The entropy value calculation module 204 is configured to calculate a memory pressure entropy value representing the intensity of memory resource competition based on the future short-term memory usage rate sequence.

[0130] The memory dynamic adjustment module 205 is configured to generate a memory adjustment instruction based on the future short-term memory usage rate sequence, the memory change trend label, the memory pressure entropy value, and a preset multi-level constraint rule, trigger a hot plug operation accordingly according to the memory adjustment instruction, and execute a rollback mechanism when an adjustment anomaly is detected.

[0131] It is worth noting that, although only some basic functional modules are disclosed in the embodiments of the present application, it does not mean that the composition of the system is limited to only the above basic functional modules. On the contrary, the meaning expressed in the embodiments is that one or more functional modules can be added by those skilled in the art based on the above basic functional modules in combination with existing technology to form an infinite number of embodiments or technical solutions. That is, the system is open rather than closed, and the protection scope of the present application claims cannot be limited to the disclosed basic functional modules. At the same time, for the convenience of description, the above device is described as various units and modules. Of course, the functions of the units and modules can be implemented in the same software and / or hardware.

[0132] As shown in Figure 7 The present application also provides an electronic device, comprising: a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory complete mutual communication through the communication bus; the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the memory dynamic adjustment method.

[0133] Figure 7 is a structural schematic diagram of an electronic device provided by the embodiments of the present application. As shown in the structure of Figure 7 The electronic device provided in the embodiments of the present application includes one or more processors 710 and a memory 720; the processor 710 in the electronic device can be one or more, Figure 7The processor 710 is taken as an example; the memory 720 is configured to store one or more programs; the one or more programs are executed by the one or more processors 710, so that the one or more processors 710 implement the memory dynamic adjustment method according to any one of the embodiments of the present application.

[0134] The electronic device can further include an input device 730 and an output device 740.

[0135] The processor 710, the memory 720, the input device 730 and the output device 740 in the electronic device can be connected through a bus or other means, Figure 7 The connection through the bus is taken as an example.

[0136] The memory 720 in the electronic device is a computer readable storage medium, which can be configured to store one or more programs, and the programs can be software programs, computer executable programs and modules, such as program instructions / modules of the memory dynamic adjustment method provided in the embodiments of the present application. The processor 710 executes the software programs, instructions and modules stored in the memory 720, so as to perform various function applications and data processing of the electronic device, that is, to implement the memory dynamic adjustment method in the above method embodiments.

[0137] The memory 720 can include a program storage area and a data storage area, wherein the program storage area can store an operating system and at least one application required by a function; the data storage area can store data created according to the use of the electronic device, etc. In addition, the memory 720 can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device or other non-volatile solid-state memory device. In some examples, the memory 720 can further include a memory remotely arranged with respect to the processor 710, and the remote memory can be connected to the device through a network. Examples of the above network include but are not limited to the Internet, an intranet, a local area network, a mobile communication network and a combination thereof.

[0138] The input device 730 can be configured to receive input digital or character information, and generate key signal input related to user settings and function control of the electronic device. The output device 740 can include a display device such as a display screen.

[0139] The present application also provides a computer readable storage medium, which stores a computer program executable by an electronic device, and when the computer program runs on the electronic device, the electronic device executes the steps of the memory dynamic adjustment method.

[0140] In particular, a computer storage medium of embodiments of the present application can employ any combination of one or more computer readable medium or media. The computer readable medium can be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In this embodiment, the computer readable storage medium can be any tangible medium that contains or stores a program used by an instruction execution system, apparatus, or device to function or to be combined with the instruction execution system, apparatus, or device.

[0141] Finally, it should be noted that the above-described embodiments are merely used to illustrate the technical solutions of the present application, rather than limit the technical solutions of the present application; even though the present application has been described in detail with reference to the above embodiments, those of ordinary skill in the art should understand that modifications can be made to the technical solutions recorded in the above embodiments, or some or all of the technical features thereof can be equivalently replaced; and these modifications or replacements do not cause the essence of the corresponding technical solutions to depart from the scope of the technical solutions of the embodiments of the present application.

Claims

1. A method for dynamically adjusting memory, characterized in that, include: In response to the periodically collected resource performance indicators of virtual machines and host machines, historical standardized time-series data is formed. The historical standardized time-series data is normalized to obtain standardized time-series data. The resource performance indicators include memory utilization and CPU load. The standardized time-series data is subjected to anomaly detection and repair, and abnormal data points exceeding the preset mutation threshold are filtered out; if the virtual machine is found to be running in an unstable state, the prediction process is paused. The repaired standardized time series data is input into a dual-scale temporal convolutional network model. The short-term prediction branch outputs the future short-term memory usage sequence, and the long-term trend branch outputs the memory change trend label. Based on the aforementioned future short-term memory usage sequence, calculate the memory pressure entropy value, which characterizes the intensity of memory resource competition. Based on the future short-term memory usage sequence, memory change trend label, memory pressure entropy value and preset multi-level constraint rules, a memory adjustment instruction is generated, a hot-plug operation is triggered according to the memory adjustment instruction, and a rollback mechanism is executed when an adjustment anomaly is detected. Among them, the memory change rate of adjacent sampling points is monitored in real time, and abnormal data points whose change rate exceeds the preset mutation threshold are identified; The identified outlier data points are replaced using a sliding window mean algorithm to smooth out data fluctuations. The running status of the virtual machine is detected through the virtualization state interface. If it is in an unstable state, the prediction process is paused and a state identifier is injected. If the system returns to steady-state operation, the prediction process will be restarted. Among them, the preset multi-level constraint rules include: The host machine's global memory utilization does not exceed the safe threshold; The amount of memory adjustment in a single instance shall not exceed the maximum proportion of the virtual machine's current memory. The interval between two consecutive adjustments should not be less than the anti-oscillation cycle; Adjustment is only triggered when multiple consecutive sampling points exceed the usage threshold. When the memory pressure entropy value exceeds the conflict threshold, a gradient adjustment strategy based on business priority is activated.

2. The method for dynamically adjusting memory according to claim 1, characterized in that, The repaired, standardized time-series data is input into a dual-scale temporal convolutional network model. The short-term prediction branch outputs the future short-term memory usage sequence, and the long-term trend branch outputs memory change trend labels, further including: The short-term prediction branch is based on standardized time-series data of the first historical duration. It extracts features through a causal convolutional layer with a small inflation coefficient and outputs a sequence of future short-term memory usage. The long-term trend branch is based on standardized time-series data with a second historical duration, and outputs memory change trend labels through causal convolutional layer regression with a large inflation coefficient; When the output of the long-term trend branch is in a continuous downward trend, the expansion instruction generated by the short-term prediction branch is suppressed. The short-term prediction branch and the long-term trend branch are linked through a feature fusion layer to collaboratively optimize the prediction output.

3. The method for dynamically adjusting memory according to claim 1, characterized in that, Based on the aforementioned future short-term memory usage sequence, the memory pressure entropy value, which characterizes the intensity of memory resource contention, is calculated, further including: Iterate through the virtual machines on the host machine that need to be adjusted and obtain the normalized memory usage prediction value; Based on the discrete distribution characteristics of the predicted memory usage of each virtual machine, the uncertainty of resource competition is quantified through logarithmic operations; When the entropy value exceeds the first preset threshold, it is determined that there is a risk of resource conflict. Select a concurrent adjustment strategy based on the entropy value, including batch parallel adjustment or time-sharing gradient adjustment according to business priority.

4. The method for dynamically adjusting memory according to claim 1, characterized in that, Based on the future short-term memory usage sequence, memory change trend labels, memory pressure entropy values, and preset multi-level constraint rules, a memory adjustment instruction is generated. Hot-plugging operations are triggered accordingly based on the memory adjustment instruction, and a rollback mechanism is executed when an adjustment anomaly is detected. Further, this includes: The system determines whether the adjustment conditions are met based on short-term memory usage sequences and memory change trend labels, and generates memory adjustment values ​​by combining multi-level constraint rules. Perform uninterrupted memory hot-plugging operations through the virtualization driver interface; Real-time monitoring of host machine memory utilization and virtual machine service health status after hot-plugging operation; If the host machine's memory utilization exceeds the circuit breaker threshold or the service response is abnormal, the memory configuration will be rolled back to its previous state.

5. The method for dynamically adjusting memory according to claim 3, characterized in that, The memory pressure entropy value, which characterizes the intensity of memory resource contention, is calculated. Only virtual machines whose predicted memory utilization is in the high or low load range are included. The uncertainty of the utilization distribution of each virtual machine is calculated by a logarithmic function, and the adjustment strategy is dynamically selected according to the entropy value. This includes batch parallel execution when there is low conflict, and adjustment operations are performed in stages according to business criticality when there is high conflict.

6. A memory dynamic adjustment system, used in the memory dynamic adjustment method of claim 1, characterized in that, include: A standardized time-series data processing module is configured to respond to periodically collected resource performance indicators of virtual machines and host machines, form historical standardized time-series data, and perform normalization processing on the historical standardized time-series data to obtain standardized time-series data. The resource performance indicators include memory utilization and CPU load. The prediction process control module is configured to perform anomaly detection and repair on the standardized time series data, filter out abnormal data points that exceed a preset mutation threshold, and pause the prediction process if the virtual machine is detected to be in an unstable state. The prediction model output module is configured to input the repaired standardized time series data into a dual-scale temporal convolutional network model, output the future short-term memory usage sequence through the short-term prediction branch, and output the memory change trend label through the long-term trend branch. The entropy calculation module is configured to calculate the memory pressure entropy value, which characterizes the intensity of memory resource competition, based on the future short-term memory usage sequence. The memory dynamic adjustment module is configured to generate memory adjustment instructions based on the future short-term memory usage sequence, memory change trend labels, memory pressure entropy value, and preset multi-level constraint rules, trigger hot-plug operations according to the memory adjustment instructions, and execute a rollback mechanism when an adjustment anomaly is detected.

7. An electronic device, characterized in that, include: The system includes a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other via the communication bus; the memory stores a computer program, which, when executed by the processor, causes the processor to perform the steps of the method according to any one of claims 1 to 5.

8. A computer-readable storage medium, characterized in that, It stores a computer program executable by an electronic device, which, when run on the electronic device, causes the electronic device to perform the steps of the method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Space-Time Prediction Algorithm Based on Federated Learning on Industrial Internet of Things Edge Devices

    CN114265913B

  • Cloud collaborative container elastic scaling method, device and electronic equipment

    CN118041787B

  • Memory optimization method based on AI scheduling task

    CN119065856A

  • Free memory trending for detecting out-of-memory events in virtual machines

    US20160371180A1