Method and device for automatically expanding and shrinking capacity

Through the automated scaling method, front-end requests are received, machine collection is determined and pressure measurement indicator values ​​are obtained, which solves the problem of manual scaling and manual scaling in the e-commerce field, and achieves efficient and accurate scaling operations.

CN120256079APending Publication Date: 2025-07-04BEIJING WODONG TIANJUN INFORMATION TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410010184.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-01-03
Publication Date
2025-07-04

AI Technical Summary

Technical Problem

In the prior art, business system expansion and capacity operation in the e-commerce field relies on manual methods, resulting in a long time and low accuracy.

Method used

It provides a method of automatic expansion and expansion, by receiving the front-end acquisition request, determining the machine set, obtaining the pressure measurement index value, and automatically calculating the expansion and expansion information based on the preset threshold, so as to achieve updating the total number of machines.

Benefits of technology

The processing efficiency and accuracy of expansion capacity are improved, the defects of manual manual operation are overcome, and automated expansion capacity processing is realized.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120256079A_ABST
    Figure CN120256079A_ABST
Patent Text Reader

Abstract

The invention discloses a method and a device for automatically expanding and shrinking capacity, and relates to the technical field of computers. A specific embodiment of the method comprises the following steps: receiving an acquisition request of capacity expansion and shrinkage information sent by a front end, wherein the acquisition request comprises a system identifier, a pressure measurement packet identifier, pressure measurement time and a preset pressure measurement index threshold; determining a corresponding machine set according to the system identifier and the pressure measurement grouping identifier; the machine set comprises a plurality of machine identifiers; acquiring a pressure measurement index value of each machine identifier in the pressure measurement time; according to the pressure measurement index value of each machine identifier in the pressure measurement time and a preset pressure measurement index threshold value, capacity expansion and shrinkage information corresponding to the acquisition request is determined, and the total number of machines in a machine set is updated according to the capacity expansion and shrinkage information. According to the embodiment, automatic capacity expansion and shrinkage can be realized, the capacity expansion and shrinkage processing efficiency and accuracy are improved, and the defects of long consumed time and low accuracy caused by manual operation are overcome.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular, to a method and device for automatic scaling. Background Art

[0002] In the e-commerce field, during activities, in order to save machine costs or meet traffic, stress testing is performed on the business system to evaluate the need to reduce or increase the number of machines, i.e., servers, and perform scaling-up or scaling-down application operations.

[0003] In the related art, all machine identifiers and the total number of machines are obtained manually, and then the stress test index values of each machine are queried one by one, and the array for scaling-up or scaling-down is calculated manually, so as to submit a scaling-up or scaling-down application according to the calculation result. However, the manual method results in long working hours, low efficiency, and low accuracy. Summary of the Invention

[0004] In view of this, embodiments of the present invention provide a method and device for automatic scaling, which can achieve automatic scaling, improve the processing efficiency and accuracy of scaling, and overcome the defects of long time consumption and low accuracy caused by manual operation.

[0005] To achieve the above object, according to one aspect of the embodiments of the present invention, a method for automatic scaling is provided, including:

[0006] Receiving a request for obtaining scaling information sent by the front end, where the request includes a system identifier, a stress test group identifier, a stress test time, and a preset stress test index threshold;

[0007] Determining a corresponding machine set according to the system identifier and the stress test group identifier; the machine set includes a plurality of machine identifiers;

[0008] Obtaining the stress test index value of each machine identifier within the stress test time;

[0009] Determining the scaling information corresponding to the obtaining request according to the stress test index value of each machine identifier within the stress test time and the preset stress test index threshold, so as to perform scaling processing according to the scaling information and update the total number of machines in the machine set.

[0010] Optionally, obtaining the stress test index value of each machine identifier within the stress test time includes:

[0011] For each machine identifier, sending a data acquisition request to the machine performance monitoring system, where the data acquisition request includes the machine identifier and the stress test time;

[0012] Receive the stress test index values at each time collection point of the machine identifier within the stress test time returned by the machine performance monitoring system.

[0013] Optionally, the scaling information includes a scaling identifier; the preset stress test index threshold includes a preset maximum peak value of the stress test index and a preset minimum peak value of the stress test index; determining the scaling information corresponding to the acquisition request includes:

[0014] Determine the maximum peak value of the stress test index according to the stress test index values of each machine identifier within the stress test time;

[0015] Determine the scaling identifier according to at least one of the maximum peak value of the stress test index, the preset maximum peak value of the stress test index, and / or the preset minimum peak value of the stress test index.

[0016] Optionally, determining the scaling identifier according to at least one of the maximum peak value of the stress test index, the preset maximum peak value of the stress test index, and the preset minimum peak value of the stress test index includes:

[0017] In response to the maximum peak value of the stress test index being greater than the preset maximum peak value of the stress test index, determine the scaling identifier as an identifier indicating capacity expansion;

[0018] In response to the maximum peak value of the stress test index being less than the preset minimum peak value of the stress test index, determine the scaling identifier as an identifier indicating capacity reduction;

[0019] In response to the maximum peak value of the stress test index being greater than the preset minimum peak value of the stress test index and less than the preset maximum peak value of the stress test index, determine the scaling identifier as an identifier indicating capacity reduction or an identifier indicating capacity expansion.

