Plasma control system resource use prediction method based on LSTM

By introducing LSTM-based resource usage prediction methods in the plasma control system, the problem that traditional methods are difficult to capture the long-term trend of resource usage is solved, and accurate prediction and health assessment of CPU and memory resource usage is achieved, and the system stability and fault detection capabilities are improved.

CN120234221AActive Publication Date: 2025-07-01HEFEI INSTITUTE OF PHYSICAL SCIENCE CHINESE ACADEMY OF SCIENCES
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510381301.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-28
Publication Date
2025-07-01
Estimated Expiration
2045-03-28

AI Technical Summary

Technical Problem

Traditional plasma control system health monitoring methods are difficult to capture the long-term trend of resource use, especially in tasks with periodic fluctuations, making it difficult to predict abnormal situations of resource use.

Method used

The LSTM-based resource usage prediction method is adopted to achieve accurate prediction and health assessment of resource usage through data preprocessing and feature extraction, introduction of LSTM networks, time series prediction, embedded feature and feature separation strategy, standard value prediction and memory leak detection, health index calculation and feedback adjustment.

Benefits of technology

It significantly improves the accuracy of CPU occupancy and memory allocation prediction, can accurately judge the health status of the system, quickly identify memory leak trends, improve the sensitivity and reliability of fault detection, and ensure the stability and security of system operation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120234221A_ABST
    Figure CN120234221A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of nuclear fusion Tokamak device control systems, in particular to a plasma control system resource use prediction method based on LSTM. According to the technical scheme, the method comprises the steps of data preprocessing and feature extraction, introduction of an LSTM network for time sequence prediction, feature embedding and feature separation strategy embedding, standard value prediction and memory leak detection, health index calculation and feedback adjustment and feedback adjustment in a prediction period. The method is used for predicting the standard value of resource use in the system operation process and judging whether the resource use deviates from the standard value too much or not by comparing the standard value with real-time monitoring data, can capture long-term dependency and nonlinear change rules of system resource use, is particularly suitable for processing complex periodic waveforms, and has high practicability. The method not only can improve the precision of the predicted standard value, but also can more effectively evaluate the health condition of the system and early warn potential abnormal conditions in advance, and provides important support for stable operation of the system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of the control system of a nuclear fusion tokamak device, and particularly to a method for predicting resource usage of a plasma control system based on LSTM. Background Art

[0002] With the increasing functional complexity of the Plasma Control System (PCS) and the dynamic changes in the operating environment, it has become crucial to evaluate the system health status in real time and predict the standard values of resource usage. The PCS usually needs to handle multiple real-time tasks, and the control algorithms and functions running at different times vary. The occupancy of resources such as CPU and memory shows significant dynamic characteristics. In addition, since many control algorithms and functions are encapsulated in the form of "black boxes", the external system cannot directly know the changing rules of their internal resource consumption, which brings great challenges to real-time health assessment and resource scheduling.

[0003] Traditional health monitoring methods usually rely on the real-time monitoring of key performance indicators (KPIs) such as CPU occupancy rate and memory usage rate. However, these methods can only capture the static data at the current moment and lack the ability to analyze and judge the long-term changing trends of the indicators. This makes it difficult for the system to predict abnormal resource usage in a timely manner, especially in tasks with periodic fluctuation characteristics (such as the intermittent discharge mode in PCS), where the resource usage waveform shows the characteristics of alternating busy areas and non-busy areas. Facing such complex dynamic waveforms, traditional methods are difficult to provide accurate reference standards for health assessment, thereby affecting the accuracy of health status judgment and resource scheduling.

[0004] Therefore, this application proposes a method for predicting resource usage of a plasma control system based on LSTM. Summary of the Invention

[0005] The object of the present invention is to address the problem in the background art that traditional health monitoring methods usually rely on the real-time monitoring of key performance indicators (KPIs) such as CPU occupancy rate and memory usage rate and lack the ability to analyze and judge the long-term changing trends of the indicators, and to propose a method for predicting resource usage of a plasma control system based on LSTM.

[0006] The technical solution of the present invention: A method for predicting resource usage of a plasma control system based on LSTM includes the following steps:

[0007] Data preprocessing and feature extraction: Collect and process the operation data of the plasma control system, select the characteristic indicators reflecting the system operation state, and perform standardization processing;

[0008] Introduce the LSTM network for time series prediction: construct an LSTM model, use historical data to train the model to predict the standard value of resource usage at future time points, and enhance the model adaptability through the sliding window method;

