Determination Method, Device and Electronic Device for Number of Machines Required for Application

By obtaining historical data and traffic prediction of cloud application system, combining traffic and CPU correlation model, determining the number of target machines, the problem of inaccurate expansion and capacity in the existing technology is solved, and efficient resource management is achieved.

CN114443432BActive Publication Date: 2025-07-18ANT YUNCHUANG DIGITAL TECH (BEIJING) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210088940.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-01-25
Publication Date
2025-07-18
Estimated Expiration
2042-01-25

AI Technical Summary

Technical Problem

The prior art is difficult to perform refined correlation analysis of traffic and CPU resource consumption in cloud application systems, resulting in insufficient recommendation of the number of expansion and capacity machines, which affects system stability and resource utilization efficiency.

Method used

By obtaining historical monitoring data, the target CPU water level is generated, and the pre-established traffic and CPU correlation model is used to predict future traffic and determine the number of target machines to achieve accurate scaling decisions.

Benefits of technology

In complex business scenarios, accurate machine number recommendation is provided, system stability and resource utilization efficiency are improved, and resource overhead is reduced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114443432B_ABST
    Figure CN114443432B_ABST
Patent Text Reader

Abstract

An embodiment of this specification provides a method, an apparatus, and an electronic device for determining the number of machines required for an application. In the method for determining the number of machines required for the application, after obtaining historical monitoring data including the performance data and traffic data of the application, a target CPU water level of the application is generated according to the performance data of the application, and the traffic of the application within a predetermined time interval after the current moment is predicted according to the traffic data of the application. Then, according to the target CPU water level of the application and the traffic within the predetermined time interval, the target number of machines required for the application is determined by using a pre-established traffic-CPU association model. Finally, according to the target number of machines and the number of machines currently used by the application, the number of machines for scaling the application up or down is obtained, so that it is possible to accurately recommend the number of machines for scaling the application up or down according to the association relationship between the traffic and the CPU water level in a scenario with high business complexity.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of this specification relate to the field of Internet technologies, and in particular, to a method, an apparatus, and an electronic device for determining the number of machines required for an application.

Background Art

[0002] For a cloud application system, traffic is the source of resource consumption. If the impact of traffic on resource consumption can be accurately characterized (i.e., the impact of traffic on performance at different central processing unit (CPU) water levels of a host), then effective capacity assessment becomes possible, and a large amount of resource overhead can be saved. However, application traffic types are diverse, and different types of traffic have their own different components. Due to reasons such as differences in their periods and / or phases, and the interleaving and / or overlapping of peaks and valleys of various component traffic, it is difficult for coarse-grained capacity assessment to accurately meet the increasingly refined requirements. Therefore, it is necessary to comprehensively consider the application's segmented traffic to overcome this problem.

[0003] Due to the current complexity and stability requirements of cloud services, the methods currently adopted in the industry are not applicable to the refined analysis requirements generated thereby. Therefore, a solution is needed that can generate accurate recommendations for the number of machines for scaling in and out.

Summary of the Invention

[0004] The embodiments of this specification provide a method, an apparatus, and an electronic device for determining the number of machines required for an application to achieve accurate recommendations for the number of machines for scaling in and out of the application.

[0005] In a first aspect, the embodiments of this specification provide a method for determining the number of machines required for an application, including: obtaining historical monitoring data, where the historical monitoring data includes the performance data and traffic data of the application; generating a target CPU water level of the application according to the performance data of the application; and predicting the traffic of the application within a predetermined time interval after the current moment according to the traffic data of the application; determining the target number of machines required for the application according to the target CPU water level of the application and the traffic within the predetermined time interval by using a pre-established traffic-CPU association model, where the target number of machines makes the difference between the CPU water level of the application and the CPU target water level less than or equal to a predetermined threshold.

[0006] In the method for determining the number of machines required for the above application, after obtaining the historical monitoring data including the performance data and traffic data of the application, according to the performance data of the above application, the target CPU water level of the above application is generated, and according to the traffic data of the above application, the traffic of the above application within a predetermined time interval after the current moment is predicted. Furthermore, according to the target CPU water level of the above application and the traffic within the predetermined time interval, the target number of machines required for the above application is determined by using the pre-established traffic-CPU association model. Finally, according to the target number of machines and the number of machines currently used by the above application, the number of machines for scaling the above application is obtained, so that it is possible to accurately recommend the number of machines for scaling the application according to the association relationship between traffic and CPU water level in a scenario with high business complexity.

[0007] In one possible implementation, after determining the target number of machines required for the application by using the pre-established traffic-CPU association model according to the target CPU water level of the application and the traffic within the predetermined time interval, it further includes: obtaining the number of machines for scaling the application according to the target number of machines and the number of machines currently used by the application.

[0008] In one possible implementation, generating the target CPU water level of the application according to the performance data of the application includes: obtaining the CPU water level of the application according to the performance data of the application; determining the target CPU water level of the application according to the CPU water level of the application and the predetermined maximum CPU water level; wherein, the target CPU water level is less than or equal to the predetermined maximum CPU water level.

[0009] In one possible implementation, after determining the target CPU water level of the application according to the CPU water level of the application and the predetermined maximum CPU water level, it further includes: if the current CPU water level of the application is greater than the target CPU water level, then according to the current CPU water level and the predetermined maximum CPU water level, the target CPU water level is increased, and the increased target CPU water level is less than or equal to the predetermined maximum CPU water level.