[0020] Optionally, the scaling information further includes a scaling value corresponding to the scaling identifier; after determining the scaling identifier, it further includes:

[0021] Determine the minimum and maximum values of the total number of machines after scaling corresponding to the scaling identifier according to the total number of machines in the machine set, the maximum peak value of the stress test index, the preset maximum peak value of the stress test index, and the preset minimum peak value of the stress test index;

[0022] Determine the scaling value corresponding to the scaling identifier according to the total number of machines and the minimum and maximum values of the total number of machines after scaling.

[0023] Optionally, after determining the scaling information corresponding to the acquisition request, it further includes:

[0024] Return the scaling information to the front end; the scaling information includes a scaling identifier and a scaling value corresponding to the scaling identifier;

[0025] Receive the scaling request sent by the front end, where the scaling request indicates the system identifier, the stress test group identifier, the scaling identifier, and the number of machines; the number of machines is determined according to the scaling value;

[0026] Send the system identifier, the stress test group identifier, the scaling identifier, and the number of machines to the approval flow system, and receive the approval result returned by the approval flow system;

[0027] Return the approval result to the front end so that the front end can display the approval result.

[0028] Optionally, after sending the system identifier, the stress test group identifier, the scaling identifier, and the number of machines to the approval flow system, it further includes:

[0029] Cause the approval flow system to send an MQ message containing the approval result to the message queue, so that the machine management system can obtain the MQ message containing the approval result from the message queue;

[0030] In the case where the approval result indicates approval, cause the machine management system to perform scaling processing according to the scaling identifier and the number of machines.

[0031] According to another aspect of the embodiments of the present invention, there is provided a device for automatic scaling, including:

[0032] A receiving module, which receives a request for obtaining scaling information sent by the front end, and the request includes a system identifier, a stress test group identifier, a stress test time, and a preset stress test index threshold;

[0033] A first obtaining module, which determines a corresponding machine set according to the system identifier and the stress test group identifier; the machine set includes a plurality of machine identifiers;

[0034] A second obtaining module, which obtains the stress test index value of each machine identifier during the stress test time;

[0035] A determining module, which determines the scaling information corresponding to the obtaining request according to the stress test index value of each machine identifier during the stress test time and the preset stress test index threshold, so as to update the total number of machines in the machine set according to the scaling information.

[0036] According to another aspect of the embodiments of the present invention, there is provided an electronic device, including:

[0037] One or more processors;

[0038] A storage device for storing one or more programs,

[0039] When the one or more programs are executed by the one or more processors, the one or more processors implement the method for automatic scaling provided by the present invention.

[0040] According to another aspect of the embodiments of the present invention, there is provided a computer-readable medium having a computer program stored thereon, and when the program is executed by a processor, the method for automatic scaling provided by the present invention is implemented.

[0041] One embodiment of the above invention has the following advantages or beneficial effects: The method for automatic scaling provided by the embodiments of the present invention first receives a request for obtaining scaling information sent by the front end, then determines a set of machines according to the system identifier and the stress testing group identifier, obtains the stress testing index values of each machine during the stress testing time, and then determines the scaling information according to the stress testing index values of each machine identifier during the stress testing time and a preset stress testing index threshold, so as to perform scaling processing according to the scaling information to determine the total number of machines in the set of machines. This method realizes the determination of scaling information in a multi-machine stress testing scenario in an automated manner, improves the efficiency and accuracy of scaling, and overcomes the defects of low efficiency and low accuracy caused by manually counting stress testing index data and manually calculating scaling values.

[0042] The further effects of the above non-conventional optional ways will be described in combination with specific embodiments below. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] The drawings are used to better understand the present invention and do not constitute an improper limitation of the present invention. Among them:

[0044] Figure 1 is a schematic diagram of the main process of a method for automatic scaling according to an embodiment of the present invention;

[0045] Figure 2 is a schematic diagram of the main process of another method for automatic scaling according to an embodiment of the present invention;

[0046] Figure 3 is a schematic diagram of the main process of yet another method for automatic scaling according to an embodiment of the present invention;

[0047] Figure 4 is a schematic diagram of the process of a method for automatic scaling according to an embodiment of the present invention;

[0048] Figure 5 is a schematic diagram of the main modules of a device for automatic scaling according to an embodiment of the present invention;

[0049] Figure 6 is an exemplary system architecture diagram to which the embodiments of the present invention can be applied;

[0050] Figure 7 It is a schematic structural diagram of a computer system of a terminal device or a server suitable for implementing the embodiments of the present invention. Detailed implementation manners

[0051] The following describes exemplary embodiments of the present invention with reference to the accompanying drawings. Various details of the embodiments of the present invention are included to facilitate understanding, and they should be considered merely exemplary. Therefore, those of ordinary skill in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, descriptions of well-known functions and structures are omitted below for clarity and conciseness.

[0052] Figure 1 It is a schematic diagram of the main process of a method for automatic scaling in and out according to an embodiment of the present invention. As Figure 1 shown, the method for automatic scaling in and out includes the following steps:

[0053] Step S101: Receive a request for obtaining scaling in and out information sent by the front end. The obtaining request includes a system identifier, a stress test group identifier, a stress test time, and a preset stress test index threshold;

[0054] Step S102: Determine a corresponding machine set according to the system identifier and the stress test group identifier; the machine set includes multiple machine identifiers;