[0009] Embedding feature and feature separation strategy: generate embedding vectors for the system state, and separate the memory waveform into busy and non-busy states;

[0010] Standard value prediction and memory leak detection: collect system operation data in real time, apply the LSTM model to predict the future standard value of resource usage, calculate and monitor the difference and its increment between the actual memory waveform and the predicted standard value to detect memory leaks;

[0011] Health index calculation and feedback adjustment: calculate the system health index based on the actual difference, introduce a time decay factor, and adjust the health index when a memory leak is detected;

[0012] Feedback adjustment during the prediction period: according to the memory leak detection result, perform feedback adjustment on the prediction input and perform cyclic prediction at a certain time step.

[0013] Optionally, the data preprocessing and feature extraction specifically include:

[0014] Data collection: collect time series data on CPU occupancy rate and memory allocation resource usage during system operation, ensuring that the data includes resource consumption under different system operation states;

[0015] Feature selection: select feature indicators reflecting the system operation state, and the feature indicators include:

[0016] Algorithm type: the type of control algorithm currently running;

[0017] Trigger state: the state of the system under different trigger conditions;

[0018] Operation stage: the operation stage of the control system; the operation stage includes initialization, operation, and pause;

[0019] Dynamic resource utilization: including resource utilization data on historical CPU occupancy rate and dynamic changes in memory allocation.

[0020] Standardization processing: perform standardization processing on the input features to eliminate the scale difference between different features and ensure the stability and efficiency of model training.

[0021] Optionally, the introduction of the LSTM network for time series prediction specifically includes:

[0022] Model structure determination: Construct an LSTM model, set the input window to 200 time steps, and the input features of the model include the CPU occupancy rate of the previous step, memory allocation, and the current system state;

[0023] Time series learning: Use historical data to train the LSTM model. The model learns the relationship between different system operation stages and resource usage to predict the standard resource usage values at future time points; the standard resource usage values include the standard CPU occupancy rate and the standard memory value;

[0024] Model training: Through the sliding window method, the training data is divided into multiple small windows to cover all possible operation states and enhance the model's adaptability to resource fluctuations.

[0025] Optionally, the embedding feature and feature separation strategy specifically include the following steps:

[0026] Embedding feature: Conduct statistical analysis on the system state to generate an embedding vector to replace the traditional digital encoding. The system state includes the algorithm type and trigger state;

[0027] Feature separation: In view of the obvious square wave characteristic of the memory waveform, separate the memory occupancy rate into busy areas and non-busy areas, and use them as independent input features for the LSTM model to learn. The obvious square wave characteristic of the memory waveform is the alternating change of busy areas and non-busy areas.

[0028] Optionally, the standard value prediction steps are as follows:

[0029] Real-time data collection: During the system operation, collect the data of CPU occupancy rate and memory allocation resource usage in real time to form a time series;

[0030] Application of the LSTM prediction model: Use the trained LSTM network model to predict the resource usage of the system in the future for a period of time (e.g., within 10 seconds). The LSTM model will predict the standard CPU occupancy rate and memory allocation values at future time points according to historical data. The historical data includes CPU occupancy rate, memory usage, and control algorithm type;

[0031] Input features: Include the control algorithm type, trigger state, and system state features at the current moment of operation stage. Combine the CPU and memory storage information of the previous moment to provide sufficient context information for the LSTM model;

[0032] Prediction process: The time series relationship learned by the LSTM model during training is used to predict the standard resource usage value M p (t). The standard resource usage values include the standard memory value and the standard CPU occupancy rate;

[0033] Standard value output: The standard value M output by the LSTM model p (t) is the "ideal" value of future resource usage predicted by the model based on historical data. The standard value is used as a benchmark for health assessment and is compared with the actual memory usage data.

[0034] Optionally, the memory leak detection specifically includes the following steps:

[0035] Compare with the actual memory usage:

[0036] Obtain the actual memory usage data: Real-time monitor the actual memory waveform M r (t) of the system, that is, the current memory occupancy of the system;

[0037] Calculate the difference: Calculate the difference between the actual memory waveform M r (t) and the predicted standard value M p (t), that is

[0038] D(t) = |M r (t) - M p (t)|

[0039] where D(t) is the difference value at the current time point t, indicating the deviation between the actual memory usage and the predicted standard value;

[0040] Calculate the difference increment:

[0041] Calculate the difference increment ΔD(t): To detect the occurrence of memory leakage, it is necessary to calculate the change rate of the difference D(t), that is, the difference increment ΔD(t) = diff(D(t)), and diff(D(t)) is the difference increment of the calculated difference value D(t) over time, reflecting the change in the deviation between the actual memory usage and the standard value;

[0042] Memory leak detection:

[0043] Judge whether the difference increment exceeds the threshold: If the difference increment ΔD(t) > leakageThreshold, it is considered that a memory leak has occurred. The threshold is determined by experimental data or experience, indicating that the deviation between the actual memory usage and the predicted value increases too fast, indicating that there may be a resource leak;

[0044] Set the memory leak status: At this time, the memory leak status is set to

[0045]

[0046] where isLeakage(t) = 1 indicates that the system detects a memory leak, and isLeakage(t) = 0 indicates that no memory leak is detected.

[0047] Optionally, the health index calculation and feedback adjustment specifically include the following steps:

[0048] Calculate the health index. In the prediction method of the resource usage of the plasma control system based on LSTM, it is necessary to calculate the health index of the system based on the actual difference, and its definition is:

[0049]

[0050] The health index H(t) represents the degree of system health. The smaller the difference D(t), the higher the health index. The health index H(t) is used to evaluate the health status of system resource usage in real time;

[0051] Introduce a time decay factor to simulate the decay of the health state over time. Introduce the time decay factor where τ is the decay constant that controls the decay rate; this decay factor ensures that the health state gradually decreases over time and avoids overly high health assessments over a long period.

[0052] Adjustment of the health index in the case of memory leakage. If memory leakage is detected, i.e., isLeakage(t) = 1, the health index will drop rapidly, and the health index will be multiplied by the decay factor to represent the rapid deterioration of the system health state. The calculation formula is:

[0053]

[0054] where, is the health index after introducing time decay, representing the rapid decline of the system health state in the case of memory leakage.

[0055] Optionally, the feedback adjustment within the prediction period specifically includes the following steps:

[0056] Feedback adjustment: If the system does not detect memory leakage, the actual memory waveform M r (t) is used as the input to continue predicting the standard value at the next time point. If memory leakage is detected, the predicted standard memory waveform M p (t) is used as the input for the next cycle, instead of using the actual memory waveform M r (t);

[0057] Recursive prediction: The prediction period will perform iterative prediction at time steps such as 10 seconds and 20 seconds, continuously monitoring the health status and resource usage of the system.

[0058] Compared with the prior art, the present application includes at least one of the following beneficial technical effects:

[0059] By introducing LSTM, the long-term dependencies and dynamic change characteristics of resource usage in PCS are effectively captured. Combining the embedded features and the feature separation strategy significantly improves the accuracy of CPU occupancy and memory allocation prediction, especially under complex periodic waveforms.

[0060] Based on the predicted standard values of resource usage, real-time comparison with the actual values can accurately determine the health status of the system. Combining the time decay mechanism of the health index makes the system more intuitive in the dynamic changes of the health state, supporting rapid diagnosis and localization of potential problems.

[0061] The proposed memory leak detection algorithm can identify the memory leak trend in real time by calculating the difference and difference increment between the actual value and the standard value. This method can effectively avoid misjudgment caused by resource fluctuations and improve the sensitivity and reliability of system fault detection.

[0062] Through the feedback adjustment mechanism, when a memory leak occurs, the predicted standard value is used to replace the actual value as the input for the next cycle, preventing the negative impact of the memory leak on model prediction and maintaining the efficiency and accuracy of resource usage prediction.

[0063] Using the sliding window method and multi-stage training data enhances the adaptability of the LSTM model to different scenarios during the operation of PCS. Whether in the initialization, operation, or abnormal stages, the technical solutions of the present invention can effectively cope with them.

[0064] Through the real-time feedback of the health index and the memory leak detection results, the system can identify and respond to potential risks in the early stage, reduce system interruptions or experimental delays caused by failures, and improve the reliability and safety of system operation.

[0065] The technical solutions of the present invention are not only applicable to the prediction of CPU occupancy and memory allocation, but also can be extended to other resources, providing a general solution for the overall resource optimization and health assessment of the system.