[0010] In one possible implementation manner, predicting the traffic of the application within a predetermined time interval after the current moment according to the traffic data of the application includes: determining the traffic type to which the traffic data of the application belongs by performing a periodic trend discrimination on the traffic data of the application; if the traffic data of the application belongs to the first traffic type, predicting, through a pre-established time series prediction model, the traffic belonging to the first traffic type within a predetermined time interval after the current moment; wherein, the first traffic type is a traffic type with periodicity or trend; if the traffic data of the application belongs to the second traffic type, predicting, through the pre-established dependency relationship between time points, the traffic belonging to the second traffic type within a predetermined time interval after the current moment; wherein, the second traffic type is a traffic type that does not belong to the first traffic type.

[0011] In one possible implementation manner, before determining the target number of machines required for the application according to the target CPU water level of the application and the traffic within the predetermined time interval by using the pre-established traffic-CPU association model, it further includes: obtaining the true value of the CPU water level of the application according to the performance data of the application; performing independent modeling according to the true value of the CPU water level of the application and the traffic data of the application to obtain a single association model between the CPU water level and the traffic of the application, and obtaining the predicted value of the CPU water level of the application output by the single association model.

[0012] In one possible implementation manner, after obtaining the predicted value of the CPU water level of the application output by the single association model, it further includes: performing unified modeling according to the name of each application globally, the name of the computer room where each application is located, the traffic data of each application and the corresponding time information, the predicted value of the CPU water level of each application, and the true value of the CPU water level of each application to obtain the traffic-CPU association model.

[0013] In a second aspect, an embodiment of the present specification provides a device for determining the number of machines required for an application, including: an acquisition module, configured to acquire historical monitoring data, where the historical monitoring data includes the performance data and traffic data of the application; a generation module, configured to generate the target CPU water level of the application according to the performance data of the application; a prediction module, configured to predict the traffic of the application within a predetermined time interval after the current moment according to the traffic data of the application; a determination module, configured to determine the target number of machines required for the application according to the target CPU water level of the application and the traffic within the predetermined time interval by using the pre-established traffic-CPU association model, where the difference between the CPU water level of the application and the CPU target water level is less than or equal to a predetermined threshold for the target number of machines.

[0014] In one possible implementation, the determining module is further configured to, after determining the target number of machines required for the application by using a pre-established traffic-CPU association model, obtain the number of machines for scaling the application up or down according to the target number of machines and the number of machines currently used by the application.

[0015] In one possible implementation, the generating module includes: a water level obtaining sub-module, configured to obtain the CPU water level of the application according to the performance data of the application; a water level determining sub-module, configured to determine the target CPU water level of the application according to the CPU water level of the application and a predetermined maximum CPU water level, where the target CPU water level is less than or equal to the predetermined maximum CPU water level.

[0016] In one possible implementation, the generating module further includes: a water level adjusting sub-module, configured to, after the water level determining sub-module determines the target CPU water level of the application according to the CPU water level of the application and the predetermined maximum CPU water level, if the current CPU water level of the application is greater than the target CPU water level, increase the target CPU water level according to the current CPU water level and the predetermined maximum CPU water level, and the increased target CPU water level is less than or equal to the predetermined maximum CPU water level.

[0017] In one possible implementation, the predicting module includes: a type determining sub-module, configured to perform a periodic trend discrimination on the traffic data of the application to determine the traffic type to which the traffic data of the application belongs; a traffic predicting sub-module, configured to, when the traffic data of the application belongs to a first traffic type, predict the traffic belonging to the first traffic type within a predetermined time interval after the current moment by using a pre-established time series prediction model, where the first traffic type is a traffic type with periodicity or trend; when the traffic data of the application belongs to a second traffic type, predict the traffic belonging to the second traffic type within a predetermined time interval after the current moment by using a pre-established dependency relationship between time points, where the second traffic type is a traffic type that does not belong to the first traffic type.

[0018] In one possible implementation, the apparatus further includes: a modeling module; the obtaining module is further configured to, before the determining module determines the target number of machines required for the application by using a pre-established traffic-CPU association model, obtain the true value of the CPU water level of the application according to the performance data of the application; the modeling module is configured to perform independent modeling according to the true value of the CPU water level of the application and the traffic data of the application to obtain a single association model between the CPU water level and the traffic of the application; the obtaining module is further configured to obtain the predicted value of the CPU water level of the application output by the single association model.

[0019] In one possible implementation, after the obtaining module obtains the predicted value of the CPU water level of the application output by the single association model, the modeling module is further configured to perform unified modeling based on the name of each application globally, the name of the computer room where each application is located, the traffic data of each application and the corresponding time information, the predicted value of the CPU water level of each application, and the true value of the CPU water level of each application, so as to obtain the traffic-CPU association model.

[0020] In a third aspect, an embodiment of the present specification provides an electronic device, including: at least one processor; and at least one memory communicatively connected to the processor, where: the memory stores program instructions executable by the processor, and the processor can execute the method provided in the first aspect by invoking the program instructions.

[0021] In a fourth aspect, an embodiment of the present specification provides a non-transitory computer-readable storage medium, where the non-transitory computer-readable storage medium stores computer instructions, and the computer instructions cause the computer to execute the method provided in the first aspect.

[0022] It should be understood that the technical solutions of the second to fourth aspects of the embodiments of the present specification are consistent with those of the first aspect of the embodiments of the present specification, and the beneficial effects obtained by each aspect and the corresponding feasible implementation manners are similar, and will not be elaborated herein.

Description of the Drawings

[0023] In order to more clearly illustrate the technical solutions of the embodiments of the present specification, the drawings required for the embodiments will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present specification. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0024] Figure 1 It is a flowchart of a method for determining the number of machines required for an application provided by an embodiment of the present specification;

