A resource prediction method and device

By collecting data in a production environment and using linear regression and bilinear regression models, we build correlation characteristics between interfaces and optimize the estimation of single TPS resource consumption, solving the problem of low accuracy in resource prediction in the existing technology, and achieving more accurate resource prediction and expansion decisions.

CN114090204BActive Publication Date: 2025-05-02WEBANK (CHINA)
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111364690.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-17
Publication Date
2025-05-02
Estimated Expiration
2041-11-17

AI Technical Summary

Technical Problem

When predicting server resource consumption, the difference between the test environment and the production environment leads to low accuracy and high uncertainty in the expansion results, especially in a multi-interface hybrid server environment.

Method used

By collecting the actual total resource consumption of the server and the TPS data of each interface in the production environment, using the linear regression model and the bilinear regression model, the correlation characteristics between the interfaces are constructed, and the estimation of the single TPS resource consumption is gradually optimized to improve the accuracy of resource prediction.

Benefits of technology

It improves the accuracy of resource prediction, reduces the uncertainty of expansion results, and can more accurately predict the total consumption of server resources, and is suitable for multi-interface hybrid server environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114090204B_ABST
    Figure CN114090204B_ABST
Patent Text Reader

Abstract

The embodiment of the present invention provides a resource prediction method and device. The method includes: collecting the actual total resource consumption of the server in the production environment at each moment and the transaction volume TPS per second of each interface of the server at each moment; based on the linear regression model, through the actual total resource consumption at each moment and the TPS of each interface at each moment, determining the rough estimated resource consumption of each interface per TPS; constructing the first correlation feature between interfaces and the second correlation feature between interfaces; based on the bilinear regression model, through the first correlation feature between interfaces and the second correlation feature between interfaces, determining the detailed estimated resource consumption of each interface per TPS. More clearly understand the actual use of resources in the production environment. Take into account the interaction between the interfaces, thereby improving the accuracy of resource prediction. The accuracy of the obtained detailed estimated consumption of single TPS resources of each interface is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present invention relate to the technical field of resource scheduling, and in particular, to a resource prediction method, apparatus, computing device, and computer-readable storage medium. Background Art

[0002] With the development of computer technology, more and more technologies are being applied in the financial field. The traditional financial industry is gradually transforming into financial technology (Fintech). However, due to the security and real-time requirements of the financial industry, higher requirements are also placed on technology.

[0003] After receiving the transaction request from the user, the application system allocates corresponding resources for the transaction request for processing. When the transaction request volume is large, it is necessary to expand the resources accordingly according to the increase in the transaction request volume. Taking a server in the application system as an example, the server contains multiple interfaces, and different interfaces receive different types of transaction requests. Different types of transaction requests consume different amounts of resources. Therefore, if the resource consumption of each transaction request of any interface can be determined, that is, the resource consumption of a single TPS (Transaction Per Second), then when determining how to expand the capacity at a subsequent moment, the increased resource consumption of the interface can be obtained based on the single TPS resource consumption of the interface and the increased transaction request volume of the interface, and the total increased resource consumption of each interface of the server can be further obtained. The resources are expanded accordingly according to the increased total resource consumption.

[0004] In the prior art, the single TPS resource consumption of each interface is determined by stress testing the server in the test environment. Specifically, the machine in the test environment is set to an ideal condition, that is, only a single interface service is performed, and the single TPS resource consumption of each interface is obtained by performing a single stress test on each interface. However, there are differences in data, configuration, cache, etc. between the test environment and the actual production environment. If the stress test results of the test environment are directly applied to the production environment, the environmental differences will lead to low accuracy and high uncertainty in the expansion results. At the same time, most servers are hybrid servers with multiple interfaces, and different interfaces will affect each other. If the server is set to an ideal single-interface server in the test environment for a single stress test, it will also lead to low accuracy and high uncertainty in the expansion results.

[0005] In summary, the embodiments of the present invention provide a resource prediction method to improve the accuracy of resource prediction. Summary of the invention

[0006] An embodiment of the present invention provides a resource prediction method to improve the accuracy of resource prediction.

[0007] In a first aspect, an embodiment of the present invention provides a resource prediction method, comprising:

[0008] Collect the actual total resource consumption of the servers in the production environment at each time and the transaction volume per second (TPS) of each interface of the server at each time;

[0009] Based on the linear regression model, the rough estimated single TPS resource consumption of each interface is determined through the actual total resource consumption at each moment and the TPS of each interface at each moment;

[0010] According to the roughly estimated single TPS resource consumption of the first interface and the roughly estimated single TPS resource consumption of the second interface, a first correlation feature between interfaces is constructed; for any moment, according to the TPS of the first interface at the moment and the TPS of the second interface at the moment, a second correlation feature between interfaces is constructed; the first interface and the second interface are any one of the interfaces;

[0011] Based on the bilinear regression model, the single TPS resource estimated consumption of each interface is determined through the first correlation feature between each interface and the second correlation feature between each interface; the single TPS resource estimated consumption of each interface is used to predict the total predicted resource consumption of the server at subsequent times.

[0012] By collecting and analyzing the monitoring data of the server at each moment in the production environment, we can more clearly understand the actual use of resources in the production environment. The monitoring data includes the actual total resource consumption of the server at each moment in the production environment and the TPS of each interface of the server at each moment. The resource usage of each interface is analyzed at the same time, and the correlation features are constructed for any two interfaces, taking into account the interaction between the interfaces, thereby improving the accuracy of resource prediction. The bilinear regression model is used to predict the single TPS resource consumption of each interface, which further intuitively and accurately determines the resource usage of each interface. In this way, the accuracy of the single TPS resource consumption estimate of each interface is improved.

[0013] Optionally, based on a linear regression model, the rough estimated single TPS resource consumption of each interface is determined through the actual total resource consumption at each moment and the TPS of each interface at each moment, including:

[0014] A first initial value of the single TPS resource consumption of each interface is set, and the first initial value and the TPS of each interface at each moment are substituted into a linear regression equation to obtain an estimated total resource consumption at each moment; based on the actual total resource consumption at each moment and the estimated total resource consumption at each moment, the first initial value is updated until the actual total resource consumption at each moment and the estimated total resource consumption at each moment meet the set requirements, and the first initial value when the set requirements are met is determined as the rough estimated single TPS resource consumption of each interface.

[0015] By continuously correcting the first initial value in the linear regression model until the actual total resource consumption at each moment and the estimated total resource consumption at each moment meet the set requirements, the rough estimated single TPS resource consumption determined in this way is determined in the multi-interface service provided by the server, so it is more accurate.