[0066] The present invention is used to predict the standard values of resource usage during the operation of the system, and by comparing with the real-time monitoring data, it determines whether the resource usage deviates too much from the standard values. The LSTM network can capture the long-term dependencies and non-linear change laws of system resource usage through learning historical operation data, and is particularly suitable for processing complex periodic waveforms. In addition, this method combines the embedded features and the feature separation strategy, which can not only improve the accuracy of predicting the standard values, but also more effectively evaluate the system health status and early warning of potential abnormal situations, providing important support for the stable operation of the system. BRIEF DESCRIPTION OF THE DRAWINGS

[0067] Figure 1Comparison between predicted waveform and actual waveform - Comparison graph of predicted and actual memory usage waveforms;

[0068] Figure 2 Comparison between predicted waveform and actual waveform - Curve graph of mean absolute error for different predictions;

[0069] Figure 3 Comparison between predicted waveform and actual waveform - Curve graph of mean squared error for different predictions;

[0070] Figure 4 Comparison between predicted waveform and actual waveform - Curve graph of coefficient of determination for different predictions;

[0071] Figure 5 Comparison between 10 - second predicted waveform and actual waveform - CPU usage: 10 - second prediction accuracy graph;

[0072] Figure 6 Comparison between 10 - second predicted waveform and actual waveform - Memory usage: 10 - second prediction accuracy graph. Detailed implementation manner

[0073] The technical solution of the present invention will be further described below in conjunction with the accompanying drawings and specific embodiments.

[0074] Embodiment 1

[0075] As Figure 1 shown, a method for predicting resource usage of a plasma control system based on LSTM proposed by the present invention includes data pre - processing and feature extraction, introducing an LSTM network for time - series prediction, embedding feature and feature separation strategy, standard value prediction and memory leak detection, health index calculation and feedback adjustment, and feedback adjustment within the prediction period. Each step will be described in detail below.

[0076] The first step: Data pre - processing and feature extraction

[0077] Before model training, it is first necessary to pre - process the historical operation data of the system. The specific steps are as follows:

[0078] 1. Data collection: Collect time - series data on resource usage such as CPU occupancy rate and memory allocation during the operation of the system, ensuring that the data includes resource consumption under different system operation states.

[0079] 2. Feature selection: Select feature indicators reflecting the system operation state, mainly including:

[0080] Algorithm type: The type of control algorithm currently running.

[0081] Trigger state: The state of the system under different trigger conditions.

[0082] Operation phase: The operation phase in which the control system is located (including initialization, operation, and pause).

[0083] Dynamic resource utilization: It includes resource utilization data with dynamic changes such as historical CPU occupancy and memory allocation.

[0084] Standardization processing: Standardize the input features to eliminate the scale differences between different features and ensure the stability and efficiency of model training.

[0085] Step 2: Introduce the LSTM network for time series prediction

[0086] After data preprocessing and feature extraction, use the Long Short-Term Memory network (LSTM) to predict the CPU occupancy and memory allocation of the system. LSTM is suitable for processing time series data and can capture long-term dependencies in the data. The specific steps are as follows:

[0087] 1 Determination of model structure: Build an LSTM model, set the input window to 200 time steps, and the input features of the model include the previous CPU occupancy, memory allocation, and the current system state, etc.

[0088] 2 Time series learning: Use historical data to train the LSTM model. The model learns the relationship between different system operation phases and resource usage to predict the standard values of resource usage at future time points (such as standard CPU occupancy and standard memory values).

[0089] 3 Model training: Through the sliding window method, divide the training data into multiple small windows to cover all possible operation states and enhance the model's adaptability to resource fluctuations.

[0090] Step 3: Embedded feature and feature separation strategy

[0091] To further improve the prediction accuracy, the present invention introduces an embedded feature and a feature separation strategy into the LSTM model:

[0092] 1 Embedded feature: Conduct statistical analysis on the system state (such as algorithm type, trigger state) to generate embedded vectors to replace traditional digital coding. These embedded vectors have physical meanings and can better reflect the resource usage characteristics, thereby enhancing the model's ability to model the non-linear relationship between the system state and resource usage.

[0093] 2 Feature separation: In view of the obvious square wave characteristic of the memory waveform (that is, the busy area and the non-busy area alternate), separate the memory occupancy rate according to the busy area and the non-busy area, and use them as independent input features for the LSTM model to learn. This separation method effectively reduces the interference of resource usage fluctuations in different phases and enhances the model's prediction ability for complex waveforms.

[0094] Step 4: Standard Value Prediction and Memory Leak Detection