[0025] Figure 2 It is a flowchart of a method for determining the number of machines required for an application provided by another embodiment of the present specification;

[0026] Figure 3 It is a flowchart of a method for determining the number of machines required for an application provided by still another embodiment of the present specification;

[0027] Figure 4 It is a schematic diagram of a traffic-CPU association model architecture provided by an embodiment of the present specification;

[0028] Figure 5Schematic diagram of the implementation of the method for determining the number of machines required for an application provided by an embodiment of this specification;

[0029] Figure 6 Schematic diagram of the structure of the device for determining the number of machines required for an application provided by an embodiment of this specification;

[0030] Figure 7 Schematic diagram of the structure of the device for determining the number of machines required for an application provided by another embodiment of this specification;

[0031] Figure 8 Schematic diagram of the structure of an electronic device provided by an embodiment of this specification.

Specific implementation manners

[0032] In order to better understand the technical solutions of this specification, the embodiments of this specification will be described in detail below with reference to the accompanying drawings.

[0033] It should be clear that the described embodiments are only a part of the embodiments of this specification, rather than all of the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments in this specification without creative efforts shall fall within the scope of protection of this specification.

[0034] The terms used in the embodiments of this specification are only for the purpose of describing specific embodiments, and are not intended to limit this specification. The singular forms of "a", "the" and "said" used in the embodiments of this specification and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise.

[0035] In the existing related technologies, there are mainly two capacity evaluation methods adopted by the industry. For the financial cloud application system, these two methods have certain deficiencies more or less:

[0036] 1) Decision-making driven by the total incoming traffic:

[0037] This method observes the change of the response time (RT). If it is abnormal, it triggers horizontal pod autoscaler (HPA) to scale in and out, which has a certain after-event nature and has a greater impact on system stability.

[0038] 2) Decision-making driven by single-machine performance:

[0039] This method predicts the CPU occupancy and / or memory (mem) usage. If the threshold is exceeded, it triggers vertical pod autoscaler (VPA). However, the CPU occupancy and / or mem usage of a single machine can be predicted, which is based on the premise of low business complexity and strong regularity.

[0040] Based on the above problems, the embodiments of this specification provide a method for determining the number of machines required for an application. It fits the quantitative correlation between the segmented traffic and the CPU water level (cpu_util) based on a model that combines elasticNet and residual neural network (resNet), and generates an accurate recommendation for the number of machines to scale in or out based on this model.

[0041] Figure 1 The flowchart of the method for determining the number of machines required for an application provided by an embodiment of this specification is as Figure 1 shown. The above method for determining the number of machines required for an application may include:

[0042] Step 102, obtain historical monitoring data, where the historical monitoring data includes the performance data and traffic data of the application.

[0043] Among them, the above historical monitoring data can be obtained from a database; the performance data may include the CPU utilization rate of each application, and the traffic data may include the number of times each application is requested / requests other applications within a period of time, that is, the traffic data includes the incoming traffic and the outgoing traffic.

[0044] Step 104, generate the target CPU water level of the application according to the performance data of the application; and predict the traffic of the application within a predetermined time interval after the current moment according to the traffic data of the application.

[0045] Among them, the above CPU water level may be the CPU occupancy.

[0046] Specifically, generating the target CPU water level of the application according to the performance data of the application may be: obtaining the CPU water level of the application according to the performance data of the application; determining the target CPU water level of the application according to the CPU water level of the application and the predetermined maximum CPU water level; where the above target CPU water level is less than or equal to the predetermined maximum CPU water level.

[0047] Further, after determining the target CPU water level of the above application based on the CPU water level of the above application and the predetermined maximum CPU water level, if the current CPU water level of the above application is greater than the target CPU water level, then according to the current CPU water level and the predetermined maximum CPU water level, increase the target CPU water level, and the increased target CPU water level is less than or equal to the above-mentioned predetermined maximum CPU water level.

[0048] Among them, the above-mentioned predetermined maximum CPU water level can be set by itself according to system performance and / or implementation requirements during specific implementation. This embodiment does not limit the above-mentioned predetermined maximum CPU water level. For example, the above-mentioned predetermined maximum CPU water level can be 45%.

[0049] Specifically, the target CPU water level of the above application is the water level at which it is expected that the application can run stably. On the one hand, to meet the disaster tolerance strategy requirements formulated for system stability, the daily CPU water level cannot exceed 45% at most. On the other hand, to meet the high-risk requirements of capacity issues, the following strategy can be used to complete the final 45% water level target through several iteration cycles.

[0050] cpu_target = min(data['cpu_core_util'].quantile(q = 0.9)+10, 45) (1)

[0051] In formula (1), cpu_target is the target CPU water level of the above application; data['cpu_core_util'].quantile(q = 0.9) is the 90th percentile of the CPU water level. The meaning expressed by formula (1) is that the target CPU water level of the above application takes the 90th percentile of the CPU water level + 10%, to avoid the influence of a small number of extreme points, but the maximum does not exceed 45%.

[0052] In addition, in this embodiment, during the determination of the target CPU water level, verification is performed. If the current CPU water level of the above application has exceeded the target CPU water level, then the current target water level is increased to the nearest ten-digit greater than the current CPU water level, but the maximum does not exceed 45%, as shown in formula (2). Among them, the current CPU water level of the above application can use the predicted value obtained from the current traffic and the number of machines. The real value of the CPU water level is not used because at points not affected by traffic, such as in timed tasks, using the real value will cause the scaling policy to jitter.