[0016] Optionally, based on a linear regression model, the rough estimated single TPS resource consumption of each interface is determined through the actual total resource consumption at each moment and the TPS of each interface at each moment, including:

[0017] Setting a first initial value of a single TPS resource consumption of each interface, substituting the first initial value and the TPS of each interface at each moment into a linear regression equation to obtain an estimated total resource consumption at each moment; updating the first initial value based on the actual total resource consumption at each moment and the estimated total resource consumption at each moment until the actual total resource consumption at each moment and the estimated total resource consumption at each moment meet the set requirements;

[0018] Based on the first initial value when the set requirements are met, the estimated total resource consumption of each interface at each moment is obtained according to the TPS of each interface at each moment; the difference between the estimated total resource consumption at each moment and the actual total resource consumption at each moment is calculated, and the actual total resource consumption corresponding to the moment when the difference is less than a preset threshold is retained;

[0019] Based on the actual total resource consumption at each reserved moment, the first initial value when the set requirements are met and the TPS of each interface at each reserved moment are substituted into the linear regression equation to obtain the estimated total resource consumption at each reserved moment; based on the estimated total resource consumption at each reserved moment and the actual total resource consumption at each reserved moment, the first initial value when the set requirements are met is updated until the estimated total resource consumption at each reserved moment and the actual total resource consumption at each reserved moment meet the set requirements, and the first initial value when the set requirements are met again is determined as the rough estimated single TPS resource consumption of each interface.

[0020] The first initial value is further optimized by filtering out noise data with large deviations.

[0021] Optionally, constructing a first correlation feature between interfaces according to the roughly estimated single TPS resource consumption of the first interface and the roughly estimated single TPS resource consumption of the second interface includes:

[0022] Representing the roughly estimated single TPS resource consumption of each interface as a first row vector, and transposing the first row vector to obtain a first column vector;

[0023] The first column vector is multiplied by the first row vector to obtain a first association feature between the interfaces.

[0024] In practice, the interfaces of the server are interrelated, and using the linear regression model to calculate each interface independently does not take into account the correlation between the interfaces. Therefore, the first correlation feature is determined, which reflects the correlation between the single TPS resource consumption of each interface.

[0025] Optionally, at any moment, according to the TPS of the first interface at the moment and the TPS of the second interface at the moment, constructing a second association feature between interfaces includes:

[0026] For any moment, the TPS of each interface at the moment is represented as a second row vector, and the second row vector is transposed to obtain a second column vector;

[0027] The second column vector is multiplied by the second row vector to obtain a second association feature between the interfaces.

[0028] In practice, the interfaces of the server are interrelated, and using the linear regression model to calculate each interface independently does not take into account the correlation between the interfaces. Therefore, the second correlation feature is determined, which reflects the correlation between the TPS of each interface at any time.

[0029] Optionally, based on the bilinear regression model, the single TPS resource detailed consumption of each interface is determined through the first correlation feature between each interface and the second correlation feature between each interface, including:

[0030] Substituting the first correlation feature between the interfaces and the second correlation feature between the interfaces into the bilinear regression equation to obtain the estimated total resource consumption at each moment; based on the actual total resource consumption at each moment and the estimated total resource consumption at each moment, updating the rough estimated single TPS resource consumption of each interface until the actual total resource consumption at each moment and the estimated total resource consumption at each moment meet the set requirements;

[0031] The roughly estimated single TPS resource consumption of each interface when the set requirements are met is determined as the detailed estimated single TPS resource consumption of each interface.

[0032] By continuously correcting the rough estimated single TPS resource consumption of each interface in the bilinear regression model until the actual total resource consumption at each moment and the estimated total resource consumption at each moment meet the set requirements, the rough estimated single TPS resource consumption determined in this way has a higher accuracy.

[0033] Optionally, after determining the estimated single TPS resource consumption of each interface, the method further includes:

[0034] Performing normalization and / or regularization on the single TPS resource detailed estimated consumption of each interface to obtain normalized vectors and / or regularized vectors of the single TPS resource detailed estimated consumption of each interface;

[0035] Constructing a feature vector according to the single TPS resource detailed consumption of each interface, the normalized vector and at least two of the normalized vector;

[0036] Setting a second initial value of the correction parameter, substituting the characteristic vector, the second initial value and the TPS of each interface at each moment into a linear regression equation to obtain the estimated total resource consumption at each moment; updating the second initial value based on the actual total resource consumption at each moment and the estimated total resource consumption at each moment until the actual total resource consumption at each moment and the estimated total resource consumption at each moment meet the set requirements;

[0037] The final single TPS resource estimated consumption of each interface is determined according to the second initial value and the characteristic vector when the set requirement is met.

[0038] The single TPS resource detailed consumption obtained initially is normalized to obtain a normalized vector, which can limit the single TPS resource detailed consumption of each interface within a certain range, thereby speeding up the subsequent optimal solution and improving the processing accuracy; the single TPS resource detailed consumption obtained initially is normalized to obtain a normalized vector, which can make the single TPS resource detailed consumption of each interface obey the standard normal distribution, further improving the processing accuracy. In this way, the feature vector constructed based on at least two of the single TPS resource detailed consumption, the normalized vector and the normalized vector can improve the subsequent processing accuracy. Since the feature vector is fixed, a correction parameter is introduced, and the correction parameter is corrected multiple times to obtain the second initial value of the correction parameter when the setting requirement is obtained. The final single TPS resource detailed consumption is further obtained based on the second initial value and the feature vector when the setting requirement is set. Compared with the single TPS resource detailed consumption obtained initially, the final single TPS resource detailed consumption obtained in this way is data enhanced, contains more information, and the robustness is improved.

[0039] In a second aspect, an embodiment of the present invention further provides a resource prediction device, comprising:

[0040] A collection unit, used to collect the actual total resource consumption of the server in the production environment at each moment and the transaction volume per second TPS of each interface of the server at each moment;

[0041] A processing unit for:

[0042] Based on the linear regression model, the rough estimated single TPS resource consumption of each interface is determined through the actual total resource consumption at each moment and the TPS of each interface at each moment;

[0043] According to the roughly estimated single TPS resource consumption of the first interface and the roughly estimated single TPS resource consumption of the second interface, a first correlation feature between interfaces is constructed; for any moment, according to the TPS of the first interface at the moment and the TPS of the second interface at the moment, a second correlation feature between interfaces is constructed; the first interface and the second interface are any one of the interfaces;