[0055] Step S103: Obtain the stress test index values of each machine identifier during the stress test time;

[0056] Step S104: Determine the scaling in and out information corresponding to the obtaining request according to the stress test index values of each machine identifier during the stress test time and the preset stress test index threshold, so as to determine the total number of machines in the machine set according to the scaling in and out information.

[0057] In the embodiments of the present invention, the method for automatic scaling in and out can be applied to the expansion or contraction of the number of machines in a business system during stress testing to meet the traffic of the business system and save machine costs. Stress testing is a test method for establishing system stability.

[0058] In an embodiment of the present invention, the method for automatic scaling can be executed by a front-end gateway system. When performing a stress test on a business system, a request for obtaining scaling information sent by the front end is received to obtain the scaling information, that is, an indication of scaling up or down and the number of machines for scaling up or down are obtained. The request for obtaining scaling information includes a system identifier, a stress test group identifier, a stress test time, and a preset stress test index threshold. Among them, the system identifier, the stress test group identifier, the stress test time, and the preset stress test index threshold can be data input by the user on the front-end page, and then the front end sends the data input by the user to the front-end gateway system to obtain the scaling information. The system identifier is the identifier of the business system for stress testing. When performing a stress test, the business system can correspond to one or more stress test groups, and each stress test group has a corresponding stress test group identifier for distinguishing different stress test groups; the stress test time includes a stress test start time and a stress test end time; the preset stress test index threshold includes a preset maximum peak value of the stress test index and a preset minimum peak value of the stress test index. The stress test index can be a resource utilization rate. For example, if the stress test index is the CPU usage rate of a machine, that is, the preset stress test index threshold includes a preset maximum peak value of the CPU usage rate maxTargetUseCPU and a preset minimum peak value of the CPU usage rate minTargetUseCPU. The preset stress test index threshold can be custom-set according to business requirements. The stress test index can also be other indexes, such as response time, throughput, concurrency number, etc.

[0059] In an embodiment of the present invention, after receiving the request for obtaining scaling information sent by the front end, a request is sent to the machine management system. The request includes a system identifier and a stress test identifier. Through this request, the machine combination under the stress test group of the system application can be obtained, that is, according to the system identifier and the stress test group identifier, the corresponding machine set can be obtained. The machine set includes multiple machine identifiers and the total number of machines. The machine identifier can be the machine IP or other custom identifiers. Among them, the front-end gateway system sends the request to the machine management system through an interface set between the front-end gateway system and the machine relationship system.

[0060] In an embodiment of the present invention, after obtaining the machine set, for each machine in the machine set, the stress test index value of each machine within the stress test time is obtained, that is, multiple stress test index values of each machine from the stress test start time to the stress test end time are obtained. The multiple stress test index values can be stress test index values at multiple time collection points.

[0061] In an embodiment of the present invention, obtaining the stress test index value of each machine identifier within the stress test time includes:

[0062] For each machine identifier, a data acquisition request is sent to the machine performance monitoring system. The data acquisition request includes the machine identifier and the stress test time;

[0063] Receive the stress test metric values at each time collection point of this machine identifier within the stress test time returned by the machine performance monitoring system.

[0064] In an embodiment of the present invention, the front-end gateway system sends a data acquisition request to the machine performance monitoring system through the interface between the front-end gateway system and the machine performance monitoring system. For each machine identifier, a data acquisition request is sent to the machine performance monitoring system once. The data acquisition request includes the machine identifier and the stress test time to obtain the stress test metric values of the machine identifier within the stress test time. After receiving the data acquisition request, the machine performance monitoring system obtains the stress test metric values at each time collection point of the machine identifier within the stress test time and returns them to the front-end gateway system. The front-end gateway system receives the return result of the machine performance monitoring system, so that the stress test metric values at each time collection point of each machine identifier within the stress test time, that is, the CPU usage rate, can be obtained. The machine performance monitoring system is a system used to monitor the performance of each machine, which can monitor the performance of each machine and can monitor the CPU usage rate of each machine at each time collection point. The machine performance monitoring system can be implemented through CPU performance monitoring tools, such as tools like top and OpManager.

[0065] In an embodiment of the present invention, after obtaining the stress test metric values of each machine identifier within the stress test time, combined with the preset stress test metric threshold, the scaling information can be determined, and thus the scaling processing can be performed according to the scaling information.

[0066] In an embodiment of the present invention, as Figure 2 shown, the scaling information includes a scaling identifier, and the preset stress test metric threshold includes a preset maximum peak value of the stress test metric and a preset minimum peak value of the stress test metric. Determining the scaling information corresponding to the acquisition request includes:

[0067] Step S201: Determine the maximum peak value of the stress test metric according to the stress test metric values of each machine identifier within the stress test time;

[0068] Step S202: Determine the scaling identifier according to at least one of the maximum peak value of the stress test metric, the preset maximum peak value of the stress test metric, and the preset minimum peak value of the stress test metric.

