Resource adjustment method and device of computing node, and computer equipment storage medium
By decomposing and updating the resource data matrix with singular values, analyzing the resource changes of the computing nodes, solving the problem of low resource adjustment efficiency in cloud computing, and achieving more efficient resource management.
Patent Information
- Application Number
- CN202411712721.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-27
- Publication Date
- 2025-03-11
AI Technical Summary
The resource adjustment efficiency of computing nodes in cloud computing is low, resulting in insufficient resource allocation.
By obtaining the resource data matrix of the computing node, performing singular value decomposition, updating the data matrix, analyzing resource changes, and making resource adjustments.
Improve the efficiency of resource adjustment, reduce manual intervention, and achieve faster resource response.
Smart Images

Figure CN119597478A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of cloud computing technology, and in particular to a method, apparatus, computer equipment, storage medium and computer program product for adjusting resources of a computing node. Background Art
[0002] With the development of technology, the demand for data processing is increasing day by day, and cloud computing has emerged as a model of resource computing. Cloud computing continuously adjusts the resources in computing nodes according to the business scale and number of users, but sometimes the resources required by computing nodes change greatly in a short period of time, and resource adjustment takes time, which often leads to insufficient resource allocation.
[0003] In the traditional method, resources in computing nodes are adjusted manually, which is limited by the experience of operators. In the case of insufficient experience, there is a problem of low efficiency in resource adjustment. Summary of the invention
[0004] Based on this, it is necessary to provide a resource adjustment method, apparatus, computer equipment, computer-readable storage medium and computer program product for computing nodes that can improve resource adjustment efficiency in response to the above technical problems.
[0005] In a first aspect, the present application provides a method for adjusting resources of a computing node. The method comprises:
[0006] Obtain resource data matrices corresponding to a plurality of computing resource items of a computing node; the resource data matrix includes historical resource data collected at a plurality of historical moments; for each of the resource data matrices, perform singular value decomposition on the resource data matrix to obtain a singular data matrix and a diagonal singular value matrix corresponding to the resource data matrix; the diagonal singular value matrix includes a plurality of singular values; based on target singular values in each of the singular values and the singular data matrix, update the resource data matrix to obtain an updated data matrix; based on the updated data matrix of each of the computing resource items, perform resource change analysis on the computing node to determine the resource change situation of the computing node corresponding to each of the computing resource items; based on the resource change situation, perform resource adjustment on the computing node.
[0007] In one of the embodiments, for each of the resource data matrices, singular value decomposition is performed on the resource data matrix to obtain a singular data matrix and a diagonal singular value matrix corresponding to the resource data matrix, including: for each of the resource data matrices, data preprocessing is performed on each historical resource data contained in the resource data matrix to obtain a preprocessed data matrix; singular value decomposition is performed on the preprocessed data matrix to obtain a singular data matrix and a diagonal singular value matrix corresponding to the resource data matrix.
[0008] In one of the embodiments, each historical resource data contained in the resource data matrix is subjected to data preprocessing to obtain a preprocessed data matrix, including: for each historical resource data contained in the resource data matrix, the historical resource data is normalized to obtain normalized data; and singular samples in each normalized data are removed to obtain a preprocessed data matrix corresponding to the resource data matrix.
[0009] In one of the embodiments, the resource data matrix is updated based on the target singular values in each of the singular values and the singular data matrix to obtain an updated data matrix, including: determining the target singular value that meets the screening condition in each of the singular values; multiplying the updated singular value matrix containing each target singular value with the singular data matrix to obtain an updated data matrix.
[0010] In one of the embodiments, the method further includes: obtaining current resource data of the computing node corresponding to each of the computing resource items at the current moment; and determining a screening condition according to the computing capacity represented by each of the current resource data.
[0011] In one of the embodiments, based on the updated data matrix of each of the computing resource items, resource change analysis is performed on the computing node to determine the resource change situation of each of the computing resource items corresponding to the computing node, including: obtaining a resource change analysis model; inputting the updated data matrix of each of the computing resource items into the resource change analysis model, and determining the resource change situation of each of the computing resource items corresponding to the computing node based on the output of the resource change analysis model.
[0012] In a second aspect, the present application also provides a computing node resource adjustment device. The device includes:
[0013] An acquisition module is used to acquire resource data matrices corresponding to a plurality of computing resource items of a computing node; the resource data matrix includes historical resource data collected at a plurality of historical moments; a decomposition module is used to perform singular value decomposition on the resource data matrix for each of the resource data matrices to obtain a singular data matrix and a diagonal singular value matrix corresponding to the resource data matrix; the diagonal singular value matrix includes a plurality of singular values; an update module is used to update the resource data matrix based on target singular values in each of the singular values and the singular data matrix to obtain an updated data matrix; an analysis module is used to perform resource change analysis on the computing node based on the updated data matrix of each of the computing resource items to determine the resource change situation of the computing node corresponding to each of the computing resource items; an adjustment module is used to adjust the resources of the computing node based on each of the resource change situations.
[0014] In a third aspect, the present application further provides a computer device. The computer device includes a memory and a processor, the memory stores a computer program, and the processor implements the following steps when executing the computer program:
[0015] Obtain resource data matrices corresponding to a plurality of computing resource items of a computing node; the resource data matrix includes historical resource data collected at a plurality of historical moments; for each of the resource data matrices, perform singular value decomposition on the resource data matrix to obtain a singular data matrix and a diagonal singular value matrix corresponding to the resource data matrix; the diagonal singular value matrix includes a plurality of singular values; based on target singular values in each of the singular values and the singular data matrix, update the resource data matrix to obtain an updated data matrix; based on the updated data matrix of each of the computing resource items, perform resource change analysis on the computing node to determine the resource change situation of the computing node corresponding to each of the computing resource items; based on the resource change situation, perform resource adjustment on the computing node.
[0016] In a fourth aspect, the present application further provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the following steps are implemented:
[0017] Obtain resource data matrices corresponding to a plurality of computing resource items of a computing node; the resource data matrix includes historical resource data collected at a plurality of historical moments; for each of the resource data matrices, perform singular value decomposition on the resource data matrix to obtain a singular data matrix and a diagonal singular value matrix corresponding to the resource data matrix; the diagonal singular value matrix includes a plurality of singular values; based on target singular values in each of the singular values and the singular data matrix, update the resource data matrix to obtain an updated data matrix; based on the updated data matrix of each of the computing resource items, perform resource change analysis on the computing node to determine the resource change situation of the computing node corresponding to each of the computing resource items; based on the resource change situation, perform resource adjustment on the computing node.
[0018] In a fifth aspect, the present application further provides a computer program product. The computer program product includes a computer program, and when the computer program is executed by a processor, the following steps are implemented:
[0019] Obtain resource data matrices corresponding to a plurality of computing resource items of a computing node; the resource data matrix includes historical resource data collected at a plurality of historical moments; for each of the resource data matrices, perform singular value decomposition on the resource data matrix to obtain a singular data matrix and a diagonal singular value matrix corresponding to the resource data matrix; the diagonal singular value matrix includes a plurality of singular values; based on target singular values in each of the singular values and the singular data matrix, update the resource data matrix to obtain an updated data matrix; based on the updated data matrix of each of the computing resource items, perform resource change analysis on the computing node to determine the resource change situation of the computing node corresponding to each of the computing resource items; based on the resource change situation, perform resource adjustment on the computing node.
[0020] The resource adjustment method, device, computer equipment, storage medium and computer program product of the computing node are used to obtain the resource data matrix corresponding to each of the computing nodes and multiple computing resource items. The resource data matrix includes historical resource data collected at multiple historical moments. For each resource data matrix, the resource data matrix is subjected to singular value decomposition to obtain a singular data matrix and a diagonal singular value matrix corresponding to the resource data matrix. The diagonal singular value matrix contains multiple singular values. Based on the target singular values and the singular data matrix in each singular value, the resource data matrix is updated to obtain an updated data matrix. The resource data matrix is updated based on the singular values, which helps to extract important features from the resource data matrix and reduce the subsequent resource change analysis time. The above method is used to analyze the resource changes of the computing nodes based on the updated data matrix of each computing resource item, and determine the resource changes of the computing nodes corresponding to each computing resource item. Based on the resource changes, the computing nodes are timely adjusted for resources without manual adjustment of resources, thereby improving the efficiency of resource adjustment. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Figure 1 An application environment diagram of a method for adjusting resources of a computing node in an embodiment;
[0022] Figure 2 A schematic diagram of a flow chart of a method for adjusting resources of a computing node in an embodiment;
[0023] Figure 3 1 is a flow chart of a method for predicting cloud computing resource load based on a GWO-LSTM model in one embodiment;
[0024] Figure 4 A schematic diagram of the structure of LSTM in one embodiment;
[0025] Figure 5 A flowchart of cloud resource load prediction in one embodiment;
[0026] Figure 6 It is a general architecture diagram of the GWO-LSTM model prediction in one embodiment;
[0027] Figure 7 is a structural block diagram of a resource adjustment device for a computing node in an embodiment;
[0028] Figure 8 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0029] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0030] The resource adjustment method of the computing node provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown, the terminal 102 communicates with the server 104 through a network. The data storage system can store data that the server 104 needs to process. The data storage system can be integrated on the server 104, or placed on the cloud or other network servers.
[0031] The server 104 can obtain the resource data matrix corresponding to each of the multiple computing resource items of the computing node to which the terminal 102 belongs; the resource data matrix includes historical resource data collected at multiple historical moments. The server 104 can perform singular value decomposition on the resource data matrix for each resource data matrix to obtain a singular data matrix and a diagonal singular value matrix corresponding to the resource data matrix; the diagonal singular value matrix contains multiple singular values. The server 104 can update the resource data matrix based on the target singular values and the singular data matrix in each singular value to obtain an updated data matrix. The server 104 can perform resource change analysis on the computing node based on the updated data matrix of each computing resource item, and determine the resource change situation of the computing node corresponding to each computing resource item. The server 104 can adjust the resources of the computing node to which the terminal 102 belongs based on each resource change situation.
[0032] The terminal 102 may be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, IoT devices, and portable wearable devices. The IoT devices may be smart speakers, smart TVs, smart air conditioners, smart car-mounted devices, etc. The portable wearable devices may be smart watches, smart bracelets, head-mounted devices, etc. The server 104 may be implemented as an independent server or a server cluster consisting of multiple servers.
[0033] In one embodiment, Figure 2 As shown, a resource adjustment method for a computing node is provided, and the method is applied to Figure 1 The server 104 in FIG. 1 is used as an example to illustrate, including:
[0034] S202, obtaining resource data matrices corresponding to the computing nodes and the respective computing resource items.
[0035] Among them, a computing node can represent a physical device used to perform computing tasks, which can be a terminal or a server. A computing node can also be a virtual machine or a container. In cloud computing scenarios, a computing node is responsible for performing computing tasks, storing data, and providing network services.
[0036] The computing resource item may represent a specific resource item of a computing node, including a CPU resource item, a memory resource item, and a storage resource item.
[0037] The resource data matrix may represent a set of resource changes of computing resource items in a historical period. For example, the resource data matrix may be a CPU resource matrix, a memory resource matrix, or a storage resource matrix.
[0038] The historical resource data may be resource values at different historical moments, for example, CPU idle rate and CPU remaining capacity collected at preset moments, or remaining memory size collected at preset moments.
[0039] The resource data matrix may include historical resource data collected at multiple historical moments. Historical moments may include monitoring cycles and time nodes. For example, the resource data matrix is as follows:
[0040]
[0041] in, can represent a resource data matrix, It can represent the historical resource data collected during the first monitoring cycle and the first time node. It can represent the historical resource data collected at the kth monitoring cycle and the nth time node. The monitoring cycle can be one day or several days, and the time node can be the collection time within the cycle.
[0042] Specifically, the server may determine a monitoring cycle range and a time node range. The server may collect resource data matrices corresponding to the computing nodes and the plurality of computing resource items according to the monitoring cycle range and the time node range.
[0043] In one embodiment, the server may receive a selection operation of a developer for a monitoring cycle range and a time node range, and obtain a selected cycle range and a selected node range. The server may collect resource data matrices corresponding to the computing nodes of the plurality of computing resource items according to the selected cycle range and the selected node range.
[0044] S204, for each resource data matrix, performing singular value decomposition on the resource data matrix to obtain a singular data matrix and a diagonal singular value matrix corresponding to the resource data matrix.
[0045] Among them, singular value decomposition can be a calculation method. Singular value decomposition can decompose a complex matrix into a simple matrix multiplication. Singular value decomposition not only simplifies the calculation, but also reveals the important structure and characteristics inside the matrix.
[0046] The singular data matrix may be a left and right singular vector matrix obtained by singular value decomposition. The singular data matrix may include two orthogonal matrices that are transposed of each other.
[0047] The diagonal singular value matrix may be a matrix containing singular values obtained by singular value decomposition. The diagonal singular value matrix contains a plurality of singular values.
[0048] The resource data matrix may be a CPU data matrix. The CPU data matrix includes historical resource data collected at multiple historical moments, as well as sampling dates and sampling times. The CPU data matrix is as follows:
[0049]
[0050] in, can represent the CPU data matrix, D can represent the sampling date, and T can represent the sampling time.
[0051] right Perform singular value decomposition to obtain .
[0052] Among them, U and V can represent singular data matrices, can represent a diagonal singular value matrix. Specifically, ,in, Can represent singular values.
[0053] Specifically, for each resource data matrix, the server can perform singular value decomposition on the resource data matrix to obtain a singular data matrix and a diagonal singular value matrix corresponding to the resource data matrix. This facilitates subsequent dimensionality reduction of data, reduces storage space and computational complexity, and improves data processing efficiency by retaining larger singular values and corresponding singular vectors.
[0054] There are many ways to perform singular value decomposition, such as the method based on QR iteration, the method based on the power method, etc. In practical applications, for each resource data matrix, the server can use the functions provided by the numerical computing library (such as NumPy, SciPy) to perform singular value decomposition on the resource data matrix to obtain the singular data matrix and diagonal singular value matrix corresponding to the resource data matrix.
[0055] S206, based on the target singular values in each singular value and the singular data matrix, the resource data matrix is updated to obtain an updated data matrix.
[0056] The target singular value may be a singular value with a larger value. Among the singular values, the larger the singular value, the more information the singular value corresponds to and the more important features it contains. Conversely, the smaller the singular value, the less information the singular value corresponds to and the fewer important features it contains.
[0057] The updated data matrix may represent an updated resource data matrix, for example, a matrix obtained by performing data compression or data denoising on the resource data matrix.
[0058] Specifically, the server may update the diagonal singular value matrix according to the target singular value in each singular value to obtain a new diagonal singular value matrix. The server may determine the product of the new diagonal singular value matrix and the singular data matrix as the updated data matrix.
[0059] In one of the embodiments, the server may randomly determine a singular value from among the singular values as a target singular value.
[0060] In one embodiment, the server may determine a target singular value that satisfies a screening condition among the singular values, wherein the screening condition may be the top 10% of the singular values.
[0061] S208, based on the updated data matrix of each computing resource item, performing resource change analysis on the computing node, and determining the resource change status of each computing node corresponding to each computing resource item.
[0062] The resource change situation may represent the change situation of the computing resource items of the computing node in the target period. The resource change situation may include the change situation of the CPU resources in the target period, the change situation of the memory resources in the target period, and the change situation of the storage resources in the target period. For example, the change situation of the CPU resources in the target period may be that the CPU residual load first increases and then decreases in the target period. The target period may represent a period after the resource change analysis time.
[0063] There are many ways to analyze resource changes. Resource change analysis can be a one-to-one relationship. For example, the server can update the data matrix based on the CPU resource item, perform resource change analysis on the computing node, and determine the resource change status of the computing node corresponding to the CPU resource item.
[0064] Resource change analysis can be a many-to-one relationship. For example, the server can perform resource change analysis on the computing nodes based on the updated data matrix of the CPU resource items and the memory resource items to determine the resource change status of the computing nodes corresponding to the CPU resource items.
[0065] S210: Adjust the resources of the computing nodes based on the changes in the resources.
[0066] The resource adjustment may represent the adjustment of resources of each resource item in the computing node. Specifically, the resource adjustment may represent the node migration of the computing node.
[0067] Node migration can mean migrating a virtual machine (VM) or computing task from one physical node to another to achieve optimal resource configuration and load balancing. This process involves multiple key aspects, including the migration of memory, CPU, and storage resources.
[0068] Memory: During the migration process, the memory state of the virtual machine needs to be copied to the target host to ensure that the migrated virtual machine can continue to operate normally. For example, during hot migration, the data in the memory will be copied to the new physical host and the cloud hard disk will be remounted.
[0069] CPU: CPU state migration is a key step to ensure that the virtual machine can be seamlessly restored on the target node. By copying the state of the CPU registers, the running state of the virtual machine can be restored on the target host. In addition, the migration algorithm takes into account the differences in CPU performance parameters of different physical hosts to optimize task execution time and load balancing.
[0070] Storage: Migration of storage resources includes migration of data disks and system disks. For local storage, you usually need to uninstall the data cloud disk first and then remount it on the target host. If it is network shared storage, you can copy the memory and CPU-related register status through online real-time migration, and support cross-cluster migration. In addition, hot migration of the storage layer will also involve synchronization of disk status.
[0071] Specifically, since each resource change situation reflects the expected required resource situation of the computing node in each resource item, the server can adjust the resources of the computing node based on each resource change situation.
[0072] In one embodiment, for each resource change, the server can adjust the resources of the resource items corresponding to the resource change in the computing node based on the resource change. Efficiently migrate the memory, CPU and storage resources of the virtual machine to achieve optimal resource configuration and load balancing, thereby improving the overall performance and resource utilization of the system
[0073] In the resource adjustment method of the above computing node, the resource data matrix corresponding to each of the computing nodes and the plurality of computing resource items is obtained. The resource data matrix includes the historical resource data collected at a plurality of historical moments. For each resource data matrix, the resource data matrix is subjected to singular value decomposition to obtain the singular data matrix and the diagonal singular value matrix corresponding to the resource data matrix. The diagonal singular value matrix contains a plurality of singular values. Based on the target singular values and the singular data matrix in each singular value, the resource data matrix is updated to obtain the updated data matrix. The resource data matrix is updated based on the singular values, which helps to extract important features from the resource data matrix and reduce the subsequent resource change analysis time. The above method is adopted to analyze the resource changes of the computing nodes based on the updated data matrix of each computing resource item, and determine the resource changes of the computing nodes corresponding to each computing resource item. Based on the changes of each resource, the resources of the computing nodes are adjusted in time, without the need to adjust the resources manually, thereby improving the efficiency of resource adjustment.
[0074] In one embodiment, for each resource data matrix, singular value decomposition is performed on the resource data matrix to obtain a singular data matrix and a diagonal singular value matrix corresponding to the resource data matrix, including: for each resource data matrix, data preprocessing is performed on each historical resource data contained in the resource data matrix to obtain a preprocessed data matrix, and singular value decomposition is performed on the preprocessed data matrix to obtain a singular data matrix and a diagonal singular value matrix corresponding to the resource data matrix.
[0075] The preprocessed data matrix may be a matrix obtained by performing data preprocessing on the resource data matrix. Specifically, data preprocessing is performed on each historical resource data included in the resource data matrix to obtain the preprocessed data matrix.
[0076] Specifically, the server may perform data preprocessing on each historical resource data included in the resource data matrix to obtain preprocessed historical resource data. The server may construct a preprocessed data matrix based on the preprocessed historical resource data.
[0077] There are many ways to preprocess data. In one embodiment, for each resource data matrix, the server can perform data cleaning on each historical resource data included in the resource data matrix to obtain a preprocessed data matrix.
[0078] In one of the embodiments, the server may also perform data integration, data conversion, and data reduction processing on each historical resource data included in the resource data matrix to obtain a pre-processed data matrix.
[0079] Specifically, the server may also normalize each historical resource data contained in the resource data matrix to obtain normalized data. The server may remove singular samples in each normalized data to obtain a preprocessed data matrix corresponding to the resource data matrix.
[0080] In this embodiment, for each resource data matrix, data preprocessing is performed on each historical resource data contained in the resource data matrix to obtain a preprocessed data matrix, and singular value decomposition is performed on the preprocessed data matrix to obtain a singular data matrix and a diagonal singular value matrix corresponding to the resource data matrix. This can reduce missing values of the data, facilitate subsequent improvement of the accuracy of data processing, and help improve the accuracy of subsequent resource adjustments.
[0081] In one embodiment, each historical resource data contained in the resource data matrix is subjected to data preprocessing to obtain a preprocessed data matrix, including: for each historical resource data contained in the resource data matrix, the historical resource data is normalized to obtain normalized data, and singular samples in each normalized data are removed to obtain a preprocessed data matrix corresponding to the resource data matrix.
[0082] Among them, normalized data can represent historical resource data that has been normalized. Normalization can speed up the gradient descent to find the optimal solution, improve the accuracy of the model, and ensure that each feature contributes equally to the result. In addition, normalization can also reduce the impact of internal covariance, thereby improving the efficiency of model training.
[0083] Singular samples can represent sample vectors (i.e., eigenvectors) that are particularly large or small relative to other input samples. For example, if the eigenvalue of a sample is very different from the eigenvalues of other samples, then this sample is considered a singular sample. The presence of singular samples may have a negative impact on model training, such as increasing training time and causing the model to fail to converge. Therefore, before model training, it is usually necessary to preprocess the data, such as normalization, to eliminate the influence of singular samples, thereby improving the training efficiency and stability of the model.
[0084] There are many ways to normalize, such as Min-Max Normalization, Z-score Normalization, and nonlinear normalization. Min-Max Normalization maps data to the [0,1] interval through linear transformation, which is suitable for situations where the target value range is clear. Z-score Normalization requires that the original data is approximately Gaussian distributed, which is suitable for classification, clustering, and PCA technology. Specifically, the server can perform Min-Max Normalization on historical resource data to obtain normalized data.
[0085] Specifically, after the server obtains the normalized data, the server may remove the maximum and minimum values in each normalized data to obtain a preprocessed data matrix corresponding to the resource data matrix.
[0086] In this embodiment, for each historical resource data contained in the resource data matrix, the historical resource data is normalized to obtain normalized data, and the singular samples in each normalized data are removed to obtain a preprocessed data matrix corresponding to the resource data matrix.
[0087] In one embodiment, based on the target singular values and the singular data matrix in each singular value, the resource data matrix is updated to obtain an updated data matrix, including: determining the target singular value that meets the screening condition in each singular value, multiplying the updated singular value matrix containing each target singular value with the singular data matrix to obtain an updated data matrix.
[0088] The screening condition may be a condition for screening larger singular values.
[0089] The updated singular value matrix may represent a diagonal singular value matrix including target singular values. The difference between the updated singular value matrix and the diagonal singular value matrix may be that the updated singular value matrix includes some singular values (target singular values), while the diagonal singular value matrix includes all singular values.
[0090] Exemplarily, each singular value may include , the screening condition can be to screen out some larger target singular values from each singular value, for example, .
[0091] Specifically, after obtaining the target singular values, the server can update the singular value matrix containing each target singular value Multiply by the singular data matrices (U and V) to get the update data matrix.
[0092] The screening condition may be determined manually, or may be determined based on the computing capacity of the computing node. Specifically, the server may obtain multiple candidate screening conditions. The server may obtain the screening condition in response to a selection operation for each candidate screening condition.
[0093] Specifically, the server may also obtain the current resource data of the computing node corresponding to each computing resource item at the current moment. The service may determine the screening condition according to the computing capacity represented by each current resource data.
[0094] In this embodiment, among each singular value, the target singular value that meets the screening conditions is determined, and the updated singular value matrix containing each target singular value is multiplied by the singular data matrix to obtain an updated data matrix, which helps to extract important features from the resource data matrix, reduce the time for subsequent resource change analysis, and thus improve resource adjustment efficiency.
[0095] In one embodiment, the resource adjustment method of a computing node further includes: obtaining current resource data of the computing node corresponding to each computing resource item at the current moment, and determining a screening condition according to the computing capacity represented by each current resource data.
[0096] The current resource data may represent the resource usage of the computing node under the computing resource item. For example, the current resource data may be the real-time idle rate of the CPU of the computing node under the CPU resource item. For another example, the current resource data may be the remaining storage space size of the computing node under the storage resource item.
[0097] Computing capability refers to the ability of a computing node to process data.
[0098] There is a correlation between current resource data and computing power. For example, if the current resource indicates that the CPU real-time idle rate is larger, it can be said that the computing power of the computing node is stronger. If the current resource indicates that the remaining memory capacity is larger, it can be said that the computing power of the computing node is stronger. Furthermore, the stronger the computing power, the more target singular values can be screened out by the computing node.
[0099] Specifically, the server may obtain the current resource data of the computing node corresponding to each computing resource item at the current moment, and the service determines the screening condition according to the computing capacity represented by each current resource data.
[0100] In one embodiment, the server may obtain the computing power weights configured for each resource item, and determine the screening condition according to the computing power represented by each current resource data and the computing power weights.
[0101] In one embodiment, the server can obtain the computing power value according to the computing power represented by each current resource data and the weight of each computing power. The service can determine the screening conditions that match the computing power value. In this way, it can be ensured that the number of target singular values screened according to the screening conditions matches the computing power of the computing node. The efficiency and accuracy of data processing are taken into account.
[0102] In this embodiment, the current resource data of the computing node corresponding to each computing resource item at the current moment is obtained, and the screening conditions are determined according to the computing capacity represented by each current resource data, thereby taking into account both the efficiency and accuracy of data processing.
[0103] In one embodiment, based on the updated data matrix of each computing resource item, a resource change analysis is performed on the computing node to determine the resource change status of the computing node corresponding to each computing resource item, including: obtaining a resource change analysis model, inputting the updated data matrix of each computing resource item into the resource change analysis model, and determining the resource change status of the computing node corresponding to each computing resource item based on the output of the resource change analysis model.
[0104] Among them, the resource change analysis model can be based on the LSTM model. LSTM (Long Short-Term Memory Network) is a variant of a recurrent neural network (RNN) that is specifically used to process sequence data and solve long-term dependency problems. LSTM controls the flow of information by introducing a gating mechanism, thereby effectively capturing and memorizing long-term dependencies in sequence data. The resource change analysis model can also be based on the LSTM model trained by GWO.
[0105] The output of the resource change analysis model may include a plurality of candidate resource change situations of the computing resource item and the confidence level corresponding to each candidate resource change situation.
[0106] Specifically, the server can input the updated data matrix of each computing resource item into the resource change analysis model, and determine the resource change situation of each computing resource item corresponding to the computing node based on the output of the resource change analysis model. Inputting the resource change analysis model as a processed data matrix can improve the prediction accuracy and prediction efficiency of the model.
[0107] In one of the embodiments, after obtaining the output of the resource change analysis model, for each computing resource item, the server can determine the resource change status of the computing node corresponding to the computing resource item based on multiple candidate resource change statuses of the computing resource item contained in the output and the confidence level corresponding to each candidate resource change status.
[0108] In one embodiment, the server may select the target resource change situation with the greatest confidence from among the candidate resource change situations. The server may determine the target resource change situation as the resource change situation of the computing node corresponding to the computing resource item.
[0109] In this embodiment, a resource change analysis model is obtained, and the updated data matrix of each computing resource item is input into the resource change analysis model. Based on the output of the resource change analysis model, the resource change status of the computing node corresponding to each computing resource item is determined. The resource change analysis model effectively captures and memorizes the long-term dependencies in the sequence data, which is conducive to improving the accuracy of resource adjustment.
[0110] In one embodiment, Figure 3 The cloud computing resource load prediction method based on the GWO-LSTM model shown includes:
[0111] S301, obtaining resource data matrices corresponding to a plurality of computing resource items of a computing node.
[0112] The resource data matrix includes historical resource data collected at multiple historical moments.
[0113] S302, normalizing each historical resource data included in the resource data matrix to obtain normalized data.
[0114] S303, removing singular samples in each normalized data to obtain a preprocessed data matrix corresponding to the resource data matrix.
[0115] S304, performing singular value decomposition on the preprocessed data matrix to obtain a singular data matrix and a diagonal singular value matrix corresponding to the resource data matrix.
[0116] A diagonal singular value matrix contains multiple singular values.
[0117] S305: Determine, among the singular values, a target singular value that satisfies the screening condition.
[0118] Among them, the current resource data of the computing node corresponding to each computing resource item at the current moment is obtained.
[0119] S306: Determine a screening condition according to the computing capacity represented by each current resource data.
[0120] S307, multiplying the updated singular value matrix containing each target singular value with the singular data matrix to obtain an updated data matrix.
[0121] S308, obtaining a resource change analysis model.
[0122] S309, inputting the updated data matrix of each computing resource item into the resource change analysis model, and determining the resource change status of each computing node corresponding to each computing resource item based on the output of the resource change analysis model.
[0123] Among them, the resource change analysis model can be a cloud computing resource load prediction model based on the GWO-LSTM model.
[0124] Among them, historical monitoring data of CPU and memory can be obtained. In the historical monitoring data of CPU and memory, there are singular samples caused by emergencies. Such data affects the exploration and summary of rules. The minimum-maximum normalization preprocessing method can be used to remove these singular samples.
[0125] Then perform SVD processing on the data to obtain singular values, sort the singular values from large to small according to importance, remove redundant data information, retain important features, use the least singular values as much as possible to represent all singular values, and perform feature extraction to achieve the purpose of data compression and dimensionality reduction.
[0126] The historical monitoring data matrix X of CPU and memory cpu and X mem Perform SVD decomposition. The expressions are:
[0127]
[0128]
[0129]
[0130]
[0131] in represents an m-by-n diagonal singular value matrix. Here It is the singular value, which can be selected according to the above description The first 10%, multiplied by the left and right singular vector matrices, yields and Approximately replace the original X matrix.
[0132] The training data set is iteratively calculated, the hyperparameters of the LSTM model are optimized and updated, the GWO-LSTM model is trained, and the error between the actual value and the predicted value is compared. The error is back-propagated to fit the weight parameters and reduce the loss function.
[0133] In the first part, we import the enhanced dataset into the LSTM model.
[0134] like Figure 4 The key to solving the long-term dependency problem of short-term memory neural networks is that LSTM can save and transmit effective memory information, which is the "unit state": .
[0135] The LSTM model is a three-gate mechanism. It is determined by two gate structures. In the first layer, “forgetgate” controls the historical monitoring data set output of CPU and memory at time t-1 h t-1 , and the input historical monitoring data x at time t tThe information that needs to be discarded and saved in the combination of information. By importing the combined information into the sigmoid neural layer, the weight of the information is limited to the range of (0,1), where 0 represents discarding and 1 represents saving. The expression of the sigmoid neural layer, also known as the "forget gate output", is:
[0136]
[0137] In the second layer "input gate", the historical monitoring data set of CPU and memory at time t-1 is output to h t-1 , and the input historical monitoring data x at time t t The combined information of is imported into the tanh activation function to ensure that the data is mapped to a mean of 0. The expressions are:
[0138]
[0139]
[0140] Memory information "unit status" Update "unit status" via "forget gate" and "input gate" The third level "output gate" is, as its name implies, to control the output of information. , Combined information through ,get .
[0141] In the second part, GWO is used to optimize the LSTM model parameters and train the model.
[0142] like Figure 5 The flowchart of cloud resource load prediction is shown in Figure 6 The overall architecture diagram of the GWO-LSTM model prediction is shown.
[0143] During the training process of the LSTM model, the hyperparameters control the prediction accuracy of the model. In order to make the model converge faster and have higher prediction accuracy, the gray wolf optimization algorithm is added. The expression is:
[0144]
[0145] Use GWO to optimize the following prediction model parameters within the control range:
[0146]
[0147] The third part is to determine the loss function, control the LSTM model error, and optimize the LSTM model.
[0148] When training the LSTM model, use GWO to optimize the parameters of the LSTM prediction model, import the test data set into the LSTM model, obtain the predicted output value, compare it with the actual value, and get the error value. The selection of the loss function is very important, which determines the direction and convergence speed of the model optimization, and needs to consider the characteristics of the sequence. Here, MSE is selected as the loss function of the LSTM regression model, and the expression is:
[0149]
[0150] in, represents the predicted value of the prediction model, Represents real data. When the MSE value is smaller, the model prediction effect is better. Backward error propagation, calculate the gradient of the three gates, and then update the parameter weights. Repeat multiple times until the MSE reaches the optimal solution within the expected range.
[0151] For example, first, the resource usage of a computing node on the cloud platform within 14 days is obtained from an open dataset, and the first 80% of the dataset is used as a training dataset, and the last 20% is used as a test dataset.
[0152] Secondly, the data set is cleaned and normalized to standardize the data set.
[0153] Then, the data set is decomposed by SVD, feature extraction is performed, and data dimension reduction is performed.
[0154] Afterwards, the processed training data set is imported into the LSTM model, and the calculation is repeated multiple times to optimize the training parameters through GWO.
[0155] It is best to use the processed test data set to objectively evaluate and adjust the performance of the model. The smaller the loss function, the closer the actual result value is to the predicted value.
[0156] S310: Adjust the resources of the computing nodes based on the changes in the resources.
[0157] In the present embodiment, the resource data matrix corresponding to each of the plurality of computing resource items is obtained, the resource data matrix includes the historical resource data collected at a plurality of historical moments, and for each resource data matrix, the resource data matrix is subjected to singular value decomposition to obtain the singular data matrix and the diagonal singular value matrix corresponding to the resource data matrix, the diagonal singular value matrix includes a plurality of singular values, based on the target singular value and the singular data matrix in each singular value, the resource data matrix is updated to obtain the updated data matrix, and the resource data matrix is updated based on the singular value, which is helpful to extract important features from the resource data matrix and reduce the subsequent resource change analysis time. The above method is adopted, based on the updated data matrix of each computing resource item, the computing node is subjected to resource change analysis, and the computing node is determined to correspond to the resource change situation of each computing resource item. Based on the resource change situation, the computing node is timely adjusted for resources, and there is no need to manually adjust the resources, thereby improving the resource adjustment efficiency.
[0158] The above method can also bring the following beneficial effects: 1. In the data preprocessing stage, the resource prediction mechanism performs singular value decomposition on the historical monitoring data of CPU, memory and storage, removes a large amount of irrelevant redundant data, retains the information that best represents the characteristics of all data, and realizes data dimensionality reduction, which greatly reduces the recursive calculation time of the model, accelerates the convergence speed, and improves the prediction efficiency.
[0159] Second, resource scheduling is a dynamic task execution process. The GWO-LSTM model uses the Gray Wolf Optimization Algorithm to update the parameter weights of the model in real time for multiple training parameters. It increases the weight parameters for important information and reduces the weights for redundant or non-essential information to reduce the impact on the prediction results, thereby improving the prediction accuracy.
[0160] 3. In computing node scheduling, the prediction mechanism of GWO-LSTM deep learning is used to predict the distribution of future cloud resources based on historical data. The LSTM model introduces dynamic time series features, and the time series is considered in the load prediction of CPU, memory and storage resources of cloud computing. The model also solves long-term dependencies, making it possible to predict resource loads in the long term in the future.
[0161] 4. The massive cloud computing resource historical monitoring data is processed by SVD, which is conducive to extracting important and significant features and realizing data dimension reduction. It can grasp the law and trend of resource load and predict the resource load status at future moments. It can help operation and maintenance personnel to reasonably allocate resources in advance, reduce resource waste, improve resource utilization and optimize performance.
[0162] 5. The LSTM resource prediction model is used in combination with GWO to achieve the optimal solution for the model's hyperparameters of initial learning rate, number of neurons in hidden layer 1, number of neurons in hidden layer 2, batch size, and number of training iterations. Rapid convergence can significantly improve the prediction accuracy of the model and reduce the prediction time of the model.
[0163] 6. Massive historical monitoring data sets are matched with time series and imported into the appropriate neural network: GWO-LSTM combined model, to explore the relationship between monitoring data and time, dynamically adjust resources in a timely manner, and realize rapid expansion or reduction of computing nodes during business peak or low-priority periods.
[0164] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0165] Based on the same inventive concept, the embodiment of the present application also provides a computing node resource adjustment device for implementing the computing node resource adjustment method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in the embodiment of the resource adjustment device for one or more computing nodes provided below can refer to the limitations of the computing node resource adjustment method above, and will not be repeated here.
[0166] In one embodiment, Figure 7 As shown, a computing node resource adjustment device is provided, including: an acquisition module 701, a decomposition module 702, an update module 703, an analysis module 704 and an adjustment module 705, wherein:
[0167] The acquisition module 701 is used to acquire resource data matrices corresponding to the computing nodes and the plurality of computing resource items, respectively; the resource data matrix includes historical resource data collected at a plurality of historical moments;
[0168] Decomposition module 702, for each resource data matrix, performing singular value decomposition on the resource data matrix to obtain a singular data matrix and a diagonal singular value matrix corresponding to the resource data matrix; the diagonal singular value matrix contains a plurality of singular values;
[0169] An updating module 703 is used to update the resource data matrix based on the target singular value in each singular value and the singular data matrix to obtain an updated data matrix;
[0170] An analysis module 704 is used to perform resource change analysis on the computing node based on the updated data matrix of each computing resource item, and determine the resource change status of each computing node corresponding to each computing resource item;
[0171] The adjustment module 705 is used to adjust the resources of the computing nodes based on the change of each resource.
[0172] In one embodiment, the decomposition module 702 is also used to perform data preprocessing on each historical resource data contained in the resource data matrix to obtain a preprocessed data matrix; perform singular value decomposition on the preprocessed data matrix to obtain a singular data matrix and a diagonal singular value matrix corresponding to the resource data matrix.
[0173] In one embodiment, the decomposition module 702 is further used to normalize each historical resource data contained in the resource data matrix to obtain normalized data; remove singular samples in each normalized data to obtain a preprocessed data matrix corresponding to the resource data matrix.
[0174] In one embodiment, the updating module 703 is further used to determine a target singular value that meets the screening condition among the singular values; and multiply the updated singular value matrix containing the target singular values by the singular data matrix to obtain an updated data matrix.
[0175] In one of the embodiments, the resource adjustment device of the computing node also includes: a condition determination module, which is used to obtain the current resource data of the computing node corresponding to each computing resource item at the current moment; and determine the screening conditions according to the computing capacity represented by each current resource data.
[0176] In one embodiment, the analysis module 704 is also used to obtain a resource change analysis model; input the updated data matrix of each computing resource item into the resource change analysis model, and determine the resource change status of each computing node corresponding to each computing resource item based on the output of the resource change analysis model.
[0177] Each module in the resource adjustment device of the computing node can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.
[0178] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 8 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store historical resource data. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a resource adjustment method for a computing node is implemented.
[0179] Those skilled in the art will understand that Figure 8 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0180] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the above method steps are implemented when the processor executes the computer program.
[0181] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the above method steps are implemented.
[0182] In one embodiment, a computer program product is provided, comprising a computer program, which implements the above method steps when executed by a processor.
[0183] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
[0184] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0185] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A method for adjusting resources of a computing node, characterized in that: The method comprises: Obtain resource data matrices corresponding to the computing nodes for the respective plurality of computing resource items; the resource data matrices comprising historical resource data collected at a plurality of historical moments; For each of the resource data matrices, singular value decomposition is performed on the resource data matrix to obtain a singular data matrix and a diagonal singular value matrix corresponding to the resource data matrix; the diagonal singular value matrix contains a plurality of singular values; Based on the target singular value in each of the singular values and the singular data matrix, the resource data matrix is updated to obtain an updated data matrix; Based on the updated data matrix of each of the computing resource items, performing resource change analysis on the computing node to determine the resource change status of each of the computing resource items corresponding to the computing node; Based on the resource changes, resources of the computing nodes are adjusted.
2. The method according to claim 1, characterized in that: For each of the resource data matrices, performing singular value decomposition on the resource data matrix to obtain a singular data matrix and a diagonal singular value matrix corresponding to the resource data matrix includes: For each resource data matrix, data preprocessing is performed on each historical resource data contained in the resource data matrix to obtain a preprocessed data matrix; Perform singular value decomposition on the preprocessed data matrix to obtain a singular data matrix and a diagonal singular value matrix corresponding to the resource data matrix.
3. The method according to claim 2, characterized in that The data preprocessing is performed on each historical resource data contained in the resource data matrix to obtain a preprocessed data matrix, including: For each historical resource data included in the resource data matrix, normalizing the historical resource data to obtain normalized data; Singular samples in each of the normalized data are removed to obtain a preprocessed data matrix corresponding to the resource data matrix.
4. The method according to claim 1, characterized in that: The updating of the resource data matrix based on the target singular value in each singular value and the singular data matrix to obtain an updated data matrix comprises: Determine a target singular value that satisfies a screening condition among the singular values; An updated singular value matrix including each target singular value is multiplied by the singular data matrix to obtain an updated data matrix.
5. The method according to claim 4, characterized in that The method further comprises: Obtaining current resource data of the computing node corresponding to each of the computing resource items at the current moment; The screening condition is determined according to the computing capacity represented by each of the current resource data.
6. The method according to any one of claims 1 to 5, characterized in that The performing resource change analysis on the computing node based on the updated data matrix of each of the computing resource items to determine the resource change status of each of the computing nodes corresponding to each of the computing resource items includes: Obtain resource change analysis model; The updated data matrix of each of the computing resource items is input into the resource change analysis model, and based on the output of the resource change analysis model, the resource change status of each of the computing nodes corresponding to the computing resource items is determined.
7. A computing node resource adjustment device, characterized in that: The device comprises: An acquisition module is used to acquire a resource data matrix corresponding to each of a plurality of computing resource items of a computing node; the resource data matrix includes historical resource data collected at a plurality of historical moments; A decomposition module, for performing singular value decomposition on each resource data matrix to obtain a singular data matrix and a diagonal singular value matrix corresponding to the resource data matrix; the diagonal singular value matrix includes a plurality of singular values; An updating module, configured to update the resource data matrix based on a target singular value in each of the singular values and the singular data matrix to obtain an updated data matrix; An analysis module, configured to perform resource change analysis on the computing node based on the updated data matrix of each computing resource item, and determine the resource change status of each computing node corresponding to each computing resource item; The adjustment module is used to adjust the resources of the computing nodes based on the resource changes.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, 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 6 are implemented.
10. A computer program product, comprising a computer program, 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 6 are implemented.