[0044] Based on the bilinear regression model, the single TPS resource estimated consumption of each interface is determined through the first correlation feature between each interface and the second correlation feature between each interface; the single TPS resource estimated consumption of each interface is used to predict the total predicted resource consumption of the server at subsequent times.

[0045] Optionally, the processing unit is specifically configured to:

[0046] A first initial value of the single TPS resource consumption of each interface is set, and the first initial value and the TPS of each interface at each moment are substituted into a linear regression equation to obtain an estimated total resource consumption at each moment; based on the actual total resource consumption at each moment and the estimated total resource consumption at each moment, the first initial value is updated until the actual total resource consumption at each moment and the estimated total resource consumption at each moment meet the set requirements, and the first initial value when the set requirements are met is determined as the rough estimated single TPS resource consumption of each interface.

[0047] Optionally, the processing unit is specifically configured to:

[0048] Setting a first initial value of a single TPS resource consumption of each interface, substituting the first initial value and the TPS of each interface at each moment into a linear regression equation to obtain an estimated total resource consumption at each moment; updating the first initial value based on the actual total resource consumption at each moment and the estimated total resource consumption at each moment until the actual total resource consumption at each moment and the estimated total resource consumption at each moment meet the set requirements;

[0049] Based on the first initial value when the set requirements are met, the estimated total resource consumption of each interface at each moment is obtained according to the TPS of each interface at each moment; the difference between the estimated total resource consumption at each moment and the actual total resource consumption at each moment is calculated, and the actual total resource consumption corresponding to the moment when the difference is less than a preset threshold is retained;

[0050] Based on the actual total resource consumption at each reserved moment, the first initial value when the set requirements are met and the TPS of each interface at each reserved moment are substituted into the linear regression equation to obtain the estimated total resource consumption at each reserved moment; based on the estimated total resource consumption at each reserved moment and the actual total resource consumption at each reserved moment, the first initial value when the set requirements are met is updated until the estimated total resource consumption at each reserved moment and the actual total resource consumption at each reserved moment meet the set requirements, and the first initial value when the set requirements are met again is determined as the rough estimated single TPS resource consumption of each interface.

[0051] Optionally, the processing unit is specifically configured to:

[0052] Representing the roughly estimated single TPS resource consumption of each interface as a first row vector, and transposing the first row vector to obtain a first column vector;

[0053] The first column vector is multiplied by the first row vector to obtain a first association feature between the interfaces.

[0054] Optionally, the processing unit is specifically configured to:

[0055] For any moment, the TPS of each interface at the moment is represented as a second row vector, and the second row vector is transposed to obtain a second column vector;

[0056] The second column vector is multiplied by the second row vector to obtain a second association feature between the interfaces.

[0057] Optionally, the processing unit is specifically configured to:

[0058] Substituting the first correlation feature between the interfaces and the second correlation feature between the interfaces into the bilinear regression equation to obtain the estimated total resource consumption at each moment; based on the actual total resource consumption at each moment and the estimated total resource consumption at each moment, updating the rough estimated single TPS resource consumption of each interface until the actual total resource consumption at each moment and the estimated total resource consumption at each moment meet the set requirements;

[0059] The roughly estimated single TPS resource consumption of each interface when the set requirements are met is determined as the detailed estimated single TPS resource consumption of each interface.

[0060] Optionally, the processing unit is further configured to:

[0061] Performing normalization and / or regularization on the single TPS resource detailed estimated consumption of each interface to obtain normalized vectors and / or regularized vectors of the single TPS resource detailed estimated consumption of each interface;

[0062] Constructing a feature vector according to the single TPS resource detailed consumption of each interface, the normalized vector and at least two of the normalized vector;

[0063] Setting a second initial value of the correction parameter, substituting the characteristic vector, the second initial value and the TPS of each interface at each moment into a linear regression equation to obtain the estimated total resource consumption at each moment; updating the second initial value based on the actual total resource consumption at each moment and the estimated total resource consumption at each moment until the actual total resource consumption at each moment and the estimated total resource consumption at each moment meet the set requirements;

[0064] The final single TPS resource estimated consumption of each interface is determined according to the second initial value and the characteristic vector when the set requirement is met.

[0065] In a third aspect, an embodiment of the present invention further provides a computing device, including:

[0066] Memory for storing computer programs;

[0067] The processor is used to call the computer program stored in the memory and execute the resource prediction method listed in any of the above-mentioned ways according to the obtained program.

[0068] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer-executable program, and the computer-executable program is used to enable a computer to execute the resource prediction method listed in any of the above-mentioned methods. BRIEF DESCRIPTION OF THE DRAWINGS

[0069] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0070] Figure 1 A schematic diagram of a system architecture provided for an embodiment of the present invention;

[0071] Figure 2 A schematic diagram of a flow chart of a resource prediction method provided by an embodiment of the present invention;

[0072] Figure 3A A schematic diagram of a TPS change of an interface 110 provided in an embodiment of the present invention;

[0073] Figure 3B A schematic diagram of actual total resource consumption of a server provided in an embodiment of the present invention;

[0074] Figure 4 A schematic diagram of the relationship between the estimated total CPU consumption at each moment and the actual total CPU consumption at each moment provided by an embodiment of the present invention;

[0075] Figure 5 A schematic diagram of the relationship between the estimated total CPU consumption at each moment and the actual total CPU consumption at each moment provided by an embodiment of the present invention;

[0076] Figure 6 A schematic diagram of determining a first association feature between interfaces provided by an embodiment of the present invention;

[0077] Figure 7 A schematic diagram of a method for expanding a first association feature between interfaces provided by an embodiment of the present invention;

[0078] Figure 8 A schematic diagram of a flow chart of a resource prediction method provided by an embodiment of the present invention;

[0079] Fig. 9 A flow chart of a method for obtaining a feature vector and correcting parameters provided by an embodiment of the present invention;

[0080] Fig.10 A schematic diagram of the structure of a resource prediction device provided by an embodiment of the present invention;

[0081] Fig.11 A schematic diagram of the structure of a computer device provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0082] In order to make the purpose, implementation mode and advantages of the present application clearer, the exemplary implementation mode of the present application will be clearly and completely described below in conjunction with the drawings in the exemplary embodiments of the present application. Obviously, the described exemplary embodiments are only part of the embodiments of the present application, rather than all the embodiments.