[0095] In the present invention, the standard value prediction and memory leak detection are based on comparing the output of the LSTM prediction model with the actual memory usage to determine whether there is a memory leak in the system. This process is divided into the following steps, aiming to improve the accuracy of memory usage prediction and detect potential memory leak problems in the system by comparing the differences between the predicted standard values and the actual values.

[0096] 1 Standard value prediction:

[0097] Collect data in real time: During the operation of the system, collect data on resource usage such as CPU occupancy and memory allocation in real time to form a time series.

[0098] Apply the LSTM prediction model: Use the trained LSTM network model to predict the resource usage of the system in the future for a period of time. Specifically, the LSTM model will predict the standard CPU occupancy and memory allocation values in the future for a period of time (e.g., 10 seconds) based on historical data (such as CPU occupancy, memory usage, and control algorithm type characteristics).

[0099] Input features: Include the control algorithm type, trigger status, and system status characteristics at the current moment, combined with the CPU and memory occupancy information at the previous moment, to provide sufficient context information for the LSTM model.

[0100] Prediction process: The temporal relationship learned by the LSTM model during training is used to predict the standard resource usage value M p (t) (standard memory value and standard CPU occupancy).

[0101] Standard value output: The standard value M p (t) output by the LSTM model is the "ideal" value of future resource usage inferred by the model based on historical data. These standard values are used as the benchmarks for health assessment and compared with the actual memory usage data.

[0102] 2 Compare with the actual memory usage

[0103] Obtain the actual memory usage data: Monitor the actual memory waveform M r (t) of the system in real time, that is, the current memory occupancy of the system.

[0104] Calculate the difference: Calculate the difference between the actual memory waveform M r (t) and the predicted standard value M p (t), that is:

[0105] D(t) = |Mr (t)-M p (t)|

[0106] Among them, D(t) is the difference value at the current time point t, representing the deviation between the actual memory usage and the predicted standard value.

[0107] 3 Difference increment calculation

[0108] Calculate the difference increment ΔD(t): To detect the occurrence of memory leakage, it is necessary to calculate the change rate of the difference D(t), that is, the difference increment:

[0109] ΔD(t) = diff(D(t))

[0110] Here, diff(D(t)) is to calculate the difference increment of the difference value D(t) with respect to time, reflecting the change situation of the deviation between the actual memory usage and the standard value.

[0111] 4 Memory leakage detection

[0112] Judge whether the difference increment exceeds the threshold: If the difference increment ΔD(t) > leakageThreshold, it is considered that memory leakage has occurred. This threshold is determined by experimental data or experience, indicating that the deviation between the actual memory usage and the predicted value increases too fast, suggesting that there may be resource leakage.

[0113] At this time, the memory leakage status isLeakage(t) is set to:

[0114]

[0115] Among them, isLeakage(t) = 1 indicates that the system detects memory leakage, and isLeakage(t) = 0 indicates that no memory leakage is detected.

[0116] Step 5: Health index calculation and feedback adjustment

[0117] Calculate the health index H(t): Calculate the health index of the system based on the actual difference D(t), defined as:

[0118]

[0119] The health index H(t) represents the degree of system health. The smaller the difference D(t), the higher the health index. This index is used to evaluate the health status of system resource usage in real time.

[0120] Introduce the time decay factor: To simulate the decay of the health state over time, add the time decay factor where τ is the decay constant that controls the decay rate. This decay factor ensures that the health state gradually decreases over time, avoiding overly high health assessments over an extended period.

[0121] Health index adjustment in the case of memory leakage: If memory leakage is detected, i.e., isLeakage(t) = 1, the health index will drop rapidly. At this time, the health index will be multiplied by the decay factor to represent the rapid deterioration of the system health state:

[0122]

[0123] where, is the health index after introducing time decay, representing the rapid decline of the system health state in the case of memory leakage.

[0124] Step 6: Feedback adjustment during the prediction period

[0125] Feedback adjustment: If the system does not detect memory leakage, the actual memory waveform M r (t) is used as the input to continue predicting the standard value at the next time point. If memory leakage is detected, the predicted standard memory waveform M p (t) is used as the input for the next cycle, instead of using the actual memory waveform M r (t). This feedback mechanism can prevent memory leakage from having an adverse impact on future predictions and ensure the accuracy of system health assessment.

[0126] Recursive prediction: The prediction period will perform iterative predictions at time steps of 10 seconds and 20 seconds, continuously monitoring the system's health status and resource usage.