[0069] In an embodiment of the present invention, the scaling information includes a scaling identifier, and the scaling identifier includes a scaling-up identifier indicating scaling up and a scaling-down identifier indicating scaling down. When determining the scaling identifier, first, according to the stress test index values of each machine identifier within the stress test time, the maximum stress test index peak value can be selected from the machine set through a comparison selection algorithm, that is, the maximum CPU usage peak value maxRealUseCPU is selected from each time collection point of each machine within the stress test time. Assuming that the total number of machines in the machine set = ipNum and the total number of time collection points = timeNum, then the total number of CPU usage quantities totalNum = ipNum × timeNum. Then, the maximum CPU usage peak value is selected from them, and the time complexity of this algorithm is Ο(totalNum). Then, the scaling identifier is determined according to at least one of the maximum stress test index peak value, the preset maximum stress test index peak value, and / or the preset minimum stress test index peak value.

[0070] In an embodiment of the present invention, determining the scaling identifier according to at least one of the maximum stress test index peak value, the preset maximum stress test index peak value, and the preset minimum stress test index peak value includes:

[0071] In response to the maximum stress test index peak value being greater than the preset maximum stress test index peak value, determining that the scaling identifier is an identifier indicating scaling up;

[0072] In response to the maximum stress test index peak value being less than the preset minimum stress test index peak value, determining that the scaling identifier is an identifier indicating scaling down;

[0073] In response to the maximum stress test index peak value being greater than the preset minimum stress test index peak value and less than the preset maximum stress test index peak value, determining that the scaling identifier is an identifier indicating scaling down or an identifier indicating scaling up.

[0074] In an embodiment of the present invention, if the peak value of the maximum stress test index is greater than the preset highest peak value of the stress test index, that is, maxRealUseCPU > maxTargetUseCPU, which means that there is a situation where the stress test index value is greater than the preset highest peak value of the stress test index during the stress test time, the front-end gateway system may determine that the scaling identifier is an identifier indicating expansion, and the front-end gateway system may return the identifier indicating expansion to the front end; if the peak value of the maximum stress test index is less than the preset lowest peak value of the stress test index, that is, maxRealUseCPU < minTargetUseCPU, which means that the stress test index values during the stress test time are all less than the preset lowest peak value of the stress test index, the front-end system may determine that the scaling identifier is an identifier indicating contraction, and return the identifier indicating contraction to the front end; if the peak value of the maximum stress test index is greater than the preset lowest peak value of the stress test index and less than the preset highest peak value of the stress test index, that is, the peak value of the maximum stress test index is within [minTargetUseCPU, maxTargetUseCPU], the front-end gateway system may determine that the scaling identifier is an identifier indicating expansion, or may determine that the scaling identifier is an identifier indicating contraction, it can be expanded or contracted, and the identifier indicating expansion and the identifier indicating contraction may be returned to the front end.

[0075] In an embodiment of the present invention, as Figure 3 shown, the scaling information further includes a scaling value corresponding to the scaling identifier. After determining the scaling identifier, it further includes:

[0076] Step S301: Determine the minimum and maximum values of the total number of machines after scaling corresponding to the scaling identifier according to the total number of machines in the machine set, the peak value of the maximum stress test index, the preset highest peak value of the stress test index, and the preset lowest peak value of the stress test index;

[0077] Step S302: Determine the scaling value corresponding to the scaling identifier according to the total number of machines and the minimum and maximum values of the total number of machines after scaling.

[0078] In an embodiment of the present invention, the scaling information further includes a scaling value corresponding to the scaling identifier. The scaling value is the number of machines, and the scaling value can be a numerical range. If the scaling identifier is an identifier indicating expansion, the scaling value is the number of machines that can be expanded. If the scaling identifier is an identifier indicating contraction, the scaling value is the number of machines that can be contracted. According to the total number of machines in the machine set, the peak value of the maximum stress test index, the preset highest peak value of the stress test index, and the preset lowest peak value of the stress test index, the maximum and minimum values of the total number of machines after scaling corresponding to the scaling identifier can be determined, that is, the value range of the total number of machines after scaling, and then the scaling value is calculated. If it is expansion, the scaling value is the total number of machines after expansion minus the total number of machines in the machine set. If it is contraction, the scaling value is the total number of machines minus the total number of machines after scaling.

[0079] In an embodiment of the present invention, if the peak value of the maximum stress test index is greater than the preset highest peak value of the stress test index, the scaling flag is a flag indicating expansion, and the maximum value of the total number of machines after expansion can be The minimum value can be That is, the value range of the total number of machines after expansion can be Then the scaling value, that is, the value range of the number of machines that can be expanded, is Then the front-end gateway system can return to the front end the scaling flag indicating expansion and the scaling value, such as "This stress test group can be expanded by machines".

[0080] If the peak value of the maximum stress test index is less than the preset lowest peak value of the stress test index, the scaling flag is a flag indicating contraction, and the maximum value of the total number of machines after contraction can be The minimum value can be That is, the value range of the total number of machines after contraction can be Then the front-end gateway system can return to the front end the scaling flag indicating contraction and the scaling value, such as "This stress test group can be contracted by machines".

[0081] If the peak value of the maximum stress test index is greater than the preset lowest peak value of the stress test index and less than the preset highest peak value of the stress test index, the scaling flag can be a flag indicating expansion, and the maximum value of the total number of machines after expansion can be The minimum value can be ipNum, that is, the value range of the total number of machines after expansion can be Then the scaling value, that is, the number of machines that can be expanded, is Then the front-end gateway system can return to the front end the scaling flag indicating expansion and the scaling value, such as "This stress test group can be expanded by machines"; the scaling flag can also be a flag indicating contraction, the maximum value of the total number of machines after contraction can be ipNum, and the minimum value can be That is, the value range of the total number of machines after contraction can be Then the scaling value, that is, the number of machines that can be contracted, is The front-end gateway system can return to the front end the scaling flag indicating contraction and the scaling value, such as "This stress test group can be contracted by machines".

