WO2022110444A1 - Dynamic prediction method and apparatus for cloud native resources, computer device and storage medium - Google Patents

Dynamic prediction method and apparatus for cloud native resources, computer device and storage medium Download PDF

Info

Publication number
WO2022110444A1
WO2022110444A1 PCT/CN2020/139679 CN2020139679W WO2022110444A1 WO 2022110444 A1 WO2022110444 A1 WO 2022110444A1 CN 2020139679 W CN2020139679 W CN 2020139679W WO 2022110444 A1 WO2022110444 A1 WO 2022110444A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
resource
prediction
time series
predicted
Prior art date
Application number
PCT/CN2020/139679
Other languages
French (fr)
Chinese (zh)
Inventor
叶可江
陈文艳
须成忠
Original Assignee
中国科学院深圳先进技术研究院
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 中国科学院深圳先进技术研究院 filed Critical 中国科学院深圳先进技术研究院
Publication of WO2022110444A1 publication Critical patent/WO2022110444A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • G06N3/082Learning methods modifying the architecture, e.g. adding, deleting or silencing nodes or connections
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/14Network analysis or design
    • H04L41/145Network analysis or design involving simulating, designing, planning or modelling of a network
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/14Network analysis or design
    • H04L41/147Network analysis or design for predicting network behaviour
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/104Peer-to-peer [P2P] networks
    • H04L67/1074Peer-to-peer [P2P] networks for supporting data block transmission mechanisms
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45595Network integration; Enabling network access in virtual machine instances

