Method and device for predicting CPU (Central Processing Unit) utilization rate of distributed container
Predicting the CPU usage rate of distributed containers through deep convolutional neural network model, solving the resource waste and inaccuracy problems caused by manual evaluation in the prior art, improving the accuracy of prediction and system predictability, and ensuring financial security .
Patent Information
- Application Number
- CN202411005637.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-25
- Publication Date
- 2024-11-12
AI Technical Summary
Prior art CPU usage prediction in PAAS containers relies on manual evaluation, and there are problems of resource waste and inaccuracy, especially during holidays that may lead to financial security threats.
The deep convolutional neural network model is adopted to generate input feature vectors by collecting macro and micro data, and the pre-trained deep convolutional neural network model predicts the CPU usage rate of distributed containers, overcoming the shortcomings of manual evaluation and improving the accuracy of prediction. .
Accurate prediction of distributed container CPU usage is achieved, reducing resource waste and improving system predictability and security.
Smart Images

Figure CN118939506A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of deep learning technology, and in particular to a method and device for predicting CPU usage of a distributed container. Background Art
[0002] Most of the CPU usage predictions for PAAS (Platform as a Service) containers are based on the total amount of transactions that have occurred to estimate whether the current container CPU availability can support transactions in the future. Another part is based on experience that before the transaction volume is large, a large amount of capacity is expanded, which wastes resources and manpower and lacks predictability.
[0003] Both methods rely on prior knowledge and manual evaluation, which requires a lot of computing resources, especially during holidays when re-evaluation is needed, and blind expansion will cause a lot of resource waste. If manual evaluation of CPU resources is not timely or sufficient, it will cause adverse social impacts in some cases, and even seriously threaten financial security. Summary of the invention
[0004] In view of the problems in the prior art, the embodiments of the present application provide a method and device for predicting the CPU usage of a distributed container, which can at least partially solve the problems in the prior art.
[0005] On the one hand, an embodiment of the present application provides a method for predicting CPU usage of a distributed container, including:
[0006] Collect target data that affects the CPU usage of distributed containers at the preset collection frequency;
[0007] Generating an input feature vector according to the target data;
[0008] The input feature vector is input into a pre-trained deep convolutional neural network model to obtain the distributed container CPU usage predicted by the deep convolutional neural network model.
[0009] In some embodiments, the target data includes macro data and micro data; wherein,
[0010] The macro data includes at least one of the following: current time, holiday sign of current time, current temperature, current humidity, current rainfall, current visibility, train ticket sales volume in the last first time period, total train ticket sales in the last first time period, total air ticket sales in the last first time period, stock transaction volume in the last first time period, total stock transaction amount in the last first time period, and total number of business transactions in the last first time period;
[0011] The micro data includes at least one of the following: current container CPU usage, current container memory usage, average transaction time in the most recent second period, and transaction success rate in the most recent second period.
[0012] In some embodiments, generating an input feature vector according to the target data includes:
[0013] An input feature vector is generated according to the target data collected within the latest third time period.
[0014] In some embodiments, the deep convolutional neural network model is specifically used for:
[0015] Performing feature extraction on the input feature vector through a basic hidden layer and a maximum pooling layer to obtain a first feature vector;
[0016] Generate a second feature vector according to the input feature vector and the output vector of the maximum pooling layer through a multi-scale residual fusion module;
[0017] Concatenate the first feature vector and the second feature vector to obtain a concatenated feature;
[0018] Performing a pooling operation on the concatenated features through an average pooling layer to obtain an output feature vector;
[0019] The output vector is classified through a fully connected layer and an activation function to obtain the CPU usage of the distributed container.
[0020] In some embodiments, extracting features from the input feature vector through a basic hidden layer and a maximum pooling layer to obtain a first feature vector includes:
[0021] Taking the input feature vector as input, feature extraction is performed in sequence through a first basic hidden layer, a second basic hidden layer, a first pooling layer, a third basic hidden layer, a fourth basic hidden layer, a second pooling layer, a fifth basic hidden layer, a sixth basic hidden layer, a third pooling layer, a seventh basic hidden layer, an eighth basic hidden layer, a fourth pooling layer, a ninth basic hidden layer and a tenth basic hidden layer to obtain a first feature vector; wherein,
[0022] The convolution layers in the first basic hidden layer and the second basic hidden layer respectively use 24 1×5 convolution kernels, the convolution layers in the third basic hidden layer and the fourth basic hidden layer respectively use 32 1×5 convolution kernels, the convolution layers in the fifth basic hidden layer and the sixth basic hidden layer respectively use 64 1×3 convolution kernels, and the convolution layers in the seventh basic hidden layer, the eighth basic hidden layer, the ninth basic hidden layer and the tenth basic hidden layer respectively use 128 1×3 convolution kernels.
[0023] In some embodiments, generating a second feature vector according to the input feature vector and the output vector of the maximum pooling layer by a multi-scale residual fusion module includes:
[0024] Generate a first fused feature vector according to the input feature vector and the output vector of the first maximum pooling layer through a first multi-scale residual fusion module;
[0025] Generate a second fused feature vector according to the first fused feature vector and the output vector of the second maximum pooling layer through a second multi-scale residual fusion module;
[0026] A second feature vector is generated according to the second fused feature vector and the output vector of the third maximum pooling layer through a third multi-scale residual fusion module.
[0027] In some embodiments, the training process of the deep convolutional neural network model is as follows:
[0028] Acquire historical target data in a training set, wherein the training set includes historical target data affecting CPU usage of distributed containers collected at a preset collection frequency;
[0029] generating an input historical feature vector according to the historical target data;
[0030] According to the input historical feature vector and the label of the input historical feature vector, a preset deep convolutional neural network model is trained to obtain a trained deep convolutional neural network model, wherein the label is the CPU usage of the distributed container.
[0031] On the other hand, an embodiment of the present application provides a distributed container CPU usage prediction device, including:
[0032] A collection module is used to collect target data that affects the CPU usage of distributed containers according to a preset collection frequency;
[0033] A generating module, used for generating an input feature vector according to the target data;
[0034] The prediction module is used to input the input feature vector into a pre-trained deep convolutional neural network model to obtain the distributed container CPU usage predicted by the deep convolutional neural network model.
[0035] In some embodiments, the target data includes macro data and micro data; wherein,
[0036] The macro data includes at least one of the following: current time, holiday sign of current time, current temperature, current humidity, current rainfall, current visibility, train ticket sales volume in the last first time period, total train ticket sales in the last first time period, total air ticket sales in the last first time period, stock transaction volume in the last first time period, total stock transaction amount in the last first time period, and total number of business transactions in the last first time period;
[0037] The micro data includes at least one of the following: current container CPU usage, current container memory usage, average transaction time in the most recent second period, and transaction success rate in the most recent second period.
[0038] In some embodiments, the generating module is specifically used for:
[0039] An input feature vector is generated according to the target data collected within the latest third time period.
[0040] In some embodiments, the deep convolutional neural network model is specifically used for:
[0041] Performing feature extraction on the input feature vector through a basic hidden layer and a maximum pooling layer to obtain a first feature vector;
[0042] Generate a second feature vector according to the input feature vector and the output vector of the maximum pooling layer through a multi-scale residual fusion module;
[0043] Concatenate the first feature vector and the second feature vector to obtain a concatenated feature;
[0044] Performing a pooling operation on the concatenated features through an average pooling layer to obtain an output feature vector;
[0045] The output vector is classified through a fully connected layer and an activation function to obtain the CPU usage of the distributed container.
[0046] In some embodiments, extracting features from the input feature vector through a basic hidden layer and a maximum pooling layer to obtain a first feature vector includes:
[0047] Taking the input feature vector as input, feature extraction is performed in sequence through a first basic hidden layer, a second basic hidden layer, a first pooling layer, a third basic hidden layer, a fourth basic hidden layer, a second pooling layer, a fifth basic hidden layer, a sixth basic hidden layer, a third pooling layer, a seventh basic hidden layer, an eighth basic hidden layer, a fourth pooling layer, a ninth basic hidden layer and a tenth basic hidden layer to obtain a first feature vector; wherein,
[0048] The convolution layers in the first basic hidden layer and the second basic hidden layer respectively use 24 1×5 convolution kernels, the convolution layers in the third basic hidden layer and the fourth basic hidden layer respectively use 32 1×5 convolution kernels, the convolution layers in the fifth basic hidden layer and the sixth basic hidden layer respectively use 64 1×3 convolution kernels, and the convolution layers in the seventh basic hidden layer, the eighth basic hidden layer, the ninth basic hidden layer and the tenth basic hidden layer respectively use 128 1×3 convolution kernels.
[0049] In some embodiments, generating a second feature vector according to the input feature vector and the output vector of the maximum pooling layer by a multi-scale residual fusion module includes:
[0050] Generate a first fused feature vector according to the input feature vector and the output vector of the first maximum pooling layer through a first multi-scale residual fusion module;
[0051] Generate a second fused feature vector according to the first fused feature vector and the output vector of the second maximum pooling layer through a second multi-scale residual fusion module;
[0052] A second feature vector is generated according to the second fused feature vector and the output vector of the third maximum pooling layer through a third multi-scale residual fusion module.
[0053] In some embodiments, the training process of the deep convolutional neural network model is as follows:
[0054] Acquire historical target data in a training set, wherein the training set includes historical target data affecting CPU usage of distributed containers collected at a preset collection frequency;
[0055] generating an input historical feature vector according to the historical target data;
[0056] According to the input historical feature vector and the label of the input historical feature vector, a preset deep convolutional neural network model is trained to obtain a trained deep convolutional neural network model, wherein the label is the CPU usage of the distributed container.
[0057] An embodiment of the present application further provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps of the method for predicting the CPU usage rate of a distributed container described in any of the above embodiments are implemented.
[0058] An embodiment of the present application further provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of the method for predicting the CPU usage rate of a distributed container described in any of the above embodiments are implemented.
[0059] The distributed container CPU usage prediction method and device provided in the embodiment of the present application collects target data that affects the distributed container CPU usage at a preset collection frequency; generates an input feature vector based on the target data; inputs the input feature vector into a pre-trained deep convolutional neural network model to obtain the distributed container CPU usage predicted by the deep convolutional neural network model. In this way, deep learning technology can be used to predict the subsequent CPU usage of the distributed container based on the current target data that affects the distributed container CPU usage, thereby overcoming the defects of manual evaluation and improving the accuracy of prediction. BRIEF DESCRIPTION OF THE DRAWINGS
[0060] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the prior art descriptions. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. In the drawings:
[0061] Figure 1 It is a flowchart of a method for predicting CPU usage of a distributed container provided in an embodiment of the present application.
[0062] Figure 2 This is a partial flow chart of a method for predicting CPU usage of a distributed container provided in an embodiment of the present application.
[0063] Figure 3 This is a partial flow chart of a method for predicting CPU usage of a distributed container provided in an embodiment of the present application.
[0064] Figure 4 This is a partial flow chart of a method for predicting CPU usage of a distributed container provided in an embodiment of the present application.
[0065] Figure 5 It is a structural diagram of a deep convolutional neural network model provided in one embodiment of the present application.
[0066] Figure 6 It is a structural diagram of an ECA module provided in an embodiment of the present application.
[0067] Figure 7 It is a structural diagram of a multi-scale residual fusion module provided in an embodiment of the present application.
[0068] Figure 8 It is a schematic diagram of the connection method of the MRFM module on the neural network branch provided in one embodiment of the present application.
[0069] Fig. 9It is a structural diagram of a device for predicting CPU usage of a distributed container provided in an embodiment of the present application.
[0070] Fig.10 It is a schematic diagram of the physical structure of an electronic device provided in one embodiment of the present application. DETAILED DESCRIPTION
[0071] In order to make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the embodiments of the present application are further described in detail below in conjunction with the accompanying drawings. Here, the illustrative embodiments of the present application and their descriptions are used to explain the present application, but are not intended to limit the present application. It should be noted that, in the absence of conflict, the embodiments in the present application and the features in the embodiments can be arbitrarily arranged with each other.
[0072] The terms “first”, “second”, etc. used in this document do not specifically refer to an order or sequence, nor are they used to limit this application. They are only used to distinguish elements or operations described with the same technical terms.
[0073] The words “include,” “including,” “have,” “contain,” etc. used in this document are open-ended terms, meaning including but not limited to.
[0074] As used herein, "and / or" includes any and all permutations of the items described.
[0075] The execution subject of the distributed container CPU usage prediction method provided in the embodiment of the present application includes but is not limited to a computer.
[0076] Figure 1 FIG. 1 is a flow chart of a method for predicting CPU usage of a distributed container provided in an embodiment of the present application. Figure 1 As shown, the method for predicting the CPU usage of a distributed container provided in an embodiment of the present application includes:
[0077] S101. Collect target data that affects CPU usage of distributed containers according to a preset collection frequency;
[0078] S102, generating an input feature vector according to the target data;
[0079] S103: Input the input feature vector into a pre-trained deep convolutional neural network model to obtain the distributed container CPU usage predicted by the deep convolutional neural network model.
[0080] The distributed container CPU usage prediction method provided by the present application collects target data that affects the distributed container CPU usage at a preset collection frequency; generates an input feature vector based on the target data; inputs the input feature vector into a pre-trained deep convolutional neural network model to obtain the distributed container CPU usage predicted by the deep convolutional neural network model. In this way, deep learning technology can be used to predict the subsequent CPU usage of the distributed container based on the current target data that affects the distributed container CPU usage, thereby overcoming the defects of manual evaluation and improving the accuracy of prediction.
[0081] In some embodiments, the target data includes macro data and micro data; wherein,
[0082] The macro data includes at least one of the following: current time, holiday sign of current time, current temperature, current humidity, current rainfall, current visibility, train ticket sales volume in the last first time period, total train ticket sales in the last first time period, total air ticket sales in the last first time period, stock transaction volume in the last first time period, total stock transaction amount in the last first time period, and total number of business transactions in the last first time period;
[0083] The micro data includes at least one of the following: current container CPU usage, current container memory usage, average transaction time in the most recent second period, and transaction success rate in the most recent second period.
[0084] For example, specifically, the target data are collected from macro and micro respectively. In some embodiments, the macro includes time (month, day, and minute), holiday mark of the day (weekend holiday, three-day holiday, seven-day holiday), temperature, humidity, rainfall, visibility, train ticket sales within 1 hour, total train ticket sales within 1 hour, total air ticket sales within 1 hour, stock trading volume within 1 hour, total stock trading amount within 1 hour, and total number of business transactions within 1 hour; the micro data set includes the current container CPU usage, the current container memory usage, the average transaction time within the past 1 minute, and the transaction success rate within the past 1 minute; the target data includes a total of 16 factors.
[0085] In some embodiments, generating an input feature vector based on the target data includes: generating an input feature vector based on the target data collected within a most recent third time period.
[0086] For example, the preset collection frequency may be 1 time / minute, and the target data collected for 3 consecutive minutes (3 samples in total) may be composed into an input feature vector of 1×16×3.
[0087] like Figure 2 As shown, in some embodiments, the deep convolutional neural network model is specifically used for:
[0088] S201, extracting features from the input feature vector through a basic hidden layer and a maximum pooling layer to obtain a first feature vector;
[0089] S202, generating a second feature vector according to the input feature vector and the output vector of the maximum pooling layer through a multi-scale residual fusion module;
[0090] S203, concatenating the first feature vector and the second feature vector to obtain a concatenated feature;
[0091] S204, performing a pooling operation on the concatenated features through an average pooling layer to obtain an output feature vector;
[0092] S205. Classify the output vector through a fully connected layer and an activation function to obtain a CPU usage rate of a distributed container.
[0093] Specifically, compared with the traditional convolutional network to predict CPU usage, the deep convolutional neural network proposed in this application adds a multi-scale residual fusion module, which can solve the following problems: 1) The mapping learning range is expanded on the branch. The network structure re-extracts and splices the input feature vector and the output vector of the maximum pooling layer, allowing the network to adaptively select the importance of the current information features, which can achieve the reuse of important features; 2) Expand the transmission channel of the network, establish the correlation between macro and micro information over long distances, and optimize the network representation ability; 3) The important features iteratively calibrated by MRFM are spliced at the back end of the network to compensate for the loss of classification features during the convolution process. 4) MRFM has the advantages of a residual module, which retains information of each order while suppressing the gradient vanishing phenomenon caused by the depth of the network.
[0094] In some embodiments, extracting features from the input feature vector through a basic hidden layer and a maximum pooling layer to obtain a first feature vector includes:
[0095] Taking the input feature vector as input, feature extraction is performed in sequence through a first basic hidden layer, a second basic hidden layer, a first pooling layer, a third basic hidden layer, a fourth basic hidden layer, a second pooling layer, a fifth basic hidden layer, a sixth basic hidden layer, a third pooling layer, a seventh basic hidden layer, an eighth basic hidden layer, a fourth pooling layer, a ninth basic hidden layer and a tenth basic hidden layer to obtain a first feature vector; wherein,
[0096] The convolution layers in the first basic hidden layer and the second basic hidden layer respectively use 24 1×5 convolution kernels, the convolution layers in the third basic hidden layer and the fourth basic hidden layer respectively use 32 1×5 convolution kernels, the convolution layers in the fifth basic hidden layer and the sixth basic hidden layer respectively use 64 1×3 convolution kernels, and the convolution layers in the seventh basic hidden layer, the eighth basic hidden layer, the ninth basic hidden layer and the tenth basic hidden layer respectively use 128 1×3 convolution kernels.
[0097] Specifically, see Figure 5 The feature extraction module of the deep convolutional neural network model includes a first basic hidden layer F1, a second basic hidden layer F2, a first pooling layer F3, a third basic hidden layer F4, a fourth basic hidden layer F5, a second pooling layer F6, a fifth basic hidden layer F7, a sixth basic hidden layer F8, a third pooling layer F9, a seventh basic hidden layer F8, an eighth basic hidden layer F11, a fourth pooling layer F12, a ninth basic hidden layer F13 and a tenth basic hidden layer F14. After the input feature vector enters the network, when extracting shallow residual features through F1 and F2 successively, 1× 5 convolution kernels, the number is 24, the output after two convolutions passes through the pooling layer F3 to reduce the length of the feature channel, retain the maximum CPU usage classification features and reduce parameters. As the network deepens, the size of the F4 and F5 convolution kernels is still 1×5, but the number increases to 32 to adapt to the receptive field required for refined features. After the second F6 pooling, the size of the convolution kernel (F7 and F8) is reduced to 1×3, the number is 64, and more details are extracted. The kernel size of the last four convolution layers is still 1×3, and the number increases to 128, in order to capture finer high-order features.
[0098] like Figure 3 As shown, in some embodiments, generating a second feature vector according to the input feature vector and the output vector of the maximum pooling layer by a multi-scale residual fusion module includes:
[0099] S2021. Generate a first fused feature vector according to the input feature vector and the output vector of the first maximum pooling layer through a first multi-scale residual fusion module;
[0100] S2022. Generate a second fused feature vector according to the first fused feature vector and the output vector of the second maximum pooling layer through a second multi-scale residual fusion module;
[0101] S2023. Generate a second feature vector according to the second fused feature vector and the output vector of the third maximum pooling layer through a third multi-scale residual fusion module.
[0102] Specifically, if Figure 5As shown in Figure 2, a multiscale residual fusion module (MRFM) is proposed on the branch to connect the feature information of the pooling layer. Figure 5 The structures of MRFM1, MRFM2 and MRFM3 are roughly the same. MRFM1 extracts the input feature vector and the features after pooling of F3. MRFM2 further extracts the features output by MRFM1 and the features after pooling of F6. Similarly, MRFM3 further extracts the features output by MRFM2 and the features after pooling of F9.
[0103] like Figure 4 As shown, in some embodiments, the training process of the deep convolutional neural network model is as follows:
[0104] S301. Acquire historical target data in a training set, wherein the training set includes historical target data that affects CPU usage of distributed containers collected at a preset collection frequency;
[0105] S302, generating an input historical feature vector according to the historical target data;
[0106] S303. According to the input historical feature vector and the label of the input historical feature vector, a preset deep convolutional neural network model is trained to obtain a trained deep convolutional neural network model, wherein the label is the CPU usage of the distributed container.
[0107] In order to better understand the present application, the method for predicting the CPU usage of a distributed container provided by the present application is described in detail below through a specific embodiment.
[0108] In order to more accurately predict the CPU usage of distributed containers two hours later, solve the problem of manual capacity estimation based on a priori, and ensure the smooth operation of banking business, this example proposes a distributed container CPU prediction system based on neural network, as follows:
[0109] The data sets are collected from macro and micro perspectives. The macro data include time (month, day, and minute), holiday signs of the day (weekend holidays, three-day holidays, and seven-day holidays), temperature, humidity, rainfall, visibility, train ticket sales within 1 hour, total train ticket sales within 1 hour, total air ticket sales within 1 hour, stock trading volume within 1 hour, total stock trading amount within 1 hour, and total number of intra-bank (taking banks as an example) business transactions within 1 hour; the micro data include the current container CPU usage, the current container memory usage, the average transaction time within the past minute, and the transaction success rate within the past minute; the data set includes 16 factors in total. The CPU usage after 2 hours is collected as a training sample. 300,000 data samples in the past year are collected as a training set through a script. When training the network, the data of 3 consecutive minutes (3 samples in total) are combined into a 1×16×3 input set.
[0110] The predicted target set (CPU usage) is intervalized into 10%, 20%, 30%, 40%, 50%, 60%, 70%, 80%, 85%, 88%, 90%, 93%, 95%, 98%, and 100%.
[0111] like Figure 5 As shown, the structure of the neural network model in this example is as follows:
[0112] The CPU usage prediction system proposed in this example uses a deep convolutional neural network as a classifier, and the input is the feature information composed of macro data and micro data for 3 consecutive minutes. The convolution operation + batch normalization + activation function are used as the basic hidden layer of the feature extraction module (as shown in Figures F1, F2, F4, F5, F7, F8, F10, F11, F13, and F14). The input feature vector (composed of macro and micro data sets) is converted from Figure 5 The structure shown enters the neural network. When extracting shallow residual features through F1 and F2 successively, 1×5 convolution kernels are used, with a number of 24. The output after two convolutions passes through the pooling layer F3 to reduce the length of the feature channel, retain the maximum CPU usage classification features and reduce parameters. As the network deepens, the size of the F4 and F5 convolution kernels is still 1×5, but the number increases to 32 to adapt to the receptive field required for refined features. After the second F6 pooling, the size of the convolution kernel (F7 and F8) is reduced to 1×3, with a number of 64, to extract more details. The kernel size of the last four convolution layers is still 1×3, and the number increases to 128, in order to capture finer high-order features.
[0113] like Figure 5As shown in the figure, a multiscale residual fusion module (Multiscale Residual Fusion Module, MRFM) is proposed on the branch to connect the feature information of the pooling layer. Its output result is spliced with the output classification feature of the main channel through the activation function Tanh, and the pooling operation is used for the fully connected layer to learn classification. The specific structure of the network is shown in the figure. Fi (i = 0, 1, 2, ... 14) represents the residual features of the macro and micro output information of the current hidden layer. In order to ensure the parallelism of information on the channel, all convolution operations are filled to maintain the length of the input and output features. Under the effect of chain multiplication, Tanh has soft saturation, and the output mean is 0, which can adapt to the influence of high-order classification features. In the classification module (ClassificationModule), two fully connected layers and Softmax function are used to perform classification, and the output image is determined to be the probability of the CPU usage category after 2 hours.
[0114] Multi-scale residual fusion module. EACblock uses local information to replace the full-channel linear combination prediction through 1D convolution, avoiding the error caused by dimensionality reduction while reducing the number of parameters. The structure is as follows Figure 6 As shown in Figure 2, in order to enrich the receptive field of the network and adapt to both high-order and low-order residual low-level features, a multi-scale residual fusion module (MRFM) is proposed on the branch structure of the network. Figure 7 .
[0115] 3 multi-scale residual fusion modules ( Figure 5 The structures of MRFM1, MRFM2 and MRFM3 are roughly the same. MRFM1 uses convolution kernels to extract original features and features after pooling of F3, and splices them in space after batch normalization (BN) and nonlinear activation function ReLU. MRFM2 further extracts features of MRFM1 and features after pooling of F6. Similarly, MRFM3 further extracts features of MRFM2 and features after pooling of F9, and uses them together with features of F14 as input of splicing layer F16. ECAblock in MRFM1, MRFM2 and MRFM3 adaptively assigns channel weights according to the importance of different channel information in network transmission, and strengthens the trace features of important macro and micro information. The connection method of MRFM on the neural network branch is as follows: Figure 8 shown.
[0116] Feature1, Feature2, Feature3 and Feature4 represent the outputs of different hidden layers of the network and are arranged in sequence. These features contain macro- and micro-information trace features obtained by different receptive fields and nonlinear fitting. MRFM will splice the extracted multi-scale residual information, calibrate it through the attention mechanism, and perform convolution and pooling operations before outputting it as the input of the next MRFM. This serial structure helps to improve the accuracy of residual features and compress channel information as much as possible.
[0117] In order to speed up the convergence of the network and reduce the required computing resources, MRFM1 uses 7×7 and 5×5 convolution kernels for primary features, with a total of 16 kernels. While expanding the receptive field, it extracts large-scale residual features and weakens the information excess caused by macro or micro correlation. The size of the convolution kernel used by MRFM2 is reduced to 5×5 and 3×3, with a total of 32 kernels to adapt to the refined classification features. MRFM3 will further extract refined residual features, and the filter kernel will capture the traces left by the current different information and reduce the number of parameters to be optimized in the network, ensuring that the network can adaptively obtain information correlation features of different orders and enhance the generalization ability of the network.
[0118] The output information is compared with the actual CPU usage of the container 2 hours later, and the back propagation algorithm is used to continuously correct the system parameters and optimize the error, thereby realizing the prediction of CPU usage.
[0119] Compared with the traditional convolutional network to predict CPU, the multi-scale residual fusion module solves the following problems: 1) The mapping learning scope is expanded on the branch. The structure re-extracts and splices the current input features and the features extracted by convolution with large and small convolution kernels respectively, so that the network can adaptively select the importance of the current information features, which can realize the reuse of important features; 2) Expand the transmission channel of the network, establish the correlation between macro and micro under long distances, and optimize the network representation ability; 3) The important features calibrated by 3 MRFM iterations are spliced at the back end of the network, which can compensate for the loss of classification features during the convolution process. 4) MRFM has the advantages of the residual module. While retaining the information of each order, it suppresses the gradient disappearance caused by the depth of the network.
[0120] This example proposes a distributed container CPU prediction system based on neural networks. The main structure is a convolutional neural network. Multi-scale classification traces are extracted at different levels of the network and combined with the attention mechanism to form a multi-scale residual fusion module. This module connects the primary and advanced features of the network and calibrates the effectiveness of feature information transmission. While compensating for the loss of real traces during the convolution process, it removes information redundancy and accelerates network convergence.
[0121] With the innovation of the above two parts, using the current macro and micro information as samples and after 100,000 trainings, the back propagation algorithm continuously corrects the system parameters, thereby realizing the prediction of the CPU usage rate after 2 hours.
[0122] Compared with the traditional convolutional network to predict CPU, the multi-scale residual fusion module solves the following problems: 1) The mapping learning scope is expanded on the branch. The structure re-extracts and splices the current input features and the features extracted by convolution with large and small convolution kernels respectively, so that the network can adaptively select the importance of the current information features, which can realize the reuse of important features; 2) Expand the transmission channel of the network, establish the correlation between macro and micro under long distances, and optimize the network representation ability; 3) The important features calibrated by 3 MRFM iterations are spliced at the back end of the network, which can compensate for the loss of classification features during the convolution process. 4) MRFM has the advantages of the residual module. While retaining the information of each order, it suppresses the gradient disappearance caused by the depth of the network.
[0123] The distributed container CPU usage prediction method proposed in this example uses a deep convolutional neural network to extract multi-scale classification traces at different levels of the network and combines them with the attention mechanism to form a multi-scale residual fusion module. This module connects the primary and advanced features of the network and calibrates the effectiveness of feature information transmission. While compensating for the loss of real traces during the convolution process, it removes information redundancy and accelerates network convergence.
[0124] Based on the above-mentioned deep convolutional neural network, with the current macro and micro information as samples, after 100,000 trainings, the back propagation algorithm continuously corrects the system parameters, thereby realizing the prediction of the CPU usage rate after 2 hours.
[0125] Fig. 9 is a schematic diagram of the structure of a distributed container CPU usage prediction device provided in an embodiment of the present application, such as Fig. 9 As shown, the distributed container CPU usage prediction device provided in the embodiment of the present application includes:
[0126] A collection module 41 is used to collect target data affecting the CPU usage of distributed containers according to a preset collection frequency;
[0127] A generating module 42, used to generate an input feature vector according to the target data;
[0128] The prediction module 43 is used to input the input feature vector into a pre-trained deep convolutional neural network model to obtain the distributed container CPU usage predicted by the deep convolutional neural network model.
[0129] The distributed container CPU usage prediction device provided by the present application collects target data that affects the distributed container CPU usage at a preset collection frequency; generates an input feature vector based on the target data; inputs the input feature vector into a pre-trained deep convolutional neural network model to obtain the distributed container CPU usage predicted by the deep convolutional neural network model. In this way, deep learning technology can be used to predict the subsequent CPU usage of the distributed container based on the current target data that affects the distributed container CPU usage, thereby overcoming the defects of manual evaluation and improving the accuracy of prediction.
[0130] In some embodiments, the target data includes macro data and micro data; wherein,
[0131] The macro data includes at least one of the following: current time, holiday sign of current time, current temperature, current humidity, current rainfall, current visibility, train ticket sales volume in the last first time period, total train ticket sales in the last first time period, total air ticket sales in the last first time period, stock transaction volume in the last first time period, total stock transaction amount in the last first time period, and total number of business transactions in the last first time period;
[0132] The micro data includes at least one of the following: current container CPU usage, current container memory usage, average transaction time in the most recent second period, and transaction success rate in the most recent second period.
[0133] In some embodiments, the generating module is specifically used for:
[0134] An input feature vector is generated according to the target data collected within the latest third time period.
[0135] In some embodiments, the deep convolutional neural network model is specifically used for:
[0136] Performing feature extraction on the input feature vector through a basic hidden layer and a maximum pooling layer to obtain a first feature vector;
[0137] Generate a second feature vector according to the input feature vector and the output vector of the maximum pooling layer through a multi-scale residual fusion module;
[0138] Concatenate the first feature vector and the second feature vector to obtain a concatenated feature;
[0139] Performing a pooling operation on the concatenated features through an average pooling layer to obtain an output feature vector;
[0140] The output vector is classified through a fully connected layer and an activation function to obtain the CPU usage of the distributed container.
[0141] In some embodiments, extracting features from the input feature vector through a basic hidden layer and a maximum pooling layer to obtain a first feature vector includes:
[0142] Taking the input feature vector as input, feature extraction is performed in sequence through a first basic hidden layer, a second basic hidden layer, a first pooling layer, a third basic hidden layer, a fourth basic hidden layer, a second pooling layer, a fifth basic hidden layer, a sixth basic hidden layer, a third pooling layer, a seventh basic hidden layer, an eighth basic hidden layer, a fourth pooling layer, a ninth basic hidden layer and a tenth basic hidden layer to obtain a first feature vector; wherein,
[0143] The convolution layers in the first basic hidden layer and the second basic hidden layer respectively use 24 1×5 convolution kernels, the convolution layers in the third basic hidden layer and the fourth basic hidden layer respectively use 32 1×5 convolution kernels, the convolution layers in the fifth basic hidden layer and the sixth basic hidden layer respectively use 64 1×3 convolution kernels, and the convolution layers in the seventh basic hidden layer, the eighth basic hidden layer, the ninth basic hidden layer and the tenth basic hidden layer respectively use 128 1×3 convolution kernels.
[0144] In some embodiments, generating a second feature vector according to the input feature vector and the output vector of the maximum pooling layer by a multi-scale residual fusion module includes:
[0145] Generate a first fused feature vector according to the input feature vector and the output vector of the first maximum pooling layer through a first multi-scale residual fusion module;
[0146] Generate a second fused feature vector according to the first fused feature vector and the output vector of the second maximum pooling layer through a second multi-scale residual fusion module;
[0147] A second feature vector is generated according to the second fused feature vector and the output vector of the third maximum pooling layer through a third multi-scale residual fusion module.
[0148] In some embodiments, the training process of the deep convolutional neural network model is as follows:
[0149] Acquire historical target data in a training set, wherein the training set includes historical target data affecting CPU usage of distributed containers collected at a preset collection frequency;
[0150] generating an input historical feature vector according to the historical target data;
[0151] According to the input historical feature vector and the label of the input historical feature vector, a preset deep convolutional neural network model is trained to obtain a trained deep convolutional neural network model, wherein the label is the CPU usage of the distributed container.
[0152] The embodiment of the device provided in the embodiment of the present application can be specifically used to execute the processing flow of the above-mentioned method embodiment. Its functions are not described in detail here, and reference can be made to the detailed description of the above-mentioned method embodiment.
[0153] It should be noted that the distributed container CPU usage prediction method and device provided in the embodiment of the present application can be used in the financial field, and can also be used in any technical field other than the financial field. The embodiment of the present application does not limit the application field of the distributed container CPU usage prediction method and device.
[0154] Fig.10 A schematic diagram of the physical structure of an electronic device provided in an embodiment of the present application is shown in FIG. Fig.10 As shown, the electronic device may include: a processor 501, a communication interface 502, a memory 503 and a communication bus 504, wherein the processor 501, the communication interface 502 and the memory 503 communicate with each other through the communication bus 504. The processor 501 may call the logic instructions in the memory 503 to execute the method described in any of the above embodiments, for example, including: collecting target data affecting the CPU usage of the distributed container according to a preset collection frequency; generating an input feature vector according to the target data; inputting the input feature vector into a pre-trained deep convolutional neural network model to obtain the CPU usage of the distributed container predicted by the deep convolutional neural network model.
[0155] In addition, the logic instructions in the above-mentioned memory 503 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art, and the computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a U disk, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a disk or an optical disk.
[0156] The present embodiment discloses a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer can execute the methods provided by the above-mentioned method embodiments, for example, including: collecting target data that affects the CPU usage of distributed containers according to a preset collection frequency; generating an input feature vector based on the target data; and inputting the input feature vector into a pre-trained deep convolutional neural network model to obtain the CPU usage of the distributed container predicted by the deep convolutional neural network model.
[0157] The present embodiment provides a computer-readable storage medium, which stores a computer program. The computer program enables the computer to execute the methods provided by the above-mentioned method embodiments, for example, including: collecting target data that affects the CPU usage of distributed containers according to a preset collection frequency; generating an input feature vector based on the target data; and inputting the input feature vector into a pre-trained deep convolutional neural network model to obtain the CPU usage of the distributed container predicted by the deep convolutional neural network model.
[0158] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0159] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0160] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0161] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0162] In the description of this specification, the description with reference to the terms "one embodiment", "a specific embodiment", "some embodiments", "for example", "example", "specific example", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.
[0163] The specific embodiments described above further illustrate the purpose, technical solutions and beneficial effects of the present application. It should be understood that the above description is only a specific embodiment of the present application and is not intended to limit the scope of protection of the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application should be included in the scope of protection of the present application.
Claims
1. A method for predicting CPU usage of distributed containers. It is characterized in that include: Collect target data that affects the CPU usage of distributed containers at the preset collection frequency; Generating an input feature vector according to the target data; The input feature vector is input into a pre-trained deep convolutional neural network model to obtain the distributed container CPU usage predicted by the deep convolutional neural network model.
2. The method according to claim 1, It is characterized in that The target data includes macro data and micro data; wherein, The macro data includes at least one of the following: current time, holiday sign of current time, current temperature, current humidity, current rainfall, current visibility, train ticket sales volume in the last first time period, total train ticket sales in the last first time period, total air ticket sales in the last first time period, stock transaction volume in the last first time period, total stock transaction amount in the last first time period, and total number of business transactions in the last first time period; The micro data includes at least one of the following: current container CPU usage, current container memory usage, average transaction time in the most recent second period, and transaction success rate in the most recent second period.
3. The method according to claim 1, It is characterized in that Generating an input feature vector according to the target data includes: An input feature vector is generated according to the target data collected within the latest third time period.
4. The method according to claim 1, It is characterized in that The deep convolutional neural network model is specifically used for: Performing feature extraction on the input feature vector through a basic hidden layer and a maximum pooling layer to obtain a first feature vector; Generate a second feature vector according to the input feature vector and the output vector of the maximum pooling layer through a multi-scale residual fusion module; Concatenate the first feature vector and the second feature vector to obtain a concatenated feature; Performing a pooling operation on the concatenated features through an average pooling layer to obtain an output feature vector; The output vector is classified through a fully connected layer and an activation function to obtain the CPU usage of the distributed container.
5. The method according to claim 4, It is characterized in that The step of extracting features from the input feature vector through a basic hidden layer and a maximum pooling layer to obtain a first feature vector includes: Taking the input feature vector as input, feature extraction is performed in sequence through a first basic hidden layer, a second basic hidden layer, a first pooling layer, a third basic hidden layer, a fourth basic hidden layer, a second pooling layer, a fifth basic hidden layer, a sixth basic hidden layer, a third pooling layer, a seventh basic hidden layer, an eighth basic hidden layer, a fourth pooling layer, a ninth basic hidden layer and a tenth basic hidden layer to obtain a first feature vector; wherein, The convolution layers in the first basic hidden layer and the second basic hidden layer respectively use 24 1×5 convolution kernels, the convolution layers in the third basic hidden layer and the fourth basic hidden layer respectively use 32 1×5 convolution kernels, the convolution layers in the fifth basic hidden layer and the sixth basic hidden layer respectively use 64 1×3 convolution kernels, and the convolution layers in the seventh basic hidden layer, the eighth basic hidden layer, the ninth basic hidden layer and the tenth basic hidden layer respectively use 128 1×3 convolution kernels.
6. The method according to claim 5, It is characterized in that The generating a second feature vector according to the input feature vector and the output vector of the maximum pooling layer by a multi-scale residual fusion module includes: Generate a first fused feature vector according to the input feature vector and the output vector of the first maximum pooling layer through a first multi-scale residual fusion module; Generate a second fused feature vector according to the first fused feature vector and the output vector of the second maximum pooling layer through a second multi-scale residual fusion module; A second feature vector is generated according to the second fused feature vector and the output vector of the third maximum pooling layer through a third multi-scale residual fusion module.
7. The method according to claim 1, It is characterized in that The training process of the deep convolutional neural network model is as follows: Acquire historical target data in a training set, wherein the training set includes historical target data affecting CPU usage of distributed containers collected at a preset collection frequency; generating an input historical feature vector according to the historical target data; According to the input historical feature vector and the label of the input historical feature vector, a preset deep convolutional neural network model is trained to obtain a trained deep convolutional neural network model, wherein the label is the CPU usage of the distributed container.
8. A distributed container CPU usage prediction device, It is characterized in that include: A collection module is used to collect target data that affects the CPU usage of distributed containers according to a preset collection frequency; A generating module, used for generating an input feature vector according to the target data; The prediction module is used to input the input feature vector into a pre-trained deep convolutional neural network model to obtain the distributed container CPU usage predicted by the deep convolutional neural network model.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, It is characterized in that When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