[0082] In an embodiment of the present invention, after determining the scaling information corresponding to the acquisition request, it further includes:

[0083] Return the scaling information to the front end; the scaling information includes the scaling flag and the scaling value corresponding to the scaling flag;

[0084] Receive the scaling request sent by the front end. The scaling request indicates the system identifier, the stress test group identifier, the scaling identifier, and the number of machines; the number of machines is determined according to the scaling value;

[0085] Send the system identifier, the stress test group identifier, the scaling identifier, and the number of machines to the approval flow system, and receive the approval result returned by the approval flow system;

[0086] Return the approval result to the front end so that the front end can display the approval result.

[0087] In the embodiment of the present invention, after determining the scaling information, the scaling information is returned to the front end. After the front end displays the scaling information, that is, the scaling identifier and the scaling value corresponding to the scaling identifier, the user can input the number of machines for scaling on the front-end page. The number of machines is determined according to the scaling value, that is, the number of machines is within the value range corresponding to the scaling value; the front end sends a scaling application to the front-end gateway system. The scaling application includes the system identifier, the stress test group identifier, the scaling identifier, and the number of machines input by the user corresponding to the scaling identifier, and also includes the applicant's account. Among them, the scaling application corresponds to the scaling identifier, that is, it is an expansion application or a contraction application; the front-end gateway system receives the scaling application sent by the front end, and then the front-end gateway system sends a scaling approval request to the approval flow system through the interface between the front-end gateway system and the approval flow system, that is, sends the system identifier, the stress test group identifier, the scaling identifier, the number of machines, and the applicant's account to the approval flow system for approval by the approval flow system. The approval flow system returns the approval result to the front-end gateway system. After receiving the approval result, the front-end gateway system returns the approval result to the front end so that the front end can display the submission result. Among them, the approval result can be a submission success or submission failure result. Submission success can be a result indicating approval, and submission failure can be a result indicating approval rejection or withdrawal.

[0088] In the embodiment of the present invention, after sending the system identifier, the stress test group identifier, the scaling identifier, and the number of machines to the approval flow system, it further includes:

[0089] Cause the approval flow system to send an MQ message containing the approval result to the message queue so that the machine management system can obtain the MQ message containing the approval result from the message queue;

[0090] In the case where the approval result indicates approval, cause the machine management system to perform scaling processing according to the scaling identifier and the number of machines.

[0091] In an embodiment of the present invention, the approval flow system may send the approval result to the machine management system so that the machine management system performs scaling processing. Further, the approval flow system may send the MQ information including the approval result to the message queue, and the machine management system may obtain the MQ message including the approval result from the message queue, and then perform scaling processing according to the approval result. For example, if the approval result indicates approval, the machine management system directly performs scaling processing according to the scaling identifier and the number of machines, that is, directly performs scaling-up processing or scaling-down processing according to the number of machines to update the total number of machines in the machine set; if the approval result indicates approval rejection or withdrawal, no processing is performed.

[0092] Figure 4 It is an interaction schematic diagram of each system of an automatic scaling method according to an embodiment of the present invention. The user inputs data in the front-end system, and the front-end system sends a request for obtaining scaling information to the front-end gateway system to obtain the scaling identifier and the scaling value. The obtaining request includes the system identifier, the stress test group identifier, the stress test time range, the preset highest peak value of CPU usage rate, and the predicted lowest peak value of CPU usage rate. After receiving the request for obtaining scaling information, the front-end gateway system assembles the parameter system identifier and the stress test group identifier and sends a request for obtaining to the machine management system. After receiving the request for obtaining, the machine management system queries the machine IP set of the system under the stress test group according to the system identifier and the stress test group identifier, and returns the machine set to the front-end gateway system. The front-end gateway system assembles the parameter machine IP and the stress test time range and sends a request for obtaining to the machine performance monitoring system. After receiving the request for obtaining, the machine performance monitoring system queries the CPU usage rate value of each time collection point of the machine IP within the stress test time range and returns it to the front-end gateway system. The front-end gateway system obtains the highest peak value of CPU usage rate through the comparison selection algorithm. The front-end gateway system determines the scaling identifier and the scaling value according to the highest peak value of CPU usage rate, the preset highest peak value of CPU usage rate, and the preset lowest peak value of CPU usage rate, and returns the scaling identifier and the scaling value to the front-end system. The front-end system displays the scaling identifier and the scaling value. The user inputs the scaling-up or scaling-down value, that is, the number of machines, in the front-end system, and the front-end system submits an approval based on the number of machines input by the user to the front-end gateway system. The front-end gateway system assembles the parameter system identifier, the stress test group identifier, the scaling identifier, the number of machines, and the applicant account number and submits an approval request to the approval flow system. The approval flow system stores the submitted approval content, including the system identifier, the stress test group identifier, the scaling identifier, the number of machines, and the applicant account number. After the relevant personnel approve, an approval result MQ message is sent. The machine management system receives the MQ message. If the MQ message is an approval, scaling-up or scaling-down is performed. If the MQ message is an approval rejection or withdrawal, no processing is performed.