[0053] if test_cpu > cpu_target: cpu_target = min(math.ceil(test_cpu / 10)*10, 45) (2)

[0054] In formula (2), test_cpu is the current CPU water level of the above application; math.ceil(test_cpu / 10)*10 represents the round number of tens of the current CPU water level.

[0055] Step 106: According to the target CPU water level of the above application and the traffic within a predetermined time interval, use the pre-established traffic-CPU association model to determine the target number of machines required for the above application.

[0056] Among them, the difference between the CPU water level of the above application and the CPU target water level is less than or equal to a predetermined threshold value for the above target number of machines. The above predetermined threshold value can be set by itself according to system performance and / or implementation requirements, etc. in specific implementation, and the size of the above predetermined threshold value is not limited in this embodiment.

[0057] Specifically, various optimization methods can be used to solve the target number of machines by using the pre-established traffic-CPU association model. For example, algorithms such as traversal search, binary search, gradient descent, evolutionary algorithm, and / or reinforcement learning can successfully complete this task.

[0058] When establishing the traffic-CPU association model, considering the physical meaning of the traffic scenario, when training the traffic-CPU association model, the parameters can be controlled through a deep network, so as to ensure that the above traffic-CPU association model is a monotonic function with respect to the traffic (to avoid the situation where the higher the queries per second (QPS), the lower the CPU water level). Therefore, in this embodiment, a lightweight binary search algorithm is adopted to search for the target number of machines that can make the CPU water level reach the expected value (assuming load balancing and traffic evenly carried on each machine). That is, when the number of machines used by the above application is the target number of machines, the difference between the CPU water level obtained by prediction using the traffic-CPU association model and the CPU target water level is less than or equal to the predetermined threshold value.

[0059] Further, after step 106, it may further include:

[0060] Step 108: Obtain the number of machines for scaling the above application according to the above target number of machines and the number of machines currently used by the above application.

[0061] Specifically, after obtaining the target number of machines, subtract the currently used number of machines from the above target number of machines to obtain the number of machines for scaling the above application.

[0062] In the method for determining the number of machines required for the above application, after obtaining the historical monitoring data including the performance data and traffic data of the application, according to the performance data of the above application, the target CPU water level of the above application is generated, and according to the traffic data of the above application, the traffic of the above application within a predetermined time interval after the current moment is predicted. Then, according to the target CPU water level of the above application and the traffic within the predetermined time interval, the target number of machines required for the above application is determined by using the pre-established traffic-CPU association model. Finally, according to the target number of machines and the number of machines currently used by the above application, the number of machines for scaling the above application is obtained, so that in a scenario with high business complexity, an accurate recommendation for the number of machines for scaling the application can be obtained according to the association relationship between traffic and CPU water level.

[0063] Figure 2 The flowchart of the method for determining the number of machines required for the application provided by another embodiment of this specification is as Figure 2 shown. In the embodiment shown in this specification Figure 1 shown, step 104 may include:

[0064] Step 202, generating the target CPU water level of the above application according to the performance data of the above application.

[0065] Step 204, performing a periodic trend discrimination on the traffic data of the above application to determine the traffic type to which the traffic data of the above application belongs. Then, step 206 or step 208 is executed.

[0066] Step 206, if the traffic data of the above application belongs to the first traffic type, predicting the traffic belonging to the first traffic type within a predetermined time interval after the current moment of the above application through the pre-established time series prediction model; wherein, the above first traffic type is a traffic type with periodicity or trend. Then, step 106 is executed.

[0067] Step 208, if the traffic data of the above application belongs to the second traffic type, predicting the traffic belonging to the second traffic type within a predetermined time interval after the current moment of the above application through the pre-established dependency relationship between time points; wherein, the above second traffic type is a traffic type that does not belong to the first traffic type. Then, step 106 is executed.

[0068] Among them, the above predetermined time interval can be set by itself according to system performance and / or implementation requirements, etc. in specific implementation, and this embodiment does not limit the above predetermined time interval.

[0069] Specifically, the recommendation of the number of machines for application scaling is a decision made for a future predetermined time interval. Therefore, it is necessary to know the traffic information for the corresponding time interval. Since the traffic characteristics of different applications in a cloud application system vary, the traffic can be divided into two types according to periodicity to complete the prediction of the segmented traffic of the application.

[0070] 1) For traffic types with obvious periodicity and trend, the problem can be transformed into a time series prediction for modeling. Suppose there is a set z i,1:t0 =[z i,1 ,z i,2 ,…,z i,t0 containing N related time series, where z i,t represents the value of time series I at time t. Additionally, can be used to represent time-related feature information. Based on this, the values for the next r time steps are predicted The time prediction model can be as shown in Equation (3).

[0071]

[0072] The corresponding single-step prediction model is p(z t |z 1:t-1 ,x 1:t ; Φ), where Φ represents the model parameters. There are many prediction models that can be used, such as Transformer.

[0073] 2) For traffic types with no obvious periodicity and trend, traffic similarity can be used to obtain the most similar time interval in the past month for characterization, and the dependency relationship between the current time point and the previous time point of the multi-dimensional time series is constructed, as shown in Equation (4). Then, using the above dependency relationship, the traffic belonging to the second traffic type within a predetermined time interval after the current moment for the above application is predicted.

[0074]

[0075] In Equation (4), represents that there is a dependency relationship between time point and .

[0076] Figure 3 This is the flowchart of the method for determining the number of machines required for the application provided in another embodiment of this specification. As Figure 3 shown, in the embodiment shown in this specification Figure 1 , before step 106, it may further include:

[0077] Step 302: Obtain the true value of the CPU water level of the above application according to the performance data of the above application.

[0078] Step 304: Based on the true value of the CPU water level of the above application and the traffic data of the above application, perform individual modeling to obtain a single correlation model between the CPU water level and the traffic of the above application, and obtain the predicted value of the CPU water level of the above application output by the above single correlation model.

[0079] Further, after step 304, it may further include:

[0080] Step 306: Based on the name of each application globally, the name of the computer room where each application is located, the traffic data of each application and the corresponding time information, the predicted value of the CPU water level of each application, and the true value of the CPU water level of each application, perform unified modeling to obtain the above traffic-CPU correlation model.

[0081] Specifically, refer to Figure 4 , Figure 4 which is a schematic diagram of the traffic-CPU correlation model architecture provided by an embodiment of this specification. Figure 4 In [diagram], the individual modeling module elasticNet performs unique individual modeling on each application. On the one hand, it can use pre-training to solve the problem that a single model has an extremely inflated dimension for the detailed traffic data dimension and it is difficult for the model to converge. On the other hand, it can provide refined CPU predicted values for the downstream network through a linear model, improving the out-of-bound generalization ability of the overall model.

[0082] Among them, the input of the individual modeling module elasticNet includes the traffic data of the above application and the true value of the CPU water level of the above application. The traffic data of the above application may include TOP100 interface+method rpc, topic+eventid msgsub, topic+eventid antqsub, url pv; the output of the individual modeling module elasticNet is the predicted value of the CPU water level of the above application.

[0083] Figure 4 In [diagram], the unified modeling module ResNet performs global unified modeling on all applications. On the one hand, it uses the learning ability of the deep network for non-linear relationships to make up for the limitation of the linear model in expression ability. On the other hand, it uses the characteristics of the residual network to exert the stable and controllable out-of-bound generalization ability obtained by the linear model in pre-training.

[0084] Among them, the input of the unified modeling module ResNet includes the true value of the CPU water level of each application and other information. The above other information includes: the name of each application globally (appname), the name of the computer room where each application is located (Idcname), the traffic data of each application, the corresponding time information, and the predicted value of the CPU water level of each application; the traffic data of each application may include the following types of traffic data: rpc, msgsub, antqsub, and pv; the output of the unified modeling module ResNet is the CPU water level of the above application.

[0085] Figure 5 It is a schematic diagram for implementing the method for determining the number of machines required for an application provided in an embodiment of this specification. As Figure 5 shown, the method for determining the number of machines required for an application provided in this embodiment can first obtain historical monitoring data. The above historical monitoring data includes the performance data and traffic data of the application. Among them, the performance data is used to generate the target CPU water level of the above application that is expected to be achieved, and the traffic data is used to predict the traffic within a predetermined future time interval. And the two are combined to construct a traffic-CPU association model. Finally, according to the target CPU water level of the application, the traffic-CPU association model, and the traffic prediction result, the recommended number of machines for scaling is obtained, and the above number of machines for scaling is written into the production table.

[0086] The method for determining the number of machines required for an application provided in the embodiments of this specification associates multi-source traffic with the CPU. At the same time, pre-training, deep networks, and linear models are adopted, and their respective advantages are utilized. The introduction of pre-training is to make overall use of fine-grained component traffic information and coarse-grained common information. The deep network is a unified modeling of the common information and is used to capture the hidden relationships in the common information. Finally, the boundary generalization of the model is improved by using the linear model to provide baseline features for the deep network.

[0087] To solve the problem of poor predictability of the capacity evaluation of a single machine's CPU and memory in scenarios with high business complexity, the embodiments of this specification transform the capacity evaluation through a traffic-CPU association model, making the capacity evaluation a prediction of traffic, and improving the predictability of the capacity evaluation in scenarios with high business complexity, so as to adapt to scenarios with relatively high business complexity.

[0088] For a financial cloud application system with relatively high business complexity, the method provided in the embodiments of this specification has been able to complete day-long minute-level decision-making, and the accuracy of the predicted CPU water level is very high.

[0089] The above describes specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than in the embodiments and still achieve the desired results. Additionally, the processes depicted in the figures do not necessarily require the particular order or sequential order shown to achieve the desired results. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0090] Figure 6 The structural schematic diagram of the device for determining the number of machines required for an application provided in an embodiment of this specification is as Figure 6 shown. The above device for determining the number of machines required for an application may include: an acquisition module 61, a generation module 62, a prediction module 63, and a determination module 64;

[0091] Among them, the acquisition module 61 is used to acquire historical monitoring data, and the historical monitoring data includes the performance data and traffic data of the application;

[0092] The generation module 62 is used to generate the target CPU water level of the application according to the performance data of the application;

[0093] The prediction module 63 is used to predict the traffic of the application within a predetermined time interval after the current moment according to the traffic data of the application;

[0094] The determination module 64 is used to determine the target number of machines required for the application according to the target CPU water level of the application and the traffic within the predetermined time interval, using a pre-established traffic-CPU association model. Among them, the target number of machines makes the difference between the CPU water level of the application and the CPU target water level less than or equal to a predetermined threshold.

[0095] Figure 6 The device for determining the number of machines required for an application provided in the shown embodiment can be used to execute the technical solution of the method embodiment of this specification, and its implementation principle and technical effects can be further referred to the relevant description in the method embodiment. Figure 1 The structural schematic diagram of the device for determining the number of machines required for an application provided in another embodiment of this specification, compared with the

