Resource scheduling method, device, equipment and readable storage medium
By acquiring monitoring data and cloud resource nodes, using multiple models for data prediction and resource scoring, combining cloud virtual machines with unbalanced resources, allocating target resource nodes, and forming resource scheduling solutions, solving the problem of cloud platform resource optimization scheduling and improving resource utilization.
Patent Information
- Application Number
- CN202111070249.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-13
- Publication Date
- 2025-03-11
- Estimated Expiration
- 2041-09-13
AI Technical Summary
On the cloud platform, how to achieve optimized scheduling of cloud resources is to ensure the stable operation of the business system, and to reduce the operating costs of the cloud platform.
By acquiring monitoring data and cloud resource nodes, using STL model, linear regression model and GRU model for data prediction and resource scoring, combining cloud virtual machines with unbalanced resources, allocating target resource nodes, and forming a resource scheduling scheme.
It realizes the optimization scheduling of cloud platform resources while meeting the complex constraints of cloud platform and cloud applications, and improves the resource utilization rate of cloud platform.
Smart Images

Figure CN113886006B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of resource scheduling, and in particular to a resource scheduling method, device, equipment and readable storage medium. Background Art
[0002] As cloud computing technology matures, enterprises have begun to push business systems to the cloud to achieve flexible management and reduce operating costs. In the process of pushing business systems to the cloud, cloud platform operation and maintenance personnel are also facing more challenges. In terms of business systems, they need to provide business systems with resource services that meet their needs on the cloud platform to ensure the stable operation of the business system. In terms of cloud platforms, they also need to maintain reasonable resource utilization during the operation of the cloud platform to reduce the operating costs of the cloud platform. Therefore, how to achieve optimal scheduling of cloud platform resources has always been the research focus in the operation and maintenance of enterprise cloud platforms. Summary of the invention
[0003] The object of the present invention is to provide a resource scheduling method, device, equipment and readable storage medium to improve the above-mentioned problem.
[0004] In order to achieve the above objectives, the present application provides the following technical solutions:
[0005] On the one hand, an embodiment of the present application provides a resource scheduling method, the method comprising:
[0006] Acquire monitoring data and cloud resource nodes, wherein the monitoring data includes monitoring data of each indicator of each type of resource on each cloud virtual machine within a statistical period, and the cloud resource node is a cloud resource node that hosts the cloud virtual machine;
[0007] Obtaining a usage measurement value of each type of the resource on each of the cloud virtual machines according to the monitoring data;
[0008] Obtaining at least one cloud virtual machine combination according to the usage measurement value;
[0009] According to the cloud virtual machine combination and the cloud resource nodes, a target resource node is allocated to the cloud virtual machine combination to form a resource scheduling solution.
[0010] Optionally, obtaining the usage measurement value of each type of the resource on each of the cloud virtual machines according to the monitoring data includes:
[0011] Sorting the monitoring data of each indicator of each type of resource on each cloud virtual machine in chronological order to obtain a historical time series of each indicator of each type of resource on each cloud virtual machine;
[0012] Decomposing the historical time series of each indicator of each type of resource on each cloud virtual machine using the STL model to obtain a decomposed sequence, and obtaining a predicted time series of each indicator of each type of resource on each cloud virtual machine based on the decomposed sequence;
[0013] Based on the historical time series of each indicator of each type of resource on each cloud virtual machine and the predicted time series of each indicator of each type of resource on each cloud virtual machine, a usage measurement value of each type of resource on each cloud virtual machine is obtained.
[0014] Optionally, the using of the STL model to decompose the historical time series of each indicator of each type of resource on each cloud virtual machine to obtain a decomposed sequence, and obtaining a predicted time series of each indicator of each type of resource on each cloud virtual machine based on the decomposed sequence includes:
[0015] Decomposing the historical time series of each indicator of each type of resource on each cloud virtual machine using the STL model to obtain a trend series and a periodic series of each indicator of each type of resource on each cloud virtual machine;
[0016] A linear regression model is used to predict and analyze the trend sequence of each indicator of each type of resource on each cloud virtual machine to obtain a first prediction sequence, and a GRU model is used to predict and analyze the periodic sequence of each indicator of each type of resource on each cloud virtual machine to obtain a second prediction sequence;
[0017] The first prediction sequence and the second prediction sequence are added together to obtain a prediction time series of each indicator of each type of resource on each cloud virtual machine.
[0018] Optionally, obtaining at least one cloud virtual machine combination according to the usage measurement value includes:
[0019] According to the usage measurement value of each type of the resource on each of the cloud virtual machines, obtaining the usage measurement value of each type of the resource on each of the cloud virtual machines after dimensionless processing;
[0020] Analyze the dimensionless usage measurement values of each type of the resources on each of the cloud virtual machines, and select the maximum absolute value thereof as the ranking value of each of the cloud virtual machines;
[0021] Based on the ranking value of each cloud virtual machine, a combination analysis is performed on all the cloud virtual machines, the combination analysis includes comparing the ranking value of each cloud virtual machine to obtain the cloud virtual machine with the largest ranking value, combining the cloud virtual machine with the largest ranking value with other cloud virtual machines to obtain multiple initial cloud virtual machine combinations, adding the absolute values of the dimensionless usage measurement values of each type of the resources of each initial cloud virtual machine combination to obtain the sum of the absolute values of the usage measurement of each initial cloud virtual machine combination, and selecting the initial cloud virtual machine combination with the smallest sum of the absolute values of the usage measurement as a new virtual machine;
[0022] The new virtual machine and the uncombined cloud virtual machines are combined and analyzed again to finally obtain at least one cloud virtual machine combination.
[0023] Optionally, obtaining the dimensionless usage measurement value of each type of the resource on each of the cloud virtual machines according to the usage measurement value of each type of the resource on each of the cloud virtual machines includes:
[0024] The usage measurement values of the same type of resources on all the cloud virtual machines are aggregated to obtain a usage measurement value set of the same type of resources, and an average value of the usage measurement value set of the same type of resources is calculated to obtain an average resource usage measurement value of each type of resource;
[0025] Aggregating the usage measurement values of the same type of resources on all the cloud virtual machines to obtain a usage measurement value set of the same type of resources, and selecting the maximum and minimum values in the usage measurement value set of the same type of resources;
[0026] The dimensionless usage metric value of each type of resource on each of the cloud virtual machines is calculated based on the average usage metric value of each type of resource, the maximum value in the usage metric value set of the same type of resources, and the minimum value in the usage metric value set of the same type of resources.
[0027] Optionally, allocating a target resource node to the cloud virtual machine combination according to the cloud virtual machine combination and the cloud resource node to form a resource scheduling scheme includes:
[0028] Calculate the sum of the resource allocation amounts of each type of resource for each cloud virtual machine combination, and allocate the target resource node to each cloud virtual machine combination in descending order of the sum of the resource allocation amounts of each type of resource for each cloud virtual machine combination; wherein, when allocating cloud resource nodes to each cloud virtual machine combination, select the cloud resource node with the largest number of cloud virtual machines as the target resource node to be scheduled by this cloud virtual machine combination.
[0029] Optionally, allocating a target resource node to the cloud virtual machine combination according to the cloud virtual machine combination and the cloud resource node to form a resource scheduling scheme includes:
[0030] Calculate the sum of the resource allocation amounts of each type of resource and the sum of the usage amounts of each type of resource for each cloud virtual machine combination, and allocate cloud resource nodes to each cloud virtual machine combination in turn according to the size of the sum of the resource allocation amounts of each type of resource for each cloud virtual machine combination; wherein, when allocating a target resource node to each cloud virtual machine combination, if multiple cloud resource nodes have the same number of cloud virtual machines as the cloud virtual machine combination, then select the cloud resource node with the highest cloud virtual machine resource allocation amount as the target resource node; if the cloud virtual machine resource allocation amounts of the cloud resource nodes are still the same, then select the cloud resource node with the highest cloud virtual machine resource usage as the target resource node.
[0031] In a second aspect, an embodiment of the present application provides a resource scheduling device, which includes an acquisition module, a first calculation module, a second calculation module and an allocation module.
[0032] The acquisition module is used to acquire monitoring data and cloud resource nodes, wherein the monitoring data includes monitoring data of each indicator of each type of resource on each cloud virtual machine within a statistical period, and the cloud resource node is a cloud resource node that carries the cloud virtual machine;
[0033] The first computing module is used to obtain a usage measurement value of each type of resource on each of the cloud virtual machines according to the monitoring data;
[0034] The second computing module is used to obtain at least one cloud virtual machine combination according to the usage measurement value;
[0035] The allocation module is used to allocate target resource nodes to the cloud virtual machine combination according to the cloud virtual machine combination and the cloud resource nodes to form a resource scheduling solution.
[0036] Optionally, the first computing module includes:
[0037] A sorting unit, used to sort the monitoring data of each indicator of each type of resource on each cloud virtual machine in chronological order to obtain a historical time series of each indicator of each type of resource on each cloud virtual machine;
[0038] A decomposition unit, used to decompose the historical time series of each indicator of each type of resource on each cloud virtual machine using an STL model to obtain a decomposed sequence, and obtain a predicted time series of each indicator of each type of resource on each cloud virtual machine based on the decomposed sequence;
[0039] The first computing unit is used to obtain the usage measurement value of each type of resource on each cloud virtual machine based on the historical time series of each indicator of each type of resource on each cloud virtual machine and the predicted time series of each indicator of each type of resource on each cloud virtual machine.
[0040] Optionally, the decomposition unit includes:
[0041] A decomposition subunit, used to decompose the historical time series of each indicator of each type of resource on each cloud virtual machine using the STL model to obtain a trend series and a periodic series of each indicator of each type of resource on each cloud virtual machine;
[0042] An analysis subunit is used to predict and analyze the trend sequence of each indicator of each type of resource on each cloud virtual machine using a linear regression model to obtain a first prediction sequence, and to predict and analyze the periodic sequence of each indicator of each type of resource on each cloud virtual machine using a GRU model to obtain a second prediction sequence;
[0043] The first calculation subunit is used to add the first prediction sequence and the second prediction sequence to obtain a prediction time series of each indicator of each type of resource on each cloud virtual machine.
[0044] Optionally, the second computing module includes:
[0045] A second calculation unit is used to obtain the dimensionless usage measurement value of each type of the resource on each of the cloud virtual machines according to the usage measurement value of each type of the resource on each of the cloud virtual machines;
[0046] A selection unit is used to analyze the dimensionless usage measurement values of each type of the resources on each of the cloud virtual machines, and select the maximum absolute value thereof as the ranking value of each of the cloud virtual machines;
[0047] A first combination unit is used to perform a combination analysis on all the cloud virtual machines based on the ranking value of each of the cloud virtual machines, the combination analysis comprising comparing the ranking value of each of the cloud virtual machines to obtain the cloud virtual machine with the largest ranking value, combining the cloud virtual machine with the largest ranking value with other cloud virtual machines to obtain multiple initial cloud virtual machine combinations, adding the absolute values of the dimensionless usage metric values of each type of the resources of each initial cloud virtual machine combination to obtain the sum of the absolute values of the usage metrics of each initial cloud virtual machine combination, and selecting the initial cloud virtual machine combination with the smallest sum of the absolute values of the usage metrics as a new virtual machine;
[0048] The second combining unit is used to combine and analyze the new virtual machine with the uncombined cloud virtual machines again, and finally obtain at least one cloud virtual machine combination.
[0049] Optionally, the second computing unit includes:
[0050] The second calculation subunit is used to aggregate the usage measurement values of the same type of resources on all the cloud virtual machines to obtain a usage measurement value set of the same type of resources, and calculate the average value of the usage measurement value set of the same type of resources to obtain an average resource usage measurement value of each type of resource;
[0051] A selection subunit is used to aggregate the usage measurement values of the same type of resources on all the cloud virtual machines to obtain a usage measurement value set of the same type of resources, and select a maximum value and a minimum value in the usage measurement value set of the same type of resources;
[0052] The third calculation sub-unit is used to calculate the dimensionless usage measurement value of each type of resource on each of the cloud virtual machines based on the average resource usage measurement value of each type of resources, the maximum value in the usage measurement value set of the same type of resources, and the minimum value in the usage measurement value set of the same type of resources.
[0053] Optionally, the allocation module includes:
[0054] The third calculation unit is used to calculate the sum of the resource allocation amounts of each type of resource of each cloud virtual machine combination, and allocate the target resource node to each cloud virtual machine combination in descending order of the sum of the resource allocation amounts of each type of resource of each cloud virtual machine combination; wherein, when allocating cloud resource nodes to each cloud virtual machine combination, the cloud resource node with the largest number of the same cloud virtual machines is selected as the target resource node to be scheduled by this cloud virtual machine combination.
[0055] Optionally, the allocation module includes:
[0056] The fourth calculation unit is used to calculate the sum of the resource allocation amounts of each type of resources and the sum of the usage amounts of each type of resources of each cloud virtual machine combination, and allocate cloud resource nodes to each cloud virtual machine combination in turn according to the size of the sum of the resource allocation amounts of each type of resources of each cloud virtual machine combination; wherein, when allocating a target resource node to each cloud virtual machine combination, if multiple cloud resource nodes have the same number of cloud virtual machines as the cloud virtual machine combination, the cloud resource node with the highest cloud virtual machine resource allocation amount is selected as the target resource node; if the cloud virtual machine resource allocation amounts of the cloud resource nodes are still the same, the cloud resource node with the highest cloud virtual machine resource usage is selected as the target resource node.
[0057] In a third aspect, an embodiment of the present application provides a resource scheduling device, the device comprising a memory and a processor. The memory is used to store a computer program; the processor is used to implement the steps of the above resource scheduling method when executing the computer program.
[0058] In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the above-mentioned resource scheduling method are implemented.
[0059] The beneficial effects of the present invention are:
[0060] The present invention uses STL model, linear regression model, GRU model analysis to predict data and extract peak values, uses dimensionless processing to achieve unified scoring of multiple types of resource data, achieves resource rebalancing by combining cloud virtual machines with unbalanced resources, maintains satisfaction of cloud platform constraints and application constraints through constraint analysis, matches the status of cloud resource nodes with scheduling analysis results, and reduces the specific scheduling steps required for scheduling schemes. This method can achieve optimal scheduling of cloud platform resources and improve cloud platform resource utilization under the premise of satisfying complex constraints of cloud platforms and cloud applications.
[0061] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or be understood by implementing the embodiments of the present invention. The purpose and other advantages of the present invention can be realized and obtained by the structures particularly pointed out in the written description, claims, and drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0062] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.
[0063] Figure 1 It is a schematic diagram of a resource scheduling method flow in an embodiment of the present invention;
[0064] Figure 2 It is a schematic diagram of the structure of a resource scheduling device described in an embodiment of the present invention;
[0065] Figure 3 It is a schematic diagram of the structure of a resource scheduling device described in an embodiment of the present invention. DETAILED DESCRIPTION
[0066] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all of the embodiments. The components of the embodiments of the present invention generally described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present invention provided in the drawings is not intended to limit the scope of the claimed invention, but merely represents selected embodiments of the present invention. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0067] It should be noted that similar reference numerals or letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in the subsequent drawings. At the same time, in the description of the present invention, the terms "first", "second", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.
[0068] Example 1
[0069] like Figure 1 As shown, this embodiment provides a resource scheduling method, which includes step S1, step S2, step S3 and step S4.
[0070] Step S1, obtaining monitoring data and cloud resource nodes, wherein the monitoring data includes monitoring data of each indicator of each type of resource on each cloud virtual machine within a statistical period, and the cloud resource node is a cloud resource node that carries the cloud virtual machine;
[0071] Step S2: obtaining a usage measurement value of each type of resource on each of the cloud virtual machines according to the monitoring data;
[0072] Step S3: obtaining at least one cloud virtual machine combination according to the usage measurement value;
[0073] Step S4: According to the cloud virtual machine combination and the cloud resource nodes, a target resource node is allocated to the cloud virtual machine combination to form a resource scheduling plan.
[0074] In this embodiment, by combining cloud virtual machines with unbalanced resources to achieve resource rebalancing, and then scheduling the combined cloud virtual machines, cloud platform resources can be optimized and scheduled, thereby improving cloud platform resource utilization.
[0075] In this embodiment, the resources on the cloud virtual machine include three types of resources: CPU, memory, and network. The CPU index includes CPU load or CPU utilization, the memory index includes memory utilization, and the network index includes network bandwidth utilization or network IOPS. In this embodiment, a statistical period can be one week, two weeks, one month, or two months, which can be set according to user needs.
[0076] In a specific implementation of the present disclosure, the step S2 may further include step S21, step S22 and step S23.
[0077] Step S21, sorting the monitoring data of each indicator of each type of resource on each cloud virtual machine in chronological order to obtain a historical time series of each indicator of each type of resource on each cloud virtual machine;
[0078] Step S22: Decompose the historical time series of each indicator of each type of resource on each cloud virtual machine using the STL model to obtain a decomposed sequence, and obtain a predicted time series of each indicator of each type of resource on each cloud virtual machine based on the decomposed sequence;
[0079] Step S23: obtaining a usage measurement value of each type of resource on each cloud virtual machine based on the historical time series of each indicator of each type of resource on each cloud virtual machine and the predicted time series of each indicator of each type of resource on each cloud virtual machine.
[0080] In this embodiment, a time series decomposition model (abbreviated as STL model) of local weighted regression (Seasonal-Trend decomposition procedurebased on Loess);
[0081] In this embodiment, only one indicator is considered for each type of resource of each cloud virtual machine, and the historical time series of this indicator of each type of resource and the predicted time series of this indicator of each type of resource on each cloud virtual machine are compared and analyzed, and a maximum value between the historical time series and the predicted time series is selected as the usage measurement value of each type of resource on each cloud virtual machine.
[0082] In a specific implementation of the present disclosure, the step S22 may further include step S221, step S222 and step S223.
[0083] Step S221: Decompose the historical time series of each indicator of each type of resource on each cloud virtual machine using the STL model to obtain a trend series and a periodic series of each indicator of each type of resource on each cloud virtual machine;
[0084] Step S222: Use a linear regression model to predict and analyze the trend sequence of each indicator of each type of resource on each cloud virtual machine to obtain a first prediction sequence, and use a GRU model to predict and analyze the periodic sequence of each indicator of each type of resource on each cloud virtual machine to obtain a second prediction sequence;
[0085] Step S223: Add the first prediction sequence and the second prediction sequence to obtain a prediction time series of each indicator of each type of resource on each cloud virtual machine.
[0086] In this embodiment, a gated recurrent unit (Gated Recurretn Unit) recurrent network model (GRU model for short);
[0087] In this embodiment, the historical time series of each indicator of each type of resource on each cloud virtual machine is (V 1 ,V 2 ...V n ), using the STL model to analyze the historical time series (V 1 ,V 2 ...V n ) is decomposed to obtain its trend sequence (A 1 ,A 2 ...A n ) and periodic series (P 1 ,P 2 ...P n ), and then use the linear regression model to analyze the trend series (A 1 ,A 2 ...A n ) to perform prediction analysis and obtain the prediction sequence (A n+1 , A n+2 ...A n+m ), using the GRU model for the periodic sequence (P 1 ,P 2 ...P n ) to perform prediction analysis and obtain the prediction sequence (P n+1 , P n+2 ...P n+m ), add the two result sequences together to get the complete prediction result, i.e. the prediction time series (A n+1 +P n+1 , A n+2 +P n+2 ...A n+m +P n+m ).
[0088] In a specific implementation of the present disclosure, the step S3 may further include step S31, step S32, step S33 and step S34.
[0089] Step S31, according to the usage measurement value of each type of the resource on each of the cloud virtual machines, obtain the usage measurement value of each type of the resource on each of the cloud virtual machines after dimensionless processing;
[0090] Step S32: Analyze the dimensionless usage measurement values of each type of the resources on each of the cloud virtual machines, and select the maximum absolute value as the ranking value of each of the cloud virtual machines;
[0091] Step S33: Based on the ranking value of each cloud virtual machine, a combination analysis is performed on all the cloud virtual machines, the combination analysis includes comparing the ranking value of each cloud virtual machine to obtain the cloud virtual machine with the largest ranking value, combining the cloud virtual machine with the largest ranking value with other cloud virtual machines to obtain multiple initial cloud virtual machine combinations, adding the absolute values of the dimensionless usage measurement values of each type of the resource of each initial cloud virtual machine combination to obtain the sum of the absolute values of the usage measurement of each initial cloud virtual machine combination, and selecting the initial cloud virtual machine combination with the smallest sum of the absolute values of the usage measurement as the new virtual machine;
[0092] Step S34: Combine and analyze the new virtual machine with the uncombined cloud virtual machines again, and finally obtain at least one cloud virtual machine combination.
[0093] In this embodiment, the dimensionless usage metric value of a certain type of resource on each cloud virtual machine is V', and the dimensionless usage metric values of each type of resource on a cloud virtual machine are combined to be (V' 1 , V' 2 ...V' n ), analyze V' 1 , V' 2 ...V' n The maximum absolute value of the use metric value, if V' 1 The absolute value of V' is the largest. 1 As the ranking value of this cloud virtual machine;
[0094] If four cloud virtual machines are included in this embodiment, the dimensionless usage metric values of each type of resource of the first cloud virtual machine (ie, the first cloud virtual machine) are combined to form (V' 1 , V' 2 ...V' n ), the dimensionless usage metric values of each type of resource of the second cloud virtual machine are combined together to form (V" 1 , V” 2 ...V" n), the dimensionless usage metric values of each type of resource of the third cloud virtual machine are combined together to form (V"' 1 , V'' 2 ...V"' n ), the dimensionless usage metric values of each type of resource of the fourth cloud virtual machine are combined together to be (V”) 1 , V"" 2 ...V"" n );
[0095] The ranking value of each cloud virtual machine is determined according to the above method. After determination, the four cloud virtual machines are sorted in descending order according to the ranking value. If the ranking value of the first cloud virtual machine is the largest, the first cloud virtual machine is combined with the other three cloud virtual machines to obtain combination 1 (first cloud virtual machine + second cloud virtual machine), combination 2 (first cloud virtual machine + third cloud virtual machine) and combination 3 (first cloud virtual machine + fourth cloud virtual machine); the sum of the absolute values of the dimensionless usage metrics of each type of the resource in combination 1 is calculated, and the result is: (|V' 1 +V” 1 |+|V' 2 +V” 2 |+...+|V' n +V” n |), calculate the absolute value of the dimensionless usage metric of each resource in combination 2, and the result 2 is (|V' 1 +V"' 1 |+|V' 2 +V"' 2 |+...+|V' n +V"' n |), calculate the sum of the absolute values of the dimensionless usage metrics of each type of resources in combination three, and the result three is: (|V' 1 +V” 1 |+|V' 2 +V” 2 |+...+|V' n +V” n|), if the absolute value of combination 2 is the smallest, then combination 2 will become a new cloud virtual machine, namely, the first cloud virtual machine + the third cloud virtual machine (named as the fifth cloud virtual machine), and then the fifth cloud virtual machine is combined with the second and fourth cloud virtual machines, and the combination analysis is performed according to the above method. If the combination formed after the second analysis is the fifth cloud virtual machine + the second cloud virtual machine, there is still a fourth cloud virtual machine left. At this time, the fifth cloud virtual machine + the second cloud virtual machine + the fourth cloud virtual machine will be analyzed to determine whether the number of cloud virtual machines included in this combination exceeds the upper limit of the number of cloud virtual machines, whether the number of resources included in this combination after the combination exceeds the upper limit of the number of resources, and whether there is a constraint conflict between the fifth cloud virtual machine and the second cloud virtual machine and the fourth cloud virtual machine. If none of them exceeds and there is no constraint conflict, they are combined together, otherwise they cannot be combined. If they cannot be combined, the final virtual machine combination is: the fifth cloud virtual machine + the second cloud virtual machine (named as the sixth cloud virtual machine) and the fourth cloud virtual machine, and then the sixth cloud virtual machine and the fourth cloud virtual machine are matched to the target resource node.
[0096] In another embodiment, when combining cloud virtual machines, it is also necessary to determine whether there is a constraint conflict between the two cloud virtual machines to be combined. If so, the two cloud virtual machines cannot be combined.
[0097] In a specific implementation of the present disclosure, the step S31 may further include step S311, step S312 and step S313.
[0098] Step S311: collect the usage measurement values of the same type of resources on all the cloud virtual machines to obtain a usage measurement value set of the same type of resources, and calculate the average value of the usage measurement value set of the same type of resources to obtain the average resource usage measurement value of each type of resource;
[0099] Step S312: Aggregate the usage measurement values of the same type of resources on all the cloud virtual machines to obtain a usage measurement value set of the same type of resources, and select the maximum value and the minimum value in the usage measurement value set of the same type of resources;
[0100] Step S313, based on the average resource usage measurement value of each type of resources, the maximum value in the usage measurement value set of the same type of resources, and the minimum value in the usage measurement value set of the same type of resources, the dimensionless usage measurement value of each type of resource on each of the cloud virtual machines is calculated.
[0101] In this embodiment, if three cloud virtual machines are included, and all three cloud virtual machines include resources such as CPU, then the CPU usage metric value V of the first cloud virtual machine is 1 + The CPU usage metric value V of the second cloud virtual machine 2+CPU usage metric value V of the third cloud virtual machine 3 Then divide it by 3 to get the average usage value V of resources such as CPU. avg ;
[0102] If the CPU usage metric value of the first cloud virtual machine is the largest (i.e., V max ), the CPU usage metric value of the second cloud virtual machine is the smallest (that is, V min ), the dimensionless CPU usage metric of the first cloud virtual machine is:
[0103] V 1 '=(V 1 -V avg ) / max(V max -V avg ,V avg -V min )
[0104] The dimensionless CPU usage metric of the second cloud virtual machine is:
[0105] V 2 '=(V 2 -V avg ) / max(V max -V avg ,V avg -V min )
[0106] The dimensionless CPU usage metric of the third cloud virtual machine is:
[0107] V 3 '=(V 3 -V avg ) / max(V max -V avg ,V avg -V min )
[0108] The values of the usage metrics after dimensionless processing are all in the range of (-1, 1), and this method can facilitate subsequent calculations.
[0109] In a specific implementation of the present disclosure, the step S4 may further include step S41.
[0110] Step S41, calculate the sum of the resource allocation amounts of each type of resource of each cloud virtual machine combination, and allocate the target resource node to each cloud virtual machine combination in order from large to small according to the sum of the resource allocation amounts of each type of resource of each cloud virtual machine combination; wherein, when allocating cloud resource nodes to each cloud virtual machine combination, select the cloud resource node with the largest number of cloud virtual machines as the target resource node to be scheduled by this cloud virtual machine combination.
[0111] In this embodiment, if the cloud virtual machine combination includes cloud virtual machine No. 1 and cloud virtual machine No. 2, and there are three cloud resource nodes at the same time, and the first cloud resource node only includes cloud virtual machine No. 1, then the first cloud resource node and the cloud virtual machine combination both include cloud virtual machine No. 1, and the number of identical cloud virtual machines is one; the second cloud resource node also only includes cloud virtual machine No. 1, then the second cloud resource node and the cloud virtual machine combination both include cloud virtual machine No. 1, and the number of identical cloud virtual machines is one; the third cloud resource node includes cloud virtual machine No. 1 and cloud virtual machine No. 2, then the third cloud resource node and the cloud virtual machine combination both include cloud virtual machine No. 1 and cloud virtual machine No. 2, and the number of identical cloud virtual machines is two; then the cloud virtual machine combination is scheduled to the third cloud resource node.
[0112] In a specific implementation of the present disclosure, the step S4 may further include step S42.
[0113] Step S42, calculate the sum of the resource allocation amounts of each type of resources and the sum of the usage amounts of each type of resources of each cloud virtual machine combination, and allocate cloud resource nodes to each cloud virtual machine combination in turn according to the size of the sum of the resource allocation amounts of each type of resources of each cloud virtual machine combination; wherein, when allocating a target resource node to each cloud virtual machine combination, if multiple cloud resource nodes have the same number of cloud virtual machines as the cloud virtual machine combination, then select the cloud resource node with the highest cloud virtual machine resource allocation amount as the target resource node; if the cloud virtual machine resource allocation amounts of the cloud resource nodes are still the same, then select the cloud resource node with the highest cloud virtual machine resource usage as the target resource node.
[0114] After this embodiment, after determining the target resource node, when scheduling the cloud virtual machine combination to the target resource node, it is also necessary to determine whether the number of cloud virtual machines contained in this target resource node has reached the upper limit, and whether the number of resources contained in this target resource node has reached the upper limit. If one of them reaches the upper limit, scheduling cannot be performed. At the same time, if the target resource node to which the cloud virtual machine combination (this cloud virtual machine combination only includes one cloud virtual machine) is to be scheduled is the cloud resource node that hosts this cloud virtual machine, then scheduling does not need to be performed.
[0115] Example 2
[0116] like Figure 2 As shown, this embodiment provides a resource scheduling device, which includes an acquisition module 701, a first calculation module 702, a second calculation module 703 and an allocation module 704.
[0117] The acquisition module 701 is used to acquire monitoring data and cloud resource nodes, wherein the monitoring data includes monitoring data of each indicator of each type of resource on each cloud virtual machine within a statistical period, and the cloud resource node is a cloud resource node that carries the cloud virtual machine;
[0118] The first calculation module 702 is used to obtain the usage measurement value of each type of the resource on each of the cloud virtual machines according to the monitoring data;
[0119] The second calculation module 703 is used to obtain at least one cloud virtual machine combination according to the usage measurement value;
[0120] The allocation module 704 is used to allocate target resource nodes to the cloud virtual machine combination according to the cloud virtual machine combination and the cloud resource nodes to form a resource scheduling solution.
[0121] This embodiment achieves resource rebalancing by combining cloud virtual machines with unbalanced resources, and then schedules the combined cloud virtual machines, so as to achieve optimized scheduling of cloud platform resources and improve the utilization rate of cloud platform resources.
[0122] In a specific implementation of the present disclosure, the first calculation module 702 includes a sorting unit 7021 , a decomposition unit 7022 and a first calculation unit 7023 .
[0123] The sorting unit 7021 is used to sort the monitoring data of each indicator of each type of resource on each cloud virtual machine in chronological order to obtain a historical time series of each indicator of each type of resource on each cloud virtual machine;
[0124] The decomposition unit 7022 is used to decompose the historical time series of each indicator of each type of resource on each cloud virtual machine using the STL model to obtain a decomposed sequence, and obtain a predicted time series of each indicator of each type of resource on each cloud virtual machine based on the decomposed sequence;
[0125] The first computing unit 7023 is used to obtain the usage measurement value of each type of resource on each cloud virtual machine based on the historical time series of each indicator of each type of resource on each cloud virtual machine and the predicted time series of each indicator of each type of resource on each cloud virtual machine.
[0126] In a specific implementation of the present disclosure, the decomposition unit 7022 includes a decomposition subunit 70221 , an analysis subunit 70222 and a first calculation subunit 70223 .
[0127] The decomposition subunit 70221 is used to decompose the historical time series of each indicator of each type of resource on each cloud virtual machine using the STL model to obtain a trend series and a periodic series of each indicator of each type of resource on each cloud virtual machine;
[0128] The analysis subunit 70222 is used to use a linear regression model to predict and analyze the trend sequence of each indicator of each type of resource on each cloud virtual machine to obtain a first prediction sequence, and use a GRU model to predict and analyze the periodic sequence of each indicator of each type of resource on each cloud virtual machine to obtain a second prediction sequence;
[0129] The first calculation subunit 70223 is used to add the first prediction sequence and the second prediction sequence to obtain a prediction time series of each indicator of each type of resource on each cloud virtual machine.
[0130] In a specific implementation of the present disclosure, the second calculation module 703 includes a second calculation unit 7031 , a selection unit 7032 , a first combination unit 7033 and a second combination unit 7034 .
[0131] The second calculation unit 7031 is used to obtain the dimensionless usage measurement value of each type of the resource on each of the cloud virtual machines according to the usage measurement value of each type of the resource on each of the cloud virtual machines;
[0132] The selection unit 7032 is used to analyze the dimensionless usage measurement values of each type of the resources on each of the cloud virtual machines, and select the maximum absolute value thereof as the ranking value of each of the cloud virtual machines;
[0133] The first combination unit 7033 is used to perform a combination analysis on all the cloud virtual machines based on the ranking value of each of the cloud virtual machines, the combination analysis comprising comparing the ranking value of each of the cloud virtual machines to obtain the cloud virtual machine with the largest ranking value, combining the cloud virtual machine with the largest ranking value with other cloud virtual machines to obtain multiple initial cloud virtual machine combinations, adding the absolute values of the dimensionless usage metric values of each type of the resource of each initial cloud virtual machine combination to obtain the sum of the absolute values of the usage metrics of each initial cloud virtual machine combination, and selecting the initial cloud virtual machine combination with the smallest sum of the absolute values of the usage metrics as a new virtual machine;
[0134] The second combining unit 7034 is used to combine and analyze the new virtual machine with the uncombined cloud virtual machines again, and finally obtain at least one cloud virtual machine combination.
[0135] In a specific implementation of the present disclosure, the second calculation unit 7031 includes a second calculation subunit 70311 , a selection subunit 70312 and a third calculation subunit 70313 .
[0136] The second calculation subunit 70311 is used to aggregate the usage measurement values of the same type of resources on all the cloud virtual machines to obtain a usage measurement value set of the same type of resources, and calculate the average value of the usage measurement value set of the same type of resources to obtain the average resource usage measurement value of each type of resource;
[0137] The selection subunit 70312 is used to aggregate the usage measurement values of the same type of resources on all the cloud virtual machines to obtain a usage measurement value set of the same type of resources, and select the maximum value and the minimum value in the usage measurement value set of the same type of resources;
[0138] The third calculation sub-unit 70313 is used to calculate the dimensionless usage measurement value of each type of resource on each of the cloud virtual machines based on the average resource usage measurement value of each type of resources, the maximum value in the usage measurement value set of the same type of resources, and the minimum value in the usage measurement value set of the same type of resources.
[0139] In a specific implementation of the present disclosure, the allocation module 704 includes a third calculation unit 7041 .
[0140] The third calculation unit 7041 is used to calculate the sum of the resource allocation amounts of each type of resource of each cloud virtual machine combination, and allocate the target resource node to each cloud virtual machine combination in order from large to small according to the sum of the resource allocation amounts of each type of resource of each cloud virtual machine combination; wherein, when allocating cloud resource nodes to each cloud virtual machine combination, the cloud resource node with the largest number of the same cloud virtual machines is selected as the target resource node to be scheduled by this cloud virtual machine combination.
[0141] In a specific implementation of the present disclosure, the allocation module 704 includes a fourth calculation unit 7042 .
[0142] The fourth calculation unit 7042 is used to calculate the sum of the resource allocation amounts of each type of resources and the sum of the usage amounts of each type of resources of each cloud virtual machine combination, and allocate cloud resource nodes to each cloud virtual machine combination in turn according to the size of the sum of the resource allocation amounts of each type of resources of each cloud virtual machine combination; wherein, when allocating a target resource node to each cloud virtual machine combination, if multiple cloud resource nodes have the same number of cloud virtual machines as the cloud virtual machine combination, the cloud resource node with the highest cloud virtual machine resource allocation amount is selected as the target resource node; if the cloud virtual machine resource allocation amounts of the cloud resource nodes are still the same, the cloud resource node with the highest cloud virtual machine resource usage is selected as the target resource node.
[0143] It should be noted that, regarding the device in the above embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment of the method, and will not be elaborated here.
[0144] Example 3
[0145] Corresponding to the above method embodiment, the embodiment of the present disclosure further provides a resource scheduling device. The resource scheduling device described below and the resource scheduling method described above can refer to each other.
[0146] Figure 3 FIG. 8 is a block diagram of a resource scheduling device 800 according to an exemplary embodiment. Figure 3 As shown, the resource scheduling device 800 may include: a processor 801 and a memory 802. The resource scheduling device 800 may also include one or more of a multimedia component 803, an input / output (I / O) interface 804, and a communication component 805.
[0147] The processor 801 is used to control the overall operation of the resource scheduling device 800 to complete all or part of the steps in the above-mentioned resource scheduling method. The memory 802 is used to store various types of data to support the operation of the resource scheduling device 800. For example, these data may include instructions for any application or method used to operate on the resource scheduling device 800, and application-related data, such as contact data, sent and received messages, pictures, audio, video, etc. The memory 802 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (Static Random Access Memory, referred to as SRAM), electrically erasable programmable read-only memory (Electrically Erasable Programmable Read-Only Memory, referred to as EEPROM), erasable programmable read-only memory (Erasable Programmable Read-Only Memory, referred to as EPROM), programmable read-only memory (Programmable Read-Only Memory, referred to as PROM), read-only memory (Read-Only Memory, referred to as ROM), magnetic memory, flash memory, magnetic disk or optical disk. The multimedia component 803 may include a screen and an audio component. The screen may be, for example, a touch screen, and the audio component is used to output and / or input audio signals. For example, the audio component may include a microphone, which is used to receive external audio signals. The received audio signal may be further stored in the memory 802 or sent through the communication component 805. The audio component also includes at least one speaker for outputting audio signals. The I / O interface 804 provides an interface between the processor 801 and other interface modules, and the above-mentioned other interface modules may be keyboards, mice, buttons, etc. These buttons may be virtual buttons or physical buttons. The communication component 805 is used for wired or wireless communication between the resource scheduling device 800 and other devices. Wireless communication, such as Wi-Fi, Bluetooth, Near Field Communication (NFC), 2G, 3G or 4G, or a combination of one or more of them, so the corresponding communication component 805 may include: Wi-Fi module, Bluetooth module, NFC module.
[0148] In an exemplary embodiment, the resource scheduling device 800 can be implemented by one or more application specific integrated circuits (ASIC), digital signal processors (DSP), digital signal processing devices (DSPD), programmable logic devices (PLD), field programmable gate arrays (FPGA), controllers, microcontrollers, microprocessors or other electronic components to execute the above-mentioned resource scheduling method.
[0149] In another exemplary embodiment, a computer-readable storage medium including program instructions is also provided, and when the program instructions are executed by a processor, the steps of the above-mentioned resource scheduling method are implemented. For example, the computer-readable storage medium can be the above-mentioned memory 802 including program instructions, and the above-mentioned program instructions can be executed by the processor 801 of the resource scheduling device 800 to complete the above-mentioned resource scheduling method.
[0150] Example 4
[0151] Corresponding to the above method embodiment, the embodiment of the present disclosure further provides a readable storage medium. The readable storage medium described below and the resource scheduling method described above can refer to each other.
[0152] A readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the resource scheduling method of the above method embodiment are implemented.
[0153] The readable storage medium may specifically be a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, or other readable storage medium that can store program codes.
[0154] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A resource scheduling method, characterized in that: include: Acquire monitoring data and cloud resource nodes, wherein the monitoring data includes monitoring data of each indicator of each type of resource on each cloud virtual machine within a statistical period, and the cloud resource node is a cloud resource node that hosts the cloud virtual machine; Obtaining a usage measurement value of each type of resource on each of the cloud virtual machines according to the monitoring data; Obtaining at least one cloud virtual machine combination according to the usage measurement value; According to the cloud virtual machine combination and the cloud resource node, a target resource node is allocated to the cloud virtual machine combination to form a resource scheduling solution; The obtaining, according to the usage measurement value, at least one cloud virtual machine combination includes: According to the usage measurement value of each type of the resource on each of the cloud virtual machines, obtaining the usage measurement value of each type of the resource on each of the cloud virtual machines after dimensionless processing; Analyze the dimensionless usage measurement values of each type of the resources on each of the cloud virtual machines, and select the maximum absolute value thereof as the ranking value of each of the cloud virtual machines; Based on the ranking value of each cloud virtual machine, a combination analysis is performed on all the cloud virtual machines, the combination analysis includes comparing the ranking value of each cloud virtual machine to obtain the cloud virtual machine with the largest ranking value, combining the cloud virtual machine with the largest ranking value with other cloud virtual machines to obtain multiple initial cloud virtual machine combinations, adding the absolute values of the dimensionless usage measurement values of each type of the resources of each initial cloud virtual machine combination to obtain the sum of the absolute values of the usage measurement of each initial cloud virtual machine combination, and selecting the initial cloud virtual machine combination with the smallest sum of the absolute values of the usage measurement as a new virtual machine; The new virtual machine and the uncombined cloud virtual machines are combined and analyzed again to finally obtain at least one cloud virtual machine combination.
2. The resource scheduling method according to claim 1, characterized in that: The obtaining, according to the monitoring data, a usage measurement value of each type of the resource on each of the cloud virtual machines includes: Sorting the monitoring data of each indicator of each type of resource on each cloud virtual machine in chronological order to obtain a historical time series of each indicator of each type of resource on each cloud virtual machine; Decomposing the historical time series of each indicator of each type of resource on each cloud virtual machine using the STL model to obtain a decomposed sequence, and obtaining a predicted time series of each indicator of each type of resource on each cloud virtual machine based on the decomposed sequence; Based on the historical time series of each indicator of each type of resource on each cloud virtual machine and the predicted time series of each indicator of each type of resource on each cloud virtual machine, a usage measurement value of each type of resource on each cloud virtual machine is obtained.
3. The resource scheduling method according to claim 2, characterized in that: The STL model is used to decompose the historical time series of each indicator of each type of resource on each cloud virtual machine to obtain a decomposed sequence, and based on the decomposed sequence, a predicted time series of each indicator of each type of resource on each cloud virtual machine is obtained, including: Decomposing the historical time series of each indicator of each type of resource on each cloud virtual machine using the STL model to obtain a trend series and a periodic series of each indicator of each type of resource on each cloud virtual machine; A linear regression model is used to predict and analyze the trend sequence of each indicator of each type of resource on each cloud virtual machine to obtain a first prediction sequence, and a GRU model is used to predict and analyze the periodic sequence of each indicator of each type of resource on each cloud virtual machine to obtain a second prediction sequence; The first prediction sequence and the second prediction sequence are added together to obtain a prediction time series of each indicator of each type of resource on each cloud virtual machine.
4. A resource scheduling device, characterized in that: include: An acquisition module, used to acquire monitoring data and cloud resource nodes, wherein the monitoring data includes monitoring data of each indicator of each type of resource on each cloud virtual machine within a statistical period, and the cloud resource node is a cloud resource node that carries the cloud virtual machine; A first computing module, configured to obtain a usage measurement value of each type of resource on each of the cloud virtual machines according to the monitoring data; A second calculation module, configured to obtain at least one cloud virtual machine combination according to the usage measurement value; An allocation module, configured to allocate a target resource node to the cloud virtual machine combination according to the cloud virtual machine combination and the cloud resource node, so as to form a resource scheduling scheme; Wherein, the second calculation module includes: A second calculation unit is used to obtain the dimensionless usage measurement value of each type of the resource on each of the cloud virtual machines according to the usage measurement value of each type of the resource on each of the cloud virtual machines; A selection unit is used to analyze the dimensionless usage measurement values of each type of the resources on each of the cloud virtual machines, and select the maximum absolute value thereof as the ranking value of each of the cloud virtual machines; A first combination unit is used to perform a combination analysis on all the cloud virtual machines based on the ranking value of each of the cloud virtual machines, the combination analysis comprising comparing the ranking value of each of the cloud virtual machines to obtain the cloud virtual machine with the largest ranking value, combining the cloud virtual machine with the largest ranking value with other cloud virtual machines to obtain multiple initial cloud virtual machine combinations, adding the absolute values of the dimensionless usage metric values of each type of the resources of each initial cloud virtual machine combination to obtain the sum of the absolute values of the usage metrics of each initial cloud virtual machine combination, and selecting the initial cloud virtual machine combination with the smallest sum of the absolute values of the usage metrics as a new virtual machine; The second combining unit is used to combine and analyze the new virtual machine with the uncombined cloud virtual machines again, and finally obtain at least one cloud virtual machine combination.
5. The resource scheduling device according to claim 4, characterized in that: The first computing module comprises: A sorting unit, used to sort the monitoring data of each indicator of each type of resource on each cloud virtual machine in chronological order to obtain a historical time series of each indicator of each type of resource on each cloud virtual machine; A decomposition unit, used to decompose the historical time series of each indicator of each type of resource on each cloud virtual machine using an STL model to obtain a decomposed sequence, and obtain a predicted time series of each indicator of each type of resource on each cloud virtual machine based on the decomposed sequence; The first computing unit is used to obtain the usage measurement value of each type of resource on each cloud virtual machine based on the historical time series of each indicator of each type of resource on each cloud virtual machine and the predicted time series of each indicator of each type of resource on each cloud virtual machine.
6. The resource scheduling device according to claim 5, characterized in that: The decomposition unit comprises: A decomposition subunit, used to decompose the historical time series of each indicator of each type of resource on each cloud virtual machine using the STL model to obtain a trend series and a periodic series of each indicator of each type of resource on each cloud virtual machine; An analysis subunit is used to predict and analyze the trend sequence of each indicator of each type of resource on each cloud virtual machine using a linear regression model to obtain a first prediction sequence, and to predict and analyze the periodic sequence of each indicator of each type of resource on each cloud virtual machine using a GRU model to obtain a second prediction sequence; The first calculation subunit is used to add the first prediction sequence and the second prediction sequence to obtain a prediction time series of each indicator of each type of resource on each cloud virtual machine.
7. A resource scheduling device, characterized in that: include: Memory for storing computer programs; A processor, configured to implement the steps of the resource scheduling method as claimed in any one of claims 1 to 3 when executing the computer program.
8. A readable storage medium, characterized in that: The readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the resource scheduling method according to any one of claims 1 to 3 are implemented.
Citation Information
Patent Citations
Resource scheduling method and device, and related equipment
CN111176792A