[0127] The present invention dynamically predicts the standard values of CPU occupancy and memory allocation in the PCS through LSTM. The LSTM network has the ability to process time series data, can accurately capture the long-term dependencies and dynamic change characteristics of resource usage, and provides a benchmark reference for health assessment. This method significantly improves the accuracy and real-time performance of resource usage prediction in complex operating environments. A memory leakage detection method based on standard value prediction is proposed. By calculating the difference and difference increment between the actual resource usage value and the predicted standard value, it can quickly determine whether there is a memory leakage problem in the system. This method can track the dynamic trend of memory leakage in real time and improve the accuracy of system fault detection.

[0128] The present invention introduces a time decay factor to dynamically adjust the health index, simulating the change of the system health state over time. When a memory leak is detected, the health index drops rapidly, intuitively reflecting the deterioration of the system health and supporting the operation and maintenance personnel to respond quickly. In terms of the waveform characteristic processing of memory allocation, a feature embedding and separation strategy is proposed. By embedding features, the modeling ability of the non-linear relationship between the system state and resource usage is enhanced. At the same time, a method of separating the characteristics of the busy area and the non-busy area is adopted to effectively reduce the interference of resource fluctuations in different operation stages and further improve the prediction accuracy.

[0129] The present invention introduces a feedback mechanism to dynamically adjust the prediction input according to the memory leak detection result, ensuring the accuracy of future predictions. By using the actual value as the input for the next cycle when there is no memory leak and using the standard value when a memory leak occurs, the impact of memory leaks on the model performance is avoided.

[0130] In order to verify the technical effects of the present invention, experimental verification is carried out.

[0131] I. Verification of Model Prediction Accuracy

[0132] The optimized model accurately predicted the PCS memory allocation and CPU utilization in the experiment. In the comparative experiment, the basic model, the enhanced embedding model, and the final optimized model were used for prediction respectively, and the specific steps are as follows:

[0133] Experimental Design:

[0134] Select the time series data of memory allocation and CPU utilization generated during the operation of PCS.

[0135] Apply the basic model, the enhanced embedding model, and the final optimized model to the same test data set.

[0136] Compare the deviation between the predicted values and the actual values of the three models.

[0137] Experimental Results:

[0138] As Figure 1 shows the prediction results of the basic model, the enhanced embedding model, and the final optimized model.

[0139] The red curve represents the actual memory usage value.

[0140] The blue curve is the prediction result of the basic model, with a large deviation.

[0141] The yellow curve is the prediction result of the enhanced embedding model, with improved accuracy.

[0142] The purple curve is the prediction result of the final optimized model, which highly coincides with the actual value.

[0143] The results show that the final optimized model significantly reduces the bias and meets the prediction accuracy requirements of the PCS.

[0144] Performance evaluation:

[0145] Compare the predicted waveform with the actual waveform and calculate the mean squared error (MSE), mean absolute error (MAE), and fractional quantization model performance (R 2 ).

[0146] The experimental results are as Figures 1 - 4 shown. The final optimized model has the highest degree of fitting with the actual waveform. The MSE and MAE of the final optimized model are the lowest, and the R 2 score is the highest, verifying its excellent prediction ability.

[0147] II: Verification of short-term prediction ability

[0148] In this experiment, verify the prediction ability of the model for resource usage in the short term. The specific steps are as follows:

[0149] Prediction method:

[0150] Set the prediction window length to 200 seconds, and use time series data to predict the memory allocation and CPU utilization within the next 10 seconds.

[0151] After each prediction, use the predicted value as the input for the next round of prediction and iterate continuously 10 times.

[0152] The sliding window moves forward 1 second each time, and repeat the above process to generate prediction results covering multiple time periods.

[0153] The experimental results are as Figure 5 、 Figure 6 shown, showing the results of the predicted memory allocation values and CPU utilization of the model within the 10-second prediction range, which are highly consistent with the actual values. The experiment proves that the model can effectively capture the dynamic changes during system operation and provide accurate benchmark values for health assessment.

[0154] The present invention has the following effects:

[0155] 1. Improve prediction accuracy:

[0156] By introducing LSTM, effectively capture the long-term dependencies and dynamic change characteristics of resource usage in the PCS. Combining the embedding features and feature separation strategy significantly improves the prediction accuracy of CPU occupancy and memory allocation, especially under complex periodic waveforms.

[0157] 2. Achieve dynamic health assessment:

[0158] Based on the predicted standard value of resource usage and real-time comparison with the actual value, it can accurately judge the health status of the system. Combining with the time decay mechanism of the health index makes the dynamic change of the system health status more intuitive, supporting rapid diagnosis and positioning of potential problems.

[0159] 3. Real-time and precise memory leak detection:

[0160] The proposed memory leak detection algorithm can identify the memory leak trend in real time by calculating the difference and difference increment between the actual value and the standard value. This method can effectively avoid misjudgment caused by resource fluctuations and improve the sensitivity and reliability of system fault detection.

[0161] 4. Reducing the impact of system anomalies on prediction:

[0162] Through the feedback adjustment mechanism, when a memory leak occurs, the predicted standard value is used to replace the actual value as the input for the next cycle, preventing the negative impact of memory leaks on model prediction and maintaining the efficiency and accuracy of resource usage prediction.

[0163] 5. Enhancing the adaptability and generality of the model:

[0164] The sliding window method and multi-stage training data are adopted to enhance the adaptability of the LSTM model to different scenarios during the PCS operation process. Whether it is the initialization, operation or abnormal stage, the technical solution of the present invention can effectively cope with them.

[0165] 6. Improving the stability and security of system operation:

[0166] Through the real-time feedback of the health index and memory leak detection results, the system can identify and respond to potential risks in the early stage, reduce system interruptions or experiment delays caused by failures, and improve the reliability and security of system operation.

[0167] 7. Supporting multi-dimensional resource evaluation and optimization:

[0168] The technical solution of the present invention is not only applicable to the prediction of CPU occupancy and memory allocation, but also can be extended to other resources (such as network bandwidth, disk occupancy, etc.), providing a general solution for the overall resource optimization and health assessment of the system.

[0169] The above specific embodiments are only several alternative embodiments of the present invention. Based on the technical solution of the present invention and the relevant inspirations of the above embodiments, those skilled in the art can make various alternative improvements and combinations to the above specific embodiments.

Claims

1. A plasma control system resource usage prediction method based on LSTM, characterized in that: The following steps are involved: Data preprocessing and feature extraction: Collect and process the plasma control system operation data, select characteristic indicators that reflect the system operation status and perform standardization; Introducing LSTM network for time series prediction: Building an LSTM model, using historical data to train the model to predict the standard value of resource usage at future time points, and enhancing the model adaptability through the sliding window method; Embedding features and feature separation strategy: Generate an embedding vector for the system state and separate the memory waveform into busy and non-busy ones; Standard value prediction and memory leak detection: collect system operation data in real time, apply LSTM model to predict future resource usage standard value, calculate and monitor the difference between actual memory waveform and predicted standard value and its increment to detect memory leak; Health index calculation and feedback adjustment: Calculate the system health index based on the actual difference, introduce a time decay factor, and adjust the health index when a memory leak is detected; Feedback adjustment within the prediction cycle: Based on the memory leak detection results, feedback adjustment is made to the prediction input, and cyclic prediction is performed at a certain time step.

2. According to a plasma control system resource usage prediction method based on LSTM according to claim 1, it is characterized in that: The data preprocessing and feature extraction specifically include: Collect data: Collect time series data about CPU usage and memory allocation resource usage during system operation to ensure that the data includes resource consumption under different system operation states; Feature selection: Select feature indicators that reflect the system operation status. Feature indicators include: Algorithm type: the type of control algorithm currently running; Trigger state: the state of the system under different trigger conditions; Operation phase: the operation phase of the control system; Dynamic resource utilization: includes historical CPU usage and resource utilization data of dynamic changes in memory allocation. Standardization: Standardize the input features to eliminate the scale differences between different features.

3. The plasma control system resource usage prediction method based on LSTM according to claim 1, characterized in that: The introduction of LSTM network for time series prediction specifically includes: Model structure determination: Build an LSTM model, set the input window to 200 time steps, and use the input features of the model including the CPU usage, memory allocation, and current system status of the previous step; Time series learning: Use historical data to train the LSTM model. The model learns the relationship between different system operation stages and resource usage, and predicts the standard value of resource usage at future time points. Model training: The training data is divided into multiple small windows through the sliding window method to cover all possible operating states.