[0096] Figure 7 device for determining the number of machines required for an application shown, Figure 6 in the device for determining the number of machines required for an application shown, the determination module 64 is further used to, after determining the target number of machines required for the application using a pre-established traffic-CPU association model, obtain the number of machines for the application to scale in or out according to the target number of machines and the number of machines currently used by the application. Figure 7 ​

[0097] In this embodiment, the generation module 62 may include: a water level acquisition sub-module 621 and a water level determination sub-module 622;

[0098] Among them, the water level acquisition sub-module 621 is used to obtain the CPU water level of the above application according to the performance data of the above application;

[0099] The water level determination sub-module 622 is used to determine the target CPU water level of the above application according to the CPU water level of the above application and the predetermined maximum CPU water level; among them, the above target CPU water level is less than or equal to the predetermined maximum CPU water level.

[0100] Furthermore, the generation module 62 may further include: a water level adjustment sub-module 623;

[0101] The water level adjustment sub-module 623 is used to, after the water level determination sub-module 622 determines the target CPU water level of the above application according to the CPU water level of the above application and the predetermined maximum CPU water level, if the current CPU water level of the above application is greater than the target CPU water level, increase the target CPU water level according to the current CPU water level and the predetermined maximum CPU water level, and the increased target CPU water level is less than or equal to the above-mentioned predetermined maximum CPU water level.

[0102] In this embodiment, the prediction module 63 may include: a type determination sub-module 631 and a traffic prediction sub-module 632;

[0103] The type determination sub-module 631 is used to perform a periodic trend discrimination on the traffic data of the above application to determine the traffic type to which the traffic data of the above application belongs;

[0104] The traffic prediction sub-module 632 is used to, when the traffic data of the above application belongs to the first traffic type, predict the traffic belonging to the first traffic type within a predetermined time interval after the current moment through a pre-established time series prediction model; among them, the first traffic type is a traffic type with periodicity or trend; when the traffic data of the above application belongs to the second traffic type, predict the traffic belonging to the second traffic type within a predetermined time interval after the current moment through the pre-established dependency relationship between time points; among them, the second traffic type is a traffic type that does not belong to the first traffic type.

[0105] Furthermore, the determining device for the number of machines required by the above application may further include: a modeling module 65;

[0106] The acquisition module 61 is further used to obtain the true value of the CPU water level of the above application according to the performance data of the above application before the determination module 64 determines the target number of machines required by the above application by using the pre-established traffic-CPU association model;

[0107] A modeling module 65, configured to perform independent modeling based on the true value of the CPU water level of the above application and the traffic data of the above application, so as to obtain a single correlation model between the CPU water level and the traffic of the above application;

[0108] The obtaining module 61 is further configured to obtain the predicted value of the CPU water level of the above application output by the above single correlation model.

[0109] Furthermore, after the obtaining module 61 obtains the predicted value of the CPU water level of the above application output by the above single correlation model, the modeling module 65 is further configured to perform unified modeling according to the name of each application globally, the name of the computer room where each application is located, the traffic data of each application and the corresponding time information, the predicted value of the CPU water level of each application, and the true value of the CPU water level of each application, so as to obtain the above traffic-CPU correlation model.

[0110] Figure 7 The apparatus for determining the number of machines required for an application provided in the illustrated embodiment can be used to execute the technical solution of the method embodiment described in this specification Figures 1 to 5 The implementation principle and technical effects can be further referred to the relevant descriptions in the method embodiment.

[0111] Figure 8 The structure diagram of an electronic device provided in an embodiment of this specification is shown as Figure 8 shown. The above electronic device may include at least one processor; and at least one memory communicatively connected to the above processor, wherein: the memory stores program instructions executable by the processor, and the above processor can execute the method for determining the number of machines required for an application provided in the embodiment shown in this specification by calling the above program instructions. Figures 1 to 5 shown.

[0112] Among them, the above electronic device may be a server, for example: a cloud server. The form of the above electronic device is not limited in this embodiment.

[0113] Figure 8 A block diagram of an exemplary electronic device suitable for implementing the embodiments of this specification is shown. Figure 8 The electronic device shown is only an example and should not bring any limitation to the functions and usage scope of the embodiments of this specification.

[0114] As Figure 8 shown, the electronic device is presented in the form of a general-purpose computing device. The components of the electronic device may include, but are not limited to: one or more processors 410, a communication interface 420, a memory 430, and a communication bus 440 connecting different components (including the memory 430, the communication interface 420, and the processing unit 410).

[0115] The communication bus 440 represents one or more of several types of bus architectures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, or a local bus using any of the various bus architectures. By way of example, the communication bus 440 may include, but is not limited to, an Industry Standard Architecture (ISA) bus, a Micro Channel Architecture (MCA) bus, an Enhanced ISA bus, a Video Electronics Standards Association (VESA) local bus, and a Peripheral Component Interconnection (PCI) bus.

[0116] An electronic device typically includes a variety of computer system readable media. These media can be any available media that can be accessed by the electronic device, including volatile and nonvolatile media, removable and non-removable media.

[0117] The memory 430 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) and / or cache memory. The memory 430 may include at least one program product having a set (e.g., at least one) of program modules that are configured to carry out the functions of the embodiments described in this specification Figures 1 to 5 as illustrated.

[0118] A program / utility having a set (at least one) of program modules may be stored in the memory 430. Such program modules include - but are not limited to - an operating system, one or more application programs, other program modules, and program data. Each or some combination of these examples may include an implementation of a network environment. The program modules generally carry out the functions and / or methods in the embodiments described in this specification Figures 1 to 5 as described.