[0093] The method for automatic scaling provided by the embodiments of the present invention first receives a request for obtaining scaling information sent by the front end, then determines a set of machines according to the system identifier and the stress testing group identifier, obtains the stress testing index values of each machine during the stress testing time, and then determines the scaling information according to the stress testing index values of each machine identifier during the stress testing time and the preset stress testing index threshold, so as to perform scaling processing according to the scaling information. This method realizes the determination of scaling information in the multi-machine stress testing scenario in an automated manner, improves the efficiency and accuracy of scaling, and overcomes the defects of low efficiency and low accuracy caused by manually counting stress testing index data and manually calculating the scaling values.

[0094] According to another aspect of the embodiments of the present invention, as Figure 5 shown, a device 500 for automatic scaling is provided, including:

[0095] A receiving module 501, which receives a request for obtaining scaling information sent by the front end, and the obtaining request includes a system identifier, a stress testing group identifier, a stress testing time, and a preset stress testing index threshold;

[0096] A first obtaining module 502, which determines a corresponding set of machines according to the system identifier and the stress testing group identifier; the set of machines includes multiple machine identifiers;

[0097] A second obtaining module 503, which obtains the stress testing index values of each machine identifier during the stress testing time;

[0098] A determining module 504, which determines the scaling information corresponding to the obtaining request according to the stress testing index values of each machine identifier during the stress testing time and the preset stress testing index threshold, so as to determine the total number of machines in the set of machines according to the scaling information.

[0099] In the embodiments of the present invention, the second obtaining module 503 is further configured to: for each machine identifier, send a data obtaining request to the machine performance monitoring system, and the data obtaining request includes the machine identifier and the stress testing time; receive the stress testing index values of each time collection point of the machine identifier during the stress testing time returned by the machine performance monitoring system.

[0100] In the embodiments of the present invention, the scaling information includes a scaling identifier, and the preset stress testing index threshold includes a preset maximum peak value of the stress testing index and a preset minimum peak value of the stress testing index. The determining module 504 is further configured to: determine the maximum peak value of the stress testing index according to the stress testing index values of each machine identifier during the stress testing time; determine the scaling identifier according to at least one of the maximum peak value of the stress testing index, the preset maximum peak value of the stress testing index, and the preset minimum peak value of the stress testing index.

[0101] In an embodiment of the present invention, according to at least one of the peak value of the maximum stress test index, the highest peak value of the preset stress test index, and the lowest peak value of the preset stress test index, determination module 504 is further configured to: in response to the peak value of the maximum stress test index being greater than the highest peak value of the preset stress test index, determine that the scale-out / scale-in identifier is an identifier indicating scale-out; in response to the peak value of the maximum stress test index being less than the lowest peak value of the preset stress test index, determine that the scale-out / scale-in identifier is an identifier indicating scale-in; in response to the peak value of the maximum stress test index being greater than the lowest peak value of the preset stress test index and less than the highest peak value of the preset stress test index, determine that the scale-out / scale-in identifier is an identifier indicating scale-in or an identifier indicating scale-out.

[0102] In an embodiment of the present invention, the scale-out / scale-in information further includes a scale-out / scale-in value corresponding to the scale-out / scale-in identifier. Determination module 504 is further configured to: after determining the scale-out / scale-in identifier, determine the minimum value and the maximum value of the total number of machines after scale-out / scale-in corresponding to the scale-out / scale-in identifier according to the total number of machines in the machine set, the peak value of the maximum stress test index, the highest peak value of the preset stress test index, and the lowest peak value of the preset stress test index; determine the scale-out / scale-in value corresponding to the scale-out / scale-in identifier according to the total number of machines and the minimum value and the maximum value of the total number of machines after scale-out / scale-in.

[0103] In an embodiment of the present invention, determination module 504 is further configured to: after determining the scale-out / scale-in information corresponding to the acquisition request, return the scale-out / scale-in information to the front end; the scale-out / scale-in information includes the scale-out / scale-in identifier and the scale-out / scale-in value corresponding to the scale-out / scale-in identifier; receive a scale-out / scale-in request sent by the front end, where the scale-out / scale-in request indicates a system identifier, a stress test group identifier, a scale-out / scale-in identifier, and the number of machines; the number of machines is determined according to the scale-out / scale-in value; send the system identifier, the stress test group identifier, the scale-out / scale-in identifier, and the number of machines to the approval flow system, and receive an approval result returned by the approval flow system; return the approval result to the front end so that the front end displays the approval result.

[0104] In an embodiment of the present invention, determination module 504 is further configured to: after sending the system identifier, the stress test group identifier, the scale-out / scale-in identifier, and the number of machines to the approval flow system, cause the approval flow system to send an MQ message including the approval result to the message queue, so that the machine management system obtains the MQ message including the approval result from the message queue; in the case where the approval result indicates approval, cause the machine management system to perform scale-out / scale-in processing according to the scale-out / scale-in identifier and the number of machines.

[0105] According to another aspect of an embodiment of the present invention, there is provided an electronic device, including: one or more processors; a storage device configured to store one or more programs, which when executed by the one or more processors cause the one or more processors to implement the method for automatic scale-out / scale-in provided by the present invention.