[0083] Based on the exemplary embodiments described in this application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the claims attached to this application. In addition, although the disclosure in this application is introduced according to one or several exemplary examples, it should be understood that each aspect of the disclosure can also constitute a complete implementation method separately.

[0084] It should be noted that the brief description of terms in this application is only for the convenience of understanding the embodiments described below, and is not intended to limit the embodiments of this application. Unless otherwise specified, these terms should be understood according to their common and usual meanings.

[0085] The terms "first", "second", "third", etc. in the specification and claims of this application and the above drawings are used to distinguish similar or similar objects or entities, and do not necessarily mean to limit a specific order or sequence, unless otherwise indicated. It should be understood that the terms used in this way can be interchangeable under appropriate circumstances, for example, they can be implemented according to orders other than those given in the diagrams or descriptions of the embodiments of this application.

[0086] In addition, the terms "include" and "have" and any variations thereof are intended to cover but not exclude inclusion, for example, a product or device comprising a list of components is not necessarily limited to those components expressly listed but may include other components not expressly listed or inherent to such products or devices.

[0087] Figure 1 The following is an exemplary diagram showing a system architecture applicable to an embodiment of the present invention. The system architecture may be a server 100, including multiple interfaces, such as Figure 1 The interface 110, interface 120, and interface 130 are shown in FIG. Different interfaces may process different transaction requests or may process the same transaction request, which is not limited in the embodiment of the present invention. For example, interface 110 receives a transaction request for opening an account, interface 120 receives a transaction request for closing an account, and interface 130 receives a transaction request for transferring funds.

[0088] It should be noted that the above Figure 1 The structure shown is only an example and is not limited to this embodiment of the present invention.

[0089] Figure 1 The server shown can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDNs), as well as big data and artificial intelligence platforms.

[0090] In the prior art, the method for determining the single TPS resource consumption of each interface is to build a test environment that is as consistent as possible with the configuration of the working environment. In the test environment, the server is set to an ideal condition, that is, only a single interface service is provided, so as to measure the single TPS resource consumption of each interface. For example, if only a transaction request for opening an account is sent to the server 100, the transaction request for opening an account is only received through the interface 110. The monitoring data measures the TPS of the interface 110 at any time and the total resource consumption of the server corresponding to that time. The total resource consumption of the server at that time is divided by the TPS of the interface 110 at that time to obtain the single TPS resource consumption of the interface 110, that is, the resource consumption occupied by each transaction request in the transaction request through the interface 110 is determined. Then, if the subsequent business personnel determine the increased TPS of the interface 110, the increased total resource consumption of the interface 110 is obtained by multiplying the increased TPS of the interface 110 by the single TPS resource consumption of the interface 110. Similarly, the total resource consumption of interface 120 and interface 130 can be obtained, and the resource capacity can be expanded accordingly.

[0091] However, the above method is performed in a test environment and assumes that the server only provides a single interface service. Therefore, the accuracy of the single TPS resource consumption determined in this way is low, and a single stress test is performed on each interface. Due to the large number of interfaces, the test will be complex and time-consuming.

[0092] The embodiment of the present invention provides a resource prediction method, such as Figure 2 As shown, the following steps are included.

[0093] Step 201, collecting the actual total resource consumption of the server in the production environment at each time and the transaction volume per second TPS of each interface of the server at each time;

[0094] Step 202, based on a linear regression model, the rough estimated single TPS resource consumption of each interface is determined through the actual total resource consumption at each moment and the TPS of each interface at each moment;

[0095] Step 203, constructing a first correlation feature between interfaces according to the roughly estimated single TPS resource consumption of the first interface and the roughly estimated single TPS resource consumption of the second interface; for any moment, constructing a second correlation feature between interfaces according to the TPS of the first interface at the moment and the TPS of the second interface at the moment; the first interface and the second interface are any one of the interfaces;

[0096] Step 204, based on the bilinear regression model, the single TPS resource estimated consumption of each interface is determined through the first correlation feature between each interface and the second correlation feature between each interface; the single TPS resource estimated consumption of each interface is used to predict the total predicted resource consumption of the server at a subsequent time.

[0097] The resource prediction method provided by the embodiment of the present invention can be directly performed in a production environment and when the server provides multi-interface services.

[0098] By collecting and analyzing the monitoring data of the server at each moment in the production environment, we can more clearly understand the actual use of resources in the production environment. The monitoring data includes the actual total resource consumption of the server at each moment in the production environment and the TPS of each interface of the server at each moment. The resource usage of each interface is analyzed at the same time, and the correlation features are constructed for any two interfaces, taking into account the interaction between the interfaces, thereby improving the accuracy of resource prediction. The bilinear regression model is used to predict the single TPS resource consumption of each interface, which further intuitively and accurately determines the resource usage of each interface. In this way, the accuracy of the single TPS resource consumption estimate of each interface is improved.

[0099] In step 201, the actual total resource consumption of the servers in the production environment at each moment and the transaction volume per second TPS of each interface of the server at each moment are collected.

[0100] The monitoring data can monitor the TPS of each interface of the server at each time. For example, the TPS change of interface 110 from 8:00 to 9:00 is as follows: Figure 3A As shown, the TPS changes of other interfaces at different times can be obtained in the same way. The monitoring data can also monitor the actual total resource consumption of the server at different times. Taking CPU resources as an example, Figure 3B The figure shows the actual total resource consumption changes of the server from 8:00 to 9:00.

[0101] In step 202, based on a linear regression model, a rough estimate of the single TPS resource consumption of each interface is determined through the actual total resource consumption at each moment and the TPS of each interface at each moment.

[0102] At any time, define the TPS of each interface as x1, x2, ..., xn, where n is the number of interfaces. Define the single TPS resource consumption of each interface as a1, a2, ..., an. Define the actual total resource consumption of the server as y, which should satisfy formula (1).

[0103] y=a1x1+a2x2+…+a n x n +β (1)

[0104] Among them, β is the CPU consumption of the process itself.

[0105] In formula (1), x1, x2, ..., xn and y are obtained through monitoring data, and a1, a2, ..., an are unknowns. Then, the unknowns are obtained by linear regression method.

[0106] Specifically: set the first initial value of the single TPS resource consumption of each interface, substitute the first initial value and the TPS of each interface at each moment into the linear regression equation to obtain the estimated total resource consumption at each moment; based on the actual total resource consumption at each moment and the estimated total resource consumption at each moment, update the first initial value until the actual total resource consumption at each moment and the estimated total resource consumption at each moment meet the set requirements, and determine the first initial value when the set requirements are met as the rough estimated single TPS resource consumption of each interface.