[0119] The processor 410 executes various functional applications and data processing by running programs stored in the memory 430, such as implementing the method for determining the number of machines required for the applications provided in the embodiments illustrated in this specification Figures 1 to 5 as described.

[0120] The embodiments of this specification provide a non-transitory computer-readable storage medium that stores computer instructions that cause the computer to execute the method for determining the number of machines required for the applications provided in the embodiments illustrated in this specification Figures 1 to 5 as described.

[0121] The above-mentioned non-transitory computer-readable storage medium may adopt any combination of one or more computer-readable media. The computer-readable media may be computer-readable signal media or computer-readable storage media. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples (non-exhaustive list) of the computer-readable storage medium include: an electrical connection having one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read only memory (ROM), an erasable programmable read only memory (EPROM), or a flash memory, an optical fiber, a portable compact disk read only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this document, the computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.

[0122] The computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries the computer-readable program code. Such a propagated data signal may take various forms, including - but not limited to - an electromagnetic signal, an optical signal, or any suitable combination of the above. The computer-readable signal medium may also be any computer-readable medium other than the computer-readable storage medium, which can send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0123] The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including - but not limited to - wireless, wire, optical cable, radio frequency (RF), etc., or any suitable combination of the above.

[0124] Computer program code for performing the operations of this specification can be written in one or more programming languages or combinations thereof. The programming languages include object-oriented programming languages such as Java, Smalltalk, C++, and also include conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, executed as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any kind of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computer (for example, by using an Internet service provider to connect through the Internet).

[0125] The specific embodiments of this specification are described above. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims can be performed in a different order than in the embodiments and still achieve the desired results. Additionally, the processes depicted in the figures do not necessarily require the particular order or sequential order shown to achieve the desired results. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0126] In the description of this specification, the description with reference to terms such as "one embodiment", "some embodiments", "example", "specific example", or "some examples", etc. means that the specific features, structures, materials, or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of this specification. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described can be combined in a suitable manner in any one or more embodiments or examples. In addition, without contradiction, those skilled in the art can combine and combine the different embodiments or examples described in this specification and the features of different embodiments or examples.

[0127] Furthermore, the terms "first" and "second" are used only for descriptive purposes and cannot be construed as indicating or implying relative importance or implicitly specifying the quantity of the indicated technical features. Thus, the features defined with "first" and "second" can explicitly or implicitly include at least one of the features. In the description of this specification, the meaning of "a plurality" is at least two, such as two, three, etc., unless otherwise specifically defined.

[0128] Any process or method description, whether in a flowchart or otherwise described herein, can be understood to represent a module, segment, or portion of code that includes one or more executable instructions for implementing a customized logical function or process. The scope of the preferred embodiments of this specification includes additional implementations, where the functions may be executed not in the order shown or discussed, including in a substantially simultaneous manner or in the reverse order according to the functions involved, which should be understood by those skilled in the technical field to which the embodiments of this specification pertain.

[0129] Depending on the context, the word "if" as used herein can be interpreted as "when" or "while" or "in response to determining" or "in response to detecting". Similarly, depending on the context, the phrase "if determined" or "if detected (stated condition or event)" can be interpreted as "when determined" or "in response to determining" or "when detected (stated condition or event)" or "in response to detecting (stated condition or event)".

[0130] It should be noted that the terminals involved in the embodiments of this specification may include, but are not limited to, personal computers (PCs), personal digital assistants (PDAs), wireless handheld devices, tablet computers, mobile phones, MP3 players, MP4 players, etc.

[0131] In the several embodiments provided in this specification, it should be understood that the disclosed systems, devices, and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the units is only a logical function division, and there may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed couplings or direct couplings or communication connections between each other can be through some interfaces, and the indirect couplings or communication connections of the devices or units can be in electrical, mechanical, or other forms.

[0132] In addition, each functional unit in the various embodiments of this specification can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit. The above-mentioned integrated units can be implemented in the form of hardware, or in the form of a combination of hardware and software functional units.

[0133] The integrated unit implemented in the form of software functional units can be stored in a computer-readable storage medium. The above-mentioned software functional units are stored in a storage medium and include several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to execute some steps of the methods described in the embodiments of this specification. The foregoing storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard disks, read-only memories (ROMs), random access memories (RAMs), magnetic disks, or optical discs.

[0134] The above are only the preferred embodiments of this specification and are not intended to limit this specification. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of this specification shall be included within the scope of protection of this specification.

Claims

1. A method for determining the number of machines required for an application, comprising: Obtaining historical monitoring data, where the historical monitoring data includes the performance data and traffic data of the application; Generating a target CPU water level for the application based on the performance data of the application; and predicting the traffic of the application within a predetermined time interval after the current moment based on the traffic data of the application; Determining the target number of machines required for the application based on the target CPU water level of the application and the traffic within the predetermined time interval by using a pre-established traffic-CPU association model, where the difference between the CPU water level of the application and the CPU target water level is less than or equal to a predetermined threshold; Before determining the target number of machines required for the application based on the target CPU water level of the application and the traffic within the predetermined time interval by using a pre-established traffic-CPU association model, it further includes: Obtaining the true value of the CPU water level of the application based on the performance data of the application; Separately modeling based on the true value of the CPU water level of the application and the traffic data of the application to obtain a single association model between the CPU water level and traffic of the application, and obtaining the predicted value of the CPU water level of the application output by the single association model; Performing unified modeling based on the name of each application globally, the name of the computer room where each application is located, the traffic data of each application and the corresponding time information, the predicted value of the CPU water level of each application, and the true value of the CPU water level of each application to obtain the traffic-CPU association model.

