Method, device, equipment and medium for predicting virtual machine load status
By classifying virtual machine load data as fluctuating, stable, or periodic and applying appropriate training models, the method provides accurate load predictions, enabling efficient resource management and preventing system crashes.
Patent Information
- Application Number
- CN202110336758.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-03-29
- Publication Date
- 2024-12-24
- Estimated Expiration
- 2041-03-29
AI Technical Summary
Existing methods for predicting virtual machine load status are unable to account for the different characteristics of load data, leading to inaccurate predictions and inefficient resource allocation, which can result in system crashes and wasted time in optimizing resources.
A method that determines the data type of virtual machine load data as fluctuating, stable, or periodic, and uses specific training models (BP neural network, Holt-Winters, and LSTM algorithms) to accurately predict load data within a preset time period, allowing for timely resource expansion or reduction suggestions.
Accurate prediction of virtual machine load enables proactive resource management, reducing the risk of system crashes and saving time and costs by anticipating resource needs based on data type.
Smart Images

Figure CN115129420B_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of resource optimization of cloud computing platforms, and in particular, relates to a method, device, equipment and medium for predicting the load status of a virtual machine. Background Art
[0002] As the scale of virtual machines becomes larger and larger, the use of resources between different application systems frequently becomes unbalanced. The existing methods for the load status of virtual machines are to set the thresholds for expansion or reduction based on a large amount of historical data. When the load status value of the virtual machine exceeds the threshold, an expansion suggestion or reduction suggestion corresponding to the threshold is given. After obtaining the suggestion, it takes some time to optimize the virtual resources, and it is impossible to perform relevant operations on the virtual machine in advance. In addition, the existing methods are unable to take into account the different characteristics presented by the data and give corresponding expansion suggestions or reduction suggestions in advance.
[0003] Therefore, how to predict the load data of virtual machines in the future based on the different characteristics of the load data is an urgent problem to be solved. Summary of the invention
[0004] The embodiments of the present application provide a method, apparatus, device and medium for predicting the load status of a virtual machine, which can select different training models according to the data type of the data carried by the virtual machine to predict the data value of the virtual machine in the future.
[0005] In a first aspect, an embodiment of the present application provides a method for predicting the carrying status of a virtual machine, the method comprising: obtaining the carrying data of the virtual machine; determining the carrying status of the virtual machine based on the carrying data; determining the data type of the carrying data based on the carrying status of the virtual machine, the data type comprising a fluctuating type, a stable type or a periodic type; when the data type is a fluctuating type, using a first training model to calculate a predicted value of the carrying data within a preset time period; when the data type is a stable type, using a second training model to calculate a predicted value of the carrying data within a preset time period; when the data type is a periodic type, using a long short-term memory network LSTM algorithm training model to calculate a predicted value of the carrying data within a preset time period; wherein the predicted value of the carrying data is used to determine the carrying status of the virtual machine.
[0006] In some embodiments of the first aspect, obtaining the bearer data of the virtual machine includes: using a nearest neighbor interpolation method to complete a default value of historical bearer data of the virtual machine to obtain the bearer data of the virtual machine.
[0007] In some embodiments of the first aspect, the carrying state of the virtual machine is determined based on the carrying data, including: when the carrying data within a preset range is greater than a first threshold, determining that the carrying state of the virtual machine is a state to be expanded; when the carrying data within the preset range is less than a second threshold, determining that the carrying state of the virtual machine is a state to be reduced; when the carrying data within the preset range exists between the first threshold and the second threshold, determining that the carrying state of the virtual machine is a normal state, wherein the first threshold is less than the second threshold.
[0008] In some embodiments of the first aspect, the data type of the carried data is determined based on the carrying state of the virtual machine, including: when the carrying state of the virtual machine is normal, obtaining multiple carried data sets of the virtual machine; calculating the similarity of the multiple carried data sets based on the carried data in the multiple carried data sets; determining the number of carried data sets whose similarity is greater than a third threshold; when the number of carried data sets is less than a fourth threshold, determining that the data type of the carried data in the carried data sets is a fluctuating type; when the number of carried data sets is greater than the fourth threshold, judging whether the coefficient of variation of the carried data sets meets a preset condition; when the coefficient of variation meets the preset condition, determining that the data type of the carried data in the carried data sets is a periodic type; when the coefficient of variation does not meet the preset condition, determining that the data type of the carried data in the carried data sets is a stable type.
[0009] In some embodiments of the first aspect, when the data type is a periodic type, a third training model is used to calculate a predicted value of the load-bearing data within a preset time period, including: obtaining multiple daily periodic data sets; obtaining a frequency graph of the multiple daily periodic data sets based on the multiple daily periodic data sets and the daily periodic data frequencies; determining the number of peaks of the daily periodic data based on the frequency graph; determining a threshold for dividing the busy time period and the idle time period of the data processed by the virtual machine based on the number of peaks; determining the busy time period and the idle time period based on the threshold; determining a target busy time period and a target idle time period based on the number of occurrences of the busy time period and the idle time period in the multiple daily periodic data sets; inputting the target busy time period and the target idle time period into the LSTM algorithm training model to obtain a predicted value of the load-bearing data within the preset time period.
[0010] In some embodiments of the first aspect, the threshold for dividing the busy time period and the idle time period is determined based on the number of peaks, including: when the number of peaks is equal to 1, determining the daily cycle data of a first preset range in multiple daily cycle data sets as the threshold for dividing the busy time period and the idle time period; when the number of peaks is greater than 1, determining the daily cycle data corresponding to the first trough in the frequency diagram as the threshold for dividing the busy time period and the idle time period.
[0011] In a second aspect, an embodiment of the present application provides a device for predicting the carrying status of a virtual machine, the device comprising: an acquisition module for acquiring the carrying data of the virtual machine; a determination module for determining the carrying status of the virtual machine based on the carrying data; the determination module is also used to determine the data type of the carrying data based on the carrying status of the virtual machine, the data type including a fluctuating type, a stable type or a periodic type; a calculation module is used to calculate the predicted value of the carrying data within a preset time period using a first training model when the data type is a fluctuating type; the calculation module is also used to calculate the predicted value of the carrying data within a preset time period using a second training model when the data type is a stable type; the calculation module is also used to calculate the predicted value of the carrying data within a preset time period using a long short-term memory network LSTM algorithm training model when the data type is periodic; wherein the predicted value of the carrying data is used to determine the carrying status of the virtual machine.
[0012] In some embodiments of the second aspect, the acquisition module specifically includes: a first acquisition unit, configured to complete the default value of the historical data of the virtual machine by using a nearest neighbor interpolation method to acquire the data of the virtual machine.
[0013] In a third aspect, a device for predicting virtual machine load data is provided, comprising: a memory for storing computer program instructions; a processor for reading and running the computer program instructions stored in the memory to execute the method for predicting the virtual machine load status provided by the first aspect or any optional implementation manner of the first aspect.
[0014] In a fourth aspect, a computer storage medium is provided, on which computer program instructions are stored. When the computer program instructions are executed by a processor, the method for predicting the load status of a virtual machine provided by the first aspect or any optional implementation manner of the first aspect is implemented.
[0015] The technical solution provided by the embodiments of the present application brings at least the following beneficial effects:
[0016] The embodiment of the present application determines the carrying status of a virtual machine by acquiring the carrying data of the virtual machine, and then determines whether the carrying data is fluctuating data, stable data or periodic data according to the carrying status of the virtual machine. After determining the data type of the carrying data, different training models are selected according to different data types of the carrying data to calculate the predicted value of the carrying data of the virtual machine within a preset time period. In this way, the corresponding training model can be selected according to the data type of the carrying data of the virtual machine, thereby accurately predicting the carrying data of the virtual machine in a period of time in the future. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the technical solution of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0018] Figure 1 It is a flowchart of a method for predicting a virtual machine load status provided in an embodiment of the present application;
[0019] Figure 2 It is a flowchart of another method for predicting the load status of a virtual machine provided in an embodiment of the present application;
[0020] Figure 3 This is a flow chart of another method for predicting the load status of a virtual machine provided in an embodiment of the present application.
[0021] Figure 4 It is a structural schematic diagram of a device for predicting a virtual machine load status provided in an embodiment of the present application;
[0022] Figure 5 It is a structural diagram of a virtual machine bearing state prediction device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0023] The features and exemplary embodiments of various aspects of the present application will be described in detail below. In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain the present application, rather than to limit the present application. For those skilled in the art, the present application can be implemented without the need for some of these specific details. The following description of the embodiments is only to provide a better understanding of the present application by illustrating the examples of the present application.
[0024] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "include..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0025] The term "and / or" in this article is merely a description of the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone.
[0026] Since the existing methods for the load status of virtual machines mainly rely on the evaluation of historical load data and set thresholds based on experience, expansion or reduction suggestions will only be generated when the data of the virtual machine exceeds the threshold. Therefore, it is impossible to predict the load data of the virtual machine in the future. It is easy to cause the virtual machine to generate expansion or reduction suggestions. It will take some time to optimize resources, resulting in a waste of time costs. In addition, when an emergency occurs, the amount of collected load data increases sharply. The virtual machine does not have a good load-bearing capacity, which is also easy to cause system crashes. In addition, the existing methods cannot accurately predict the data values of the virtual machine in the future based on different data types.
[0027] In summary, in order to solve the problem that the existing method for predicting the load-bearing status of a virtual machine cannot take into account the different characteristics of the data presented by the virtual machine, and thus cannot accurately predict the data of the virtual machine in the future, the embodiments of the present application provide a method, device, equipment and medium for predicting the load-bearing data of a virtual machine.
[0028] The technical solution provided in the embodiments of the present application is described below in conjunction with the accompanying drawings.
[0029] Figure 1 It is a flowchart of a method for predicting virtual machine-borne data provided in an embodiment of the present application.
[0030] like Figure 1 As shown, the execution subject of the method is a prediction device for the virtual machine load status, and the prediction method for the virtual machine load status may include the following steps:
[0031] First, in step S110, the bearer data of the virtual machine is obtained.
[0032] Next, in step S120, the bearer status of the virtual machine is determined according to the bearer data.
[0033] Next, in step S130, the data type of the bearer data is determined based on the bearer status of the virtual machine, and the data type includes a fluctuating type, a stable type, or a periodic type.
[0034] Then, in step S140, when the data type is a fluctuating type, a predicted value of the bearing data within a preset time period is calculated using the first training model.
[0035] Alternatively, in step S150, when the data type is a stationary type, a second training model is used to calculate a predicted value of the load-bearing data within a preset time period.
[0036] Alternatively, in step S160, when the data type is a periodic type, a third training model is used to calculate a predicted value of the load-bearing data within a preset time period.
[0037] Therefore, the load status of the virtual machine is determined by obtaining the load data of the virtual machine, and then it is determined whether the load data is fluctuating data, stable data or periodic data according to the load status of the virtual machine. After the data type of the load data is determined, different training models are selected according to the different data types of the load data to calculate the load data prediction value of the virtual machine within a preset time period. In this way, the corresponding training model can be selected according to the data type of the load data of the virtual machine, thereby accurately predicting the load data of the virtual machine in the future.
[0038] The above steps are described in detail below:
[0039] First, step S110 is involved. The carrying data of the virtual machine in the embodiment of the present disclosure is data reflecting the carrying capacity of the virtual machine, that is, data that can reflect the carrying capacity of the virtual machine's resource capacity and the resource occupancy capacity. Therefore, the virtual machine carrying data may include resource capacity data, such as memory data, central processing unit (CPU) data, or storage resource occupancy data, that is, storage data, or multiple types of the above data, which are not limited too much here. Exemplarily, the virtual machine can obtain historical carrying data, and further process the historical carrying data to obtain the carrying data of the virtual machine that can be used. For example, the virtual machine can first obtain the CPU data of the past year, and further process the CPU data of the past year to obtain the carrying data of the virtual machine that can be further used.
[0040] In a specific example, the virtual machine can obtain the virtual machine's load data by completing the default value in the virtual machine's historical load data through the nearest neighbor interpolation method, wherein the virtual machine's historical load data can be the historical load data of the past month, the historical load data of the past year, or even the historical load data of any time period in the past. Preferably, the virtual machine's load data can be obtained by completing the default value of the virtual machine's historical load data of the past year using the nearest neighbor interpolation method, so as to subsequently more accurately predict the relevant load data of the virtual machine in the future period.
[0041] Secondly, step S120 is involved. After the load data of the virtual machine is obtained, the load state of the virtual machine is determined according to the obtained load data. The load state of the virtual machine includes an expandable state, a shrinkable state, or a normal state. Exemplarily, after determining that the load state of the virtual machine is an expandable state or a shrinkable state, the virtual machine can directly give an expansion suggestion or a shrinking suggestion corresponding to the load state of the virtual machine, or directly perform an expansion operation or a shrinking operation, which is not limited here.
[0042] In a specific example, the virtual machine can determine whether the load state of the virtual machine is to be expanded, to be reduced, or normal by judging the relationship between the load data in a preset range and the threshold. Exemplarily, a first threshold and a second threshold can be set, wherein the first threshold is less than the second threshold. When the load data of the virtual machine in the preset range is greater than the first threshold, the load state of the virtual machine is to be expanded; when the load data of the virtual machine in the preset range is less than the second threshold, the load state of the virtual machine is determined to be to be reduced; when the load data of the virtual machine in the preset range is between the first threshold and the second threshold, the load state of the virtual machine is normal.
[0043] In a specific example, when the preset range is set to 90%, the first threshold is set to A, and the second lower threshold is set to B, wherein threshold A is less than threshold B.
[0044] When the data of 90% of the virtual machines is greater than the threshold A, the state of the virtual machine is to be expanded. At this time, a capacity expansion suggestion based on the virtual machine can be directly given according to the state of the virtual machine to be expanded, or the virtual machine can be directly instructed to start the capacity expansion operation.
[0045] When the data of 90% of the virtual machines is less than the threshold B, the state of the virtual machine is ready to be shrunk. At this time, a scaling suggestion based on the virtual machine can be directly given according to the ready to be shrunk state of the virtual machine, or the virtual machine can be directly instructed to start the scaling operation.
[0046] When the data of 90% of the virtual machines exist between the threshold value A and the threshold value B in the confidence interval, that is, between the range A and B, the state of the virtual machine is normal.
[0047] In this way, after determining the load status of the virtual machine, a capacity expansion suggestion or capacity reduction suggestion related to the load status of the virtual machine can be directly given according to the load status of the virtual machine, or the virtual machine can be directly instructed to expand or reduce capacity, which can not only save manpower and time costs, but also avoid the embarrassing situation of urgently needing to remedy the situation after the resource expansion or reduction alarm occurs.
[0048] Again, step S130 is involved. After the load status of the virtual machine is determined, the data type of the load data of the virtual machine is determined according to the load status of the virtual machine. The data type includes a fluctuating type, a stable type, or a periodic type. Exemplarily, when the load status of the virtual machine is normal, it can be determined that the data type of the virtual machine is a fluctuating type, or it can be determined that the data type of the virtual machine is a stable type or a periodic type.
[0049] Then, step S140 is involved. When it is determined that the data type of the virtual machine is a fluctuating type, the bearer data of the fluctuating data type can be input into the first training model to obtain the predicted value of the bearer data within a preset time period. Among them, the first training model can be a back propagation (BP) neural network training model, and the BP neural network training model is a training model obtained by pre-training the BP neural network, which is not limited here. The preset time period is a time period that can be customized according to production needs, for example, one month, three months or one year. The predicted value of the bearer data refers to the value of the bearer data of the virtual machine in the future period of time, which is used to determine the bearer status of the virtual machine.
[0050] Exemplarily, when it is determined that the data type of the CPU data of the virtual machine is a fluctuating type, the CPU data may be input into a BP neural network training model to obtain the load-bearing data of the virtual machine in the next month.
[0051] Alternatively, in step S150, when it is determined that the data type of the virtual machine's bearer data is a stable type, the bearer data of the virtual machine whose data type is a stable type is input into a second training model to obtain a predicted value of the bearer data within a preset time period. The second training model may be a holt_winters algorithm training model obtained through pre-training, which is not limited here.
[0052] Exemplarily, when it is determined that the data type of the memory data of the virtual machine is a stable type, the memory data with a stable data type can be input into a pre-trained holt_winters algorithm training model to obtain the memory data of the virtual machine within the next year.
[0053] Alternatively, in step S160, when it is determined that the data type of the virtual machine's bearer data is periodic, the bearer data of the virtual machine whose data type is periodic is input into a third training model to obtain a predicted value of the bearer data within a preset time period. The third training model may be a pre-trained Long Short-Term Memory (LSTM) algorithm training model, which is not limited here.
[0054] Exemplarily, when it is determined that the data type of the storage data of the virtual machine is periodic, the storage data with periodic data type can be input into a pre-trained LSTM algorithm training model to obtain the storage data of the virtual machine in the next three months.
[0055] Based on this, the above-mentioned step S130, such as Figure 2 Specifically, it may include: step S1301 to step S1308.
[0056] Step S1301, obtaining multiple bearer data sets of the virtual machine.
[0057] Here, the bearer data set refers to a bearer data set of multiple bearer data of the virtual machine obtained by dividing the bearer data of the virtual machine by a preset time unit. For example, it can be a day unit or a week unit. Exemplarily, when the bearer status of the virtual machine is normal, the bearer data of the virtual machine obtained is divided by a day unit to obtain n data sets. No excessive restrictions are made here.
[0058] Step S1302: Calculate similarities of multiple bearer data sets according to the bearer data in the multiple bearer data sets.
[0059] Exemplarily, the similarity of each bearer data set can be calculated based on the bearer data in multiple bearer data sets using a dynamic time warping (DTW) algorithm, or other methods can be used to calculate the similarity of each bearer data set, which is not limited here.
[0060] Step S1303: determine the number of bearer data sets whose similarity is greater than a third threshold.
[0061] The third threshold is a threshold set based on experience to divide bearer data sets with high similarity, and the number of bearer data sets with high similarity can be determined based on the third threshold. Exemplarily, when the third threshold is set to X, the number of bearer data sets with similarity greater than the threshold X in multiple bearer data sets can be counted.
[0062] Step S1304 determines whether the number of the bearer quantity set is less than a fourth threshold. If yes, execute step S1305; if no, execute step S1306.
[0063] Specifically, the fourth threshold is a threshold used to distinguish the data type of the data in the data set according to the number of the data set. Where n is a positive integer, representing n data sets.
[0064] Step S1305: determine that the data type of the bearer data in the bearer data set is a fluctuating type.
[0065] Step S1306, determine whether the coefficient of variation of the bearing data set meets the preset condition. If yes, execute step S1307, if not, execute step S1308.
[0066] Here, the coefficient of variation is a normalized measure of the dispersion of the probability distribution, which is defined as the ratio of the standard deviation to the mean, that is: The default condition is whether it is less than Wherein σ is the standard deviation between the respective carrying data of the multiple carrying data sets, and μ is the average value of the respective carrying data of the multiple carrying data sets.
[0067] Step S1307: determine that the data type of the bearer data in the bearer data set is a periodic type.
[0068] Step S1308: Determine whether the data type of the bearer data in the bearer data set is a stationary type.
[0069] It should be noted that after determining the data type of the carried data, it is necessary to further select the corresponding training model according to the different data types of the carried data to obtain the carried data of the virtual machine for the preset time period to prevent the inability to accurately obtain the carried data of the virtual machine for the preset time period due to the difference in the data type of the carried data.
[0070] In addition to the above steps, in one embodiment, the above step S160, such as Figure 3 Specifically, it may include steps S1601 to S1607.
[0071] Step S1601, obtaining multiple daily period data sets.
[0072] The daily periodic data set refers to a data set containing multiple periodic data in units of days.
[0073] Step S1602: obtaining a frequency graph of the plurality of daily cycle data sets according to the plurality of daily cycle data sets and the daily cycle data frequencies.
[0074] Specifically, a frequency graph of the multiple daily cycle data sets is obtained according to the multiple daily cycle data sets and the daily cycle data frequencies, wherein the daily cycle data frequencies can be obtained based on the statistics of the multiple daily cycle data sets, which is not limited too much here.
[0075] Step S1603, determining the number of peaks of the daily cycle data according to the frequency diagram.
[0076] Step S1604: determining a threshold for dividing the busy time period and the idle time period of the data processed by the virtual machine according to the number of peaks.
[0077] Here, the busy time period refers to a time period when the data of the virtual machine continuously reaches a certain load, and the idle time period refers to a time period when the data of the virtual machine cannot reach a certain load.
[0078] Exemplarily, when the number of peaks is equal to 1, the daily cycle data corresponding to the preset range in the plurality of daily cycle data sets can be determined as the threshold for dividing the busy time period and the idle time period. When the number of peaks is greater than 1, the daily cycle data corresponding to the first trough in the frequency graph is determined as the threshold for dividing the busy time period and the idle time period. The time period corresponding to the daily cycle data greater than the threshold is the busy time period, and the time period corresponding to the daily cycle data less than the threshold is the idle time period.
[0079] In a specific example, when the number of peaks is equal to 1, assuming that daily cycle data A, B, C, and D are arranged in a certain order, and the preset range is set to 75%, the total number of daily cycle data is multiplied by 75% to obtain the number 3. The third daily cycle data C in the daily cycle data arranged in a certain order is the threshold for dividing the busy time period and the idle time period. The daily cycle data can be arranged in order from small to large, or in order from large to small. There are no excessive restrictions on the arrangement order of the daily cycle data.
[0080] When the number of peaks is greater than 1, the frequency graph has multiple troughs. Assuming that the daily cycle data corresponding to the first trough is A, the daily cycle data A is the threshold for dividing the busy time period and the idle time period.
[0081] Step S1605, determining the busy time period and the idle time period according to the threshold.
[0082] Specifically, the time period corresponding to the multiple daily cycles greater than the threshold is the busy time period, and the time period corresponding to the multiple daily cycles less than the threshold is the idle time period.
[0083] Step S1606, determining a target busy time period and a target idle time period according to the number of occurrences of the busy time period and the idle time period in the plurality of daily cycle data sets.
[0084] Specifically, according to the number of occurrences of busy time periods and idle time periods in multiple daily periodic data sets, the target busy time period and the target idle time period are determined, wherein the target busy time period refers to the time period during which the data of the finally determined virtual machine continuously reaches a certain load, and the target idle time period refers to the time period during which the data of the finally determined virtual machine cannot reach a certain load.
[0085] In one embodiment, 9:15 am on February 28, 2021 to 11:45 am on February 28, 2021 is a time period greater than the threshold, and 11:45 am on February 28, 2021 to 13:30 pm on February 28, 2021 is another time period greater than the threshold. Then the two time periods of 9:15 on February 28, 2021 to 11:45 on February 28, 2021 and 11:45 on February 28, 2021 to 13:30 on February 28, 2021 are the initial busy time periods, but the so-called periodic target busy time period we expect is 9:15 to 11:45, and the target idle time period is 11:45 to 13:30. First, we need to remove the date of the time period. Assuming that we have collected 91 days of daily cycle data, the time period of 9:15 to 11:45 appears 46 times or more in this list greater than the threshold, then we can consider this time interval as the target busy time period; if it only appears 45 times or less, then we can consider this time interval as the target idle time period. According to the principle of minority obeys majority, the number of occurrences of busy time periods and idle time periods in multiple daily cycle data sets is used to determine the target busy time period and target idle time period.
[0086] Step S1607, input the target busy time period and the target idle time period into the LSTM algorithm training model to obtain the predicted value of the bearing data within the preset time period.
[0087] When the data type is periodic, the determined target busy time period and target idle time period are marked and input into a pre-trained LSTM algorithm training model to calculate the load-bearing data based on the virtual machine in a future period of time.
[0088] Based on the same inventive concept, the embodiment of the present application also provides a device for predicting the virtual machine load status. Figure 4 Provide explanation.
[0089] Figure 4 It is a structural diagram of a device for predicting the load status of a virtual machine provided in an embodiment of the present application.
[0090] like Figure 4 As shown, the prediction device for the virtual machine bearing state may include: an acquisition module 410 , a determination module 420 and a calculation module 430 .
[0091] Wherein, the acquisition module 410 is used to obtain the bearer data of the virtual machine;
[0092] A determination module 420, configured to determine the bearer status of the virtual machine according to the bearer data;
[0093] The determination module 420 is further used to determine the data type of the bearer data based on the bearer status of the virtual machine, and the data type includes a fluctuating type, a stable type or a periodic type;
[0094] A calculation module 430, configured to calculate a predicted value of load bearing data within a preset time period using a first training model when the data type is a fluctuating type;
[0095] The calculation module 430 is further used to calculate the predicted value of the bearing data within a preset time period using the second training model when the data type is a stable type;
[0096] The calculation module 430 is further used to calculate the predicted value of the bearing data within a preset time period using the third training model when the data type is a periodic type;
[0097] The load data prediction value is used to determine the load status of the virtual machine.
[0098] In some embodiments, the acquisition module 410 specifically includes:
[0099] The first acquisition unit is used to complete the default value of the historical load-bearing data of the virtual machine by using the nearest neighbor interpolation method to acquire the load-bearing data of the virtual machine.
[0100] In some embodiments, the determination module 420 specifically includes:
[0101] A first determining unit, configured to determine that the load state of the virtual machine is a state to be expanded when the load data within a preset range is greater than a first threshold;
[0102] A second determining unit, configured to determine that the load state of the virtual machine is a to-be-reduced state when the load data within a preset range is less than a second threshold;
[0103] The third determining unit is configured to determine that the load status of the virtual machine is normal when the load data within a preset range exists between a first threshold and a second threshold, wherein the first threshold is smaller than the second threshold.
[0104] In some embodiments, the determination module 420 further includes:
[0105] A second acquisition unit, configured to acquire multiple bearer data sets of the virtual machine when the bearer state of the virtual machine is normal;
[0106] A similarity calculation unit, used for calculating the similarity of multiple bearer data sets according to the bearer data in the multiple bearer data sets;
[0107] a fourth determining unit, configured to determine the number of bearer data sets having a similarity greater than a third threshold;
[0108] A fifth determining unit, configured to determine that the data type of the bearer data in the bearer data set is a fluctuating type when the number of the bearer data set is less than a fourth threshold;
[0109] a judging unit, configured to judge whether a coefficient of variation of the bearer data set satisfies a preset condition when the number of the bearer data set is greater than a fourth threshold;
[0110] A sixth determining unit, configured to determine that the data type of the bearer data in the bearer data set is a periodic type when the coefficient of variation satisfies a preset condition;
[0111] The seventh determination unit is used to determine that the data type of the data in the data set is a stationary type when the coefficient of variation does not meet the preset condition.
[0112] In some embodiments, the calculation module 430 specifically includes:
[0113] A third acquisition unit is used to acquire multiple daily period data sets;
[0114] A fourth acquisition unit, configured to obtain a frequency graph of the plurality of daily cycle data sets according to the plurality of daily cycle data sets and the daily cycle data frequencies;
[0115] An eighth determination unit, configured to determine the number of peaks of the daily cycle data according to the frequency graph;
[0116] A ninth determining unit, configured to determine a threshold for dividing a busy time period and an idle time period of data processed by the virtual machine according to the number of peaks;
[0117] A tenth determining unit, configured to determine a busy time period and an idle time period according to a threshold;
[0118] an eleventh determination unit, configured to determine a target busy time period and a target idle time period according to the number of occurrences of the busy time period and the idle time period in a plurality of daily cycle data sets;
[0119] The first calculation unit is used to input the target busy time period and the target idle time period into the LSTM algorithm training model to obtain the load data prediction value within the preset time period.
[0120] In some embodiments, the ninth determining unit further includes:
[0121] A first threshold determination subunit is used to determine, when the number of peaks is equal to 1, a first preset range of daily cycle data in a plurality of daily cycle data sets as a threshold for dividing a busy time period and a non-busy time period;
[0122] The second threshold determination subunit is used to determine the daily cycle data corresponding to the first trough in the frequency graph as the threshold for dividing the busy time period and the idle time period when the number of frequency peaks is greater than 1.
[0123] The embodiment of the present application determines the load status of the virtual machine by acquiring the load data of the virtual machine, and then determines whether the load data is fluctuating data, stable data or periodic data according to the load status of the virtual machine. After determining the data type of the load data, different training models are selected according to the different data types of the load data to calculate the load data prediction value of the virtual machine within a preset time period. In this way, the corresponding training model can be selected according to the data type of the load data of the virtual machine, thereby accurately predicting the load data of the virtual machine in a period of time in the future.
[0124] Figure 5 It is a structural diagram of a virtual machine bearing state prediction device provided in an embodiment of the present application.
[0125] like Figure 5 As shown, the prediction device 500 for virtual machine data bearing in this embodiment includes an input device 501, an input interface 502, a central processing unit 503, a memory 504, an output interface 505, and an output device 506. Among them, the input interface 502, the central processing unit 503, the memory 504, and the output interface 505 are interconnected through a bus 510, and the input device 501 and the output device 506 are connected to the bus 510 through the input interface 502 and the output interface 505, respectively, and then connected to other components of the information acquisition device 500.
[0126] Specifically, the input device 501 receives input information from the outside and transmits the input information to the central processing unit 503 through the input interface 502; the central processing unit 503 processes the input information based on the computer executable instructions stored in the memory 504 to generate output information, temporarily or permanently stores the output information in the memory 504, and then transmits the output information to the output device 506 through the output interface 505; the output device 506 outputs the output information to the outside of the information acquisition device 500 for user use.
[0127] In one embodiment, Figure 5 The virtual machine load state prediction device 500 shown includes: a memory 504, which is used to store programs; a processor 503, which is used to run the programs stored in the memory to execute the embodiments of the present application. Figure 1 or Figure 2 The method of the illustrated embodiment.
[0128] The present application also provides a computer-readable storage medium on which computer program instructions are stored; when the computer program instructions are executed by a processor, the present application also provides a computer-readable storage medium on which computer program instructions are stored; Figure 1 or Figure 2 The method of the illustrated embodiment.
[0129] It should be clear that the present application is not limited to the specific configuration and processing described above and shown in the figures. For the sake of simplicity, a detailed description of the known method is omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present application is not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications and additions, or change the order between the steps after understanding the spirit of the present application.
[0130] The functional blocks shown in the above structural block diagram can be implemented as hardware, software, firmware or a combination thereof. When implemented in hardware, it can be, for example, an electronic circuit, an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), appropriate firmware, plug-in, function card, etc. When implemented in software, the elements of the present application are programs or code segments used to perform the required tasks. The program or code segment can be stored in a machine-readable medium, or transmitted on a transmission medium or communication link by a data signal carried in a carrier. "Machine-readable medium" may include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, read-only memory (Read-Only Memory, ROM), flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, optical fiber media, radio frequency (Radio Frequency, RF) links, etc. The code segment can be downloaded via a computer network such as the Internet, an intranet, etc.
[0131] It should also be noted that the exemplary embodiments mentioned in this application describe some methods or systems based on a series of steps or devices. However, this application is not limited to the order of the above steps, that is, the steps can be performed in the order mentioned in the embodiment, or in a different order from the embodiment, or several steps can be performed simultaneously.
[0132] The above is only a specific implementation of the present application. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the systems, modules and units described above can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here. It should be understood that the protection scope of the present application is not limited to this. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in this application, and these modifications or replacements should be included in the protection scope of this application.
Claims
1. A method for predicting a virtual machine load status, characterized in that: include: Get the bearer data of the virtual machine; Determine the bearer status of the virtual machine according to the bearer data; Determine a data type of the bearer data based on the bearer status of the virtual machine, the data type including a fluctuating type, a stable type or a periodic type; In the case where the data type is a fluctuating type, using the first training model to calculate a predicted value of the load-bearing data within a preset time period; When the data type is a stationary type, using a second training model to calculate a predicted value of the load-bearing data within the preset time period; In the case where the data type is a periodic type, using a third training model to calculate a predicted value of the bearer data within the preset time period; Wherein, the load data prediction value is used to determine the load status of the virtual machine; The determining the bearing state of the virtual machine according to the bearing data includes: When the load data within the preset range is greater than a first threshold, determining that the load state of the virtual machine is a state to be expanded; When the load data within the preset range is less than a second threshold, determining that the load state of the virtual machine is a state to be shrunk; In a case where the bearer data within the preset range exists between the first threshold and the second threshold, determining that the bearer state of the virtual machine is a normal state, wherein the first threshold is less than the second threshold; The determining the data type of the bearer data based on the bearer state of the virtual machine includes: When the load bearing state of the virtual machine is normal, obtaining multiple load bearing data sets of the virtual machine; Calculating similarities of the multiple bearer data sets according to the bearer data in the multiple bearer data sets; Determining the number of bearer data sets whose similarity is greater than a third threshold; When the number of the bearer data set is less than a fourth threshold, determining that the data type of the bearer data in the bearer data set is a fluctuating type; When the number of the bearer data set is greater than the fourth threshold, determining whether the coefficient of variation of the bearer data set meets a preset condition; When the coefficient of variation satisfies a preset condition, determining that the data type of the bearer data in the bearer data set is a periodic type; When the coefficient of variation does not satisfy a preset condition, it is determined that the data type of the bearer data in the bearer data set is a stationary type.
2. The method according to claim 1, characterized in that The obtaining of the bearer data of the virtual machine includes: The default value of the historical load-bearing data of the virtual machine is supplemented by using the nearest neighbor interpolation method to obtain the load-bearing data of the virtual machine.
3. The method according to claim 1, characterized in that When the data type is a periodic type, calculating the predicted value of the bearer data within the preset time period by using a third training model includes: Get multiple daily period data sets; Obtaining a frequency graph of the plurality of daily cycle data sets according to the plurality of daily cycle data sets and the daily cycle data frequencies; Determining the number of peaks of the daily cycle data according to the frequency graph; Determine, according to the number of peaks, a threshold for dividing the busy time period and the idle time period of the data processed by the virtual machine; Determine the busy time period and the idle time period according to the threshold; Determine a target busy time period and a target idle time period according to the number of occurrences of the busy time period and the idle time period in the plurality of daily periodic data sets; The target busy time period and the target idle time period are input into the LSTM algorithm training model to obtain the predicted value of the load-bearing data within the preset time period.
4. The method according to claim 3, characterized in that Determining the threshold for dividing the busy time period and the idle time period according to the number of peaks includes: When the number of peaks is equal to 1, determining the daily cycle data of a first preset range in the plurality of daily cycle data sets as the threshold for dividing the busy time period and the idle time period; When the number of wave peaks is greater than 1, the daily cycle data corresponding to the first wave valley in the frequency graph is determined as the threshold for dividing the busy time period and the idle time period.
5. A device for predicting a virtual machine load status, characterized in that: The device comprises: An acquisition module, used to acquire the bearer data of the virtual machine; A determination module, configured to determine the bearer status of the virtual machine according to the bearer data; The determination module is further used to determine the data type of the bearer data based on the bearer status of the virtual machine, and the data type includes a fluctuating type, a stable type or a periodic type; A calculation module, configured to calculate a predicted value of the load-bearing data within a preset time period using a first training model when the data type is a fluctuating type; The calculation module is further configured to calculate the predicted value of the bearing data within the preset time period by using the second training model when the data type is a stationary type; The calculation module is further used to calculate the predicted value of the load-bearing data within the preset time period by using a long short-term memory network LSTM algorithm training model when the data type is a periodic type; Wherein, the load data prediction value is used to determine the load status of the virtual machine; The determination module comprises: A first determining unit, configured to determine that the load status of the virtual machine is a state to be expanded when the load data within a preset range is greater than a first threshold; A second determining unit, configured to determine that the load status of the virtual machine is a waiting-to-shrink state when the load data within the preset range is less than a second threshold; A third determining unit, configured to determine that the bearer state of the virtual machine is a normal state when the bearer data within the preset range exists between the first threshold and the second threshold, wherein the first threshold is less than the second threshold; The determining module further includes: A second acquisition unit, configured to acquire, when the load bearing state of the virtual machine is normal, a plurality of load bearing data sets of the virtual machine; A similarity calculation unit, configured to calculate similarities of the multiple bearer data sets according to the bearer data in the multiple bearer data sets; a fourth determining unit, configured to determine the number of bearer data sets whose similarity is greater than a third threshold; A fifth determining unit, configured to determine, when the number of the bearer data set is less than a fourth threshold, that the data type of the bearer data in the bearer data set is a fluctuating type; a judging unit, configured to judge whether a coefficient of variation of the bearer data set satisfies a preset condition when the number of the bearer data set is greater than the fourth threshold; A sixth determining unit, configured to determine that the data type of the bearer data in the bearer data set is a periodic type when the coefficient of variation satisfies a preset condition; The seventh determining unit is used to determine that the data type of the bearer data in the bearer data set is a stationary type when the coefficient of variation does not meet a preset condition.
6. The device according to claim 5, characterized in that The acquisition module specifically includes: The first acquisition unit is used to complete the default value of the historical data of the virtual machine by using the nearest neighbor interpolation method to acquire the data of the virtual machine.
7. A device for predicting the load status of a virtual machine, characterized in that: The device comprises: a processor and a memory storing computer program instructions; The processor reads and executes the computer program instructions to implement the method for predicting the virtual machine bearing state according to any one of claims 1 to 4.
8. A computer storage medium, characterized in that The computer storage medium stores computer program instructions, and when the computer program instructions are executed by a processor, the method for predicting the virtual machine bearing state according to any one of claims 1 to 4 is implemented.
Citation Information
Patent Citations
Virtual machine deployment method and device, electronic equipment and storage medium thereof
CN111538560A
Data processing method and device and storage medium
CN111831389A
Automated scaling of resources based on LSTM-RNN and attention mechanisms
CN112015543A