[0106] According to another aspect of the embodiments of the present invention, there is provided a computer-readable medium having a computer program stored thereon, and when the program is executed by a processor, the method for automatic scaling provided by the present invention is implemented.

[0107] Figure 6 An exemplary system architecture 600 is shown to which the method for automatic scaling or the apparatus for automatic scaling according to the embodiments of the present invention can be applied.

[0108] As Figure 6 shown, the system architecture 600 may include terminal devices 601, 602, 603, a network 604, and a server 605. The network 604 is used to provide a medium for communication links between the terminal devices 601, 602, 603 and the server 605. The network 604 may include various connection types, such as wired, wireless communication links, or fiber optic cables, etc.

[0109] Users can use the terminal devices 601, 602, 603 to interact with the server 605 through the network 604 to receive or send messages, etc. Various communication client applications may be installed on the terminal devices 601, 602, 603, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (only for example).

[0110] The terminal devices 601, 602, 603 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, and desktop computers, etc.

[0111] The server 605 may be a server providing various services, such as a background management server (only for example) that supports shopping websites browsed by users using the terminal devices 601, 602, 603. The background management server may analyze and process data such as product information query requests received, and feedback the processing results (such as target push information, product information - only for example) to the terminal devices.

[0112] It should be noted that the method for automatic scaling provided by the embodiments of the present invention is generally executed by the server 605. Correspondingly, the apparatus for automatic scaling is generally provided in the server 605.

[0113] It should be understood that Figure 6 the numbers of the terminal devices, the network, and the server in

[0114] are merely illustrative. According to actual requirements, there may be any number of terminal devices, networks, and servers. Figure 7 are merely illustrative. According to actual requirements, there may be any number of terminal devices, networks, and servers. Figure 7The terminal device shown is only an example and should not impose any limitations on the functions and scope of use of the embodiments of the present invention.

[0115] As Figure 7 shown, the computer system 700 includes a central processing unit (CPU) 701, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 702 or a program loaded from a storage section 708 into a random access memory (RAM) 703. In the RAM 703, various programs and data required for the operation of the system 700 are also stored. The CPU 701, ROM 702, and RAM 703 are connected to each other via a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.

[0116] The following components are connected to the I / O interface 705: an input section 706 including a keyboard, a mouse, etc.; an output section 707 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc. and a speaker, etc.; a storage section 708 including a hard disk, etc.; and a communication section 709 including a network interface card such as a LAN card, a modem, etc. The communication section 709 performs communication processing via a network such as the Internet. A drive 710 is also connected to the I / O interface 705 as needed. A removable medium 711, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 710 as needed so that a computer program read from it can be installed into the storage section 708 as needed.

[0117] In particular, according to the embodiments disclosed in the present invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, the embodiments disclosed in the present invention include a computer program product that includes a computer program carried on a computer-readable medium, and the computer program includes program codes for performing the methods shown in the flowcharts. In such an embodiment, the computer program can be downloaded and installed from a network via the communication section 709, and / or installed from the removable medium 711. When the computer program is executed by the central processing unit (CPU) 701, the above-described functions defined in the system of the present invention are executed.

[0118] It should be noted that the computer-readable medium shown in the present invention can be a computer-readable signal medium, a computer-readable storage medium, or any combination of the above two. The computer-readable storage medium can 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 of the computer-readable storage medium can include, but are not limited to: 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 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 the present invention, the computer-readable storage medium can be any tangible medium that contains or stores a program, and this program can be used by or in conjunction with an instruction execution system, apparatus, or device. In the present invention, the computer-readable signal medium can include a data signal propagated in a baseband or as part of a carrier wave, in which the computer-readable program code is carried. Such a propagated data signal can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer-readable signal medium can also be any computer-readable medium other than the computer-readable storage medium, and this computer-readable medium can send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted by any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.

[0119] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of systems, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagram can represent a module, a program segment, or a part of code, and the above module, program segment, or part of code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than marked in the accompanying drawings. For example, two consecutive blocks shown may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram or flowchart, and the combination of blocks in the block diagram or flowchart, can be implemented by a dedicated hardware-based system for performing the specified functions or operations, or can be implemented by a combination of dedicated hardware and computer instructions.

[0120] The modules involved in the embodiments of the present invention can be implemented in software or in hardware. The described modules can also be provided in a processor. For example, it can be described as: a processor includes a receiving module, a first obtaining module, a second obtaining module, and a determining module. Among them, the names of these modules do not constitute a limitation to the module itself in some cases. For example, the receiving module can also be described as "the module for obtaining the scaling information acquisition request sent by the front end".

[0121] As another aspect, the present invention also provides a computer-readable medium. The computer-readable medium can be included in the device described in the above embodiments; or it can exist alone without being assembled into the device. The above computer-readable medium carries one or more programs. When the one or more programs are executed by the device, the device includes: receiving the scaling information acquisition request sent by the front end, where the acquisition request includes a system identifier, a stress test group identifier, a stress test time, and a preset stress test index threshold; determining a corresponding machine set according to the system identifier and the stress test group identifier; the machine set includes a plurality of machine identifiers; obtaining the stress test index values of each machine identifier during the stress test time; determining the scaling information corresponding to the acquisition request according to the stress test index values of each machine identifier during the stress test time and the preset stress test index threshold, so as to perform scaling processing according to the scaling information.