[0107] For example, set the first initial value for a1, a2, ..., an, and the value of the first initial value is constant at any time. Substitute the first initial value and the TPS of each interface at any time into formula (1) to obtain the estimated total resource consumption y' at that time. Similarly, y' at each time can be obtained. Calculate the residual sum of squares of y and y' at each time to obtain formula (2).

[0108] D=∑(y-y') 2 (2)

[0109] The first initial value is updated by the least square method or the gradient descent method until D is minimized. At this time, the fitting degree of y and y' at each moment is the best. The first initial value at this time is determined as the rough estimated consumption of single TPS resources of each interface.

[0110] Figure 4 exemplarily shows the relationship between the estimated total CPU consumption at each moment and the actual total CPU consumption at each moment when a1, a2, ..., an are the first initial values ​​that meet the set requirements. Figure 4 The difference between the actual total CPU consumption and the estimated total CPU consumption at each moment is shown in the Error curve below.

[0111] It can be seen that the Error curve has many spikes, which are noise data and will affect the fitting effect. There are many reasons for the generation of noise data. For example, in the actual production environment, there will be indefinite CPU overhead, such as log compression. When this happens, the total CPU consumption will increase sharply. This indefinite CPU overhead data is noise data for accurately fitting the above formula to solve the coefficient. Next, we can filter out this kind of noise data and get a more accurate value of the rough consumption of single TPS resources of each interface.

[0112] Specifically: based on the first initial value that meets the set requirements obtained by the above method, the estimated total resource consumption of each interface at each moment is obtained according to the TPS of each interface at each moment; the difference between the estimated total resource consumption at each moment and the actual total resource consumption at each moment is calculated, and the actual total resource consumption corresponding to the moment when the difference is less than the preset threshold is retained.

[0113] For example, in getting Figure 4 After the relationship diagram between the estimated total CPU consumption at each moment and the actual total CPU consumption at each moment is shown, a preset threshold is set. If the difference between the estimated total resource consumption and the actual total resource consumption at any moment is not less than the preset threshold, the TPS value of each interface and the actual total resource consumption value corresponding to the moment are deleted, and the actual total resource consumption and TPS of each interface corresponding to the moment when the difference is less than the preset threshold are retained.

[0114] After the data is deleted, it is fitted again based on the actual total resource consumption at each retained moment and the TPS of each interface at each moment. The linear regression model is still used to update the first initial value obtained by the above method again. Specifically: the first initial value when the set requirements are met and the TPS of each interface at each retained moment are substituted into the linear regression equation to obtain the estimated total resource consumption at each retained moment; based on the estimated total resource consumption at each retained moment and the actual total resource consumption at each retained moment, the first initial value when the set requirements are met is updated until the estimated total resource consumption at each retained moment and the actual total resource consumption at each retained moment meet the set requirements, and the first initial value when the set requirements are met again is determined as the rough estimate of the single TPS resource consumption of each interface.

[0115] In this way, a more optimized rough estimate of the single TPS resource consumption of each interface is obtained. Figure 5 , which exemplarily shows the relationship between the estimated total CPU consumption at each moment obtained after filtering the noise data and the actual total CPU consumption at each moment. It can be seen that the modified linear regression model obtained after filtering out the noise data can better fit the actual total CPU consumption and the TPS values ​​of each interface involved. At the same time, the difference between the estimated total CPU consumption at each moment and the actual total CPU consumption is close to 0.

[0116] The rough estimated consumption of single TPS resources of each interface obtained by the above method does not take into account the relationship between the interfaces, while in reality, the interfaces in the server are interrelated. Therefore, the optimization is continued through step 203.

[0117] In step 203, a first association feature between interfaces is constructed based on the rough estimated single TPS resource consumption of the first interface and the rough estimated single TPS resource consumption of the second interface; at any moment, a second association feature between interfaces is constructed based on the TPS of the first interface at that moment and the TPS of the second interface at that moment; the first interface and the second interface are any one of the interfaces.

[0118] Specifically, the rough estimated consumption of single TPS resources of each interface is represented as a first row vector, and the first row vector is transposed to obtain a first column vector; the first column vector is multiplied by the first row vector to obtain the first correlation feature between the interfaces. For any moment, the TPS of each interface at the moment is represented as a second row vector, and the second row vector is transposed to obtain a second column vector; the second column vector is multiplied by the second row vector to obtain the second correlation feature between the interfaces.

[0119] Figure 6 The above process is illustrated as an example. For example, the rough estimate of the single TPS resource consumption of each interface is represented by a row vector (1, 2, 3), and then the column vector (1, 2, 3) is obtained after transposition. T The 3×1 column vector is multiplied by the 1×3 row vector to obtain a 3×3 matrix, which is the first correlation feature between interfaces.

[0120] Similarly, at any time, the TPS of each interface at that time is represented by a row vector (4, 5, 6), and after transposition, a column vector (4, 5, 6) T is obtained. The 3×1 column vector is multiplied by the 1×3 row vector to obtain a 3×3 matrix, which is the second correlation feature between interfaces.

[0121] In step 204, based on the bilinear regression model, the single TPS resource estimated consumption of each interface is determined through the first correlation feature between each interface and the second correlation feature between each interface.

[0122] The roughly estimated consumption of a single TPS resource is iteratively optimized, and the optimized roughly estimated consumption of a single TPS resource is used as the detailed estimated consumption of a single TPS resource.

[0123] Specifically, the first association feature between the interfaces and the second association feature between the interfaces are substituted into the bilinear regression equation to obtain the estimated total resource consumption at each moment; based on the actual total resource consumption at each moment and the estimated total resource consumption at each moment, the rough estimated single TPS resource consumption of each interface is updated until the actual total resource consumption at each moment and the estimated total resource consumption at each moment meet the set requirements; the rough estimated single TPS resource consumption of each interface when the set requirements are met is used to determine the detailed estimated single TPS resource consumption of each interface.

[0124] For example, combining Figure 7 , the first association feature and the second association feature obtained in step 203 are both 3×3 matrices. For the convenience of subsequent calculations, the first association feature can be expanded into a 1×9 row vector, and the second association feature can be expanded into a 9×1 column vector. The two vectors are substituted into formula (1) to obtain the estimated total resource consumption at any time. For each moment, the residual sum of squares of the actual total resource consumption at each moment and the estimated total resource consumption at each moment is calculated. The rough estimated consumption of single TPS resources of each interface is continuously updated, and the first association feature is updated accordingly until the residual sum of squares is minimized. The rough estimated consumption of single TPS resources of each interface at this time is determined as the detailed estimated consumption of single TPS resources of each interface.

[0125] Optionally, the above-obtained estimated consumption of single TPS resources can be further optimized. Figure 8 As shown. Includes:

[0126] Step 801, normalizing and / or normalizing the single TPS resource detailed estimated consumption of each interface, and obtaining normalized vectors and / or normalized vectors of the single TPS resource detailed estimated consumption of each interface;

[0127] Step 802, constructing a feature vector according to the single TPS resource detailed estimated consumption of each interface, the normalized vector and at least two of the regularized vector;

[0128] Step 803, setting a second initial value of the correction parameter, substituting the characteristic vector, the second initial value and the TPS of each interface at each moment into a linear regression equation to obtain the estimated total resource consumption at each moment; based on the actual total resource consumption at each moment and the estimated total resource consumption at each moment, updating the second initial value until the actual total resource consumption at each moment and the estimated total resource consumption at each moment meet the set requirements;

[0129] Step 804: Determine the final single TPS resource consumption of each interface according to the second initial value and the characteristic vector when the set requirement is met.

[0130] For example, combining Fig. 9 , if the single TPS resource consumption of each interface is estimated as follows Fig. 9 As shown in the figure, it is a 1×3 row vector. The row vector is normalized, that is, each number in the row vector is divided by the largest number in the row vector to obtain a normalized vector; the row vector is normalized, that is, each number in the row vector is divided by the modulus of the row vector to obtain a normalized vector. If the eigenvector is constructed based on the row vector, the normalized vector and the normalized vector, a 3×3 matrix can be obtained.

[0131] The correction parameter is introduced. The number of rows and columns of the correction parameter is determined by the number of rows and columns of the feature vector and the number of rows and columns of the TPS of each interface at each time. In this example, the feature vector is a 3×3 matrix, and the TPS of each interface at each time is a 3×1 column vector. In order to make the total estimated resource consumption at this time a value, the correction parameter is set to a 1×3 row vector, such as Fig. 9 shown.

[0132] The correction parameter is an unknown number. The second initial value of the correction parameter is set. The characteristic vector, the second initial value and the TPS of each interface at any time are substituted into the linear regression equation to obtain the estimated total resource consumption at any time. The residual sum of squares of the actual total resource consumption and the estimated total resource consumption at each time is calculated, and the second initial value is continuously updated until the residual sum of squares is minimized. At this time, the product of the second initial value of the correction parameter and the characteristic vector is the final single TPS resource consumption estimate of each interface.

[0133] The single TPS resource detailed consumption obtained initially is normalized to obtain a normalized vector, which can limit the single TPS resource detailed consumption of each interface within a certain range, thereby speeding up the subsequent optimal solution and improving the processing accuracy; the single TPS resource detailed consumption obtained initially is normalized to obtain a normalized vector, which can make the single TPS resource detailed consumption of each interface obey the standard normal distribution, further improving the processing accuracy. In this way, the feature vector constructed based on at least two of the single TPS resource detailed consumption, the normalized vector and the normalized vector can improve the subsequent processing accuracy. Since the feature vector is fixed, a correction parameter is introduced, and the correction parameter is corrected multiple times to obtain the second initial value of the correction parameter when the setting requirement is obtained. The final single TPS resource detailed consumption is further obtained based on the second initial value and the feature vector when the setting requirement is set. Compared with the single TPS resource detailed consumption obtained initially, the final single TPS resource detailed consumption obtained in this way is data enhanced, contains more information, and the robustness is improved.

[0134] It is worth noting that Figure 8 The method shown can not only normalize and / or regularize the single TPS resource consumption, but also directly normalize and / or regularize the single TPS resource consumption. If the single TPS resource consumption is normalized and / or regularized, the subsequent processing steps are the same as Figure 8 The steps shown are similar and will not be repeated here.

[0135] A person skilled in the art may use the roughly estimated single TPS resource consumption for the predicted total resource consumption of the server at a subsequent moment; may also use the finely estimated single TPS resource consumption for the predicted total resource consumption of the server at a subsequent moment; may also use the final finely estimated single TPS resource consumption for the predicted total resource consumption of the server at a subsequent moment; the embodiment of the present invention does not impose any limitation on this.

[0136] After determining the single TPS resource consumption (single TPS resource rough consumption or single TPS resource detailed consumption), the expansion resource can be predicted at a later time. For example, the CPU consumption of a single TPS of interface 110 is 1%, the CPU consumption of a single TPS of interface 120 is 2%, and the CPU consumption of a single TPS of interface 130 is 3%. The business personnel set the TPS of interface 110 to increase by 100 / second at a later time, the TPS of interface 120 to increase by 200 / second at a later time, and the TPS of interface 130 to increase by 300 / second at a later time. It can be seen that the total resource consumption of the server at a later time is 100×1%+200×2%+300×3%. Based on this, the application system can be expanded accordingly.

[0137] Based on the same technical concept, Fig.10 The structure of a resource prediction device provided by an embodiment of the present invention is exemplarily shown, and the structure can execute the resource prediction process.

[0138] like Fig.10 As shown, the device specifically includes:

[0139] The collection unit 1001 is used to collect the actual total resource consumption of the server in the production environment at each time and the transaction volume per second TPS of each interface of the server at each time;

[0140] The processing unit 1002 is configured to:

[0141] Based on the linear regression model, the rough estimated single TPS resource consumption of each interface is determined through the actual total resource consumption at each moment and the TPS of each interface at each moment;

[0142] According to the roughly estimated single TPS resource consumption of the first interface and the roughly estimated single TPS resource consumption of the second interface, a first correlation feature between interfaces is constructed; for any moment, according to the TPS of the first interface at the moment and the TPS of the second interface at the moment, a second correlation feature between interfaces is constructed; the first interface and the second interface are any one of the interfaces;

[0143] Based on the bilinear regression model, the single TPS resource estimated consumption of each interface is determined through the first correlation feature between each interface and the second correlation feature between each interface; the single TPS resource estimated consumption of each interface is used to predict the total predicted resource consumption of the server at subsequent times.

[0144] Optionally, the processing unit 1002 is specifically configured to:

[0145] A first initial value of the single TPS resource consumption of each interface is set, and the first initial value and the TPS of each interface at each moment are substituted into a linear regression equation to obtain an estimated total resource consumption at each moment; based on the actual total resource consumption at each moment and the estimated total resource consumption at each moment, the first initial value is updated until the actual total resource consumption at each moment and the estimated total resource consumption at each moment meet the set requirements, and the first initial value when the set requirements are met is determined as the rough estimated single TPS resource consumption of each interface.

[0146] Optionally, the processing unit 1002 is specifically configured to:

[0147] Setting a first initial value of a single TPS resource consumption of each interface, substituting the first initial value and the TPS of each interface at each moment into a linear regression equation to obtain an estimated total resource consumption at each moment; updating the first initial value based on the actual total resource consumption at each moment and the estimated total resource consumption at each moment until the actual total resource consumption at each moment and the estimated total resource consumption at each moment meet the set requirements;

[0148] Based on the first initial value when the set requirements are met, the estimated total resource consumption of each interface at each moment is obtained according to the TPS of each interface at each moment; the difference between the estimated total resource consumption at each moment and the actual total resource consumption at each moment is calculated, and the actual total resource consumption corresponding to the moment when the difference is less than a preset threshold is retained;

[0149] Based on the actual total resource consumption at each reserved moment, the first initial value when the set requirements are met and the TPS of each interface at each reserved moment are substituted into the linear regression equation to obtain the estimated total resource consumption at each reserved moment; based on the estimated total resource consumption at each reserved moment and the actual total resource consumption at each reserved moment, the first initial value when the set requirements are met is updated until the estimated total resource consumption at each reserved moment and the actual total resource consumption at each reserved moment meet the set requirements, and the first initial value when the set requirements are met again is determined as the rough estimated single TPS resource consumption of each interface.

[0150] Optionally, the processing unit 1002 is specifically configured to:

[0151] Representing the roughly estimated single TPS resource consumption of each interface as a first row vector, and transposing the first row vector to obtain a first column vector;

[0152] The first column vector is multiplied by the first row vector to obtain a first association feature between the interfaces.

[0153] Optionally, the processing unit 1002 is specifically configured to:

[0154] For any moment, the TPS of each interface at the moment is represented as a second row vector, and the second row vector is transposed to obtain a second column vector;

[0155] The second column vector is multiplied by the second row vector to obtain a second association feature between the interfaces.

[0156] Optionally, the processing unit 1002 is specifically configured to:

[0157] Substituting the first correlation feature between the interfaces and the second correlation feature between the interfaces into the bilinear regression equation to obtain the estimated total resource consumption at each moment; based on the actual total resource consumption at each moment and the estimated total resource consumption at each moment, updating the rough estimated single TPS resource consumption of each interface until the actual total resource consumption at each moment and the estimated total resource consumption at each moment meet the set requirements;

[0158] The roughly estimated single TPS resource consumption of each interface when the set requirements are met is determined as the detailed estimated single TPS resource consumption of each interface.

[0159] Optionally, the processing unit 1002 is further configured to:

[0160] Performing normalization and / or regularization on the single TPS resource detailed estimated consumption of each interface to obtain normalized vectors and / or regularized vectors of the single TPS resource detailed estimated consumption of each interface;

[0161] Constructing a feature vector according to the single TPS resource detailed consumption of each interface, the normalized vector and at least two of the normalized vector;

[0162] Setting a second initial value of the correction parameter, substituting the characteristic vector, the second initial value and the TPS of each interface at each moment into a linear regression equation to obtain the estimated total resource consumption at each moment; updating the second initial value based on the actual total resource consumption at each moment and the estimated total resource consumption at each moment until the actual total resource consumption at each moment and the estimated total resource consumption at each moment meet the set requirements;

[0163] The final single TPS resource estimated consumption of each interface is determined according to the second initial value and the characteristic vector when the set requirement is met.

[0164] Based on the same technical concept, the embodiment of the present application provides a computer device, such as Fig.11 As shown, it includes at least one processor 1101 and a memory 1102 connected to the at least one processor. The specific connection medium between the processor 1101 and the memory 1102 is not limited in the embodiment of the present application. Fig.11 For example, the processor 1101 and the memory 1102 are connected via a bus. The bus can be divided into an address bus, a data bus, a control bus, etc.

[0165] In the embodiment of the present application, the memory 1102 stores instructions that can be executed by at least one processor 1101, and the at least one processor 1101 can perform the steps of the above-mentioned resource prediction method by executing the instructions stored in the memory 1102.

[0166] Among them, the processor 1101 is the control center of the computer device, and can use various interfaces and lines to connect various parts of the computer device, and perform resource prediction by running or executing instructions stored in the memory 1102 and calling data stored in the memory 1102. Optionally, the processor 1101 may include one or more processing units, and the processor 1101 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 1101. In some embodiments, the processor 1101 and the memory 1102 may be implemented on the same chip, and in some embodiments, they may also be implemented separately on independent chips.

[0167] Processor 1101 can be a general-purpose processor, such as a central processing unit (CPU), a digital signal processor, an application-specific integrated circuit (ASIC), a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component, and can implement or execute the methods, steps and logic block diagrams disclosed in the embodiments of the present application. A general-purpose processor can be a microprocessor or any conventional processor, etc. The steps of the method disclosed in the embodiments of the present application can be directly embodied as a hardware processor for execution, or can be executed by a combination of hardware and software modules in the processor.

[0168] Memory 1102, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer executable programs and modules. Memory 1102 may include at least one type of storage medium, such as flash memory, hard disk, multimedia card, card-type memory, random access memory (Random Access Memory, RAM), static random access memory (Static Random Access Memory, SRAM), programmable read-only memory (Programmable Read Only Memory, PROM), read-only memory (Read Only Memory, ROM), electrically erasable programmable read-only memory (Electrically Erasable Programmable Read-Only Memory, EEPROM), magnetic memory, disk, optical disk, etc. Memory 1102 is any other medium that can be used to carry or store a desired program code in the form of an instruction or data structure and can be accessed by a computer, but is not limited thereto. The memory 1102 in the embodiment of the present application can also be a circuit or any other device that can realize a storage function, for storing program instructions and / or data.

[0169] Based on the same technical concept, an embodiment of the present invention further provides a computer-readable storage medium, which stores a computer-executable program. The computer-executable program is used to enable a computer to execute the resource prediction method listed in any of the above-mentioned ways.

[0170] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0171] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0172] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0173] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0174] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

