Resource elastic scaling method and device, computer equipment, storage medium and program product
By dynamically adjusting the current limit threshold and instance scaling of middleware services, the problem of untimely response of traditional elastic scaling technology is solved, and efficient response to burst traffic and complex scenarios is achieved, and the stability and resource utilization of the system are improved.
Patent Information
- Application Number
- CN202510456096.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-11
- Publication Date
- 2025-07-08
AI Technical Summary
When traditional elastic scaling technology faces burst traffic or complex scenarios, the resource demand response is not timely, resulting in a decrease in service performance or an increase in the probability of server downtime.
By obtaining real-time access to cloud platform middleware services, combining preset basic thresholds, service priority, current access change rate and historical access mean, dynamically determine the current limit threshold, and elastically scale and shrink according to the access volume and current limit threshold, including instance expansion, shrinkage and current limit operations.
It improves the timely response to resource requirements for burst traffic or complex scenarios, reduces the probability of service performance degradation and server downtime, and improves the system's fault tolerance and resource utilization efficiency.
Smart Images

Figure CN120281656A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of cloud computing technology, and particularly to a method, device, computer device, storage medium, and program product for elastic resource scaling. Background Art
[0002] In a cloud computing environment, through an elastic scaling mechanism, an automatic resource adjustment mechanism can be performed on middleware services (such as message queues, cache services, database proxies, etc.) to achieve dynamic expansion and efficient operation of the services.
[0003] Traditional elastic scaling technologies mostly rely on static rules or single performance metrics (such as CPU and memory usage) to adjust resources.
[0004] However, traditional solutions have a problem of not reacting in a timely manner to resource requirements in the face of sudden traffic or complex scenarios. Summary of the Invention
[0005] Based on this, in view of the above technical problems, it is necessary to provide a method, device, computer device, storage medium, and program product for elastic resource scaling that can improve the timeliness of response to resource requirements in sudden traffic or complex scenarios.
[0006] In a first aspect, this application provides a method for elastic resource scaling, including:
[0007] Obtain the first real-time access volume of the middleware service running on the cloud platform;
[0008] Determine the first traffic limiting threshold corresponding to the first real-time access volume according to a preset basic threshold, the service priority of the middleware service, the current access volume change rate, and the historical access volume average value;
[0009] Perform elastic scaling on the instances of the middleware service according to the first real-time access volume and the first traffic limiting threshold.
[0010] In one embodiment, performing elastic scaling on the instances of the middleware service according to the first access volume and the first traffic limiting threshold includes:
[0011] If the first real-time access volume is greater than the first traffic limiting threshold, trigger a traffic limiting operation and perform elastic scaling on the instances of the middleware service.
[0012] In one embodiment, performing elastic scaling on the instances of the middleware service includes:
[0013] If it is necessary to expand the instances of the middleware service, create new instances; the newly created instances are used to process requests for the middleware service;
[0014] If it is necessary to scale in the instances of the middleware service, mark the target instance of the middleware service as the waiting state, and perform elastic scaling on the instances of the middleware service according to the second real-time access volume of the middleware service and the second traffic limiting threshold corresponding to the second real-time access volume obtained after marking the target instance as the waiting state; the target instance is determined according to the access volume of the instances of the middleware service.
[0015] In one embodiment, performing elastic scaling on the instances of the middleware service according to the second real-time access volume of the middleware service and the second traffic limiting threshold corresponding to the second real-time access volume obtained after marking the target instance as the waiting state includes:
[0016] If the second real-time access volume is greater than the second traffic limiting threshold, re-enable the target instance.
[0017] In one embodiment, the method further includes:
[0018] If the second real-time access volume of the middleware service within a preset duration after marking the target instance as the waiting state is not greater than the second traffic limiting threshold corresponding to the second real-time access volume, determine the instance to be evicted according to the access volume of the instances of the middleware service, and evict the instance to be evicted.
[0019] In one embodiment, determining the first traffic limiting threshold corresponding to the first real-time access volume according to a preset basic threshold, the service priority of the middleware service, the current access volume change rate, and the historical access volume average includes:
[0020] Determine the ratio of the current access volume change rate to the historical access volume average;
[0021] Determine the first product of the service priority of the middleware service and the priority weight coefficient, and determine the second product of the ratio and the access volume change sensitivity coefficient;
[0022] Determine the summation result of the first product and the second product, and determine the first traffic limiting threshold according to the product of the preset basic threshold and the summation result.
[0023] In a second aspect, the present application further provides a resource elastic scaling device, including:
[0024] An acquisition module, configured to acquire the first real-time access volume of the middleware service running on the cloud platform;
[0025] A determination module, configured to determine the first traffic limiting threshold corresponding to the first real-time access volume according to a preset basic threshold, the service priority of the middleware service, the current access volume change rate, and the historical access volume average;
[0026] An elastic scaling module, configured to perform elastic scaling on the instances of the middleware service according to the first real-time access volume and the first traffic limiting threshold.
[0027] In a third aspect, the present application further provides a computer device, including a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:
[0028] Obtain the first real-time access volume of the middleware service running on the cloud platform;
[0029] Determine the first traffic limiting threshold corresponding to the first real-time access volume according to a preset basic threshold, the service priority of the middleware service, the current access volume change rate, and the historical access volume average value;
[0030] Elastically scale the instances of the middleware service according to the first real-time access volume and the first traffic limiting threshold.
[0031] In a fourth aspect, the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented:
[0032] Obtain the first real-time access volume of the middleware service running on the cloud platform;
[0033] Determine the first traffic limiting threshold corresponding to the first real-time access volume according to a preset basic threshold, the service priority of the middleware service, the current access volume change rate, and the historical access volume average value;
[0034] Elastically scale the instances of the middleware service according to the first real-time access volume and the first traffic limiting threshold.
[0035] In a fifth aspect, the present application further provides a computer program product, including a computer program. When the computer program is executed by a processor, the following steps are implemented:
[0036] Obtain the first real-time access volume of the middleware service running on the cloud platform;
[0037] Determine the first traffic limiting threshold corresponding to the first real-time access volume according to a preset basic threshold, the service priority of the middleware service, the current access volume change rate, and the historical access volume average value;
[0038] Elastically scale the instances of the middleware service according to the first real-time access volume and the first traffic limiting threshold.
[0039] The above resource elastic scaling method, device, computer device, storage medium, and program product obtain the first real-time access volume of the middleware service running on the cloud platform, determine the first traffic limiting threshold corresponding to the first real-time access volume according to the preset basic threshold, the service priority of the middleware service, the current access volume change rate, and the historical access volume average value, and perform elastic scaling on the instances of the middleware service according to the first real-time access volume and the first traffic limiting threshold. Through the dynamic traffic limiting threshold trigger mechanism, the resource allocation is flexibly controlled to ensure that the system can be expanded or contracted in a timely manner when the access volume fluctuates, so as to effectively respond to different application scenarios, improve the timeliness of response to the resource requirements of sudden traffic or complex scenarios, and reduce the probability of service performance degradation or even server downtime. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the following will briefly introduce the drawings required for use in the description of the embodiments or related technologies. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.
[0041] Figure 1 is the internal structure diagram of a computer device provided by an embodiment of the present application;
[0042] Figure 2 is the flowchart of a resource elastic scaling method provided by an embodiment of the present application;
[0043] Figure 3 is the flowchart of a method for determining the first traffic limiting threshold provided by an embodiment of the present application;
[0044] Figure 4 is the overall flowchart of a resource elastic scaling method provided by an embodiment of the present application;
[0045] Figure 5 is the structural block diagram of a resource elastic scaling device provided by an embodiment of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0046] In order to make the objectives, technical solutions, and advantages of the present application clearer, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0047] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as Figure 1As shown in the figure. The computer device includes a processor, a memory, an input / output interface (Input / Output, abbreviated as I / O), and a communication interface. Among them, the processor, the memory, and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and external devices. The communication interface of the computer device is used to communicate with external terminals through a network connection. When the computer program is executed by the processor, it implements a method for elastic resource scaling.
[0048] Those skilled in the art can understand that Figure 1 the structure shown in the figure is only a block diagram of some structures related to the solution of this application, and does not constitute a limitation on the computer device to which the solution of this application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine some components, or have different component arrangements.
[0049] In an exemplary embodiment, as Figure 2 shown, Figure 2 is a schematic flowchart of a method for elastic resource scaling provided by an embodiment of this application. Taking the application of this method to the Figure 1 computer device in the figure as an example for description, it includes the following steps S201 to S203. Among them:
[0050] S201, obtain the first real-time access volume of the middleware service running on the cloud platform.
[0051] The monitoring program of the cloud platform can monitor the first real-time access volume of the middleware service running on the cloud platform in real time, and can send the first real-time access volume to the cloud platform, so that the cloud platform can obtain the first real-time access volume of the middleware service running on the cloud platform. By monitoring the access volume of the middleware service, the change of traffic can be sensed in time.
[0052] S202, determine the first flow-limiting threshold corresponding to the first real-time access volume according to the preset basic threshold, the service priority of the middleware service, the current access volume change rate, and the historical access volume average value.
[0053] The current access volume change rate can be determined based on the current first real-time access volume and the most recent historical real-time access volume. The historical access volume average value can be determined based on the historical real-time access volume within the most recent preset duration before the current moment. Furthermore, based on the preset basic threshold, the current access volume change rate of the middleware service, and the historical access volume average value, the first traffic limiting threshold corresponding to the first real-time access volume can be determined. Since the current access volume change rate and the historical access volume average value may change over time, the determined traffic limiting threshold corresponding to the real-time access volume may change. That is, the first traffic limiting threshold corresponding to the first real-time access volume at the first moment may be different from the first traffic limiting threshold corresponding to the first real-time access volume at the second moment, where the second moment is the next moment of the first moment. That is, the traffic limiting thresholds involved in the embodiments of the present application are dynamic thresholds, and each traffic limiting threshold can be determined using a method similar to S202.
[0054] In a possible implementation manner, the ratio of the current access volume change rate to the historical access volume average value can be determined, the sum result of the ratio and the service priority can be determined, the product of the sum result and the preset basic threshold can be determined, and this product can be used as the first traffic limiting threshold.
[0055] In another possible implementation manner, the ratio of the current access volume change rate to the historical access volume average value is determined; the first product of the service priority of the middleware service and the priority weight coefficient is determined, and the second product of the ratio and the access volume change sensitivity coefficient is determined; the sum result of the first product and the second product is determined, and the first traffic limiting threshold is determined according to the product of the basic threshold and the sum result.
[0056] S203, perform elastic scaling on the instances of the middleware service according to the first real-time access volume and the first traffic limiting threshold.
[0057] If the first real-time access volume is greater than the first traffic limiting threshold, trigger a traffic limiting operation and perform elastic scaling on the instances of the middleware service.
[0058] If the first real-time access volume is not greater than the first traffic limiting threshold, obtain the real-time access volume of the middleware service running on the cloud platform, determine the traffic limiting threshold corresponding to this real-time access volume, and perform elastic scaling on the instances of the middleware service according to this real-time access volume and this traffic limiting threshold. The instance belongs to the resources of the middleware service, thereby realizing the elastic contraction of the instance resources of the middleware service.
[0059] The method provided in this embodiment determines the first traffic limiting threshold corresponding to the first real-time access volume by obtaining the first real-time access volume of the middleware service running on the cloud platform, according to a preset basic threshold, the service priority of the middleware service, the current access volume change rate, and the historical access volume average value. Then, according to the first real-time access volume and the first traffic limiting threshold, the instances of the middleware service are elastically scaled. Through the dynamic traffic limiting threshold triggering mechanism, the resource allocation is flexibly controlled to ensure that the system can be expanded or contracted in a timely manner when the access volume fluctuates, so as to effectively cope with different application scenarios, improve the timeliness of response to resource requirements for sudden traffic or complex scenarios, and reduce the probability of service performance degradation or even server downtime.
[0060] In an exemplary embodiment, for S202 above, elastically scaling the instances of the middleware service according to the first real-time access volume and the first traffic limiting threshold can be implemented in the following manner:
[0061] If the first real-time access volume is greater than the first traffic limiting threshold, a traffic limiting operation is triggered, and the instances of the middleware service are elastically scaled.
[0062] Among them, the traffic limiting operation includes rejecting external requests or degrading external requests to relieve the pressure on the middleware service. Exemplarily, if the number of requests corresponding to the first real-time access volume is 100 and the first traffic limiting threshold is 80, 20 requests can be rejected or the 20 requests can be degraded.
[0063] In a multi-tenant environment, the service request types are diverse and the priority differences are significant. Traditional scaling strategies are difficult to manage traffic in a refined manner and cannot meet the requirements of the cloud platform for high availability and efficient resource utilization. However, the embodiment of this application is an elastic scaling method based on traffic limiting, which combines the advantages of traffic limiting and elastic scaling. Through real-time analysis and dynamic decision-making of multi-dimensional indicators, it can intelligently adjust resource allocation according to system load and traffic changes, thereby improving the fault tolerance, scalability, and resource utilization efficiency of the system. This innovative technology can effectively cope with high-concurrency traffic and service exception problems in complex distributed environments and ensure the stable operation of the cloud platform in various business scenarios.
[0064] The method provided in this embodiment can relieve the pressure on the middleware service by triggering a traffic limiting operation and elastically scaling the instances of the middleware service if the first real-time access volume is greater than the first traffic limiting threshold.
[0065] In an exemplary embodiment, the elastic scaling of the instances of the middleware service above can be implemented in the following manner:
[0066] If it is necessary to expand the instances of the middleware service, new instances are created; the newly created instances are used to process requests for the middleware service. Among them, the number of newly created instances can be at least one, and the newly created instances can be added to the resource pool.
[0067] If it is necessary to shrink the instances of the middleware service, the target instance of the middleware service is marked as the waiting state, and elastic scaling of the instances of the middleware service is performed according to the second real-time access volume of the middleware service obtained after marking the target instance as the waiting state and the second traffic limiting threshold corresponding to the second real-time access volume; the target instance is determined according to the access volume of the instances of the middleware service. Exemplarily, if there are a total of 3 instances corresponding to the middleware service, namely instance A, instance B, and instance C, and if the access volume of instance A is the smallest, then instance A can be used as the target instance of the middleware service. The target instance marked as the waiting state is in the waiting state and stops providing external services. The second real-time access volume of the middleware service refers to the real-time access volume of the middleware service obtained after marking the target instance of the middleware service as the waiting state.
[0068] In this embodiment, after triggering the traffic limiting operation, it can be determined whether it is necessary to expand the instances of the middleware service according to the real-time access volume of the middleware service obtained after the traffic limiting operation and the traffic limiting threshold corresponding to the real-time access volume. If the real-time access volume is greater than the traffic limiting threshold corresponding to the real-time access volume, it is necessary to expand the instances of the middleware service; if the real-time access volume is less than the traffic limiting threshold corresponding to the real-time access volume, it is necessary to shrink the instances of the middleware service.
[0069] It should be noted that for the case where the access volume of the cloud middleware service is relatively low, the elastic scaling method based on traffic limiting can be used to mark the target instance as the waiting state, and these application instances marked as the waiting state will no longer provide external services and are in the waiting state. The second traffic limiting threshold can be determined by a method similar to the method for determining the first traffic limiting threshold.
[0070] The method provided in this embodiment ensures that the middleware service can handle more traffic by creating new instances when it is necessary to expand the instances of the middleware service, adding the new instances to the resource pool, and updating the resource allocation. By dynamically expanding the instances, the middleware service can quickly respond to the increase in traffic and avoid the decline in service performance.
[0071] In an exemplary embodiment, the elastic scaling of the instances of the middleware service according to the second real-time access volume of the middleware service obtained after marking the target instance as the waiting state and the second traffic limiting threshold corresponding to the second real-time access volume can be implemented in the following manner:
[0072] If the second real-time access volume is greater than the second traffic limiting threshold, the target instance is restarted.
[0073] In the method provided in this embodiment, when the access volume of the middleware service increases again, the target instance in the waiting state can be re-enabled. By re-enabling the instance in the target state, the system can release idle resources, improve resource utilization, and reduce operation and maintenance costs.
[0074] In an exemplary embodiment, if the second real-time access volume of the middleware service within a preset duration after the target instance is marked as the waiting state is not greater than the second throttling threshold corresponding to the second real-time access volume, the instance to be evicted is determined according to the access volume of the instances of the middleware service, and the instance to be evicted is evicted.
[0075] In this embodiment, if multiple second real-time access volumes obtained within the preset duration are not greater than the second throttling thresholds corresponding to the respective second real-time access volumes, the instance to be evicted is determined according to the access volume of the instances of the middleware service, and the instance to be evicted is evicted to release resources, improve resource utilization, and reduce operation and maintenance costs.
[0076] In the above embodiment, after elastic scaling, if the actual access volume is greater than the limit size, the waiting state of the application instance marked as the waiting state is removed, and the application instance will serve externally again. If the actual application access volume is less than the corresponding limit threshold within, for example, half an hour after elastic scaling, the application instance in the waiting state is evicted and cleared to release the resource space.
[0077] In an exemplary embodiment, as Figure 3 shown, Figure 3 is a flowchart of a method for determining a first throttling threshold provided in an embodiment of the present application. The above S202 includes steps S301 to S303. Among them:
[0078] S301, determine the ratio of the current access volume change rate to the historical access volume average.
[0079] S302, determine the first product of the service priority of the middleware service and the priority weight coefficient, and determine the second product of the ratio and the access volume change sensitivity coefficient.
[0080] S303, determine the summation result of the first product and the second product, and determine the first throttling threshold according to the product of the preset base threshold and the summation result.
[0081] The first throttling threshold can be determined by the following formula (1):
[0082] L = preset base threshold × (α × P + β × ) (1).
[0083] Wherein, P is the service priority, α is the priority weight coefficient, β is the sensitivity coefficient of traffic volume change, and L represents the first traffic limiting threshold. The traffic limiting thresholds involved in the embodiments of the present application are dynamic thresholds, and each traffic limiting threshold can be determined by the method of formula (1), and each traffic limiting threshold can also be determined based on the deformation formula of formula (1).
[0084] In this embodiment, by determining the summation result of the first product and the second product, and determining the first traffic limiting threshold according to the product of the base threshold and the summation result, the traffic limiting threshold can be dynamically adjusted, and the system can flexibly adjust the traffic limiting policy according to the service priority and traffic changes, avoiding resource waste or service overload caused by fixed thresholds.
[0085] In an exemplary embodiment, as Figure 4 shown, Figure 4 is the overall process schematic diagram of a resource elastic scaling method provided by the embodiments of the present application. The method includes S401 to S410:
[0086] S401, obtain the first real-time traffic volume of the middleware service running on the cloud platform.
[0087] S402, determine the first traffic limiting threshold corresponding to the first real-time traffic volume according to the preset base threshold, the service priority of the middleware service, the current traffic volume change rate, and the historical traffic volume average value.
[0088] S403, determine whether the first real-time traffic volume is greater than the first traffic limiting threshold.
[0089] If the first real-time traffic volume is greater than the first traffic limiting threshold, execute S404; if the first real-time traffic volume is not greater than the first traffic limiting threshold, return to execute S401.
[0090] S404, trigger the traffic limiting operation, and perform elastic scaling on the instances of the middleware service.
[0091] S405, determine whether to expand or contract the instances of the middleware service.
[0092] If it is necessary to expand the instances of the middleware service, execute S406; if it is necessary to contract the instances of the middleware service, execute S407.
[0093] S406, create a new instance.
[0094] S407, mark the target instance of the middleware service as the waiting state.
[0095] S408, determine whether the second real-time traffic volume is greater than the second traffic limiting threshold.
[0096] If the second real-time access volume is greater than the second flow control threshold, then execute S409; if the second real-time access volume of the middleware service within the preset duration is not greater than the second flow control threshold corresponding to the second real-time access volume, then execute S410.
[0097] S409, re-enable the target instance in the waiting state.
[0098] S410, evict the instance to be evicted.
[0099] It should be understood that although the steps in the flowcharts involved in the above embodiments are shown in sequence according to the arrows, these steps do not necessarily need to be executed in the order indicated by the arrows. Unless there is a clear description in this article, there is no strict order limit for the execution of these steps, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above embodiments may include multiple steps or multiple stages. These steps or stages do not necessarily need to be executed at the same moment, but can be executed at different moments. The execution order of these steps or stages does not necessarily need to be sequential, but can be executed alternately or in turn with at least a part of other steps or steps or stages in other steps.
[0100] Based on the same inventive concept, the embodiments of the present application also provide a resource elastic scaling device for implementing the above-mentioned resource elastic scaling method. The implementation solutions provided by this device to solve problems are similar to the implementation solutions described in the above method. Therefore, the specific limitations in one or more embodiments of the resource elastic scaling device provided below can refer to the limitations on the resource elastic scaling method in the above text, and will not be repeated here.
[0101] In an exemplary embodiment, as Figure 5 shown, Figure 5 is a structural block diagram of a resource elastic scaling device provided by an embodiment of the present application. The device 500 includes:
[0102] An acquisition module 501, configured to acquire the first real-time access volume of the middleware service running on the cloud platform;
[0103] A determination module 502, configured to determine the first flow control threshold corresponding to the first real-time access volume according to a preset basic threshold, the service priority of the middleware service, the current access volume change rate, and the historical access volume average value;
[0104] An elastic scaling module 503, configured to perform elastic scaling on the instances of the middleware service according to the first real-time access volume and the first flow control threshold.
[0105] In an exemplary embodiment, the elastic scaling module 503 is specifically configured to trigger a current limiting operation if the first real-time access volume is greater than the first current limiting threshold, and perform elastic scaling on the instances of the middleware service.
[0106] In an exemplary embodiment, the elastic scaling module 503 is specifically configured to perform elastic scaling on the instances of the middleware service, including:
[0107] If it is necessary to expand the instances of the middleware service, new instances are created; the newly created instances are used to process requests for the middleware service;
[0108] If it is necessary to contract the instances of the middleware service, the target instance of the middleware service is marked as the waiting state, and elastic scaling is performed on the instances of the middleware service according to the second real-time access volume of the middleware service obtained after marking the target instance as the waiting state and the second current limiting threshold corresponding to the second real-time access volume; the target instance is determined according to the access volume of the instances of the middleware service.
[0109] In an exemplary embodiment, the elastic scaling module 503 is specifically configured to re-enable the target instance if the second real-time access volume is greater than the second current limiting threshold.
[0110] In an exemplary embodiment, the elastic scaling module 503 is specifically configured to determine the instance to be evicted according to the access volume of the instances of the middleware service and evict the instance to be evicted if the second real-time access volume of the middleware service within the preset duration obtained after marking the target instance as the waiting state is not greater than the second current limiting threshold corresponding to the second real-time access volume.
[0111] In an exemplary embodiment, the determination module is specifically configured to determine the ratio of the current access volume change rate to the historical access volume average value; determine the first product of the service priority of the middleware service and the priority weight coefficient, and determine the second product of the ratio and the access volume change sensitivity coefficient; determine the summation result of the first product and the second product, and determine the first current limiting threshold according to the product of the base threshold and the summation result.
[0112] Each module in the above resource elastic scaling device can be implemented in whole or in part by software, hardware, and their combination. The above modules can be embedded in the processor in the computer device in the form of hardware or be independent of the processor, or be stored in the memory in the computer device in the form of software, so as to facilitate the processor to call and execute the operations corresponding to the above respective modules.
[0113] In an exemplary embodiment, a computer device is provided, including a memory and a processor. A computer program is stored in the memory. When the processor executes the computer program, the technical solutions provided in the above method embodiments are implemented. The implementation principle and technical effects are similar, and will not be elaborated here.
[0114] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the technical solutions provided in the foregoing method embodiments are implemented. The implementation principle and technical effects are similar and will not be elaborated here.
[0115] In one embodiment, a computer program product is provided, including a computer program. When the computer program is executed by a processor, the technical solutions provided in the foregoing method embodiments are implemented. The implementation principle and technical effects are similar and will not be elaborated here.
[0116] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties. Moreover, the collection, use, and processing of relevant data need to comply with relevant regulations.
[0117] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above methods. Among them, any reference to a memory, database, or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memories. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc. The databases involved in the embodiments provided in the present application can include at least one of relational databases and non-relational databases. Non-relational databases can include distributed databases based on blockchain, etc., without limitation. The processors involved in the embodiments provided in the present application can be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, data processing logics based on quantum computing, etc., without limitation.
[0118] The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity of description, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered as the scope described in this specification.
[0119] The above-described embodiments merely represent several implementation manners of the present application. The description thereof is relatively specific and detailed, but it should not be construed as a limitation on the patent scope of the present application. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present application, several modifications and improvements can still be made, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the appended claims.
Claims
1. A method for elastic scaling of resources, characterized in that The method includes: Obtaining a first real-time access volume of a middleware service running on a cloud platform; Determining a first traffic limiting threshold corresponding to the first real-time access volume according to a preset basic threshold, the service priority of the middleware service, the current access volume change rate, and the historical access volume average value; Elastically scaling the instances of the middleware service according to the first real-time access volume and the first traffic limiting threshold.
2. The method according to claim 1, characterized in that, The elastically scaling the instances of the middleware service according to the first access volume and the first traffic limiting threshold includes: If the first real-time access volume is greater than the first traffic limiting threshold, triggering a traffic limiting operation and elastically scaling the instances of the middleware service.
3. The method according to claim 2, wherein The elastically scaling the instances of the middleware service includes: If it is necessary to expand the instances of the middleware service, creating new instances; the newly created instances are used to process requests for the middleware service; If it is necessary to shrink the instances of the middleware service, marking a target instance of the middleware service as in a waiting state, and elastically scaling the instances of the middleware service according to a second real-time access volume of the middleware service obtained after marking the target instance as in the waiting state and a second traffic limiting threshold corresponding to the second real-time access volume; the target instance is determined according to the access volume of the instances of the middleware service.
4. The method according to claim 3, wherein The elastically scaling the instances of the middleware service according to the second real-time access volume of the middleware service obtained after marking the target instance as in the waiting state and the second traffic limiting threshold corresponding to the second real-time access volume includes: If the second real-time access volume is greater than the second traffic limiting threshold, re-enabling the target instance.
5. The method according to claim 3, characterized in that The method further includes: If the second real-time access volume of the middleware service within a preset duration obtained after marking the target instance as in the waiting state is not greater than the second traffic limiting threshold corresponding to the second real-time access volume, determining a to-be-evicted instance according to the access volume of the instances of the middleware service and evicting the to-be-evicted instance.
6. The method according to any one of claims 1 to 5, characterized in that, The determining a first traffic limiting threshold corresponding to the first real-time access volume according to a preset basic threshold, the service priority of the middleware service, the current access volume change rate, and the historical access volume average value includes: Determining a ratio of the current access volume change rate to the historical access volume average value; Determining a first product of the service priority of the middleware service and a priority weight coefficient, and determining a second product of the ratio and an access volume change sensitivity coefficient; Determining a summation result of the first product and the second product, and determining the first traffic limiting threshold according to a product of the preset basic threshold and the summation result.
7. A resource elastic scaling device, characterized in that The apparatus includes: An obtaining module, configured to obtain a first real-time access volume of a middleware service running on a cloud platform; A determining module, configured to determine a first traffic limiting threshold corresponding to the first real-time access volume according to a preset basic threshold, the service priority of the middleware service, the current access volume change rate, and the historical access volume average value; An elastic scaling module, configured to elastically scale the instances of the middleware service according to the first real-time access volume and the first traffic limiting threshold.
8. A computer device, comprising a memory and a processor, the memory storing a computer program, characterized in that, When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, the steps of the method according to any one of claims 1 to 6 are implemented.