Definitions

  • the present application relates to the field of information technology, and in particular, to a method, apparatus, computer equipment and storage medium for dynamic prediction of cloud native resources.
  • cloud native has the characteristics of high scalability, on-demand access, and lighter weight. More and more enterprises and individuals choose to use cloud native platforms to provide services. However, due to the complexity, heterogeneity and dynamic characteristics of upper-layer cloud-native applications, the requirements for resource management are getting higher and higher. Therefore, in order to effectively improve the performance of cloud-native cluster resource management, mixed deployment of different types of applications The approach has been widely used in cloud-native platforms.
  • the current resource prediction methods are mainly based on linear regression methods and machine learning methods.
  • the first method has good accuracy in predicting the periodicity of the model, but often cannot predict the mutation point very well.
  • such methods usually only consider the time-series correlation of the forecast resources, and easily ignore the impact of other performance indicators on the forecast resources;
  • the second method trains and cross-validates historical data through a machine learning model, and can input multi-dimensional resource data.
  • the long-term memory of neural network can effectively capture time series information, but this method still has many deficiencies in the prediction of mutation points.
  • the purpose of the embodiments of the present application is to provide a method, device, computer equipment and storage medium for dynamic prediction of cloud native resources, so as to at least solve the problems of high prediction complexity and low prediction accuracy of mutation points in traditional resource prediction methods.
  • an embodiment of the present application provides a method for dynamic prediction of cloud native resources, which adopts the following technical solutions:
  • the correlation degree of the resource data to be predicted and the performance index data is sorted, and the correlation between the resource data to be predicted and the performance index data is obtained;
  • the method also includes:
  • the historical resource data is preprocessed to obtain the resource data to be predicted.
  • steps of preprocessing the historical resource data to obtain the resource data to be predicted include:
  • the effective time series data is normalized to obtain the resource data to be predicted.
  • the method also includes:
  • the method also includes:
  • the embodiments of the present application further provide a cloud native resource dynamic prediction device, which adopts the following technical solutions:
  • a request receiving module for receiving the dynamic prediction request sent by the user terminal
  • the request response module is used to respond to the dynamic prediction request, read the local database, and obtain the resource data to be predicted and the performance indicator data of the container load in the cloud native cluster;
  • the correlation ranking module is used to sort the correlation degree of the resource data to be predicted and the performance index data based on the Pearson correlation coefficient, so as to obtain the correlation between the resource data to be predicted and the performance index data;
  • Threshold definition module used to define the correlation threshold based on the correlation relationship
  • the time series data acquisition module is used to use the performance index data greater than or equal to the correlation threshold as the performance index time series data
  • the data expansion module is used for horizontal data expansion of performance index time series data to obtain training data and test data;
  • the model training module is used to input the training data into the constructed time series neural network model for training, and obtain the trained time series neural network prediction model;
  • the data prediction module is used to input the test data into the time series neural network prediction model for prediction operation, and obtain the resource prediction result.
  • the device also includes:
  • the data collection module is used to collect historical resource data of container loads in the cloud native cluster based on a preset time interval
  • the preprocessing module is used to preprocess the historical resource data to obtain the resource data to be predicted.
  • the preprocessing module includes:
  • the data deletion unit is used to delete invalid or abnormal data in the historical resource data to obtain valid time series data
  • the normalization processing unit is used for normalizing the valid time series data to obtain the resource data to be predicted.
  • the embodiment of the present application also provides a computer device, which adopts the following technical solutions:
  • a memory and a processor are included, a computer program is stored in the memory, and when the processor executes the computer program, the steps of the cloud native resource dynamic prediction method described above are implemented.
  • the embodiments of the present application also provide a computer-readable storage medium, which adopts the following technical solutions:
  • a computer program is stored on the computer-readable storage medium, and when the computer program is executed by the processor, the steps of the cloud native resource dynamic prediction method described above are implemented.
  • the present application provides a method for dynamic prediction of cloud native resources, including: receiving a dynamic prediction request sent by a user terminal; responding to the dynamic prediction request, reading a local database, and acquiring resource data to be predicted and performance indicator data of container loads in a cloud native cluster ; Based on the Pearson correlation coefficient, sort the correlation degree of the resource data to be predicted and the performance index data to obtain the correlation relationship between the resource data to be predicted and the performance indicator data; define the correlation threshold value based on the correlation relationship; it will be greater than or equal to the correlation degree
  • the performance index data of the threshold is used as the performance index time series data; the performance index time series data is horizontally expanded to obtain training data and test data; the training data is input into the constructed time series neural network model for training, and the trained time series neural network is obtained.
  • Network prediction model input the test data into the time series neural network prediction model for prediction operation, and obtain the resource prediction result.
  • the correlation degree of the resource data to be predicted and the performance index data obtained in the local database is sorted, so as to obtain the correlation relationship between the resource data to be predicted and the performance index data to define the correlation threshold.
  • the performance index time series data is pruned and information extracted to obtain training data and test data, which can achieve data retention on the basis of reducing input data.
  • a time-series neural network prediction model that can be used to capture long-term dependent time-series data information is trained, and then the test data is used as the input of the time-series neural network prediction model, and a prediction model with high prediction accuracy is obtained. Resource forecast results.
  • FIG. 1 is a schematic diagram of an exemplary principle to which the present application can be applied;
  • FIG. 2 is a flowchart of an embodiment of a cloud native resource dynamic prediction method according to the present application
  • FIG. 3 is a flowchart of data preprocessing according to the cloud native resource dynamic prediction method of the present application
  • Fig. 4 is a flow chart of a specific implementation manner of step S302 in Fig. 3;
  • FIG. 5 is a schematic structural diagram of an embodiment of a cloud native resource dynamic prediction apparatus according to the present application.
  • FIG. 6 is a schematic structural diagram of data preprocessing of the cloud native resource dynamic prediction device according to the present application.
  • FIG. 7 is a schematic structural diagram of a specific implementation of the preprocessing module in FIG. 6;
  • FIG. 8 is a schematic structural diagram of an embodiment of a computer device according to the present application.
  • FIG. 1 and FIG. 2 a flowchart of an embodiment of a method for dynamic prediction of cloud native resources provided according to Embodiment 1 of the present application is shown. For the convenience of description, only parts related to the present application are shown.
  • step S1 a dynamic prediction request sent by the user terminal is received.
  • the dynamic prediction request is for the user to have an in-depth understanding of the characteristics of cloud-native cluster resources, so as to select an appropriate resource prediction model and optimize it in combination with a specific scenario, so as to provide effective resources for dynamic resource allocation.
  • the action request issued based on the decision of the value.
  • step S2 in response to the dynamic prediction request, the local database is read, and the resource data to be predicted and the performance indicator data of the container load in the cloud native cluster are obtained.
  • the resource data to be predicted refers to the time series data obtained by processing the historical resource data of the container load in the cloud native cluster according to a preset processing method, wherein the processing method may specifically be reasonable compression or extraction.
  • the processing method may specifically be reasonable compression or extraction.
  • the performance indicator data may specifically be performance indicators of the application layer such as CPU utilization, memory utilization, disk IO size, network bandwidth, etc.; and performance indicators of the microarchitecture layer such as IPC (Instructions per Cycle), branch Prediction (Branch Predict) and Cache misses (Cache misses) can be used to intuitively reflect the indicator data of cluster performance.
  • IPC Instructions per Cycle
  • branch Prediction Branch Predict
  • Cache misses Cache misses
  • this embodiment obtains the load of containers in the cloud native cluster based on the preset processing method in the local database based on the dynamic prediction request.
  • the historical resource data is processed according to the time series data, that is, the resource data to be predicted, and the performance index data that can be used to intuitively reflect the cluster performance, so that the subsequent resource data and performance index data based on the to-be-predicted resource data and performance index data can not be missing.
  • Reducing the size of input data under the premise of long-term dependence on information is conducive to improving the training speed of the subsequent training time series neural network prediction model, so as to realize real-time and dynamic allocation of resources, reduce the lag of resource allocation, and improve to a certain extent.
  • the accuracy and efficiency of cloud-native cluster resource prediction is conducive to improving the training speed of the subsequent training time series neural network prediction model, so as to realize real-time and dynamic allocation of resources, reduce the lag of resource allocation, and improve to a certain extent.
  • step S3 the correlation degree of the resource data to be predicted and the performance index data is sorted based on the Pearson correlation coefficient, and the correlation relationship between the resource data to be predicted and the performance index data is obtained.
  • the Pearson correlation coefficient is a coefficient capable of measuring the correlation strength of the resource data to be predicted and the performance index data.
  • the resource data to be predicted is r
  • X represents the time series data of r
  • Y represents the time series data of other performance index data
  • n represents the length of the time series data.
  • the correlation relationship refers to the strong and weak correlation relationship between different performance index data and the resource data r to be predicted, respectively.
  • this embodiment is based on the Pearson correlation coefficient. Calculate the correlation coefficients of the performance index data to obtain the correlation coefficients between the different performance index data and the resource data r to be predicted, and then sort these coefficients according to a preset sorting method, and based on the sorted correlation coefficients to represent the strong and weak correlation between different performance index data and the resource data r to be predicted, so that the subsequent pruning of the input data can be further realized based on the strong and weak relationship, so as to reduce the basis of input data. To a certain extent, the accuracy and efficiency of cloud-native cluster resource prediction can be improved.
  • step S4 a correlation threshold is defined based on the correlation relationship.
  • the correlation threshold is an index used to extract time series data with strong correlation
  • the self-defined threshold Cmax based on the strong and weak relationship of the correlation that is, the correlation threshold
  • step S5 the performance index data greater than or equal to the correlation threshold is used as the performance index time series data.
  • the effective information of the data can be retained on the basis of reducing the input data, thereby improving the accuracy and efficiency of cloud-native cluster resource prediction to a certain extent.
  • step S6 horizontal data expansion is performed on the performance index time series data to obtain training data and test data.
  • horizontal data expansion is performed on the performance index time series data, specifically, by assuming that the predicted performance index data is cpu, and the correlation value greater than Cmax is the performance index data is cpu, memory, disk, then the data at time t
  • the training data and the test data are obtained by performing horizontal data expansion and expansion based on the performance index time series data.
  • Data and test data that can be used for resource prediction can realize the pruning of input data, so as to retain the effective information of the data on the basis of reducing the input data, thereby improving the accuracy of cloud-native cluster resource prediction to a certain extent. Efficiency.
  • step S7 the training data is input into the constructed time series neural network model for training, and the trained time series neural network prediction model is obtained.
  • the time-series neural network prediction model is optimized based on time-series neural networks (TCNs).
  • TCNs time-series neural networks
  • the training data that can be used for training the time-series neural network model is input into the constructed time-series neural network model for training. Less data gets a wider receptive field, and the long-term dependent time series data information is captured by the time series neural network prediction model, which can effectively retain the long-term dependency information, thereby effectively improving the accuracy of cloud native resource prediction to a certain extent.
  • step S8 the test data is input into the time-series neural network prediction model for prediction operation to obtain the resource prediction result.
  • the test data that can be used for resource prediction is directly input into the trained time-series neural network prediction model to predict cloud native resources. Resource forecast results for predicted future resource utilization.
  • the present application provides a method for dynamic prediction of cloud native resources, including: receiving a dynamic prediction request sent by a user terminal; responding to the dynamic prediction request, reading a local database, and acquiring resource data to be predicted and performance indicator data of container loads in a cloud native cluster ; Based on the Pearson correlation coefficient, sort the correlation degree of the resource data to be predicted and the performance index data to obtain the correlation relationship between the resource data to be predicted and the performance indicator data; define the correlation threshold value based on the correlation relationship; it will be greater than or equal to the correlation degree
  • the performance index data of the threshold is used as the performance index time series data; the performance index time series data is horizontally expanded to obtain training data and test data; the training data is input into the constructed time series neural network model for training, and the trained time series neural network is obtained.
  • Network prediction model input the test data into the time series neural network prediction model for prediction operation, and obtain the resource prediction result.
  • the correlation degree of the resource data to be predicted and the performance index data obtained in the local database is sorted, so as to obtain the correlation relationship between the resource data to be predicted and the performance index data to define the correlation threshold.
  • the performance index time series data is pruned and information extracted to obtain training data and test data, which can achieve data retention on the basis of reducing input data.
  • a time-series neural network prediction model that can be used to capture long-term dependent time-series data information is trained, and then the test data is used as the input of the time-series neural network prediction model, and a prediction model with high prediction accuracy is obtained. Resource forecast results.
  • FIG. 3 a flow chart of data preprocessing of the cloud native resource dynamic prediction method provided in Embodiment 1 of the present application is shown. For convenience of description, only parts related to the present application are shown.
  • step S2 before step S2 responds to the dynamic prediction request, reads the local database, and obtains resource data to be predicted and performance indicator data of the container load in the cloud native cluster, the method further includes: Step S301 and Step S302.
  • step S301 historical resource data of container loads in the cloud native cluster is collected based on a preset time interval.
  • step S302 the historical resource data is preprocessed to obtain resource data to be predicted.
  • the historical resource data may specifically include attribute values such as CPU utilization, memory utilization, disk IO size, and network bandwidth, and the sampling frequency is data such as once every 60s.
  • the historical resource data is preprocessed, specifically, the resource data to be predicted can be obtained by deleting invalid and abnormal data.
  • the container load in the cloud native cluster includes attribute values such as CPU utilization, memory utilization, disk IO size, network bandwidth, etc., and the sampling frequency is data such as once every 60s.
  • Collect the historical resource data and then delete the invalid and abnormal data preprocessing operation to obtain the resource data to be predicted.
  • the collected historical resource data can be reasonably compressed, extracted and format converted.
  • the input data size can be reduced without missing long-term dependency information, so that the subsequent training speed of the time series neural network model can be improved based on the reduction of input data, so as to realize real-time and dynamic allocation of resources and reduce resource allocation. Therefore, to a certain extent, the accuracy and efficiency of cloud-native cluster resource prediction can be improved.
  • step S302 provided in Embodiment 1 of the present application is shown.
  • step S302 provided in Embodiment 1 of the present application is shown.
  • the part related to the present application is shown.
  • step S302 preprocesses historical resource data, and the step of obtaining resource data to be predicted includes steps S401 and S402.
  • step S401 invalid or abnormal data in the historical resource data is deleted to obtain valid time series data.
  • step S402 the effective time series data is normalized to obtain resource data to be predicted.
  • this embodiment improves prediction time by pruning input data, so as to reasonably allocate cloud-native resources to reduce resource oversale and resource oversale. Therefore, in order to realize the pruning of the input data, this embodiment first deletes invalid or abnormal data in the historical resource data, and then normalizes the valid time series data obtained after deletion. Reduction and effective extraction of effective time series data to obtain resource data to be predicted.
  • step S8 the method further includes:
  • the real-time prediction data is prediction data including the predicted future resource utilization rate obtained by dynamically online real-time prediction of resources based on a time-series neural network prediction model.
  • this embodiment in order to realize real-time and dynamic allocation of resources and reduce the hysteresis of resource allocation, this embodiment repeatedly performs a prediction operation process of inputting test data into a time-series neural network prediction model, so as to obtain information including Real-time forecast data of predicted future resource utilization to meet the real-time demand for resource allocation.
  • the method before step S7, the method further includes:
  • the basic model of the temporal neural network is temporal neural network TCNs (Temporal Convolutional Networks).
  • a preset fully connected layer and an attention mechanism are added to the basic model architecture of the time series neural network.
  • a layer of fully connected layer and an attention mechanism can be added on the basis of the time series neural network TCNs, This enables the time-series neural network model to capture long-term dependent information with a small amount of data during training, so as to reasonably dynamically allocate resources and improve the performance of cloud-native resource management to a certain extent.
  • the present application provides a method for dynamic prediction of cloud native resources, including: receiving a dynamic prediction request sent by a user terminal; responding to the dynamic prediction request, reading a local database, and obtaining resources to be predicted for container loads in a cloud native cluster data and performance indicator data; sort the correlation degree of the resource data to be predicted and the performance indicator data based on the Pearson correlation coefficient, and obtain the correlation relationship between the resource data to be predicted and the performance indicator data; define the correlation threshold based on the correlation relationship;
  • the performance index data that is greater than or equal to the correlation threshold is used as the performance index time series data; the performance index time series data is extended horizontally to obtain training data and test data; the training data is input into the constructed time series neural network model for training, and the result is obtained
  • the trained time-series neural network prediction model input the test data into the time-series neural network prediction model to perform prediction operations to obtain resource prediction results.
  • the historical resource data of the container load in the cloud native cluster is collected, and the collected historical resource data is deleted, normalized and other preprocessing to obtain the resource data to be predicted; then, based on the Pearson correlation
  • the coefficients are used to sort the relevancy of the resource data to be predicted and the performance indicator data to obtain the correlation between the resource data to be predicted and the performance indicator data to define the relevancy threshold, and obtain the performance indicator time series data based on the relevancy threshold ; and then perform pruning and information extraction on the performance index time series data based on horizontal data expansion to obtain training data and test data, which can retain the effective information of the data on the basis of reducing the input data; then, based on the training data, add
  • the fully connected layer and the time series neural network model of the attention mechanism are trained to obtain a time series neural network prediction model that can be used to capture long-term dependent time series data information, and then the test data is used as the input of the time series neural network prediction model to obtain predictions.
  • a resource prediction result with a higher accuracy rate then, the prediction operation process is repeatedly performed, and the obtained real-time prediction data is fed back to the user terminal.
  • the realization of all or part of the processes in the methods of the above embodiments can be accomplished by instructing the relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium, and the program is During execution, it may include the processes of the embodiments of the above-mentioned methods.
  • the aforementioned storage medium may be a non-volatile storage medium such as a magnetic disk, an optical disk, a read-only memory (Read-Only Memory, ROM), or a random access memory (Random Access Memory, RAM) or the like.
  • the present application provides an embodiment of a cloud native resource dynamic prediction apparatus.
  • the apparatus embodiment corresponds to the method embodiment shown in FIG. 2 .
  • the device can be specifically applied to various electronic devices.
  • the cloud native resource dynamic prediction apparatus 100 in this embodiment includes: a request receiving module 101, a request response module 102, a correlation ranking module 103, a threshold definition module 104, a time series data acquisition module 105, and a data expansion module.
  • module 106 model training module 107 and data prediction module 108 . in:
  • a request receiving module 101 configured to receive a dynamic prediction request sent by a user terminal
  • the dynamic prediction request is for the user to have an in-depth understanding of the characteristics of cloud-native cluster resources, so as to select an appropriate resource prediction model and optimize it in combination with a specific scenario, so as to provide effective resources for dynamic resource allocation.
  • the action request issued based on the decision of the value.
  • the request response module 102 is configured to respond to the dynamic prediction request, read the local database, and obtain the resource data to be predicted and the performance indicator data of the container load in the cloud native cluster;
  • the resource data to be predicted refers to the time series data obtained by processing the historical resource data of the container load in the cloud native cluster according to a preset processing method, wherein the processing method may specifically be reasonable compression or extraction.
  • the processing method may specifically be reasonable compression or extraction.
  • the performance indicator data may specifically be performance indicators of the application layer such as CPU utilization, memory utilization, disk IO size, network bandwidth, etc.; and performance indicators of the microarchitecture layer such as IPC (Instructions per Cycle), branch Prediction (Branch Predict) and Cache misses (Cache misses) can be used to intuitively reflect the indicator data of cluster performance.
  • IPC Instructions per Cycle
  • branch Prediction Branch Predict
  • Cache misses Cache misses
  • this embodiment obtains the load of containers in the cloud native cluster based on the preset processing method in the local database based on the dynamic prediction request.
  • the historical resource data is processed according to the time series data, that is, the resource data to be predicted, and the performance index data that can be used to intuitively reflect the cluster performance, so that the subsequent resource data and performance index data based on the to-be-predicted resource data and performance index data can not be missing.
  • Reducing the size of input data under the premise of long-term dependence on information is conducive to improving the training speed of the subsequent training time series neural network prediction model, so as to realize real-time and dynamic allocation of resources, reduce the lag of resource allocation, and improve to a certain extent.
  • the accuracy and efficiency of cloud-native cluster resource prediction is conducive to improving the training speed of the subsequent training time series neural network prediction model, so as to realize real-time and dynamic allocation of resources, reduce the lag of resource allocation, and improve to a certain extent.
  • the correlation ranking module 103 is configured to perform correlation ranking on the resource data to be predicted and the performance index data based on the Pearson correlation coefficient, so as to obtain the correlation relationship between the resource data to be predicted and the performance index data;
  • the Pearson correlation coefficient is a coefficient capable of measuring the correlation strength of the resource data to be predicted and the performance index data.
  • the resource data to be predicted is r
  • X represents the time series data of r
  • Y represents the time series data of other performance index data
  • n represents the length of the time series data.
  • the correlation relationship refers to the strong and weak correlation relationship between different performance index data and the resource data r to be predicted, respectively.
  • this embodiment is based on the Pearson correlation coefficient. Calculate the correlation coefficients of the performance index data to obtain the correlation coefficients between the different performance index data and the resource data r to be predicted, and then sort these coefficients according to a preset sorting method, and based on the sorted correlation coefficients to represent the strong and weak correlation between different performance index data and the resource data r to be predicted, so that the subsequent pruning of the input data can be further realized based on the strong and weak relationship, so as to reduce the basis of input data. To a certain extent, the accuracy and efficiency of cloud-native cluster resource prediction can be improved.
  • a threshold definition module 104 configured to define a correlation threshold based on the correlation relationship
  • the correlation threshold is an index used to extract time series data with strong correlation
  • the self-defined threshold Cmax based on the strong and weak relationship of the correlation that is, the correlation threshold
  • a time series data acquisition module 105 configured to use the performance index data greater than or equal to the correlation threshold as the performance index time series data
  • the effective information of the data can be retained on the basis of reducing the input data, thereby improving the accuracy and efficiency of cloud-native cluster resource prediction to a certain extent.
  • the data expansion module 106 is used to perform horizontal data expansion on the performance index time series data to obtain training data and test data;
  • horizontal data expansion is performed on the performance index time series data, specifically, by assuming that the predicted performance index data is cpu, and the correlation value greater than Cmax is the performance index data of cpu, memory, disk, then the data at time t
  • the training data and the test data are obtained by performing horizontal data expansion and expansion based on the performance index time series data.
  • Data and test data that can be used for resource prediction can realize the pruning of input data, so as to retain the effective information of the data on the basis of reducing the input data, thereby improving the accuracy of cloud-native cluster resource prediction to a certain extent. Efficiency.
  • the model training module 107 is used to input the training data into the constructed time series neural network model for training, and obtain the trained time series neural network prediction model;
  • the time-series neural network prediction model is optimized based on time-series neural networks (TCNs).
  • TCNs time-series neural networks
  • the training data that can be used for training the time-series neural network model is input into the constructed time-series neural network model for training. Less data gets a wider receptive field, and the long-term dependent time series data information is captured by the time series neural network prediction model, which can effectively retain the long-term dependency information, thereby effectively improving the accuracy of cloud native resource prediction to a certain extent.
  • the data prediction module 108 is configured to input the test data into the time-series neural network prediction model to perform prediction operations to obtain resource prediction results.
  • the test data that can be used for resource prediction is directly input into the trained time-series neural network prediction model to predict cloud native resources. Resource forecast results for predicted future resource utilization.
  • the present application provides a cloud native resource dynamic prediction device, which includes: based on the Pearson correlation coefficient, the correlation degree of the resource data to be predicted and the performance index data obtained in the local database are sorted, so as to obtain the resource data to be predicted and the performance index.
  • the correlation between the data is used to define the correlation threshold, and based on the correlation threshold, the performance index time series data is obtained; then based on the horizontal data expansion, the performance index time series data is pruned and information extracted to obtain training data and
  • the test data can retain the effective information of the data on the basis of reducing the input data; then, based on the training data, a time-series neural network prediction model that can be used to capture long-term dependent time-series data information is trained, and then the test data is used as a model.
  • the input of the time series neural network prediction model is used to obtain resource prediction results with high prediction accuracy. It can effectively reduce the computational complexity by reducing the input data of the time series neural network model, thereby reducing the forecasting complexity, and improving the accuracy and efficiency of cloud-native cluster resource forecasting to a certain extent.
  • FIG. 6 a schematic structural diagram of the data preprocessing of the apparatus for dynamic prediction of cloud native resources provided in Embodiment 1 of the present application is shown. For convenience of description, only parts related to the present application are shown.
  • the apparatus further includes: a data collection module 601 and a preprocessing module 602 .
  • a data collection module 601 configured to collect historical resource data of container loads in the cloud native cluster based on a preset time interval
  • the preprocessing module 602 is used for preprocessing historical resource data to obtain resource data to be predicted.
  • the historical resource data may specifically include attribute values such as CPU utilization, memory utilization, disk IO size, and network bandwidth, and the sampling frequency is data such as once every 60s.
  • the historical resource data is preprocessed, specifically, the resource data to be predicted can be obtained by deleting invalid and abnormal data.
  • the container load in the cloud native cluster includes attribute values such as CPU utilization, memory utilization, disk IO size, network bandwidth, etc., and the sampling frequency is data such as once every 60s.
  • Collect the historical resource data and then delete the invalid and abnormal data of the historical resource data to obtain the resource data to be predicted.
  • the collected historical resource data can be reasonably compressed, extracted and format converted.
  • the input data size can be reduced without missing long-term dependency information, so that the subsequent training speed of the time series neural network model can be improved based on the reduction of input data, so as to realize real-time and dynamic allocation of resources and reduce resource allocation. Therefore, to a certain extent, the accuracy and efficiency of cloud-native cluster resource prediction can be improved.
  • FIG. 7 a flowchart of a specific implementation manner of the preprocessing module 602 in FIG. 6 provided in Embodiment 1 of the present application is shown. For the convenience of description, only parts related to the present application are shown.
  • the preprocessing module 602 includes: a data deletion unit 701 and a normalization processing unit 702 .
  • a data deletion unit 701 is used to delete invalid or abnormal data in the historical resource data to obtain valid time series data
  • the normalization processing unit 702 is configured to perform normalization processing on the valid time series data to obtain resource data to be predicted.
  • this embodiment improves prediction time by pruning input data, so as to reasonably allocate cloud-native resources to reduce resource oversale and resource oversale. Therefore, in order to realize the pruning of the input data, this embodiment first deletes invalid or abnormal data in the historical resource data, and then normalizes the valid time series data obtained after deletion. Reduction and effective extraction of effective time series data to obtain resource data to be predicted.
  • the apparatus further includes: a real-time prediction module and a data feedback module.
  • the real-time prediction module is used to repeatedly perform the prediction operation process to obtain real-time prediction data
  • the data feedback module is used to feed back the real-time prediction data to the user terminal.
  • the real-time prediction data is prediction data including the predicted future resource utilization rate obtained by dynamically online real-time prediction of resources based on a time-series neural network prediction model.
  • this embodiment in order to realize real-time and dynamic allocation of resources and reduce the hysteresis of resource allocation, this embodiment repeatedly performs a prediction operation process of inputting test data into a time-series neural network prediction model, so as to obtain information including Real-time forecast data of predicted future resource utilization to meet the real-time demand for resource allocation.
  • the device further includes:
  • the basic model of the temporal neural network is temporal neural network TCNs (Temporal Convolutional Networks).
  • a preset fully connected layer and an attention mechanism are added to the basic model architecture of the time series neural network.
  • a layer of fully connected layer and an attention mechanism can be added on the basis of the time series neural network TCNs, This enables the time-series neural network model to capture long-term dependent information with a small amount of data during training, so as to reasonably dynamically allocate resources and improve the performance of cloud-native resource management to a certain extent.
  • the present application provides a cloud native resource dynamic prediction device, including: a request receiving module for receiving a dynamic prediction request sent by a user terminal; a request response module for responding to the dynamic prediction request and reading a local database , to obtain the resource data to be predicted and the performance index data of the container load in the cloud native cluster; the correlation ranking module is used to sort the predicted resource data and the performance index data based on the Pearson correlation coefficient to obtain the resource data to be predicted and the performance index data.
  • threshold definition module used to define the correlation threshold based on the correlation relationship
  • time series data acquisition module used to take performance index data greater than or equal to the correlation threshold as performance index time series data
  • data extension The module is used to expand the performance index time series data horizontally to obtain training data and test data
  • the model training module is used to input the training data into the constructed time series neural network model for training, and obtain the trained time series neural network.
  • Prediction model the data prediction module is used to input the test data into the time series neural network prediction model for prediction operation to obtain the resource prediction result.
  • the historical resource data of the container load in the cloud native cluster is collected, and the collected historical resource data is deleted, normalized and other preprocessing to obtain the resource data to be predicted; then, based on the Pearson correlation
  • the coefficients are used to sort the relevancy of the resource data to be predicted and the performance indicator data to obtain the correlation between the resource data to be predicted and the performance indicator data to define the relevancy threshold, and obtain the performance indicator time series data based on the relevancy threshold ; and then perform pruning and information extraction on the performance index time series data based on horizontal data expansion to obtain training data and test data, which can realize the effective information of the data is retained on the basis of reducing the input data; then, based on the training data, add
  • the fully connected layer and the time-series neural network model of the attention mechanism are trained to obtain a time-series neural network prediction model that can be used to capture long-term dependent time-series data information, and then the test data is used as the input of the time-series neural network prediction model to obtain predictions
  • FIG. 8 is a block diagram of a basic structure of a computer device according to this embodiment.
  • the computer device 8 includes a memory 81 , a processor 82 , and a network interface 83 that communicate with each other through a system bus. It should be noted that only the computer device 8 with components 81-83 is shown in the figure, but it should be understood that implementation of all shown components is not required, and more or less components may be implemented instead. Among them, those skilled in the art can understand that the computer device here is a device that can automatically perform numerical calculation and/or information processing according to pre-set or stored instructions, and its hardware includes but is not limited to microprocessors, special-purpose Integrated circuit (Application Specific Integrated Circuit, ASIC), programmable gate array (Field-Programmable Gate Array, FPGA), digital processor (Digital Signal Processor, DSP), embedded equipment, etc.
  • ASIC Application Specific Integrated Circuit
  • FPGA Field-Programmable Gate Array
  • DSP Digital Signal Processor
  • the computer equipment may be a desktop computer, a notebook computer, a palmtop computer, a cloud server and other computing equipment.
  • the computer device can perform human-computer interaction with the user through a keyboard, a mouse, a remote control, a touch pad or a voice control device.
  • the memory 81 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), random access memory (RAM), static Random Access Memory (SRAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), Programmable Read Only Memory (PROM), Magnetic Memory, Magnetic Disk, Optical Disk, etc.
  • the memory 81 may be an internal storage unit of the computer device 8 , such as a hard disk or a memory of the computer device 8 .
  • the memory 81 may also be an external storage device of the computer device 8, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, flash memory card (Flash Card), etc.
  • the memory 81 may also include both the internal storage unit of the computer device 8 and its external storage device.
  • the memory 81 is generally used to store the operating system and various application software installed on the computer device 8, such as the program code of the cloud native resource dynamic prediction method, and the like.
  • the memory 81 can also be used to temporarily store various types of data that have been output or will be output.
  • the processor 82 may be a central processing unit (Central Processing Unit, CPU), a controller, a microcontroller, a microprocessor, or other data processing chips in some embodiments.
  • the processor 82 is typically used to control the overall operation of the computer device 8 .
  • the processor 82 is configured to run the program code stored in the memory 81 or process data, for example, run the program code of the cloud native resource dynamic prediction method.
  • the network interface 83 may include a wireless network interface or a wired network interface, and the network interface 83 is generally used to establish a communication connection between the computer device 8 and other electronic devices.
  • the present application also provides another embodiment, which is to provide a computer-readable storage medium, where the computer-readable storage medium stores a cloud-native resource dynamic prediction program, and the cloud-native resource dynamic prediction program can be processed by at least one
  • the at least one processor executes the steps of the cloud native resource dynamic prediction method as described above.
  • the method of the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is better implementation.
  • the technical solution of the present application can be embodied in the form of a software product in essence or in a part that contributes to the prior art, and the computer software product is stored in a storage medium (such as ROM/RAM, magnetic disk, CD-ROM), including several instructions to make a terminal device (which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) execute the methods described in the various embodiments of this application.
  • a storage medium such as ROM/RAM, magnetic disk, CD-ROM

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Artificial Intelligence (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Biomedical Technology (AREA)
  • Biophysics (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Evolutionary Computation (AREA)
  • General Health & Medical Sciences (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • Mathematical Physics (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

A dynamic prediction method for cloud native resources, comprising: on the basis of a Pearson correlation coefficient, performing correlation sorting on obtained resource data to be predicted and performance index data to obtain a correlation relation between the resource data to be predicted and the performance index data (S3); defining a correlation threshold on the basis of the correlation relation (S4); using the performance index data greater than or equal to the correlation threshold as performance index time series data (S5); horizontally expanding the performance index time series data to obtain training data and test data (S6); inputting the training data into a constructed sequential neural network model to carry out training (S7), to obtain a trained sequential neural network prediction model; and inputting the test data into the sequential neural network prediction model to carry out prediction operation, to obtain resource prediction results (S8). Further provided are a dynamic prediction apparatus for cloud native resources, a computer device and a storage medium, capable of reducing prediction complexity and improving prediction accuracy.

Description

云原生资源动态预测方法、装置、计算机设备及存储介质Cloud native resource dynamic prediction method, device, computer equipment and storage medium 技术领域technical field
本申请涉及信息技术领域,尤其涉及云原生资源动态预测方法、装置、计算机设备及存储介质。The present application relates to the field of information technology, and in particular, to a method, apparatus, computer equipment and storage medium for dynamic prediction of cloud native resources.
背景技术Background technique
云原生技术的迅速发展使得用户数量和数据规模急剧增长,给云原生集群的资源管理带来了严峻的问题和挑战。一方面,用户的资源请求非常频繁和多样化,现有的资源预测往往只能对传统的周期性做出精准的预测,而无法精准地预测突变点的出现;另一方面,实时的在线服务和离线作业的混合部署在一定程度上提升了云原生集群的性能,但该混部模式也带来了资源竞争、性能下降的问题,进一步增加了资源预测的复杂性。此外,传统的资源预测模型往往具有一定的延后性,给实时动态的资源分配和管理造成了一定的性能阻碍。因此,如何在混部云原生集群中的资源进行实时、精准的预测,从而动态为负载分配合理的资源配置时目前研究的重点问题。The rapid development of cloud-native technologies has led to a sharp increase in the number of users and data scale, which has brought severe problems and challenges to the resource management of cloud-native clusters. On the one hand, users’ resource requests are very frequent and diverse, and existing resource forecasts can only make accurate forecasts for traditional periodicity, but cannot accurately predict the emergence of mutation points; on the other hand, real-time online services Hybrid deployment with offline jobs improves the performance of cloud-native clusters to a certain extent, but this co-location mode also brings resource competition and performance degradation, further increasing the complexity of resource prediction. In addition, traditional resource prediction models often have a certain delay, which causes certain performance obstacles to real-time dynamic resource allocation and management. Therefore, how to make real-time and accurate prediction of resources in a hybrid cloud-native cluster, so as to dynamically allocate reasonable resource allocation to the load, is the key issue of current research.
由于云原生作为新兴的云计算模式,具有高扩展性、按需存取和更加轻量等特点,越来越多的企业和个人选择使用云原生平台提供服务。而由于上层云原生应用的复杂性、异构性和动态性的特点,对资源管理的要求也越来越高,故为了能有效地提升云原生集群资源管理的性能,不同种类型应用混合部署的方式已经被广泛应用于云原生平台。As an emerging cloud computing model, cloud native has the characteristics of high scalability, on-demand access, and lighter weight. More and more enterprises and individuals choose to use cloud native platforms to provide services. However, due to the complexity, heterogeneity and dynamic characteristics of upper-layer cloud-native applications, the requirements for resource management are getting higher and higher. Therefore, in order to effectively improve the performance of cloud-native cluster resource management, mixed deployment of different types of applications The approach has been widely used in cloud-native platforms.
但是目前的资源预测方法主要是基于线性回归方法和基于机器学习方法的预测,其中,第一种方法在预测模型的周期性时具有很好的准确度,但往往不能很好的预测突变点,且此类方法通常只考虑预测资源的自身时序相关性,而容易忽略了其他性能指标对待预测资源的影响;第二种方法通过机器学习模型对历史 数据进行训练和交叉验证,可以输入多维资源数据,且能通过神经网络的长时记忆虽然能够有效抓取时序信息,但该方法在应对突变点的预测时仍有存在许多不足。However, the current resource prediction methods are mainly based on linear regression methods and machine learning methods. Among them, the first method has good accuracy in predicting the periodicity of the model, but often cannot predict the mutation point very well. Moreover, such methods usually only consider the time-series correlation of the forecast resources, and easily ignore the impact of other performance indicators on the forecast resources; the second method trains and cross-validates historical data through a machine learning model, and can input multi-dimensional resource data. , and the long-term memory of neural network can effectively capture time series information, but this method still has many deficiencies in the prediction of mutation points.
发明内容SUMMARY OF THE INVENTION
本申请实施例的目的在于提出一种云原生资源动态预测方法、装置、计算机设备及存储介质,以至少解决传统资源预测方法预测的复杂度高以及预测突变点准确率低的问题。The purpose of the embodiments of the present application is to provide a method, device, computer equipment and storage medium for dynamic prediction of cloud native resources, so as to at least solve the problems of high prediction complexity and low prediction accuracy of mutation points in traditional resource prediction methods.
为了解决上述技术问题,本申请实施例提供一种云原生资源动态预测方法,采用了如下所述的技术方案:In order to solve the above technical problems, an embodiment of the present application provides a method for dynamic prediction of cloud native resources, which adopts the following technical solutions:
接收用户终端发送的动态预测请求;Receive the dynamic prediction request sent by the user terminal;
响应动态预测请求,读取本地数据库,获取云原生集群中容器负载的待预测资源数据以及性能指标数据;Respond to dynamic prediction requests, read the local database, and obtain the resource data to be predicted and the performance indicator data of the container load in the cloud native cluster;
基于皮尔森相关系数对待预测资源数据以及性能指标数据进行相关度排序,得到待预测资源数据以及性能指标数据之间的相关性关系;Based on the Pearson correlation coefficient, the correlation degree of the resource data to be predicted and the performance index data is sorted, and the correlation between the resource data to be predicted and the performance index data is obtained;
基于相关性关系定义相关度阈值;Define relevance thresholds based on relevance relationships;
将大于或等于相关度阈值的性能指标数据作为性能指标时序数据;Use the performance index data greater than or equal to the correlation threshold as the performance index time series data;
将性能指标时序数据进行横向数据扩展,得到训练数据以及测试数据;Perform horizontal data expansion of performance index time series data to obtain training data and test data;
将训练数据输入至构建好的时序神经网络模型中进行训练,得到训练好的时序神经网络预测模型;Input the training data into the constructed time series neural network model for training, and obtain the trained time series neural network prediction model;
将测试数据输入至时序神经网络预测模型中进行预测操作,得到资源预测结果。Input the test data into the time series neural network prediction model for prediction operation to obtain the resource prediction result.
进一步的,该方法还包括:Further, the method also includes:
基于预设的时间间隔对云原生集群中容器负载的历史资源数据进行采集;Collect historical resource data of container loads in cloud-native clusters based on preset time intervals;
对历史资源数据进行预处理,得到待预测资源数据。The historical resource data is preprocessed to obtain the resource data to be predicted.
进一步地,对历史资源数据进行预处理,得到待预测资源数据的步骤包括:Further, the steps of preprocessing the historical resource data to obtain the resource data to be predicted include:
删除历史资源数据中的无效或异常数据,得到有效时序数据;Delete invalid or abnormal data in historical resource data to obtain valid time series data;
对有效时序数据进行归一化处理,得到待预测资源数据。The effective time series data is normalized to obtain the resource data to be predicted.
进一步地,该方法还包括:Further, the method also includes:
重复执行预测操作过程,得到实时预测数据;Repeat the prediction operation process to obtain real-time prediction data;
将实时预测数据反馈至用户终端。Feed back real-time prediction data to the user terminal.
进一步地,该方法还包括:Further, the method also includes:
将预设的全连接层以及注意力机制添加至时序神经网络基础模型架构中,得到时序神经网络模型。Add the preset fully connected layer and attention mechanism to the basic model architecture of the temporal neural network to obtain the temporal neural network model.
为了解决上述技术问题,本申请实施例还提供一种云原生资源动态预测装置,采用了如下所述的技术方案:In order to solve the above technical problems, the embodiments of the present application further provide a cloud native resource dynamic prediction device, which adopts the following technical solutions:
请求接收模块,用于接收用户终端发送的动态预测请求;a request receiving module for receiving the dynamic prediction request sent by the user terminal;
请求响应模块,用于响应动态预测请求,读取本地数据库,获取云原生集群中容器负载的待预测资源数据以及性能指标数据;The request response module is used to respond to the dynamic prediction request, read the local database, and obtain the resource data to be predicted and the performance indicator data of the container load in the cloud native cluster;
相关度排序模块,用于基于皮尔森相关系数对待预测资源数据以及性能指标数据进行相关度排序,得到待预测资源数据以及性能指标数据之间的相关性关系;The correlation ranking module is used to sort the correlation degree of the resource data to be predicted and the performance index data based on the Pearson correlation coefficient, so as to obtain the correlation between the resource data to be predicted and the performance index data;
阈值定义模块,用于基于相关性关系定义相关度阈值;Threshold definition module, used to define the correlation threshold based on the correlation relationship;
时序数据获取模块,用于将大于或等于相关度阈值的性能指标数据作为性能指标时序数据;The time series data acquisition module is used to use the performance index data greater than or equal to the correlation threshold as the performance index time series data;
数据扩展模块,用于将性能指标时序数据进行横向数据扩展,得到训练数据以及测试数据;The data expansion module is used for horizontal data expansion of performance index time series data to obtain training data and test data;
模型训练模块,用于将训练数据输入至构建好的时序神经网络模型中进行训练,得到训练好的时序神经网络预测模型;The model training module is used to input the training data into the constructed time series neural network model for training, and obtain the trained time series neural network prediction model;
数据预测模块,用于将测试数据输入至时序神经网络预测模型中进行预测操作,得到资源预测结果。The data prediction module is used to input the test data into the time series neural network prediction model for prediction operation, and obtain the resource prediction result.
进一步的,该装置还包括:Further, the device also includes:
数据采集模块,用于基于预设的时间间隔对云原生集群中容器负载的历史资源数据进行采集;The data collection module is used to collect historical resource data of container loads in the cloud native cluster based on a preset time interval;
预处理模块,用于对历史资源数据进行预处理,得到待预测资源数据。The preprocessing module is used to preprocess the historical resource data to obtain the resource data to be predicted.
进一步地,预处理模块包括:Further, the preprocessing module includes:
数据删除单元,用于删除历史资源数据中的无效或异常数据,得到有效时序数据;The data deletion unit is used to delete invalid or abnormal data in the historical resource data to obtain valid time series data;
归一化处理单元,用于对有效时序数据进行归一化处理,得到待预测资源数据。The normalization processing unit is used for normalizing the valid time series data to obtain the resource data to be predicted.
为了解决上述技术问题,本申请实施例还提供一种计算机设备,采用了如下所述的技术方案:In order to solve the above-mentioned technical problems, the embodiment of the present application also provides a computer device, which adopts the following technical solutions:
包括存储器和处理器,存储器中存储有计算机程序,处理器执行计算机程序时实现如上所述的云原生资源动态预测方法的步骤。A memory and a processor are included, a computer program is stored in the memory, and when the processor executes the computer program, the steps of the cloud native resource dynamic prediction method described above are implemented.
为了解决上述技术问题,本申请实施例还提供一种计算机可读存储介质,采用了如下所述的技术方案:In order to solve the above technical problems, the embodiments of the present application also provide a computer-readable storage medium, which adopts the following technical solutions:
计算机可读存储介质上存储有计算机程序,计算机程序被处理器执行时实现如上所述的云原生资源动态预测方法的步骤。A computer program is stored on the computer-readable storage medium, and when the computer program is executed by the processor, the steps of the cloud native resource dynamic prediction method described above are implemented.
与现有技术相比,本申请实施例主要有以下有益效果:Compared with the prior art, the embodiments of the present application mainly have the following beneficial effects:
本申请提供了一种云原生资源动态预测方法,包括:接收用户终端发送的动态预测请求;响应动态预测请求,读取本地数据库,获取云原生集群中容器负载的待预测资源数据以及性能指标数据;基于皮尔森相关系数对待预测资源数据以及性能指标数据进行相关度排序,得到待预测资源数据以及性能指标数据之间的相关性关系;基于相关性关系定义相关度阈值;将大于或等于相关度阈值的性能指标数据作为性能指标时序数据;将性能指标时序数据进行横向数据扩展,得到训练数据以及测试数据;将训练数据输入至构建好的时序神经网络模型中进行训练,得到训练好的时序神经网络预测模型;将测试数据输入至时序神经网络预测模型中进行预测操作,得到资源预测结果。基于皮尔森相关系数对在本地数据库 中获取到的待预测资源数据以及性能指标数据进行相关度排序,以获取待预测资源数据以及性能指标数据之间的相关性关系来对相关度阈值进行定义,并基于该相关度阈值来获取性能指标时序数据;进而基于横向数据扩展对该性能指标时序数据进行剪枝以及信息抽取,得到训练数据以及测试数据,能够实现在减少输入数据的基础上保留了数据的有效信息;然后,基于训练数据训练出能够用于长时依赖的时序数据信息抓取的时序神经网络预测模型,进而使测试数据作为时序神经网络预测模型的输入,得到预测准确率较高的资源预测结果。能够通过减少时序神经网络模型的输入数据,有效降低计算复杂度,从而降低预测复杂度,并在一定程度上提高云原生集群资源预测的准确性以及高效性。The present application provides a method for dynamic prediction of cloud native resources, including: receiving a dynamic prediction request sent by a user terminal; responding to the dynamic prediction request, reading a local database, and acquiring resource data to be predicted and performance indicator data of container loads in a cloud native cluster ; Based on the Pearson correlation coefficient, sort the correlation degree of the resource data to be predicted and the performance index data to obtain the correlation relationship between the resource data to be predicted and the performance indicator data; define the correlation threshold value based on the correlation relationship; it will be greater than or equal to the correlation degree The performance index data of the threshold is used as the performance index time series data; the performance index time series data is horizontally expanded to obtain training data and test data; the training data is input into the constructed time series neural network model for training, and the trained time series neural network is obtained. Network prediction model; input the test data into the time series neural network prediction model for prediction operation, and obtain the resource prediction result. Based on the Pearson correlation coefficient, the correlation degree of the resource data to be predicted and the performance index data obtained in the local database is sorted, so as to obtain the correlation relationship between the resource data to be predicted and the performance index data to define the correlation threshold. And based on the correlation threshold to obtain the performance index time series data; then based on the horizontal data expansion, the performance index time series data is pruned and information extracted to obtain training data and test data, which can achieve data retention on the basis of reducing input data. Then, based on the training data, a time-series neural network prediction model that can be used to capture long-term dependent time-series data information is trained, and then the test data is used as the input of the time-series neural network prediction model, and a prediction model with high prediction accuracy is obtained. Resource forecast results. By reducing the input data of the time series neural network model, the computational complexity can be effectively reduced, thereby reducing the prediction complexity, and to a certain extent, improving the accuracy and efficiency of cloud native cluster resource prediction.
附图说明Description of drawings
为了更清楚地说明本申请中的方案,下面将对本申请实施例描述中所需要使用的附图作一个简单介绍,显而易见地,下面描述中的附图是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to illustrate the solutions in the present application more clearly, the following will briefly introduce the accompanying drawings used in the description of the embodiments of the present application. For those of ordinary skill, other drawings can also be obtained from these drawings without any creative effort.
图1是本申请可以应用于其中的示例性原理示意图;FIG. 1 is a schematic diagram of an exemplary principle to which the present application can be applied;
图2是根据本申请的云原生资源动态预测方法的一个实施例的流程图;FIG. 2 is a flowchart of an embodiment of a cloud native resource dynamic prediction method according to the present application;
图3是根据本申请的云原生资源动态预测方法的数据预处理的流程图;3 is a flowchart of data preprocessing according to the cloud native resource dynamic prediction method of the present application;
图4是图3中步骤S302的一种具体实施方式的流程图;Fig. 4 is a flow chart of a specific implementation manner of step S302 in Fig. 3;
图5是根据本申请的云原生资源动态预测装置的一个实施例的结构示意图;5 is a schematic structural diagram of an embodiment of a cloud native resource dynamic prediction apparatus according to the present application;
图6是根据本申请的云原生资源动态预测装置的数据预处理的结构示意图;6 is a schematic structural diagram of data preprocessing of the cloud native resource dynamic prediction device according to the present application;
图7是图6中预处理模块的一种具体实施方式的结构示意图;7 is a schematic structural diagram of a specific implementation of the preprocessing module in FIG. 6;
图8是根据本申请的计算机设备的一个实施例的结构示意图。FIG. 8 is a schematic structural diagram of an embodiment of a computer device according to the present application.
具体实施方式Detailed ways
除非另有定义,本文所使用的所有的技术和科学术语与属于本申请的技术领域的技术人员通常理解的含义相同;本文中在申请的说明书中所使用的术语只是为了描述具体的实施例的目的,不是旨在于限制本申请;本申请的说明书和权利要求书及上述附图说明中的术语“包括”和“具有”以及它们的任何变形,意图在于覆盖不排他的包含。本申请的说明书和权利要求书或上述附图中的术语“第一”、“第二”等是用于区别不同对象,而不是用于描述特定顺序。Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the technical field of this application; the terms used herein in the specification of the application are for the purpose of describing specific embodiments only It is not intended to limit the application; the terms "comprising" and "having" and any variations thereof in the description and claims of this application and the above description of the drawings are intended to cover non-exclusive inclusion. The terms "first", "second" and the like in the description and claims of the present application or the above drawings are used to distinguish different objects, rather than to describe a specific order.
在本文中提及“实施例”意味着,结合实施例描述的特定特征、结构或特性可以包含在本申请的至少一个实施例中。在说明书中的各个位置出现该短语并不一定均是指相同的实施例,也不是与其它实施例互斥的独立的或备选的实施例。本领域技术人员显式地和隐式地理解的是,本文所描述的实施例可以与其它实施例相结合。Reference herein to an "embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the present application. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor a separate or alternative embodiment that is mutually exclusive of other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
为了使本技术领域的人员更好地理解本申请方案,下面将结合附图,对本申请实施例中的技术方案进行清楚、完整地描述。In order to make those skilled in the art better understand the solutions of the present application, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the accompanying drawings.
实施例一Example 1
请参阅图1以及图2,示出了根据本申请实施例一提供的云原生资源动态预测的方法的一个实施例的流程图,为了方便说明,仅示出了与本申请相关的部分。Referring to FIG. 1 and FIG. 2 , a flowchart of an embodiment of a method for dynamic prediction of cloud native resources provided according to Embodiment 1 of the present application is shown. For the convenience of description, only parts related to the present application are shown.
在步骤S1中,接收用户终端发送的动态预测请求。In step S1, a dynamic prediction request sent by the user terminal is received.
在本实施例中,在本实施例中,动态预测请求是用户为了对云原生集群资源特征进行深入的理解,从而对选择合适的资源预测模型并结合特定场景进行优化,为动态资源分配提供有价值的决策依据而发出的操作请求。In this embodiment, in this embodiment, the dynamic prediction request is for the user to have an in-depth understanding of the characteristics of cloud-native cluster resources, so as to select an appropriate resource prediction model and optimize it in combination with a specific scenario, so as to provide effective resources for dynamic resource allocation. The action request issued based on the decision of the value.
在步骤S2中,响应动态预测请求,读取本地数据库,获取云原生集群中容器负载的待预测资源数据以及性能指标数据。In step S2, in response to the dynamic prediction request, the local database is read, and the resource data to be predicted and the performance indicator data of the container load in the cloud native cluster are obtained.
在本实施例中,待预测资源数据是指对云原生集群中容器负载的历史资源数据按照预设的处理方式进行处理后得到的的时序数据,其中,处理方式具体可以是合理的压缩、抽取和格式转换等方式,此处不作具体限制,能够在不缺失长时 依赖信息的前提下减少输入数据大小,有利于提升后续训练时序神经网络预测模型的训练速度,从而实现对资源进行实时和动态的分配,减少资源分配的滞后性,从而在一定程度上提高云原生集群资源预测的准确性以及高效性。In this embodiment, the resource data to be predicted refers to the time series data obtained by processing the historical resource data of the container load in the cloud native cluster according to a preset processing method, wherein the processing method may specifically be reasonable compression or extraction. There are no specific restrictions here, which can reduce the size of the input data without missing long-term dependency information, which is beneficial to improve the training speed of the subsequent training time series neural network prediction model, so as to realize real-time and dynamic resource management. It can reduce the lag of resource allocation, thereby improving the accuracy and efficiency of cloud native cluster resource prediction to a certain extent.
在本实施例中,性能指标数据具体可以是应用层的性能指标如CPU利用率、内存利用率、磁盘IO大小、网络带宽等;以及微架构层的性能指标如IPC(Instructions per Cycle),分支预测(Branch Predict)和缓存丢失(Cache misses)等能够用于直观反映集群性能的指标数据。In this embodiment, the performance indicator data may specifically be performance indicators of the application layer such as CPU utilization, memory utilization, disk IO size, network bandwidth, etc.; and performance indicators of the microarchitecture layer such as IPC (Instructions per Cycle), branch Prediction (Branch Predict) and Cache misses (Cache misses) can be used to intuitively reflect the indicator data of cluster performance.
在本实施例中,由于不同应用的资源利用率具有动态性和复杂性的特征,故本实施例基于该动态预测请求在本地数据库中,获取基于预设的处理方式对云原生集群中容器负载的历史资源数据按照进行处理后得到的的时序数据,即待预测资源数据,以及能够用于直观反映集群性能的性能指标数据,以使后续基于该待预测资源数据以及性能指标数据能够在不缺失长时依赖信息的前提下减少输入数据大小,有利于提升后续训练时序神经网络预测模型的训练速度,从而实现对资源进行实时和动态的分配,减少资源分配的滞后性,从而在一定程度上提高云原生集群资源预测的准确性以及高效性。In this embodiment, since the resource utilization of different applications has the characteristics of dynamics and complexity, this embodiment obtains the load of containers in the cloud native cluster based on the preset processing method in the local database based on the dynamic prediction request. The historical resource data is processed according to the time series data, that is, the resource data to be predicted, and the performance index data that can be used to intuitively reflect the cluster performance, so that the subsequent resource data and performance index data based on the to-be-predicted resource data and performance index data can not be missing. Reducing the size of input data under the premise of long-term dependence on information is conducive to improving the training speed of the subsequent training time series neural network prediction model, so as to realize real-time and dynamic allocation of resources, reduce the lag of resource allocation, and improve to a certain extent. The accuracy and efficiency of cloud-native cluster resource prediction.
在步骤S3中,基于皮尔森相关系数对待预测资源数据以及性能指标数据进行相关度排序,得到待预测资源数据以及性能指标数据之间的相关性关系。In step S3, the correlation degree of the resource data to be predicted and the performance index data is sorted based on the Pearson correlation coefficient, and the correlation relationship between the resource data to be predicted and the performance index data is obtained.
在本实施例中,皮尔森相关系数是能够对待预测资源数据以及性能指标数据的相关性强度进行衡量的系数。In this embodiment, the Pearson correlation coefficient is a coefficient capable of measuring the correlation strength of the resource data to be predicted and the performance index data.
其中,皮尔森相关系数表示为:Among them, the Pearson correlation coefficient is expressed as:
Figure PCTCN2020139679-appb-000001
Figure PCTCN2020139679-appb-000001
其中,待预测资源数据为r,X代表r的时序数据,Y代表其他的性能指标数据的时序数据,n表示时序数据长度。The resource data to be predicted is r, X represents the time series data of r, Y represents the time series data of other performance index data, and n represents the length of the time series data.
在本实施例中,相关性关系是指不同的性能指标数据分别与待预测资源数据 r之间的相关性强弱关系。In this embodiment, the correlation relationship refers to the strong and weak correlation relationship between different performance index data and the resource data r to be predicted, respectively.
在本实施例中,由于不同负载混合部署,在同一时间会因为资源有限而产生资源竞争,且这种竞争程度与负载类型密切相关,故本实施例基于皮尔森相关系数,对待预测资源数据以及性能指标数据进行相关系数的计算,得到不同的性能指标数据分别与待预测资源数据r之间的相关系数,进而,按照预设的排序方式来对这些系数进行排序,并基于排序后的相关系数来表示不同的性能指标数据分别与待预测资源数据r之间的相关性强弱关系,以使后续能够基于该相关性强弱关系来进一步实现输入数据的剪枝,从而在减少输入数据的基础上保留数据的有效信息,从而在一定程度上提高云原生集群资源预测的准确性以及高效性。In this embodiment, due to the mixed deployment of different loads, resource competition will occur due to limited resources at the same time, and the degree of this competition is closely related to the load type. Therefore, this embodiment is based on the Pearson correlation coefficient. Calculate the correlation coefficients of the performance index data to obtain the correlation coefficients between the different performance index data and the resource data r to be predicted, and then sort these coefficients according to a preset sorting method, and based on the sorted correlation coefficients to represent the strong and weak correlation between different performance index data and the resource data r to be predicted, so that the subsequent pruning of the input data can be further realized based on the strong and weak relationship, so as to reduce the basis of input data. To a certain extent, the accuracy and efficiency of cloud-native cluster resource prediction can be improved.
在步骤S4中,基于相关性关系定义相关度阈值。In step S4, a correlation threshold is defined based on the correlation relationship.
在本实施例中,相关度阈值是用于提取相关性较强的时序数据的指标,基于相关性的强弱关系自定义阈值Cmax,即相关度阈值,能够进一步实现对输入数据的剪枝,从而在减少输入数据的基础上保留数据的有效信息,从而在一定程度上提高云原生集群资源预测的准确性以及高效性。In this embodiment, the correlation threshold is an index used to extract time series data with strong correlation, and the self-defined threshold Cmax based on the strong and weak relationship of the correlation, that is, the correlation threshold, can further realize the pruning of the input data, Therefore, the effective information of the data is retained on the basis of reducing the input data, thereby improving the accuracy and efficiency of cloud-native cluster resource prediction to a certain extent.
在步骤S5中,将大于或等于相关度阈值的性能指标数据作为性能指标时序数据。In step S5, the performance index data greater than or equal to the correlation threshold is used as the performance index time series data.
在本实施例中,基于相关性的强弱关系自定义的相关度阈值,将小于该相关度阈值的性能指标数据可全部删除,并保留大于或等于Cmax的性能指标数据作为性能指标时序数据,以使后续能够基于该性能指标时序数据进一步对输入数据进行剪枝,从而在减少输入数据的基础上保留数据的有效信息,从而在一定程度上提高云原生集群资源预测的准确性以及高效性。In this embodiment, based on a self-defined correlation threshold based on the strong and weak relationship of the correlation, all performance index data smaller than the correlation threshold can be deleted, and the performance index data greater than or equal to Cmax is retained as the performance index time series data, In order to enable the subsequent pruning of the input data based on the time series data of the performance index, the effective information of the data can be retained on the basis of reducing the input data, thereby improving the accuracy and efficiency of cloud-native cluster resource prediction to a certain extent.
在步骤S6中,将性能指标时序数据进行横向数据扩展,得到训练数据以及测试数据。In step S6, horizontal data expansion is performed on the performance index time series data to obtain training data and test data.
在本实施例中,将性能指标时序数据进行横向数据扩展,具体可以是通过假设预测性能指标数据为cpu,相关性值大于Cmax的为性能指标数据为cpu, memory,disk,那么在t时刻数据输入矩阵为arr=[cpu t,memory t,disk t],扩展后的输入矩阵为arr=[cpu t-2,cpu t-1,cpu t,memory t-2,memory t-1,memory t,disk t-2,disk t-1,disk t]。 In this embodiment, horizontal data expansion is performed on the performance index time series data, specifically, by assuming that the predicted performance index data is cpu, and the correlation value greater than Cmax is the performance index data is cpu, memory, disk, then the data at time t The input matrix is arr=[cpu t ,memory t ,disk t ], and the expanded input matrix is arr=[cpu t-2 ,cpu t-1 ,cpu t ,memory t-2 ,memory t-1 ,memory t ,disk t-2 ,disk t-1 ,disk t ].
在本实施例中,训练数据以及测试数据是基于性能指标时序数据进行横向数据扩展扩展后得到数据集,按照7:3的比例进行分割后,得到的能够用于进行时序神经网络模型训练的训练数据以及能够用于进行资源预测的测试数据,能够实现对输入数据的剪枝,从而在减少输入数据的基础上保留数据的有效信息,从而在一定程度上提高云原生集群资源预测的准确性以及高效性。In this embodiment, the training data and the test data are obtained by performing horizontal data expansion and expansion based on the performance index time series data. Data and test data that can be used for resource prediction can realize the pruning of input data, so as to retain the effective information of the data on the basis of reducing the input data, thereby improving the accuracy of cloud-native cluster resource prediction to a certain extent. Efficiency.
在步骤S7中,将训练数据输入至构建好的时序神经网络模型中进行训练,得到训练好的时序神经网络预测模型。In step S7, the training data is input into the constructed time series neural network model for training, and the trained time series neural network prediction model is obtained.
在本实施例中,时序神经网络预测模型是是基于时序神经网络(TCNs)进行优化后得到的通过采用膨胀卷积和注意力机制,能够使用更少的数据得到更广的感受野,进行长时依赖的时序数据信息抓取的模型,能够有效保留长时依赖信息,从而在一定程度上有效提升云原生资源预测的准确度。In this embodiment, the time-series neural network prediction model is optimized based on time-series neural networks (TCNs). By using dilated convolution and attention mechanisms, a wider receptive field can be obtained with less data, and a longer The time-dependent time-series data information capture model can effectively retain long-term dependent information, thereby effectively improving the accuracy of cloud native resource prediction to a certain extent.
在本实施例中,将能够用于进行时序神经网络模型训练的训练数据输入至构建好的时序神经网络模型中进行训练,不断循环优化后,得到能够通过采用膨胀卷积和注意力机制,使用更少的数据得到更广的感受野,进行长时依赖的时序数据信息抓取时序神经网络预测模型,能够有效保留长时依赖信息,从而在一定程度上有效提升云原生资源预测的准确度。In this embodiment, the training data that can be used for training the time-series neural network model is input into the constructed time-series neural network model for training. Less data gets a wider receptive field, and the long-term dependent time series data information is captured by the time series neural network prediction model, which can effectively retain the long-term dependency information, thereby effectively improving the accuracy of cloud native resource prediction to a certain extent.
在步骤S8中,将测试数据输入至时序神经网络预测模型中进行预测操作,得到资源预测结果。In step S8, the test data is input into the time-series neural network prediction model for prediction operation to obtain the resource prediction result.
在本实施例中,在时序神经网络预测模型训练结束后,直接将能够用于进行资源预测的测试数据输入该训练好的时序神经网络预测模型中对云原生资源进行预测,可获取到包含有预测的未来资源利用率的资源预测结果。In this embodiment, after the training of the time-series neural network prediction model is completed, the test data that can be used for resource prediction is directly input into the trained time-series neural network prediction model to predict cloud native resources. Resource forecast results for predicted future resource utilization.
本申请提供了一种云原生资源动态预测方法,包括:接收用户终端发送的动态预测请求;响应动态预测请求,读取本地数据库,获取云原生集群中容器负载 的待预测资源数据以及性能指标数据;基于皮尔森相关系数对待预测资源数据以及性能指标数据进行相关度排序,得到待预测资源数据以及性能指标数据之间的相关性关系;基于相关性关系定义相关度阈值;将大于或等于相关度阈值的性能指标数据作为性能指标时序数据;将性能指标时序数据进行横向数据扩展,得到训练数据以及测试数据;将训练数据输入至构建好的时序神经网络模型中进行训练,得到训练好的时序神经网络预测模型;将测试数据输入至时序神经网络预测模型中进行预测操作,得到资源预测结果。基于皮尔森相关系数对在本地数据库中获取到的待预测资源数据以及性能指标数据进行相关度排序,以获取待预测资源数据以及性能指标数据之间的相关性关系来对相关度阈值进行定义,并基于该相关度阈值来获取性能指标时序数据;进而基于横向数据扩展对该性能指标时序数据进行剪枝以及信息抽取,得到训练数据以及测试数据,能够实现在减少输入数据的基础上保留了数据的有效信息;然后,基于训练数据训练出能够用于长时依赖的时序数据信息抓取的时序神经网络预测模型,进而使测试数据作为时序神经网络预测模型的输入,得到预测准确率较高的资源预测结果。能够通过减少时序神经网络模型的输入数据,有效降低计算复杂度,从而降低预测复杂度,并在一定程度上提高云原生集群资源预测的准确性以及高效性。The present application provides a method for dynamic prediction of cloud native resources, including: receiving a dynamic prediction request sent by a user terminal; responding to the dynamic prediction request, reading a local database, and acquiring resource data to be predicted and performance indicator data of container loads in a cloud native cluster ; Based on the Pearson correlation coefficient, sort the correlation degree of the resource data to be predicted and the performance index data to obtain the correlation relationship between the resource data to be predicted and the performance indicator data; define the correlation threshold value based on the correlation relationship; it will be greater than or equal to the correlation degree The performance index data of the threshold is used as the performance index time series data; the performance index time series data is horizontally expanded to obtain training data and test data; the training data is input into the constructed time series neural network model for training, and the trained time series neural network is obtained. Network prediction model; input the test data into the time series neural network prediction model for prediction operation, and obtain the resource prediction result. Based on the Pearson correlation coefficient, the correlation degree of the resource data to be predicted and the performance index data obtained in the local database is sorted, so as to obtain the correlation relationship between the resource data to be predicted and the performance index data to define the correlation threshold. And based on the correlation threshold to obtain the performance index time series data; then based on the horizontal data expansion, the performance index time series data is pruned and information extracted to obtain training data and test data, which can achieve data retention on the basis of reducing input data. Then, based on the training data, a time-series neural network prediction model that can be used to capture long-term dependent time-series data information is trained, and then the test data is used as the input of the time-series neural network prediction model, and a prediction model with high prediction accuracy is obtained. Resource forecast results. By reducing the input data of the time series neural network model, the computational complexity can be effectively reduced, thereby reducing the prediction complexity, and to a certain extent, improving the accuracy and efficiency of cloud native cluster resource prediction.
继续参考图3,示出了本申请实施例一提供的云原生资源动态预测方法的数据预处理的流程图,为了方便说明,仅示出了与本申请相关的部分。Continuing to refer to FIG. 3 , a flow chart of data preprocessing of the cloud native resource dynamic prediction method provided in Embodiment 1 of the present application is shown. For convenience of description, only parts related to the present application are shown.
在本实施例一的一些可选的实现方式中,在步骤S2响应动态预测请求,读取本地数据库,获取云原生集群中容器负载的待预测资源数据以及性能指标数据之前,该方法还包括:步骤S301以及步骤S302。In some optional implementations of the first embodiment, before step S2 responds to the dynamic prediction request, reads the local database, and obtains resource data to be predicted and performance indicator data of the container load in the cloud native cluster, the method further includes: Step S301 and Step S302.
在步骤S301中,基于预设的时间间隔对云原生集群中容器负载的历史资源数据进行采集。In step S301, historical resource data of container loads in the cloud native cluster is collected based on a preset time interval.
在步骤S302中,对历史资源数据进行预处理,得到待预测资源数据。In step S302, the historical resource data is preprocessed to obtain resource data to be predicted.
在本实施例中,历史资源数据具体可以是包括CPU利用率、内存利用率、磁 盘IO大小、网络带宽等属性值,采样频率为60s一次等数据。In this embodiment, the historical resource data may specifically include attribute values such as CPU utilization, memory utilization, disk IO size, and network bandwidth, and the sampling frequency is data such as once every 60s.
在本实施例中,对历史资源数据进行预处理,具体可以是通过删除无效和异常数据来来获取待预测资源数据。In this embodiment, the historical resource data is preprocessed, specifically, the resource data to be predicted can be obtained by deleting invalid and abnormal data.
在本实施例中,按照预设的时间间隔如每60s对云原生集群中容器负载中包含有CPU利用率、内存利用率、磁盘IO大小、网络带宽等属性值,采样频率为60s一次等数据的历史资源数据进行采集,进而对对历史资源数据进行删除无效以及异常数据的预处理操作,以获取待预测资源数据,能够通过对采集的历史资源数据进行合理的压缩、抽取和格式转换等处理后,实现在不缺失长时依赖信息的前提下减少输入数据大小,从而使得后续能够基于减少输入数据来提高时序神经网络模型的训练速度,从而实现对资源进行实时和动态的分配,减少资源分配的滞后性,从而在一定程度上提高云原生集群资源预测的准确性以及高效性。In this embodiment, according to a preset time interval, such as every 60s, the container load in the cloud native cluster includes attribute values such as CPU utilization, memory utilization, disk IO size, network bandwidth, etc., and the sampling frequency is data such as once every 60s. Collect the historical resource data, and then delete the invalid and abnormal data preprocessing operation to obtain the resource data to be predicted. The collected historical resource data can be reasonably compressed, extracted and format converted. Then, the input data size can be reduced without missing long-term dependency information, so that the subsequent training speed of the time series neural network model can be improved based on the reduction of input data, so as to realize real-time and dynamic allocation of resources and reduce resource allocation. Therefore, to a certain extent, the accuracy and efficiency of cloud-native cluster resource prediction can be improved.
继续参考图4,示出了本申请实施例一提供的中步骤S302的一种具体实施方式的流程图,为了方便说明,仅示出了与本申请相关的部分。Continuing to refer to FIG. 4 , a flowchart of a specific implementation manner of step S302 provided in Embodiment 1 of the present application is shown. For the convenience of description, only the part related to the present application is shown.
在本实施例一的一些可选的实现方式中,步骤S302对历史资源数据进行预处理,得到待预测资源数据的步骤包括:步骤S401以及步骤S402。In some optional implementation manners of the first embodiment, step S302 preprocesses historical resource data, and the step of obtaining resource data to be predicted includes steps S401 and S402.
在步骤S401中,删除历史资源数据中的无效或异常数据,得到有效时序数据。In step S401, invalid or abnormal data in the historical resource data is deleted to obtain valid time series data.
在步骤S402中,对有效时序数据进行归一化处理,得到待预测资源数据。In step S402, the effective time series data is normalized to obtain resource data to be predicted.
在本实施例中,为了能有效地提升云原生集群资源管理的性能,本实施例通过对输入数据进行剪枝来提升预测时间,从而对云原生资源进行合理分配,以减少资源过售以及资源碎片的产生,故为了能够实现对输入数据的剪枝,本实施例先通过对历史资源数据中的无效或异常数据进行删除,然后对删除后得到的有效时序数据进行归一化处理,来实现对有效时序数据的缩减以及有效提取,得到待预测资源数据。In this embodiment, in order to effectively improve the performance of cloud-native cluster resource management, this embodiment improves prediction time by pruning input data, so as to reasonably allocate cloud-native resources to reduce resource oversale and resource oversale. Therefore, in order to realize the pruning of the input data, this embodiment first deletes invalid or abnormal data in the historical resource data, and then normalizes the valid time series data obtained after deletion. Reduction and effective extraction of effective time series data to obtain resource data to be predicted.
在本实施例一的一些可选的实现方式中,在步骤S8之后,该方法还包括:In some optional implementations of the first embodiment, after step S8, the method further includes:
重复执行预测操作过程,得到实时预测数据;Repeat the prediction operation process to obtain real-time prediction data;
将实时预测数据反馈至用户终端。Feed back real-time prediction data to the user terminal.
在本实施例中,实时预测数据是基于时序神经网络预测模型对资源进行动态在线实时预测得到的包含有预测的未来资源利用率的预测数据。In this embodiment, the real-time prediction data is prediction data including the predicted future resource utilization rate obtained by dynamically online real-time prediction of resources based on a time-series neural network prediction model.
在本实施例中,为了实现对资源进行实时和动态的分配,减少资源分配的滞后性,本实施例通过重复执行将测试数据输入至时序神经网络预测模型中进行预测操作过程,以获取包含有预测的未来资源利用率的实时预测数据,以满足资源分配需要实时性的需求。In this embodiment, in order to realize real-time and dynamic allocation of resources and reduce the hysteresis of resource allocation, this embodiment repeatedly performs a prediction operation process of inputting test data into a time-series neural network prediction model, so as to obtain information including Real-time forecast data of predicted future resource utilization to meet the real-time demand for resource allocation.
在本实施例一的一些可选的实现方式中,在步骤S7之前,该方法还包括:In some optional implementations of the first embodiment, before step S7, the method further includes:
将预设的全连接层以及注意力机制添加至时序神经网络基础模型架构中,得到时序神经网络模型。Add the preset fully connected layer and attention mechanism to the basic model architecture of the temporal neural network to obtain the temporal neural network model.
在本实施例中,时序神经网络基础模型是时序神经网络TCNs(Temporal Convolutional Networks)。In this embodiment, the basic model of the temporal neural network is temporal neural network TCNs (Temporal Convolutional Networks).
在本实施例中,将预设的全连接层以及注意力机制添加至时序神经网络基础模型架构中,具体可以是通过在时序神经网络TCNs的基础上添加一层全连接层和注意力机制,使得时序神经网络模型在训练时能通过较少的数据量抓取到长时依赖的信息,从而对资源进行合理的动态分配,在一定程度上提高云原生资源管理的性能。In this embodiment, a preset fully connected layer and an attention mechanism are added to the basic model architecture of the time series neural network. Specifically, a layer of fully connected layer and an attention mechanism can be added on the basis of the time series neural network TCNs, This enables the time-series neural network model to capture long-term dependent information with a small amount of data during training, so as to reasonably dynamically allocate resources and improve the performance of cloud-native resource management to a certain extent.
综上所述,本申请提供了一种云原生资源动态预测方法,包括:接收用户终端发送的动态预测请求;响应动态预测请求,读取本地数据库,获取云原生集群中容器负载的待预测资源数据以及性能指标数据;基于皮尔森相关系数对待预测资源数据以及性能指标数据进行相关度排序,得到待预测资源数据以及性能指标数据之间的相关性关系;基于相关性关系定义相关度阈值;将大于或等于相关度阈值的性能指标数据作为性能指标时序数据;将性能指标时序数据进行横向数据扩展,得到训练数据以及测试数据;将训练数据输入至构建好的时序神经网络模型中进行训练,得到训练好的时序神经网络预测模型;将测试数据输入至时序神经网络预测模型中进行预测操作,得到资源预测结果。基于预设的时间间隔对云 原生集群中容器负载的历史资源数据进行采集,并对采集到对历史资源数据进行删除、归一化等预处理后得到待预测资源数据;进而,基于皮尔森相关系数对待预测资源数据以及性能指标数据进行相关度排序,以获取待预测资源数据以及性能指标数据之间的相关性关系来对相关度阈值进行定义,并基于该相关度阈值来获取性能指标时序数据;进而基于横向数据扩展对该性能指标时序数据进行剪枝以及信息抽取,得到训练数据以及测试数据,能够实现在减少输入数据的基础上保留了数据的有效信息;然后,基于训练数据对添加有全连接层以及注意力机制的时序神经网络模型进行训练,得到能够用于长时依赖的时序数据信息抓取的时序神经网络预测模型,进而使测试数据作为时序神经网络预测模型的输入,得到预测准确率较高的资源预测结果;然后,重复执行预测操作过程,并将得到的实时预测数据反馈至用户终端。能够通过减少时序神经网络模型的输入数据,有效降低计算复杂度,从而降低预测复杂度,并在一定程度上提高云原生集群资源预测的准确性以及高效性。In summary, the present application provides a method for dynamic prediction of cloud native resources, including: receiving a dynamic prediction request sent by a user terminal; responding to the dynamic prediction request, reading a local database, and obtaining resources to be predicted for container loads in a cloud native cluster data and performance indicator data; sort the correlation degree of the resource data to be predicted and the performance indicator data based on the Pearson correlation coefficient, and obtain the correlation relationship between the resource data to be predicted and the performance indicator data; define the correlation threshold based on the correlation relationship; The performance index data that is greater than or equal to the correlation threshold is used as the performance index time series data; the performance index time series data is extended horizontally to obtain training data and test data; the training data is input into the constructed time series neural network model for training, and the result is obtained The trained time-series neural network prediction model; input the test data into the time-series neural network prediction model to perform prediction operations to obtain resource prediction results. Based on the preset time interval, the historical resource data of the container load in the cloud native cluster is collected, and the collected historical resource data is deleted, normalized and other preprocessing to obtain the resource data to be predicted; then, based on the Pearson correlation The coefficients are used to sort the relevancy of the resource data to be predicted and the performance indicator data to obtain the correlation between the resource data to be predicted and the performance indicator data to define the relevancy threshold, and obtain the performance indicator time series data based on the relevancy threshold ; and then perform pruning and information extraction on the performance index time series data based on horizontal data expansion to obtain training data and test data, which can retain the effective information of the data on the basis of reducing the input data; then, based on the training data, add The fully connected layer and the time series neural network model of the attention mechanism are trained to obtain a time series neural network prediction model that can be used to capture long-term dependent time series data information, and then the test data is used as the input of the time series neural network prediction model to obtain predictions. A resource prediction result with a higher accuracy rate; then, the prediction operation process is repeatedly performed, and the obtained real-time prediction data is fed back to the user terminal. By reducing the input data of the time series neural network model, the computational complexity can be effectively reduced, thereby reducing the prediction complexity, and to a certain extent, improving the accuracy and efficiency of cloud native cluster resource prediction.
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,该计算机程序可存储于一计算机可读取存储介质中,该程序在执行时,可包括如上述各方法的实施例的流程。其中,前述的存储介质可为磁碟、光盘、只读存储记忆体(Read-Only Memory,ROM)等非易失性存储介质,或随机存储记忆体(Random Access Memory,RAM)等。Those of ordinary skill in the art can understand that the realization of all or part of the processes in the methods of the above embodiments can be accomplished by instructing the relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium, and the program is During execution, it may include the processes of the embodiments of the above-mentioned methods. Wherein, the aforementioned storage medium may be a non-volatile storage medium such as a magnetic disk, an optical disk, a read-only memory (Read-Only Memory, ROM), or a random access memory (Random Access Memory, RAM) or the like.
应该理解的是,虽然附图的流程图中的各个步骤按照箭头的指示依次显示,但是这些步骤并不是必然按照箭头指示的顺序依次执行。除非本文中有明确的说明,这些步骤的执行并没有严格的顺序限制,其可以以其他的顺序执行。而且,附图的流程图中的至少一部分步骤可以包括多个子步骤或者多个阶段,这些子步骤或者阶段并不必然是在同一时刻执行完成,而是可以在不同的时刻执行,其执行顺序也不必然是依次进行,而是可以与其他步骤或者其他步骤的子步骤或者阶段的至少一部分轮流或者交替地执行。It should be understood that although the various steps in the flowchart of the accompanying drawings are sequentially shown in the order indicated by the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless explicitly stated herein, the execution of these steps is not strictly limited to the order and may be performed in other orders. Moreover, at least a part of the steps in the flowcharts of the accompanying drawings may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but may be executed at different times, and the execution sequence is also It does not have to be performed sequentially, but may be performed alternately or alternately with other steps or at least a portion of sub-steps or stages of other steps.
实施例二Embodiment 2
进一步参考图5,作为对上述图2所示方法的实现,本申请提供了一种云原生资源动态预测装置的一个实施例,该装置实施例与图2所示的方法实施例相对应,该装置具体可以应用于各种电子设备中。With further reference to FIG. 5 , as an implementation of the method shown in FIG. 2 above, the present application provides an embodiment of a cloud native resource dynamic prediction apparatus. The apparatus embodiment corresponds to the method embodiment shown in FIG. 2 . The device can be specifically applied to various electronic devices.
如图5所示,本实施例所述的云原生资源动态预测装置100包括:请求接收模块101、请求响应模块102、相关度排序模块103、阈值定义模块104、时序数据获取模块105、数据扩展模块106、模型训练模块107以及数据预测模块108。其中:As shown in FIG. 5 , the cloud native resource dynamic prediction apparatus 100 in this embodiment includes: a request receiving module 101, a request response module 102, a correlation ranking module 103, a threshold definition module 104, a time series data acquisition module 105, and a data expansion module. module 106 , model training module 107 and data prediction module 108 . in:
请求接收模块101,用于接收用户终端发送的动态预测请求;A request receiving module 101, configured to receive a dynamic prediction request sent by a user terminal;
在本实施例中,在本实施例中,动态预测请求是用户为了对云原生集群资源特征进行深入的理解,从而对选择合适的资源预测模型并结合特定场景进行优化,为动态资源分配提供有价值的决策依据而发出的操作请求。In this embodiment, in this embodiment, the dynamic prediction request is for the user to have an in-depth understanding of the characteristics of cloud-native cluster resources, so as to select an appropriate resource prediction model and optimize it in combination with a specific scenario, so as to provide effective resources for dynamic resource allocation. The action request issued based on the decision of the value.
请求响应模块102,用于响应动态预测请求,读取本地数据库,获取云原生集群中容器负载的待预测资源数据以及性能指标数据;The request response module 102 is configured to respond to the dynamic prediction request, read the local database, and obtain the resource data to be predicted and the performance indicator data of the container load in the cloud native cluster;
在本实施例中,待预测资源数据是指对云原生集群中容器负载的历史资源数据按照预设的处理方式进行处理后得到的的时序数据,其中,处理方式具体可以是合理的压缩、抽取和格式转换等方式,此处不作具体限制,能够在不缺失长时依赖信息的前提下减少输入数据大小,有利于提升后续训练时序神经网络预测模型的训练速度,从而实现对资源进行实时和动态的分配,减少资源分配的滞后性,从而在一定程度上提高云原生集群资源预测的准确性以及高效性。In this embodiment, the resource data to be predicted refers to the time series data obtained by processing the historical resource data of the container load in the cloud native cluster according to a preset processing method, wherein the processing method may specifically be reasonable compression or extraction. There are no specific restrictions here, which can reduce the size of the input data without missing long-term dependency information, which is beneficial to improve the training speed of the subsequent training time series neural network prediction model, so as to realize real-time and dynamic resource management. It can reduce the lag of resource allocation, thereby improving the accuracy and efficiency of cloud native cluster resource prediction to a certain extent.
在本实施例中,性能指标数据具体可以是应用层的性能指标如CPU利用率、内存利用率、磁盘IO大小、网络带宽等;以及微架构层的性能指标如IPC(Instructions per Cycle),分支预测(Branch Predict)和缓存丢失(Cache misses)等能够用于直观反映集群性能的指标数据。In this embodiment, the performance indicator data may specifically be performance indicators of the application layer such as CPU utilization, memory utilization, disk IO size, network bandwidth, etc.; and performance indicators of the microarchitecture layer such as IPC (Instructions per Cycle), branch Prediction (Branch Predict) and Cache misses (Cache misses) can be used to intuitively reflect the indicator data of cluster performance.
在本实施例中,由于不同应用的资源利用率具有动态性和复杂性的特征,故 本实施例基于该动态预测请求在本地数据库中,获取基于预设的处理方式对云原生集群中容器负载的历史资源数据按照进行处理后得到的的时序数据,即待预测资源数据,以及能够用于直观反映集群性能的性能指标数据,以使后续基于该待预测资源数据以及性能指标数据能够在不缺失长时依赖信息的前提下减少输入数据大小,有利于提升后续训练时序神经网络预测模型的训练速度,从而实现对资源进行实时和动态的分配,减少资源分配的滞后性,从而在一定程度上提高云原生集群资源预测的准确性以及高效性。In this embodiment, since the resource utilization of different applications has the characteristics of dynamics and complexity, this embodiment obtains the load of containers in the cloud native cluster based on the preset processing method in the local database based on the dynamic prediction request. The historical resource data is processed according to the time series data, that is, the resource data to be predicted, and the performance index data that can be used to intuitively reflect the cluster performance, so that the subsequent resource data and performance index data based on the to-be-predicted resource data and performance index data can not be missing. Reducing the size of input data under the premise of long-term dependence on information is conducive to improving the training speed of the subsequent training time series neural network prediction model, so as to realize real-time and dynamic allocation of resources, reduce the lag of resource allocation, and improve to a certain extent. The accuracy and efficiency of cloud-native cluster resource prediction.
相关度排序模块103,用于基于皮尔森相关系数对待预测资源数据以及性能指标数据进行相关度排序,得到待预测资源数据以及性能指标数据之间的相关性关系;The correlation ranking module 103 is configured to perform correlation ranking on the resource data to be predicted and the performance index data based on the Pearson correlation coefficient, so as to obtain the correlation relationship between the resource data to be predicted and the performance index data;
在本实施例中,皮尔森相关系数是能够对待预测资源数据以及性能指标数据的相关性强度进行衡量的系数。In this embodiment, the Pearson correlation coefficient is a coefficient capable of measuring the correlation strength of the resource data to be predicted and the performance index data.
其中,皮尔森相关系数表示为:Among them, the Pearson correlation coefficient is expressed as:
Figure PCTCN2020139679-appb-000002
Figure PCTCN2020139679-appb-000002
其中,待预测资源数据为r,X代表r的时序数据,Y代表其他的性能指标数据的时序数据,n表示时序数据长度。The resource data to be predicted is r, X represents the time series data of r, Y represents the time series data of other performance index data, and n represents the length of the time series data.
在本实施例中,相关性关系是指不同的性能指标数据分别与待预测资源数据r之间的相关性强弱关系。In this embodiment, the correlation relationship refers to the strong and weak correlation relationship between different performance index data and the resource data r to be predicted, respectively.
在本实施例中,由于不同负载混合部署,在同一时间会因为资源有限而产生资源竞争,且这种竞争程度与负载类型密切相关,故本实施例基于皮尔森相关系数,对待预测资源数据以及性能指标数据进行相关系数的计算,得到不同的性能指标数据分别与待预测资源数据r之间的相关系数,进而,按照预设的排序方式来对这些系数进行排序,并基于排序后的相关系数来表示不同的性能指标数据分别与待预测资源数据r之间的相关性强弱关系,以使后续能够基于该相关性强弱 关系来进一步实现输入数据的剪枝,从而在减少输入数据的基础上保留数据的有效信息,从而在一定程度上提高云原生集群资源预测的准确性以及高效性。In this embodiment, due to the mixed deployment of different loads, resource competition will occur due to limited resources at the same time, and the degree of this competition is closely related to the load type. Therefore, this embodiment is based on the Pearson correlation coefficient. Calculate the correlation coefficients of the performance index data to obtain the correlation coefficients between the different performance index data and the resource data r to be predicted, and then sort these coefficients according to a preset sorting method, and based on the sorted correlation coefficients to represent the strong and weak correlation between different performance index data and the resource data r to be predicted, so that the subsequent pruning of the input data can be further realized based on the strong and weak relationship, so as to reduce the basis of input data. To a certain extent, the accuracy and efficiency of cloud-native cluster resource prediction can be improved.
阈值定义模块104,用于基于相关性关系定义相关度阈值;a threshold definition module 104, configured to define a correlation threshold based on the correlation relationship;
在本实施例中,相关度阈值是用于提取相关性较强的时序数据的指标,基于相关性的强弱关系自定义阈值Cmax,即相关度阈值,能够进一步实现对输入数据的剪枝,从而在减少输入数据的基础上保留数据的有效信息,从而在一定程度上提高云原生集群资源预测的准确性以及高效性。In this embodiment, the correlation threshold is an index used to extract time series data with strong correlation, and the self-defined threshold Cmax based on the strong and weak relationship of the correlation, that is, the correlation threshold, can further realize the pruning of the input data, Therefore, the effective information of the data is retained on the basis of reducing the input data, thereby improving the accuracy and efficiency of cloud-native cluster resource prediction to a certain extent.
时序数据获取模块105,用于将大于或等于相关度阈值的性能指标数据作为性能指标时序数据;a time series data acquisition module 105, configured to use the performance index data greater than or equal to the correlation threshold as the performance index time series data;
在本实施例中,基于相关性的强弱关系自定义的相关度阈值,将小于该相关度阈值的性能指标数据可全部删除,并保留大于或等于Cmax的性能指标数据作为性能指标时序数据,以使后续能够基于该性能指标时序数据进一步对输入数据进行剪枝,从而在减少输入数据的基础上保留数据的有效信息,从而在一定程度上提高云原生集群资源预测的准确性以及高效性。In this embodiment, based on a self-defined correlation threshold based on the strong and weak relationship of the correlation, all performance index data smaller than the correlation threshold can be deleted, and the performance index data greater than or equal to Cmax is retained as the performance index time series data, In order to enable the subsequent pruning of the input data based on the time series data of the performance index, the effective information of the data can be retained on the basis of reducing the input data, thereby improving the accuracy and efficiency of cloud-native cluster resource prediction to a certain extent.
数据扩展模块106,用于将性能指标时序数据进行横向数据扩展,得到训练数据以及测试数据;The data expansion module 106 is used to perform horizontal data expansion on the performance index time series data to obtain training data and test data;
在本实施例中,将性能指标时序数据进行横向数据扩展,具体可以是通过假设预测性能指标数据为cpu,相关性值大于Cmax的为性能指标数据为cpu,memory,disk,那么在t时刻数据输入矩阵为arr=[cpu t,memory t,disk t],扩展后的输入矩阵为arr=[cpu t-2,cpu t-1,cpu t,memory t-2,memory t-1,memory t,disk t-2,disk t-1,disk t]。 In this embodiment, horizontal data expansion is performed on the performance index time series data, specifically, by assuming that the predicted performance index data is cpu, and the correlation value greater than Cmax is the performance index data of cpu, memory, disk, then the data at time t The input matrix is arr=[cpu t ,memory t ,disk t ], and the expanded input matrix is arr=[cpu t-2 ,cpu t-1 ,cpu t ,memory t-2 ,memory t-1 ,memory t ,disk t-2 ,disk t-1 ,disk t ].
在本实施例中,训练数据以及测试数据是基于性能指标时序数据进行横向数据扩展扩展后得到数据集,按照7:3的比例进行分割后,得到的能够用于进行时序神经网络模型训练的训练数据以及能够用于进行资源预测的测试数据,能够实现对输入数据的剪枝,从而在减少输入数据的基础上保留数据的有效信息,从而在一定程度上提高云原生集群资源预测的准确性以及高效性。In this embodiment, the training data and the test data are obtained by performing horizontal data expansion and expansion based on the performance index time series data. Data and test data that can be used for resource prediction can realize the pruning of input data, so as to retain the effective information of the data on the basis of reducing the input data, thereby improving the accuracy of cloud-native cluster resource prediction to a certain extent. Efficiency.
模型训练模块107,用于将训练数据输入至构建好的时序神经网络模型中进行训练,得到训练好的时序神经网络预测模型;The model training module 107 is used to input the training data into the constructed time series neural network model for training, and obtain the trained time series neural network prediction model;
在本实施例中,时序神经网络预测模型是是基于时序神经网络(TCNs)进行优化后得到的通过采用膨胀卷积和注意力机制,能够使用更少的数据得到更广的感受野,进行长时依赖的时序数据信息抓取的模型,能够有效保留长时依赖信息,从而在一定程度上有效提升云原生资源预测的准确度。In this embodiment, the time-series neural network prediction model is optimized based on time-series neural networks (TCNs). By using dilated convolution and attention mechanisms, a wider receptive field can be obtained with less data, and a longer The time-dependent time-series data information capture model can effectively retain long-term dependent information, thereby effectively improving the accuracy of cloud native resource prediction to a certain extent.
在本实施例中,将能够用于进行时序神经网络模型训练的训练数据输入至构建好的时序神经网络模型中进行训练,不断循环优化后,得到能够通过采用膨胀卷积和注意力机制,使用更少的数据得到更广的感受野,进行长时依赖的时序数据信息抓取时序神经网络预测模型,能够有效保留长时依赖信息,从而在一定程度上有效提升云原生资源预测的准确度。In this embodiment, the training data that can be used for training the time-series neural network model is input into the constructed time-series neural network model for training. Less data gets a wider receptive field, and the long-term dependent time series data information is captured by the time series neural network prediction model, which can effectively retain the long-term dependency information, thereby effectively improving the accuracy of cloud native resource prediction to a certain extent.
数据预测模块108,用于将测试数据输入至时序神经网络预测模型中进行预测操作,得到资源预测结果。The data prediction module 108 is configured to input the test data into the time-series neural network prediction model to perform prediction operations to obtain resource prediction results.
在本实施例中,在时序神经网络预测模型训练结束后,直接将能够用于进行资源预测的测试数据输入该训练好的时序神经网络预测模型中对云原生资源进行预测,可获取到包含有预测的未来资源利用率的资源预测结果。In this embodiment, after the training of the time-series neural network prediction model is completed, the test data that can be used for resource prediction is directly input into the trained time-series neural network prediction model to predict cloud native resources. Resource forecast results for predicted future resource utilization.
本申请提供了一种云原生资源动态预测装置,包括:基于皮尔森相关系数对在本地数据库中获取到的待预测资源数据以及性能指标数据进行相关度排序,以获取待预测资源数据以及性能指标数据之间的相关性关系来对相关度阈值进行定义,并基于该相关度阈值来获取性能指标时序数据;进而基于横向数据扩展对该性能指标时序数据进行剪枝以及信息抽取,得到训练数据以及测试数据,能够实现在减少输入数据的基础上保留了数据的有效信息;然后,基于训练数据训练出能够用于长时依赖的时序数据信息抓取的时序神经网络预测模型,进而使测试数据作为时序神经网络预测模型的输入,得到预测准确率较高的资源预测结果。能够通过减少时序神经网络模型的输入数据,有效降低计算复杂度,从而降低预 测复杂度,并在一定程度上提高云原生集群资源预测的准确性以及高效性。The present application provides a cloud native resource dynamic prediction device, which includes: based on the Pearson correlation coefficient, the correlation degree of the resource data to be predicted and the performance index data obtained in the local database are sorted, so as to obtain the resource data to be predicted and the performance index. The correlation between the data is used to define the correlation threshold, and based on the correlation threshold, the performance index time series data is obtained; then based on the horizontal data expansion, the performance index time series data is pruned and information extracted to obtain training data and The test data can retain the effective information of the data on the basis of reducing the input data; then, based on the training data, a time-series neural network prediction model that can be used to capture long-term dependent time-series data information is trained, and then the test data is used as a model. The input of the time series neural network prediction model is used to obtain resource prediction results with high prediction accuracy. It can effectively reduce the computational complexity by reducing the input data of the time series neural network model, thereby reducing the forecasting complexity, and improving the accuracy and efficiency of cloud-native cluster resource forecasting to a certain extent.
继续参考图6,示出了本申请实施例一提供的云原生资源动态预测装置的数据预处理的结构示意图,为了方便说明,仅示出了与本申请相关的部分。Continuing to refer to FIG. 6 , a schematic structural diagram of the data preprocessing of the apparatus for dynamic prediction of cloud native resources provided in Embodiment 1 of the present application is shown. For convenience of description, only parts related to the present application are shown.
在本实施例二的一些可选的实现方式中,该装置还包括:数据采集模块601以及预处理模块602。In some optional implementation manners of the second embodiment, the apparatus further includes: a data collection module 601 and a preprocessing module 602 .
数据采集模块601,用于基于预设的时间间隔对云原生集群中容器负载的历史资源数据进行采集;A data collection module 601, configured to collect historical resource data of container loads in the cloud native cluster based on a preset time interval;
预处理模块602,用于对历史资源数据进行预处理,得到待预测资源数据。The preprocessing module 602 is used for preprocessing historical resource data to obtain resource data to be predicted.
在本实施例中,历史资源数据具体可以是包括CPU利用率、内存利用率、磁盘IO大小、网络带宽等属性值,采样频率为60s一次等数据。In this embodiment, the historical resource data may specifically include attribute values such as CPU utilization, memory utilization, disk IO size, and network bandwidth, and the sampling frequency is data such as once every 60s.
在本实施例中,对历史资源数据进行预处理,具体可以是通过删除无效和异常数据来来获取待预测资源数据。In this embodiment, the historical resource data is preprocessed, specifically, the resource data to be predicted can be obtained by deleting invalid and abnormal data.
在本实施例中,按照预设的时间间隔如每60s对云原生集群中容器负载中包含有CPU利用率、内存利用率、磁盘IO大小、网络带宽等属性值,采样频率为60s一次等数据的历史资源数据进行采集,进而对对历史资源数据进行删除无效以及异常数据的预处理操作,以获取待预测资源数据,能够通过对采集的历史资源数据进行合理的压缩、抽取和格式转换等处理后,实现在不缺失长时依赖信息的前提下减少输入数据大小,从而使得后续能够基于减少输入数据来提高时序神经网络模型的训练速度,从而实现对资源进行实时和动态的分配,减少资源分配的滞后性,从而在一定程度上提高云原生集群资源预测的准确性以及高效性。In this embodiment, according to a preset time interval, such as every 60s, the container load in the cloud native cluster includes attribute values such as CPU utilization, memory utilization, disk IO size, network bandwidth, etc., and the sampling frequency is data such as once every 60s. Collect the historical resource data, and then delete the invalid and abnormal data of the historical resource data to obtain the resource data to be predicted. The collected historical resource data can be reasonably compressed, extracted and format converted. Then, the input data size can be reduced without missing long-term dependency information, so that the subsequent training speed of the time series neural network model can be improved based on the reduction of input data, so as to realize real-time and dynamic allocation of resources and reduce resource allocation. Therefore, to a certain extent, the accuracy and efficiency of cloud-native cluster resource prediction can be improved.
继续参考图7,示出了本申请实施例一提供的图6中预处理模块602的一种具体实施方式的流程图,为了方便说明,仅示出了与本申请相关的部分。Continuing to refer to FIG. 7 , a flowchart of a specific implementation manner of the preprocessing module 602 in FIG. 6 provided in Embodiment 1 of the present application is shown. For the convenience of description, only parts related to the present application are shown.
在本实施例二的一些可选的实现方式中,预处理模块602包括:数据删除单元701以及归一化处理单元702。In some optional implementations of the second embodiment, the preprocessing module 602 includes: a data deletion unit 701 and a normalization processing unit 702 .
数据删除单元701,用于删除历史资源数据中的无效或异常数据,得到有效时序数据;A data deletion unit 701 is used to delete invalid or abnormal data in the historical resource data to obtain valid time series data;
归一化处理单元702,用于对有效时序数据进行归一化处理,得到待预测资源数据。The normalization processing unit 702 is configured to perform normalization processing on the valid time series data to obtain resource data to be predicted.
在本实施例中,为了能有效地提升云原生集群资源管理的性能,本实施例通过对输入数据进行剪枝来提升预测时间,从而对云原生资源进行合理分配,以减少资源过售以及资源碎片的产生,故为了能够实现对输入数据的剪枝,本实施例先通过对历史资源数据中的无效或异常数据进行删除,然后对删除后得到的有效时序数据进行归一化处理,来实现对有效时序数据的缩减以及有效提取,得到待预测资源数据。In this embodiment, in order to effectively improve the performance of cloud-native cluster resource management, this embodiment improves prediction time by pruning input data, so as to reasonably allocate cloud-native resources to reduce resource oversale and resource oversale. Therefore, in order to realize the pruning of the input data, this embodiment first deletes invalid or abnormal data in the historical resource data, and then normalizes the valid time series data obtained after deletion. Reduction and effective extraction of effective time series data to obtain resource data to be predicted.
在本实施例二的一些可选的实现方式中,该装置还包括:实时预测模块以及数据反馈模块。In some optional implementation manners of the second embodiment, the apparatus further includes: a real-time prediction module and a data feedback module.
实时预测模块,用于重复执行预测操作过程,得到实时预测数据;The real-time prediction module is used to repeatedly perform the prediction operation process to obtain real-time prediction data;
数据反馈模块,用于将实时预测数据反馈至用户终端。The data feedback module is used to feed back the real-time prediction data to the user terminal.
在本实施例中,实时预测数据是基于时序神经网络预测模型对资源进行动态在线实时预测得到的包含有预测的未来资源利用率的预测数据。In this embodiment, the real-time prediction data is prediction data including the predicted future resource utilization rate obtained by dynamically online real-time prediction of resources based on a time-series neural network prediction model.
在本实施例中,为了实现对资源进行实时和动态的分配,减少资源分配的滞后性,本实施例通过重复执行将测试数据输入至时序神经网络预测模型中进行预测操作过程,以获取包含有预测的未来资源利用率的实时预测数据,以满足资源分配需要实时性的需求。In this embodiment, in order to realize real-time and dynamic allocation of resources and reduce the hysteresis of resource allocation, this embodiment repeatedly performs a prediction operation process of inputting test data into a time-series neural network prediction model, so as to obtain information including Real-time forecast data of predicted future resource utilization to meet the real-time demand for resource allocation.
在本实施例二的一些可选的实现方式中,该装置还包括:In some optional implementation manners of the second embodiment, the device further includes:
将预设的全连接层以及注意力机制添加至时序神经网络基础模型架构中,得到时序神经网络模型。Add the preset fully connected layer and attention mechanism to the basic model architecture of the temporal neural network to obtain the temporal neural network model.
在本实施例中,时序神经网络基础模型是时序神经网络TCNs(Temporal Convolutional Networks)。In this embodiment, the basic model of the temporal neural network is temporal neural network TCNs (Temporal Convolutional Networks).
在本实施例中,将预设的全连接层以及注意力机制添加至时序神经网络基础模型架构中,具体可以是通过在时序神经网络TCNs的基础上添加一层全连接层和注意力机制,使得时序神经网络模型在训练时能通过较少的数据量抓取到长时 依赖的信息,从而对资源进行合理的动态分配,在一定程度上提高云原生资源管理的性能。In this embodiment, a preset fully connected layer and an attention mechanism are added to the basic model architecture of the time series neural network. Specifically, a layer of fully connected layer and an attention mechanism can be added on the basis of the time series neural network TCNs, This enables the time-series neural network model to capture long-term dependent information with a small amount of data during training, so as to reasonably dynamically allocate resources and improve the performance of cloud-native resource management to a certain extent.
综上所述,本申请提供了一种云原生资源动态预测装置,包括:请求接收模块,用于接收用户终端发送的动态预测请求;请求响应模块,用于响应动态预测请求,读取本地数据库,获取云原生集群中容器负载的待预测资源数据以及性能指标数据;相关度排序模块,用于基于皮尔森相关系数对待预测资源数据以及性能指标数据进行相关度排序,得到待预测资源数据以及性能指标数据之间的相关性关系;阈值定义模块,用于基于相关性关系定义相关度阈值;时序数据获取模块,用于将大于或等于相关度阈值的性能指标数据作为性能指标时序数据;数据扩展模块,用于将性能指标时序数据进行横向数据扩展,得到训练数据以及测试数据;模型训练模块,用于将训练数据输入至构建好的时序神经网络模型中进行训练,得到训练好的时序神经网络预测模型;数据预测模块,用于将测试数据输入至时序神经网络预测模型中进行预测操作,得到资源预测结果。基于预设的时间间隔对云原生集群中容器负载的历史资源数据进行采集,并对采集到对历史资源数据进行删除、归一化等预处理后得到待预测资源数据;进而,基于皮尔森相关系数对待预测资源数据以及性能指标数据进行相关度排序,以获取待预测资源数据以及性能指标数据之间的相关性关系来对相关度阈值进行定义,并基于该相关度阈值来获取性能指标时序数据;进而基于横向数据扩展对该性能指标时序数据进行剪枝以及信息抽取,得到训练数据以及测试数据,能够实现在减少输入数据的基础上保留了数据的有效信息;然后,基于训练数据对添加有全连接层以及注意力机制的时序神经网络模型进行训练,得到能够用于长时依赖的时序数据信息抓取的时序神经网络预测模型,进而使测试数据作为时序神经网络预测模型的输入,得到预测准确率较高的资源预测结果;然后,重复执行预测操作过程,并将得到的实时预测数据反馈至用户终端。能够通过减少时序神经网络模型的输入数据,有效降低计算复杂度,从而降低预测复杂度,并在一定程度上提高云原生 集群资源预测的准确性以及高效性。To sum up, the present application provides a cloud native resource dynamic prediction device, including: a request receiving module for receiving a dynamic prediction request sent by a user terminal; a request response module for responding to the dynamic prediction request and reading a local database , to obtain the resource data to be predicted and the performance index data of the container load in the cloud native cluster; the correlation ranking module is used to sort the predicted resource data and the performance index data based on the Pearson correlation coefficient to obtain the resource data to be predicted and the performance index data. Correlation relationship between index data; threshold definition module, used to define the correlation threshold based on the correlation relationship; time series data acquisition module, used to take performance index data greater than or equal to the correlation threshold as performance index time series data; data extension The module is used to expand the performance index time series data horizontally to obtain training data and test data; the model training module is used to input the training data into the constructed time series neural network model for training, and obtain the trained time series neural network. Prediction model; the data prediction module is used to input the test data into the time series neural network prediction model for prediction operation to obtain the resource prediction result. Based on the preset time interval, the historical resource data of the container load in the cloud native cluster is collected, and the collected historical resource data is deleted, normalized and other preprocessing to obtain the resource data to be predicted; then, based on the Pearson correlation The coefficients are used to sort the relevancy of the resource data to be predicted and the performance indicator data to obtain the correlation between the resource data to be predicted and the performance indicator data to define the relevancy threshold, and obtain the performance indicator time series data based on the relevancy threshold ; and then perform pruning and information extraction on the performance index time series data based on horizontal data expansion to obtain training data and test data, which can realize the effective information of the data is retained on the basis of reducing the input data; then, based on the training data, add The fully connected layer and the time-series neural network model of the attention mechanism are trained to obtain a time-series neural network prediction model that can be used to capture long-term dependent time-series data information, and then the test data is used as the input of the time-series neural network prediction model to obtain predictions A resource prediction result with a higher accuracy rate; then, the prediction operation process is repeatedly performed, and the obtained real-time prediction data is fed back to the user terminal. It can effectively reduce the computational complexity by reducing the input data of the time series neural network model, thereby reducing the forecasting complexity, and to a certain extent, improving the accuracy and efficiency of cloud-native cluster resource forecasting.
为解决上述技术问题,本申请实施例还提供计算机设备。具体请参阅图8,图8为本实施例计算机设备基本结构框图。To solve the above technical problems, the embodiments of the present application also provide computer equipment. For details, please refer to FIG. 8 , which is a block diagram of a basic structure of a computer device according to this embodiment.
所述计算机设备8包括通过系统总线相互通信连接存储器81、处理器82、网络接口83。需要指出的是,图中仅示出了具有组件81-83的计算机设备8,但是应理解的是,并不要求实施所有示出的组件,可以替代的实施更多或者更少的组件。其中,本技术领域技术人员可以理解,这里的计算机设备是一种能够按照事先设定或存储的指令,自动进行数值计算和/或信息处理的设备,其硬件包括但不限于微处理器、专用集成电路(Application Specific Integrated Circuit,ASIC)、可编程门阵列(Field-Programmable Gate Array,FPGA)、数字处理器(Digital Signal Processor,DSP)、嵌入式设备等。The computer device 8 includes a memory 81 , a processor 82 , and a network interface 83 that communicate with each other through a system bus. It should be noted that only the computer device 8 with components 81-83 is shown in the figure, but it should be understood that implementation of all shown components is not required, and more or less components may be implemented instead. Among them, those skilled in the art can understand that the computer device here is a device that can automatically perform numerical calculation and/or information processing according to pre-set or stored instructions, and its hardware includes but is not limited to microprocessors, special-purpose Integrated circuit (Application Specific Integrated Circuit, ASIC), programmable gate array (Field-Programmable Gate Array, FPGA), digital processor (Digital Signal Processor, DSP), embedded equipment, etc.
所述计算机设备可以是桌上型计算机、笔记本、掌上电脑及云端服务器等计算设备。所述计算机设备可以与用户通过键盘、鼠标、遥控器、触摸板或声控设备等方式进行人机交互。The computer equipment may be a desktop computer, a notebook computer, a palmtop computer, a cloud server and other computing equipment. The computer device can perform human-computer interaction with the user through a keyboard, a mouse, a remote control, a touch pad or a voice control device.
所述存储器81至少包括一种类型的可读存储介质,所述可读存储介质包括闪存、硬盘、多媒体卡、卡型存储器(例如,SD或DX存储器等)、随机访问存储器(RAM)、静态随机访问存储器(SRAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、可编程只读存储器(PROM)、磁性存储器、磁盘、光盘等。在一些实施例中,所述存储器81可以是所述计算机设备8的内部存储单元,例如该计算机设备8的硬盘或内存。在另一些实施例中,所述存储器81也可以是所述计算机设备8的外部存储设备,例如该计算机设备8上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。当然,所述存储器81还可以既包括所述计算机设备8的内部存储单元也包括其外部存储设备。本实施例中,所述存储器81通常用于存储安装于所述计算机设备8的操作系统和各类应用软件,例如云原生资源动态预测方法 的程序代码等。此外,所述存储器81还可以用于暂时地存储已经输出或者将要输出的各类数据。The memory 81 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), random access memory (RAM), static Random Access Memory (SRAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), Programmable Read Only Memory (PROM), Magnetic Memory, Magnetic Disk, Optical Disk, etc. In some embodiments, the memory 81 may be an internal storage unit of the computer device 8 , such as a hard disk or a memory of the computer device 8 . In other embodiments, the memory 81 may also be an external storage device of the computer device 8, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, flash memory card (Flash Card), etc. Of course, the memory 81 may also include both the internal storage unit of the computer device 8 and its external storage device. In this embodiment, the memory 81 is generally used to store the operating system and various application software installed on the computer device 8, such as the program code of the cloud native resource dynamic prediction method, and the like. In addition, the memory 81 can also be used to temporarily store various types of data that have been output or will be output.
所述处理器82在一些实施例中可以是中央处理器(Central Processing Unit,CPU)、控制器、微控制器、微处理器、或其他数据处理芯片。该处理器82通常用于控制所述计算机设备8的总体操作。本实施例中,所述处理器82用于运行所述存储器81中存储的程序代码或者处理数据,例如运行所述云原生资源动态预测方法的程序代码。The processor 82 may be a central processing unit (Central Processing Unit, CPU), a controller, a microcontroller, a microprocessor, or other data processing chips in some embodiments. The processor 82 is typically used to control the overall operation of the computer device 8 . In this embodiment, the processor 82 is configured to run the program code stored in the memory 81 or process data, for example, run the program code of the cloud native resource dynamic prediction method.
所述网络接口83可包括无线网络接口或有线网络接口,该网络接口83通常用于在所述计算机设备8与其他电子设备之间建立通信连接。The network interface 83 may include a wireless network interface or a wired network interface, and the network interface 83 is generally used to establish a communication connection between the computer device 8 and other electronic devices.
本申请还提供了另一种实施方式,即提供一种计算机可读存储介质,所述计算机可读存储介质存储有云原生资源动态预测程序,所述云原生资源动态预测程序可被至少一个处理器执行,以使所述至少一个处理器执行如上述的云原生资源动态预测方法的步骤。The present application also provides another embodiment, which is to provide a computer-readable storage medium, where the computer-readable storage medium stores a cloud-native resource dynamic prediction program, and the cloud-native resource dynamic prediction program can be processed by at least one The at least one processor executes the steps of the cloud native resource dynamic prediction method as described above.
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,空调器,或者网络设备等)执行本申请各个实施例所述的方法。From the description of the above embodiments, those skilled in the art can clearly understand that the method of the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is better implementation. Based on this understanding, the technical solution of the present application can be embodied in the form of a software product in essence or in a part that contributes to the prior art, and the computer software product is stored in a storage medium (such as ROM/RAM, magnetic disk, CD-ROM), including several instructions to make a terminal device (which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) execute the methods described in the various embodiments of this application.
显然,以上所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例,附图中给出了本申请的较佳实施例,但并不限制本申请的专利范围。本申请 可以以许多不同的形式来实现,相反地,提供这些实施例的目的是使对本申请的公开内容的理解更加透彻全面。尽管参照前述实施例对本申请进行了详细的说明,对于本领域的技术人员来而言,其依然可以对前述各具体实施方式所记载的技术方案进行修改,或者对其中部分技术特征进行等效替换。凡是利用本申请说明书及附图内容所做的等效结构,直接或间接运用在其他相关的技术领域,均同理在本申请专利保护范围之内。Obviously, the above-described embodiments are only a part of the embodiments of the present application, rather than all of the embodiments. The accompanying drawings show the preferred embodiments of the present application, but do not limit the scope of the patent of the present application. This application may be embodied in many different forms, rather, these embodiments are provided so that a thorough and complete understanding of the disclosure of this application is provided. Although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing specific embodiments, or perform equivalent replacements for some of the technical features. . Any equivalent structure made by using the contents of the description and drawings of the present application, which is directly or indirectly used in other related technical fields, is also within the scope of protection of the patent of the present application.

Claims (10)

  1. 一种云原生资源动态预测方法,其特征在于,包括下述步骤:A method for dynamic prediction of cloud native resources, comprising the following steps:
    接收用户终端发送的动态预测请求;Receive the dynamic prediction request sent by the user terminal;
    响应所述动态预测请求,读取本地数据库,获取云原生集群中容器负载的待预测资源数据以及性能指标数据;In response to the dynamic prediction request, read the local database, and obtain the resource data to be predicted and the performance indicator data of the container load in the cloud native cluster;
    基于皮尔森相关系数对所述待预测资源数据以及所述性能指标数据进行相关度排序,得到所述待预测资源数据以及所述性能指标数据之间的相关性关系;Rank the to-be-predicted resource data and the performance index data based on the Pearson correlation coefficient, to obtain a correlation between the to-be-predicted resource data and the performance index data;
    基于所述相关性关系定义相关度阈值;define a relevance threshold based on the relevance relationship;
    将大于或等于所述相关度阈值的性能指标数据作为性能指标时序数据;Use the performance index data greater than or equal to the correlation threshold as the performance index time series data;
    将所述性能指标时序数据进行横向数据扩展,得到训练数据以及测试数据;Perform horizontal data expansion on the performance index time series data to obtain training data and test data;
    将所述训练数据输入至构建好的时序神经网络模型中进行训练,得到训练好的时序神经网络预测模型;The training data is input into the constructed time series neural network model for training, and the trained time series neural network prediction model is obtained;
    将所述测试数据输入至所述时序神经网络预测模型中进行预测操作,得到资源预测结果。Inputting the test data into the time series neural network prediction model to perform a prediction operation to obtain a resource prediction result.
  2. 根据权利要求1所述的云原生资源动态预测方法,其特征在于,在所述响应所述动态预测请求,读取本地数据库,获取云原生集群中容器负载的待预测资源数据以及性能指标数据的步骤之前,所述方法还包括:The method for dynamic prediction of cloud native resources according to claim 1, wherein in the response to the dynamic prediction request, a local database is read to obtain resource data to be predicted and performance indicator data of container loads in the cloud native cluster. Before the step, the method further includes:
    基于预设的时间间隔对云原生集群中容器负载的历史资源数据进行采集;Collect historical resource data of container loads in cloud-native clusters based on preset time intervals;
    对所述历史资源数据进行预处理,得到所述待预测资源数据。The historical resource data is preprocessed to obtain the resource data to be predicted.
  3. 根据权利要求2所述的云原生资源动态预测方法,其特征在于,所述对所述历史资源数据进行预处理,得到所述待预测资源数据的步骤包括:The method for dynamic prediction of cloud native resources according to claim 2, wherein the step of preprocessing the historical resource data to obtain the resource data to be predicted comprises:
    删除所述历史资源数据中的无效或异常数据,得到有效时序数据;Delete invalid or abnormal data in the historical resource data to obtain valid time series data;
    对所述有效时序数据进行归一化处理,得到所述待预测资源数据。The effective time series data is normalized to obtain the resource data to be predicted.
  4. 根据权利要求1所述的云原生资源动态预测方法,其特征在于,在所述将所述测试数据输入至所述时序神经网络预测模型中进行预测操作,得到资源预测结果的步骤之后,所述方法还包括:The method for dynamic prediction of cloud native resources according to claim 1, wherein after the step of inputting the test data into the time series neural network prediction model to perform a prediction operation to obtain a resource prediction result, the Methods also include:
    重复执行所述预测操作过程,得到实时预测数据;Repeatedly executing the prediction operation process to obtain real-time prediction data;
    将所述实时预测数据反馈至所述用户终端。The real-time prediction data is fed back to the user terminal.
  5. 根据权利要求1所述的云原生资源动态预测方法,其特征在于,在所述将所述训练数据输入至构建好的时序神经网络模型中进行训练,得到训练好的时序神经网络预测模型的步骤之前,所述方法还包括:The method for dynamic prediction of cloud native resources according to claim 1, characterized in that, in the step of inputting the training data into the constructed time-series neural network model for training to obtain the trained time-series neural network prediction model Before, the method further includes:
    将预设的全连接层以及注意力机制添加至时序神经网络基础模型架构中,得到所述时序神经网络模型。A preset fully connected layer and an attention mechanism are added to the basic model architecture of the time-series neural network to obtain the time-series neural network model.
  6. 一种云原生资源动态预测装置,其特征在于,包括:A cloud native resource dynamic prediction device, characterized in that it includes:
    请求接收模块,用于接收用户终端发送的动态预测请求;a request receiving module for receiving the dynamic prediction request sent by the user terminal;
    请求响应模块,用于响应所述动态预测请求,读取本地数据库,获取云原生集群中容器负载的待预测资源数据以及性能指标数据;a request-response module, configured to respond to the dynamic prediction request, read the local database, and obtain resource data to be predicted and performance indicator data of the container load in the cloud native cluster;
    相关度排序模块,用于基于皮尔森相关系数对所述待预测资源数据以及所述性能指标数据进行相关度排序,得到所述待预测资源数据以及所述性能指标数据之间的相关性关系;a correlation ranking module, configured to sort the to-be-predicted resource data and the performance index data based on the Pearson correlation coefficient, to obtain a correlation between the to-be-predicted resource data and the performance index data;
    阈值定义模块,用于基于所述相关性关系定义相关度阈值;a threshold definition module for defining a correlation threshold based on the correlation relationship;
    时序数据获取模块,用于将大于或等于所述相关度阈值的性能指标数据作为性能指标时序数据;a time series data acquisition module, configured to use the performance index data greater than or equal to the correlation threshold as the performance index time series data;
    数据扩展模块,用于将所述性能指标时序数据进行横向数据扩展,得到训练数据以及测试数据;a data expansion module, used for horizontal data expansion of the performance index time series data to obtain training data and test data;
    模型训练模块,用于将所述训练数据输入至构建好的时序神经网络模型中进行训练,得到训练好的时序神经网络预测模型;A model training module for inputting the training data into the constructed time-series neural network model for training to obtain a trained time-series neural network prediction model;
    数据预测模块,用于将所述测试数据输入至所述时序神经网络预测模型中进行预测操作,得到资源预测结果。A data prediction module, configured to input the test data into the time series neural network prediction model to perform a prediction operation to obtain a resource prediction result.
  7. 根据权利要求6所述的云原生资源动态预测装置,其特征在于,所述装置还包括:The cloud native resource dynamic prediction device according to claim 6, wherein the device further comprises:
    数据采集模块,用于基于预设的时间间隔对云原生集群中容器负载的历史资源数据进行采集;The data collection module is used to collect historical resource data of container loads in the cloud native cluster based on a preset time interval;
    预处理模块,用于对所述历史资源数据进行预处理,得到所述待预测资源数 据。The preprocessing module is used for preprocessing the historical resource data to obtain the resource data to be predicted.
  8. 根据权利要求7所述的云原生资源动态预测装置,其特征在于,所述预处理模块包括:The cloud native resource dynamic prediction device according to claim 7, wherein the preprocessing module comprises:
    数据删除单元,用于删除所述历史资源数据中的无效或异常数据,得到有效时序数据;a data deletion unit for deleting invalid or abnormal data in the historical resource data to obtain valid time series data;
    归一化处理单元,用于对所述有效时序数据进行归一化处理,得到所述待预测资源数据。A normalization processing unit, configured to perform normalization processing on the valid time series data to obtain the resource data to be predicted.
  9. 一种计算机设备,其特征在于,包括存储器和处理器,所述存储器中存储有计算机程序,所述处理器执行所述计算机程序时实现如权利要求1至5中任一项所述的云原生资源动态预测方法的步骤。A computer device, characterized in that it includes a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the cloud native method according to any one of claims 1 to 5 when the processor executes the computer program Steps of a resource dynamic prediction method.
  10. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质上存储有计算机程序,所述计算机程序被处理器执行时实现如权利要求1至5中任一项所述的云原生资源动态预测方法的步骤。A computer-readable storage medium, characterized in that a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the cloud-native cloud-native system according to any one of claims 1 to 5 is implemented. Steps of a resource dynamic prediction method.
PCT/CN2020/139679 2020-11-30 2020-12-25 Dynamic prediction method and apparatus for cloud native resources, computer device and storage medium WO2022110444A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202011373082.6A CN112565378A (en) 2020-11-30 2020-11-30 Cloud native resource dynamic prediction method and device, computer equipment and storage medium
CN202011373082.6 2020-11-30

Publications (1)

Publication Number Publication Date
WO2022110444A1 true WO2022110444A1 (en) 2022-06-02

Family

ID=75046109

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/139679 WO2022110444A1 (en) 2020-11-30 2020-12-25 Dynamic prediction method and apparatus for cloud native resources, computer device and storage medium

Country Status (2)

Country Link
CN (1) CN112565378A (en)
WO (1) WO2022110444A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116055497A (en) * 2023-01-18 2023-05-02 紫光云技术有限公司 Method for realizing load balancing LB multi-activity oversized cluster
CN117077802A (en) * 2023-06-15 2023-11-17 深圳计算科学研究院 Sequencing prediction method and device for time sequence data

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113283171A (en) * 2021-05-27 2021-08-20 上海交通大学 Industrial platform resource optimal allocation device and method
CN113408221B (en) * 2021-07-06 2022-04-15 太仓比泰科自动化设备有限公司 Probe service life prediction method, system, device and storage medium
CN117170995B (en) * 2023-11-02 2024-05-17 中国科学院深圳先进技术研究院 Performance index-based interference anomaly detection method, device, equipment and medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106205126A (en) * 2016-08-12 2016-12-07 北京航空航天大学 Large-scale Traffic Network based on convolutional neural networks is blocked up Forecasting Methodology and device
US20180151177A1 (en) * 2015-05-26 2018-05-31 Katholieke Universiteit Leuven Speech recognition system and method using an adaptive incremental learning approach
CN110059858A (en) * 2019-03-15 2019-07-26 深圳壹账通智能科技有限公司 Server resource prediction technique, device, computer equipment and storage medium
CN110751326A (en) * 2019-10-17 2020-02-04 江苏远致能源科技有限公司 Photovoltaic day-ahead power prediction method and device and storage medium

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105260794A (en) * 2015-10-12 2016-01-20 上海交通大学 Load predicting method of cloud data center
CN109714395B (en) * 2018-12-10 2021-10-26 平安科技(深圳)有限公司 Cloud platform resource use prediction method and terminal equipment
CN109858611B (en) * 2019-01-11 2024-03-26 平安科技(深圳)有限公司 Neural network compression method based on channel attention mechanism and related equipment
CN110838075A (en) * 2019-05-20 2020-02-25 全球能源互联网研究院有限公司 Training and predicting method and device for prediction model of transient stability of power grid system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180151177A1 (en) * 2015-05-26 2018-05-31 Katholieke Universiteit Leuven Speech recognition system and method using an adaptive incremental learning approach
CN106205126A (en) * 2016-08-12 2016-12-07 北京航空航天大学 Large-scale Traffic Network based on convolutional neural networks is blocked up Forecasting Methodology and device
CN110059858A (en) * 2019-03-15 2019-07-26 深圳壹账通智能科技有限公司 Server resource prediction technique, device, computer equipment and storage medium
CN110751326A (en) * 2019-10-17 2020-02-04 江苏远致能源科技有限公司 Photovoltaic day-ahead power prediction method and device and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116055497A (en) * 2023-01-18 2023-05-02 紫光云技术有限公司 Method for realizing load balancing LB multi-activity oversized cluster
CN117077802A (en) * 2023-06-15 2023-11-17 深圳计算科学研究院 Sequencing prediction method and device for time sequence data

Also Published As

Publication number Publication date
CN112565378A (en) 2021-03-26

Similar Documents

Publication Publication Date Title
WO2022110444A1 (en) Dynamic prediction method and apparatus for cloud native resources, computer device and storage medium
CN108563739B (en) Weather data acquisition method and device, computer device and readable storage medium
CN111368043A (en) Event question-answering method, device, equipment and storage medium based on artificial intelligence
US20110231399A1 (en) Clustering Method and System
CN112162965B (en) Log data processing method, device, computer equipment and storage medium
CN114780727A (en) Text classification method and device based on reinforcement learning, computer equipment and medium
CN113407785B (en) Data processing method and system based on distributed storage system
CN110147470B (en) Cross-machine-room data comparison system and method
CN111061837A (en) Topic identification method, device, equipment and medium
CN112181835A (en) Automatic testing method and device, computer equipment and storage medium
CN113010542B (en) Service data processing method, device, computer equipment and storage medium
CN112995414B (en) Behavior quality inspection method, device, equipment and storage medium based on voice call
CN110348669B (en) Intelligent rule generation method, intelligent rule generation device, computer equipment and storage medium
CN114968719A (en) Thread running state classification method and device, computer equipment and storage medium
CN106547788B (en) Data processing method and device
CN112084408A (en) List data screening method and device, computer equipment and storage medium
CN111970327A (en) News spreading method and system based on big data processing
CN117812185B (en) Control method and system of intelligent outbound system
CN116821493A (en) Message pushing method, device, computer equipment and storage medium
CN111782677A (en) Data clustering method and device based on multiple engines, computer equipment and storage medium
CN116842050A (en) Multi-dimensional state data processing method, device, computer equipment and storage medium
CN116680263A (en) Data cleaning method, device, computer equipment and storage medium
CN117076775A (en) Information data processing method, information data processing device, computer equipment and storage medium
CN117874073A (en) Search optimization method, device, equipment and storage medium thereof
CN117217684A (en) Index data processing method and device, computer equipment and storage medium

Legal Events

Date Code Title Description
NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20963332

Country of ref document: EP

Kind code of ref document: A1