Claims

1. A resource prediction method, characterized in that: include: Collect the actual total resource consumption of the servers in the production environment at each time and the transaction volume per second (TPS) of each interface of the server at each time; Based on the linear regression model, the rough estimated single TPS resource consumption of each interface is determined through the actual total resource consumption at each moment and the TPS of each interface at each moment; According to the roughly estimated single TPS resource consumption of the first interface and the roughly estimated single TPS resource consumption of the second interface, a first correlation feature between interfaces is constructed; for any moment, according to the TPS of the first interface at the moment and the TPS of the second interface at the moment, a second correlation feature between interfaces is constructed; the first interface and the second interface are any one of the interfaces; Substituting the first correlation feature between the interfaces and the second correlation feature between the interfaces into the bilinear regression equation to obtain the estimated total resource consumption at each moment; based on the actual total resource consumption at each moment and the estimated total resource consumption at each moment, updating the rough estimated single TPS resource consumption of each interface until the actual total resource consumption at each moment and the estimated total resource consumption at each moment meet the set requirements; The roughly estimated single TPS resource consumption of each interface when the set requirements are met is determined as the detailed estimated single TPS resource consumption of each interface; the detailed estimated single TPS resource consumption of each interface is used to predict the total predicted resource consumption of the server at subsequent times.