4. The plasma control system resource usage prediction method based on LSTM according to claim 1, characterized in that: The feature embedding and feature separation strategies specifically include the following steps: Embedded features: Statistical analysis of system status is performed to generate embedded vectors to replace traditional digital codes. System status includes algorithm type and trigger status. Feature separation: The memory waveform presents obvious square wave characteristics. The memory occupancy rate is separated into busy areas and non-busy areas, and each is used as an independent input feature for LSTM model learning. The memory waveform presents obvious square wave characteristics with busy and non-busy areas alternating.

5. The plasma control system resource usage prediction method based on LSTM according to claim 1, characterized in that: The standard value prediction steps are as follows: Real-time data collection: During system operation, data on CPU usage and memory allocation resources are collected in real time to form a time series. Application of LSTM prediction model: Use the trained LSTM network model to predict the resource usage of the system in the future. The LSTM model predicts the standard CPU usage and memory allocation value at a future time point based on historical data. The historical data includes CPU usage, memory usage, and control algorithm type. Input features: including the control algorithm type, trigger status, and system status characteristics of the current moment, combined with the CPU and memory storage information of the previous moment, to provide sufficient context information for the LSTM model; Prediction process: The time series relationship learned by the LSTM model during the training process is used to predict the standard value M of resource usage in the future. p (t), the resource usage standard value includes the standard memory value and the standard CPU occupancy rate; Standard value output: the standard value M output by the LSTM model p (t) is the "ideal" value of future resource usage inferred by the model based on historical data. The standard value is used as a benchmark for health assessment and is used to compare with actual memory usage data.

6. A plasma control system resource usage prediction method based on LSTM according to claim 5, characterized in that: The memory leak detection specifically includes the following steps: Compare with actual memory usage: Get actual memory usage data: real-time monitoring of the system's actual memory waveform M r (t), which is the current memory usage of the system; Calculate the difference: Calculate the actual memory waveform M r (t) and the predicted standard value M p The difference between (t), i.e. D(t)=|M r (t)-M p (t)| Where D(t) is the difference value at the current time point t, indicating the deviation between the actual memory usage and the predicted standard value; Difference increment calculation: Calculate the difference increment ΔD(t): In order to detect the occurrence of memory leaks, it is necessary to calculate the rate of change of the difference D(t), that is, the difference increment ΔD(t) = diff(D(t)). diff(D(t)) is the difference increment calculated by changing the difference value D(t) over time, reflecting the change in the deviation between the actual memory usage and the standard value. Memory leak detection: Determine whether the difference increment exceeds the threshold: If the difference increment ΔD(t)>leakageThreshold, it is considered that a memory leak has occurred. The threshold is determined by experimental data or experience, indicating that the deviation between the actual memory usage and the predicted value increases too quickly, indicating that there may be a resource leak; Memory leak status setting: At this time, the memory leak status is set to Here, isLeakage(t)=1 indicates that the system detects a memory leak, and isLeakage(t)=0 indicates that no memory leak is detected.

7. The plasma control system resource usage prediction method based on LSTM according to claim 1, characterized in that: The health index calculation and feedback adjustment specifically include the following steps: Calculate the health index. In the LSTM-based plasma control system resource usage prediction method, the health index of the system needs to be calculated based on the actual difference, which is defined as: The health index H(t) indicates the health of the system. The smaller the difference D(t), the higher the health index. The health index H(t) is used to evaluate the health status of system resource usage in real time. Introduce the time decay factor to simulate the decay of health status over time. Introduce the time decay factor Where τ is the decay constant, which controls the decay speed; The health index is adjusted in the memory leak state. If a memory leak is detected, that is, isLeakage(t) = 1, the health index will drop rapidly. The health index will be multiplied by the attenuation factor to indicate the rapid deterioration of the system health state. The calculation formula is: in, The health index after time decay is introduced to indicate the rapid decline of system health status in the case of memory leak.

8. The plasma control system resource usage prediction method based on LSTM according to claim 1, characterized in that: The feedback adjustment within the prediction cycle specifically includes the following steps: Feedback tuning: If the system does not detect a memory leak, the actual memory waveform M is used r (t) is used as input and the standard value at the next time point is predicted. If a memory leak is detected, the predicted standard memory waveform M p (t) is used as the input for the next cycle without using the actual memory waveform M r (t); Cyclic prediction: The prediction cycle will iteratively predict according to time steps such as 10 seconds and 20 seconds to continuously monitor the health status and resource usage of the system.

Citation Information

Patent Citations

  • Automated scaling of resources based on LSTM-RNN and attention mechanisms

    CN112015543A

  • CPU resource load condition prediction method based on LSTM

    CN113626177A