2. The method according to claim 1, wherein After determining the target number of machines required for the application based on the target CPU water level of the application and the traffic within the predetermined time interval by using a pre-established traffic-CPU association model, it further includes: Obtaining the number of machines for scaling the application up or down based on the target number of machines and the number of machines currently used by the application.

3. The method according to claim 1, wherein, Generating the target CPU water level for the application based on the performance data of the application includes: Obtaining the CPU water level of the application based on the performance data of the application; Determining the target CPU water level for the application based on the CPU water level of the application and a predetermined maximum CPU water level; where the target CPU water level is less than or equal to the predetermined maximum CPU water level.

4. The method according to claim 3, wherein After determining the target CPU water level for the application based on the CPU water level of the application and a predetermined maximum CPU water level, it further includes: If the current CPU water level of the application is greater than the target CPU water level, then increasing the target CPU water level based on the current CPU water level and the predetermined maximum CPU water level, and the increased target CPU water level is less than or equal to the predetermined maximum CPU water level.

5. The method according to claim 1, wherein, Predicting the traffic of the application within a predetermined time interval after the current moment based on the traffic data of the application includes: Performing a periodic trend discrimination on the traffic data of the application to determine the traffic type to which the traffic data of the application belongs; If the traffic data of the application belongs to the first traffic type, predict the traffic belonging to the first traffic type within a predetermined time interval after the current moment through a pre-established time series prediction model; wherein, the first traffic type is a traffic type with periodicity or trend. If the traffic data of the application belongs to the second traffic type, predict the traffic belonging to the second traffic type within a predetermined time interval after the current moment through the pre-established dependency relationship between time points; wherein, the second traffic type is a traffic type that does not belong to the first traffic type.

6. An apparatus for determining the number of machines required for an application, comprising: An acquisition module, configured to acquire historical monitoring data, where the historical monitoring data includes the performance data and traffic data of the application. A generation module, configured to generate the target CPU water level of the application according to the performance data of the application. A prediction module, configured to predict the traffic of the application within a predetermined time interval after the current moment according to the traffic data of the application. A determination module, configured to determine the target number of machines required for the application according to the target CPU water level of the application and the traffic within the predetermined time interval, by using a pre-established traffic-CPU association model, where the target number of machines makes the difference between the CPU water level of the application and the CPU target water level less than or equal to a predetermined threshold. Wherein, the apparatus further includes: a modeling module. The acquisition module is further configured to obtain the true value of the CPU water level of the application according to the performance data of the application before the determination module determines the target number of machines required for the application by using the pre-established traffic-CPU association model. The modeling module is configured to perform separate modeling according to the true value of the CPU water level of the application and the traffic data of the application, to obtain a single association model between the CPU water level and the traffic of the application. The acquisition module is further configured to obtain the predicted value of the CPU water level of the application output by the single association model. The modeling module is further configured to, after the acquisition module obtains the predicted value of the CPU water level of the application output by the single association model, perform unified modeling according to the name of each application globally, the name of the computer room where each application is located, the traffic data of each application and the corresponding time information, the predicted value of the CPU water level of each application, and the true value of the CPU water level of each application, to obtain the traffic-CPU association model.

7. The apparatus according to claim 6, wherein The determination module is further configured to, after determining the target number of machines required for the application by using the pre-established traffic-CPU association model, obtain the number of machines for the application to scale out or in according to the target number of machines and the number of machines currently used by the application.

8. The apparatus according to claim 6, wherein, The generation module includes: A water level acquisition sub-module, configured to obtain the CPU water level of the application according to the performance data of the application. A water level determination sub-module, configured to determine a target CPU water level of the application according to the CPU water level of the application and a predetermined maximum CPU water level; wherein, the target CPU water level is less than or equal to the predetermined maximum CPU water level.

9. The apparatus according to claim 8, wherein, The generation module further includes: A water level adjustment sub-module, configured to, after the water level determination sub-module determines the target CPU water level of the application according to the CPU water level of the application and the predetermined maximum CPU water level, if the current CPU water level of the application is greater than the target CPU water level, increase the target CPU water level according to the current CPU water level and the predetermined maximum CPU water level, and the increased target CPU water level is less than or equal to the predetermined maximum CPU water level.

10. The device according to claim 6, wherein The prediction module includes: A type determination sub-module, configured to perform a periodic trend discrimination on the traffic data of the application to determine the traffic type to which the traffic data of the application belongs; A traffic prediction sub-module, configured to, when the traffic data of the application belongs to a first traffic type, predict the traffic belonging to the first traffic type within a predetermined time interval after the current moment of the application through a pre-established time series prediction model; wherein, the first traffic type is a traffic type with periodicity or trend; when the traffic data of the application belongs to a second traffic type, predict the traffic belonging to the second traffic type within a predetermined time interval after the current moment of the application through a pre-established dependency relationship between time points; wherein, the second traffic type is a traffic type that does not belong to the first traffic type.

11. An electronic device, comprising: At least one processor; And At least one memory communicatively connected to the processor, wherein: The memory stores program instructions executable by the processor, and the processor can execute the method according to any one of claims 1 to 5 by invoking the program instructions.

12. A non-transitory computer-readable storage medium, the non-transitory computer-readable storage medium stores computer instructions, and the computer instructions cause the computer to execute the method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Prediction method and device for capacity expansion and shrinkage state

    CN111352733A

  • Container resource control method and device and computer storage medium

    CN113886010A