2. The method according to claim 1, characterized in that Based on the linear regression model, the rough estimated single TPS resource consumption of each interface is determined through the actual total resource consumption at each time and the TPS of each interface at each time, including: A first initial value of the single TPS resource consumption of each interface is set, and the first initial value and the TPS of each interface at each moment are substituted into a linear regression equation to obtain an estimated total resource consumption at each moment; based on the actual total resource consumption at each moment and the estimated total resource consumption at each moment, the first initial value is updated until the actual total resource consumption at each moment and the estimated total resource consumption at each moment meet the set requirements, and the first initial value when the set requirements are met is determined as the rough estimated single TPS resource consumption of each interface.

3. The method according to claim 1, characterized in that Based on the linear regression model, the rough estimated single TPS resource consumption of each interface is determined through the actual total resource consumption at each time and the TPS of each interface at each time, including: Setting a first initial value of a single TPS resource consumption of each interface, substituting the first initial value and the TPS of each interface at each moment into a linear regression equation to obtain an estimated total resource consumption at each moment; updating the first initial value based on the actual total resource consumption at each moment and the estimated total resource consumption at each moment until the actual total resource consumption at each moment and the estimated total resource consumption at each moment meet the set requirements; Based on the first initial value when the set requirements are met, the estimated total resource consumption of each interface at each moment is obtained according to the TPS of each interface at each moment; the difference between the estimated total resource consumption at each moment and the actual total resource consumption at each moment is calculated, and the actual total resource consumption corresponding to the moment when the difference is less than a preset threshold is retained; Based on the actual total resource consumption at each reserved moment, the first initial value when the set requirements are met and the TPS of each interface at each reserved moment are substituted into the linear regression equation to obtain the estimated total resource consumption at each reserved moment; based on the estimated total resource consumption at each reserved moment and the actual total resource consumption at each reserved moment, the first initial value when the set requirements are met is updated until the estimated total resource consumption at each reserved moment and the actual total resource consumption at each reserved moment meet the set requirements, and the first initial value when the set requirements are met again is determined as the rough estimated single TPS resource consumption of each interface.