[0122] According to the technical solution of the embodiment of the present invention, for the automatic scaling method, first, it receives the scaling information acquisition request sent by the front end, then determines the machine set according to the system identifier and the stress test group identifier, obtains the stress test index values of each machine during the stress test time, and then determines the scaling information according to the stress test index values of each machine identifier during the stress test time and the preset stress test index threshold, so as to perform scaling processing according to the scaling information. This method realizes the determination of scaling information in a multi-machine stress test scenario in an automated manner, improves the efficiency and accuracy of scaling, and overcomes the defects of low efficiency and low accuracy caused by manually counting stress test index data and manually calculating scaling values.

[0123] The above specific embodiments do not constitute a limitation to the protection scope of the present invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can occur depending on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A method for automatic scaling, characterized in that, Including: Receiving a scaling information acquisition request sent by the front end, where the acquisition request includes a system identifier, a stress test group identifier, a stress test time, and a preset stress test index threshold; Determining a corresponding machine set according to the system identifier and the stress test group identifier; the machine set includes a plurality of machine identifiers; Obtaining the stress test index values of each machine identifier within the stress test time; Determining the scaling information corresponding to the acquisition request according to the stress test index values of each machine identifier within the stress test time and the preset stress test index threshold, so as to update the total number of machines in the machine set according to the scaling information.

2. The method according to claim 1, wherein Obtaining the stress test index values of each machine identifier within the stress test time includes: For each machine identifier, sending a data acquisition request to the machine performance monitoring system, where the data acquisition request includes the machine identifier and the stress test time; Receiving the stress test index values of each time acquisition point of the machine identifier within the stress test time returned by the machine performance monitoring system.

3. The method according to claim 1, wherein The scaling information includes a scaling identifier; the preset stress test index threshold includes a preset maximum peak value of the stress test index and a preset minimum peak value of the stress test index; determining the scaling information corresponding to the acquisition request includes: Determining the maximum peak value of the stress test index according to the stress test index values of each machine identifier within the stress test time; Determining the scaling identifier according to at least one of the maximum peak value of the stress test index, the preset maximum peak value of the stress test index, and the preset minimum peak value of the stress test index.

4. The method according to claim 3, characterized in that, Determining the scaling identifier according to at least one of the maximum peak value of the stress test index, the preset maximum peak value of the stress test index, and the preset minimum peak value of the stress test index includes: Responding to the maximum peak value of the stress test index being greater than the preset maximum peak value of the stress test index, determining the scaling identifier as an identifier indicating capacity expansion; Responding to the maximum peak value of the stress test index being less than the preset minimum peak value of the stress test index, determining the scaling identifier as an identifier indicating capacity reduction; Responding to the maximum peak value of the stress test index being greater than the preset minimum peak value of the stress test index and less than the preset maximum peak value of the stress test index, determining the scaling identifier as an identifier indicating capacity reduction or an identifier indicating capacity expansion.

5. The method according to claim 3, characterized in that The scaling information further includes a scaling value corresponding to the scaling identifier; after determining the scaling identifier, it further includes: Determining the minimum value and the maximum value of the total number of machines after scaling corresponding to the scaling identifier according to the total number of machines in the machine set, the maximum peak value of the stress test index, the preset maximum peak value of the stress test index, and the preset minimum peak value of the stress test index; Determining the scaling value corresponding to the scaling identifier according to the total number of machines and the minimum value and the maximum value of the total number of machines after scaling.

6. The method according to claim 1, wherein After determining the scaling information corresponding to the acquisition request, it further includes: Returning the scaling information to the front end; the scaling information includes a scaling identifier and a scaling value corresponding to the scaling identifier; Receive the scaling request sent by the front end, where the scaling request indicates the system identifier, the stress test group identifier, the scaling identifier, and the number of machines; the number of machines is determined according to the scaling value; Send the system identifier, the stress test group identifier, the scaling identifier, and the number of machines to the approval flow system, and receive the approval result returned by the approval flow system; Return the approval result to the front end so that the front end can display the approval result.

7. The method according to claim 6, characterized in that, After sending the system identifier, the stress test group identifier, the scaling identifier, and the number of machines to the approval flow system, it further includes: Cause the approval flow system to send an MQ message containing the approval result to the message queue, so that the machine management system can obtain the MQ message containing the approval result from the message queue; In the case where the approval result indicates approval, cause the machine management system to perform scaling processing according to the scaling identifier and the number of machines.

8. An automatic scaling device, characterized in that, It includes: A receiving module that receives a request for obtaining scaling information sent by the front end, where the request includes a system identifier, a stress test group identifier, a stress test time, and a preset stress test index threshold; A first obtaining module that determines a corresponding machine set according to the system identifier and the stress test group identifier; the machine set includes multiple machine identifiers; A second obtaining module that obtains the stress test index value of each machine identifier during the stress test time; A determining module that determines the scaling information corresponding to the obtaining request according to the stress test index value of each machine identifier during the stress test time and the preset stress test index threshold, so as to update the total number of machines in the machine set according to the scaling information.

9. An electronic device, characterized in that, It includes: One or more processors; A storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1-7.

10. A computer-readable medium having a computer program stored thereon, characterized in that, The program, when executed by the processor, implements the method according to any one of claims 1-7.