4. The method according to claim 1, characterized in that According to the roughly estimated single TPS resource consumption of the first interface and the roughly estimated single TPS resource consumption of the second interface, a first correlation feature between the interfaces is constructed, including: Representing the roughly estimated single TPS resource consumption of each interface as a first row vector, and transposing the first row vector to obtain a first column vector; The first column vector is multiplied by the first row vector to obtain a first association feature between the interfaces.

5. The method according to claim 1, characterized in that At any moment, according to the TPS of the first interface at the moment and the TPS of the second interface at the moment, constructing a second association feature between interfaces includes: For any moment, the TPS of each interface at the moment is represented as a second row vector, and the second row vector is transposed to obtain a second column vector; The second column vector is multiplied by the second row vector to obtain a second association feature between the interfaces.

6. The method according to claim 1, characterized in that After determining the estimated consumption of single TPS resources for each interface, it also includes: Performing normalization and / or regularization on the single TPS resource detailed estimated consumption of each interface to obtain normalized vectors and / or regularized vectors of the single TPS resource detailed estimated consumption of each interface; Constructing a feature vector according to the single TPS resource detailed consumption of each interface, the normalized vector and at least two of the normalized vector; Setting a second initial value of the correction parameter, substituting the characteristic vector, the second initial value and the TPS of each interface at each moment into a linear regression equation to obtain the estimated total resource consumption at each moment; updating the second initial value based on the actual total resource consumption at each moment and the estimated total resource consumption at each moment until the actual total resource consumption at each moment and the estimated total resource consumption at each moment meet the set requirements; The final single TPS resource estimated consumption of each interface is determined according to the second initial value and the characteristic vector when the set requirement is met.

7. A resource prediction device, characterized in that: include: A collection unit, used to collect the actual total resource consumption of the server in the production environment at each moment and the transaction volume per second TPS of each interface of the server at each moment; A processing unit for: Based on the linear regression model, the rough estimated single TPS resource consumption of each interface is determined through the actual total resource consumption at each moment and the TPS of each interface at each moment; According to the roughly estimated single TPS resource consumption of the first interface and the roughly estimated single TPS resource consumption of the second interface, a first correlation feature between interfaces is constructed; for any moment, according to the TPS of the first interface at the moment and the TPS of the second interface at the moment, a second correlation feature between interfaces is constructed; the first interface and the second interface are any one of the interfaces; Substituting the first correlation feature between the interfaces and the second correlation feature between the interfaces into the bilinear regression equation to obtain the estimated total resource consumption at each moment; based on the actual total resource consumption at each moment and the estimated total resource consumption at each moment, updating the rough estimated single TPS resource consumption of each interface until the actual total resource consumption at each moment and the estimated total resource consumption at each moment meet the set requirements; The roughly estimated single TPS resource consumption of each interface when the set requirements are met is determined as the detailed estimated single TPS resource consumption of each interface; the detailed estimated single TPS resource consumption of each interface is used to predict the total predicted resource consumption of the server at subsequent times.

8. A computing device, characterized in that include: Memory for storing computer programs; A processor, configured to call a computer program stored in the memory, and execute the method according to any one of claims 1 to 6 according to the obtained program.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer-executable program, and the computer-executable program is used to enable a computer to execute the method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • CPU consumption estimation method and device and CPU consumption estimation model training method and device

    CN111026626A

  • Storage device and method for characteristic self-monitoring of storage device

    CN112749052A