CN117014304A - Cloud resource dynamic capacity expansion method and device - Google Patents

Cloud resource dynamic capacity expansion method and device Download PDF

Info

Publication number
CN117014304A
CN117014304A CN202311122954.5A CN202311122954A CN117014304A CN 117014304 A CN117014304 A CN 117014304A CN 202311122954 A CN202311122954 A CN 202311122954A CN 117014304 A CN117014304 A CN 117014304A
Authority
CN
China
Prior art keywords
service
expanded
cloud resource
capacity expansion
data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311122954.5A
Other languages
Chinese (zh)
Inventor
唐平
杨磊
李志强
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Chongqing Selis Phoenix Intelligent Innovation Technology Co ltd
Original Assignee
Chongqing Seres New Energy Automobile Design Institute Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Chongqing Seres New Energy Automobile Design Institute Co Ltd filed Critical Chongqing Seres New Energy Automobile Design Institute Co Ltd
Priority to CN202311122954.5A priority Critical patent/CN117014304A/en
Publication of CN117014304A publication Critical patent/CN117014304A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5011Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
    • G06F9/5016Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals the resource being the memory
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The application provides a cloud resource dynamic capacity expansion method and device, wherein the method comprises the following steps: acquiring the capacity expansion parameter data duration of the service to be expanded; according to the expansion parameter data duration of the service to be expanded, acquiring target cloud resource use data matched with the expansion parameter data duration from cloud resource use data of the service to be expanded in the history duration, wherein the expansion parameter data duration is less than or equal to the history duration; acquiring cloud resource use data of the current time of the service to be expanded; and according to the target cloud resource use data and the cloud resource use data of the service to be expanded in the current time, expanding the cloud resource used by the service to be expanded. According to the technical scheme, the cloud resources used by the service to be expanded can be actively expanded in advance according to the cloud resource use data of the service to be expanded in the history time, request blocking is effectively reduced, flow peak values and flow fluctuation can be effectively treated by expanding in advance, and the availability and user experience of the system are improved.

Description

Cloud resource dynamic capacity expansion method and device
Technical Field
The application relates to the technical field of resource capacity expansion, in particular to a cloud resource dynamic capacity expansion method and device.
Background
In the rapid development of cloud technology, container orchestration platforms are the preferred solution for many companies to manage containerized applications. Kubernetes provides powerful functionality and flexibility as a de facto standard for containerized application management tools. However, there are some technical problems with the longitudinal expansion scheme when using Kubernetes for service management. One common longitudinal expansion scheme is to dynamically adjust the resource allocation of copies according to the CPU and memory resource usage of the service. The scheme can increase or decrease the number of copies according to actual demands so as to adapt to different load conditions. However, the execution of the longitudinal expansion scheme requires a certain time, and if the flow is continuously increased during the adjustment process, the request may be blocked, thereby affecting the performance of the whole system. In addition, the longitudinal capacity expansion scheme is a passive adjustment method, and capacity expansion is triggered only when the usage of the copy resources of the service reaches a certain threshold. This means that in the time zone of the flow hot spot time and the flow rate of each day, the advanced expansion cannot be performed in a targeted manner.
Disclosure of Invention
In view of the above, the embodiments of the present application provide a method and an apparatus for dynamically expanding cloud resources, so as to solve the technical problem in the prior art that when longitudinal expansion is used, a request is blocked, thereby affecting the performance of the whole system.
In a first aspect of the embodiment of the present application, a cloud resource dynamic capacity expansion method is provided, including: acquiring the capacity expansion parameter data duration of the service to be expanded; according to the expansion parameter data duration of the service to be expanded, acquiring target cloud resource use data matched with the expansion parameter data duration from cloud resource use data of the service to be expanded in the history duration, wherein the expansion parameter data duration is less than or equal to the history duration; acquiring cloud resource use data of the current time of the service to be expanded; and according to the target cloud resource use data and the cloud resource use data of the service to be expanded in the current time, expanding the cloud resource used by the service to be expanded.
In a second aspect of the embodiment of the present application, a cloud resource dynamic capacity expansion device is provided, including: the first acquisition module is used for acquiring the capacity expansion parameter data duration of the to-be-expanded service; the second acquisition module is used for acquiring target cloud resource use data matched with the capacity expansion parameter data duration from cloud resource use data of the to-be-expanded service in the history duration according to the capacity expansion parameter data duration of the to-be-expanded service, wherein the capacity expansion parameter data duration is smaller than or equal to the history duration; the third acquisition module is used for acquiring cloud resource use data of the current time of the service to be expanded; and the capacity expansion module is used for expanding the cloud resources used by the service to be expanded according to the target cloud resource use data and the cloud resource use data of the service to be expanded in the current time.
In a third aspect of embodiments of the present application, there is provided an electronic device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, the processor implementing the steps of the method as provided in the first aspect above when the computer program is executed.
In a fourth aspect of embodiments of the present application, there is provided a computer readable storage medium storing a computer program which, when executed by a processor, performs the steps of the method as provided in the first aspect above.
Compared with the prior art, the embodiment of the application has the beneficial effects that: according to the embodiment of the application, the capacity expansion parameter data duration of the service to be expanded is obtained, the target cloud resource use data matched with the capacity expansion parameter data duration is obtained from the cloud resource use data of the service to be expanded in the history duration according to the capacity expansion parameter data duration of the service to be expanded, then the cloud resource use data of the service to be expanded in the current time is obtained, and the cloud resource used by the service to be expanded is expanded according to the target cloud resource use data and the cloud resource use data of the service to be expanded in the current time, so that the capacity expansion of the cloud resource used by the service to be expanded can be actively carried out in advance according to the cloud resource use data of the service to be expanded in the history duration, the request blocking is effectively reduced, the flow peak value and the flow fluctuation can be effectively treated by carrying out the capacity expansion in advance, and the usability and the user experience of the system are improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings used in the embodiments or the description of the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of a cloud resource dynamic capacity expansion method according to an embodiment of the application;
FIG. 2 is a flow chart of another dynamic capacity expansion method for cloud resources according to an embodiment of the present application;
FIG. 3 is a flow chart of yet another dynamic capacity expansion method for cloud resources according to an embodiment of the present application;
FIG. 4 is a flow chart of yet another dynamic capacity expansion method for cloud resources according to an embodiment of the present application;
fig. 5 is a diagram of an implementation framework corresponding to a cloud resource dynamic expansion method according to an embodiment of the present application;
FIG. 6 is a block diagram of a cloud resource dynamic capacity expansion device according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth such as the particular system architecture, techniques, etc., in order to provide a thorough understanding of the embodiments of the present application. It will be apparent, however, to one skilled in the art that the present application may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.
Fig. 1 is a flowchart of a cloud resource dynamic capacity expansion method according to an embodiment of the present application, where the method provided by the embodiment of the present application may be executed by any electronic device having computer processing capability.
As shown in fig. 1, the cloud resource dynamic capacity expansion method includes steps S110 to S140.
In step S110, a duration of capacity expansion parameter data of a service to be expanded is obtained.
In step S120, according to the capacity expansion parameter data duration of the service to be expanded, target cloud resource usage data matched with the capacity expansion parameter data duration is obtained from cloud resource usage data of the service to be expanded in the history duration, where the capacity expansion parameter data duration is less than or equal to the history duration.
In step S130, cloud resource usage data of the current time of the service to be expanded is acquired.
In step S140, according to the target cloud resource usage data and the cloud resource usage data of the service to be expanded in the current time, expanding the cloud resource used by the service to be expanded.
According to the method, the capacity expansion parameter data duration of the service to be expanded can be obtained, target cloud resource use data matched with the capacity expansion parameter data duration is obtained from cloud resource use data of the service to be expanded in historical duration according to the capacity expansion parameter data duration of the service to be expanded, then cloud resource use data of the service to be expanded in current time is obtained, and according to the target cloud resource use data and the cloud resource use data of the service to be expanded in current time, capacity expansion is carried out on cloud resources to be used by the service to be expanded, in this way, the capacity expansion can be actively carried out on cloud resources to be used by the service to be expanded in advance according to the cloud resource use data of the service to be expanded in historical duration, request blocking is effectively reduced, and flow peak and flow fluctuation can be effectively dealt with by capacity expansion in advance, and availability and user experience of a system are improved.
Referring to fig. 5, the duration of the capacity expansion parameter data of the capacity expansion service may be obtained from the resource control unit. The capacity expansion parameter data duration of the capacity expansion service can be set according to actual service requirements. The capacity expansion parameter data duration of the service to be expanded may refer to cloud resource usage data that needs to specifically refer to a period of past duration that is nearest to the current time. For example, the capacity expansion parameter data duration RD is 2 days, and cloud resource usage data of the service to be expanded in the two days nearest to the current time may be referred to.
In some embodiments, the resource adjusting unit may store, for each service to be expanded in the cloud service cluster, a corresponding time-sharing expansion switch, an expansion time step TS, and an expansion parameter data duration RD. The resource regulation and control unit can also establish a corresponding timing task according to the requirement for each service to be expanded in the cloud service cluster so as to acquire cloud resource use data of each service to be expanded in the cloud service cluster in the historical time length by executing the timing task. In this embodiment, when the time-sharing capacity-expansion switch is in an on state and the to-be-timed task reaches the execution time, the timed task is executed according to a preset time interval to obtain cloud resource usage data of each to-be-expanded service in the cloud service cluster in a history duration. The preset time interval may be a capacity expansion time step TS, for example, ts=1 hour, which indicates that the capacity expansion operation is performed once every one hour for the capacity expansion service.
In some embodiments, before obtaining the target cloud resource usage data that matches the capacity expansion parameter data duration, the method further comprises: acquiring historical cloud resource use data of a service to be expanded; according to the historical time length and the statistical step length, analyzing the historical cloud resource use data of the service to be expanded to obtain cloud resource use data of the service to be expanded in the historical time length, wherein the cloud resource use data is CPU use maximum and memory use maximum corresponding to each statistical step length of the service to be expanded in the historical time length.
Referring to fig. 5, the historical cloud resource usage data of the service to be expanded may be obtained from the database by the resource usage statistics unit. And analyzing the historical cloud resource usage data of the service to be expanded according to the historical time length and the statistical step length to obtain the CPU usage maximum value and the memory usage maximum value corresponding to each statistical step length of the service to be expanded in the historical time length. Specifically, the resource usage statistics unit performs individual configuration for the statistics parameters of each service to be expanded in the cloud service cluster, where the configurable parameters include a statistics day SD (i.e. the above-mentioned history duration), and a statistics step. The resource statistics unit takes step length as a unit to count the request quantity of each to-be-expanded service in unit time and the maximum value of the CPU and the maximum value of the memory actually used in unit time in the SD days nearest to the current time. In this embodiment, SD and step may be specifically configured according to service requirements. For example, the resource usage statistics unit is used for counting cloud resource usage data of the to-be-expanded service a every 30 minutes in the past two days, and the specific table is as follows:
wherein, CMV represents the CPU maximum value of the service A to be expanded in each time period, and MMV represents the memory maximum value of the service A to be expanded in each time period.
For another example, the resource usage statistics unit is used for counting cloud resource usage data of the to-be-expanded service B every 1 hour in the past 1 day, and the specific table is as follows:
wherein, CMV represents the CPU maximum value of the service B to be expanded in each time period, and MMV represents the memory maximum value of the service B to be expanded in each time period.
In some embodiments, since the traffic of each service to be expanded in the cloud service cluster is different, the peak value of the request received in each day is also different, and the period of time until the peak value of the request is reached corresponds to the maximum value of CPU usage and the maximum value of memory usage. The resource usage statistics unit can be configured in a targeted manner according to the service of each service to be expanded.
In some embodiments, before obtaining the target cloud resource usage data that matches the capacity expansion parameter data duration, the method further comprises: and circularly executing a timing task set for the service to be expanded according to a preset time interval to acquire a CPU use maximum value and a memory use maximum value corresponding to each statistic step length of the service to be expanded in the history time, wherein the preset time interval is an expansion time step length of the service to be expanded, and the expansion time step length is more than or equal to the statistic step length.
Referring to fig. 5, for example, the service to be expanded is a service a in the cloud service cluster, the preset time interval is 1h, and when the execution time of the first timing task to be determined arrives (for example, 00:00), the resource control unit circularly executes the timing task of the service a according to 1h, so as to obtain the CPU usage maximum value and the memory usage maximum value corresponding to each statistical step in the historical duration from the resource usage statistical unit. In this way, the cloud resource usage data of the service A in the past period is obtained from the resource usage statistics unit dynamically, so that the service A is dynamically expanded according to the corresponding cloud resource usage data.
In some embodiments, according to the capacity expansion parameter data duration of the service to be expanded, obtaining target cloud resource usage data matched with the capacity expansion parameter data duration from cloud resource usage data of the service to be expanded in the history duration includes: according to the capacity expansion parameter data duration of the service to be expanded, cloud resource use data which is closest to the current time and matches with the capacity expansion parameter data duration are obtained from CPU use maximum values and memory use maximum values corresponding to each statistical step length in the history duration of the service to be expanded; according to the time period information in the current timing task, target cloud resource use data matched with the time period information is obtained from cloud resource use data which is closest to the current time and is matched with the capacity expansion parameter data time length, wherein the target cloud resource use data comprises a CPU use maximum value and a memory use maximum value in the past time period.
Referring to fig. 5, for example, the service to be expanded is service a in the cloud service cluster, the preset time interval is 1h, the duration of the expansion parameter data is 2 days, the history duration is 3 days, and 2023.01.01-00:00 to 2023.01.04-00:00 respectively. In this case, it is necessary to acquire cloud resource usage data matching the expansion parameter data duration closest to the current time from the CPU usage maximum value and the memory usage maximum value corresponding to each statistical step in 3 days. For example, cloud resource usage data corresponding to 2023.01.02-00:00 to 2023.01.04-00:00 are obtained from CPU usage maximum values and memory usage maximum values corresponding to each statistical step in 2023.01.01-00:00 to 2023.01.04-00:00, so that timeliness of the obtained cloud resource usage data can be ensured, and the accuracy of capacity expansion can be improved subsequently.
Based on the foregoing embodiments, for example, the period information in the current timing task is 00:00-01:00, the target cloud resource usage data matching 00:00-01:00 is obtained from the cloud resource usage data corresponding to 2023.01.02-00:00 to 2023.01.04-00:00, for example, the CPU usage maximum value and the memory usage maximum value corresponding to 2023.01.02-00:00-01:00 are obtained, and the CPU usage maximum value and the memory usage maximum value corresponding to 2023.01.03-00:00-01:00 are obtained. The two are compared to the maximum. For example, the CPU usage maximum (e.g., 3235) and memory usage maximum (e.g., 6321) corresponding to 2023.01.02-00:00-01:00 correspond to greater than the CPU usage maximum (e.g., 2928) and memory usage maximum (e.g., 6021) corresponding to 2023.01.03-00:00-01:00. At this time, the target cloud resource usage data is a CPU usage maximum and a memory usage maximum corresponding to 2023.01.02-00:00-01:00. In this way, the target cloud resource usage data can be quickly and accurately obtained from the past cloud resource data according to the time period information in the current timing task.
In some embodiments, expanding the cloud resources for use by the service to be expanded according to the target cloud resource usage data and the cloud resource usage data for the current time of the service to be expanded includes: comparing the CPU usage maximum value in the past period with the CPU usage maximum value at the current time, and comparing the memory usage maximum value in the past period with the memory usage maximum value at the current time; when the CPU usage maximum value is larger than the CPU usage maximum value of the current time in the past period and the memory usage maximum value is larger than the memory usage maximum value of the current time in the past period, correspondingly expanding the CPU usage maximum value and the memory usage maximum value of the service to be expanded in the current time to the CPU usage maximum value and the memory usage maximum value in the past period. For example, the past period is 00:00-01:00, the CPU usage maximum value corresponding to the past period is M, the memory usage maximum value is N, the CPU usage maximum value at the current time is M1, the memory usage maximum value is N1, and the capacity expansion mechanism is triggered by comparing M with M1 and N with N1. For the service to be expanded, expanding the CPU use maximum value of the service to be expanded at the current time to M, and expanding the memory use maximum value of the service to be expanded at the current time to N. By the method, the capacity of the service to be expanded can be actively expanded in advance, the flow peak value and the flow fluctuation are effectively achieved, and the usability and the user experience of the system are improved. In this embodiment, when M is smaller than M1 and N is smaller than N1, no operation is performed for the service to be expanded.
Fig. 2 is a flowchart of another dynamic capacity expansion method for cloud resources according to an embodiment of the present application. As shown in fig. 2, the above method further includes steps S210 to S230 before the timing tasks set for the service to be expanded are cyclically performed at preset time intervals.
In step S210, the state of the time-sharing capacity expansion switch of the capacity expansion service is determined.
In step S220, when the state of the time-sharing capacity-expansion switch is the on state, it is determined whether the capacity-expansion time step is greater than or equal to the statistical step.
In step S230, when the capacity expansion time step is equal to or greater than the statistical step, a timing task is created for the service to be expanded.
The method can judge the state of the time-sharing capacity expansion switch of the to-be-expanded service, judge whether the capacity expansion time step is larger than or equal to the statistical step when the state of the time-sharing capacity expansion switch is in an open state, and establish a timing task for the to-be-expanded service when the capacity expansion time step is larger than or equal to the statistical step, so that inaccurate capacity expansion caused by insufficient data quantity can be avoided, and the capacity expansion accuracy is further improved.
In some embodiments, there are two key parameters in performing time-sharing expansion: a capacity expansion time step and a statistic step. The capacity expansion time step is a time interval of each capacity expansion, which can be understood as a time interval of judging whether the capacity expansion needs to be performed once by the system. The statistical step length refers to a time interval for counting the resource usage of the service to be expanded. When the state of the time-sharing capacity-expansion switch is open, the system firstly judges whether the capacity-expansion time step is larger than or equal to the statistical step. This is to ensure that the system has sufficient resource usage data to analyze and make decisions when making the capacity expansion determination. If the capacity expansion time step is smaller than the statistical step, the system is not enough to judge the data, and the capacity expansion operation is not performed at the moment.
In some embodiments, when the capacity expansion time step is equal to or greater than the statistical step, the system will create a timing task for the service to be expanded. The timing task is used for periodically checking the resource use condition of the service to be expanded in the interval of each expansion time step, and judging whether expansion is needed according to a certain rule. If the capacity expansion is judged to be needed, the system triggers corresponding capacity expansion operation, and the capacity expansion is carried out on the cloud resources of the service to be expanded according to the capacity expansion scheme.
Fig. 3 is a flowchart of still another method for dynamic capacity expansion of cloud resources according to an embodiment of the present application, where, as shown in fig. 3, before obtaining target cloud resource usage data that matches the duration of capacity expansion parameter data, the method further includes steps S310 and S320.
In step S310, it is determined whether cloud resource usage data of the service to be expanded in the history duration is sufficient according to the duration of the expansion parameter data.
In step S320, if the cloud resource usage data of the service to be expanded in the history duration is insufficient, a corresponding prompt message is sent.
According to the method, whether cloud resource usage data of the service to be expanded in the historical time is sufficient or not can be judged according to the time length of the expansion parameter data, if the cloud resource usage data of the service to be expanded in the historical time is insufficient, corresponding prompt information is sent, so that relevant personnel or system administrators can be reminded of the sufficiency of the historical data, and corresponding measures are taken to improve data acquisition and expansion parameter setting so as to ensure the accuracy and effectiveness of expansion operation. Therefore, the false capacity expansion decision based on insufficient data can be avoided, and the stability and performance of the system are improved.
In some embodiments, according to the capacity expansion parameter data duration, whether cloud resource usage data of the service to be expanded in the history duration is sufficient is judged, and if not, corresponding prompt information can be sent to remind related personnel or system administrators. For example, first, cloud resource usage data of a service to be expanded for a historical duration is acquired by executing a timed task. The system then evaluates whether the historical data is sufficient based on the duration of the expansion parameter data. If the cloud resource use data of the service to be expanded in the history time is insufficient, the system can send corresponding prompt information. The prompt information may be communicated by mail, messaging, or logging. The content of the hint information may include the following: reminding a data acquisition problem: the system may indicate that the frequency or duration of data collection is insufficient, resulting in insufficient historical data. The related personnel are recommended to check the data acquisition mechanism, so that the accuracy and the integrity of the data are ensured. It is suggested to expand the data collection range: if the historical data is insufficient because only a portion of the resource usage data is collected, the system may suggest an expanded data collection range, including more metrics or a longer time span, to obtain more comprehensive resource usage information. It is recommended to increase the data acquisition frequency: if the historical data is insufficient because the acquisition frequency is low, the system can recommend increasing the data acquisition frequency so as to acquire the resource use condition of the service to be expanded more timely. Suggesting to adjust the expansion parameter data duration: if the historical data is insufficient because the capacity expansion parameter data duration is set too short, the system may recommend adjusting the capacity expansion parameter data duration to ensure there is enough historical data to make capacity expansion decisions and decisions.
Fig. 4 is a flowchart of still another dynamic capacity expansion method for cloud resources according to an embodiment of the present application, and as shown in fig. 4, the method further includes step S410 and step S420 before the timing tasks set for the service to be expanded are cyclically executed at preset time intervals.
In step S410, it is determined whether the current time satisfies a preset configuration period.
In step S420, if the current time satisfies the preset configuration period, the time-sharing capacity expansion switch of the service to be expanded is turned off, and the capacity expansion is performed preferentially according to the CPU usage maximum value and the storage usage maximum value set for the preset configuration period.
The method can judge whether the current time meets the preset configuration time period, and if the current time meets the preset configuration time period, the time-sharing capacity expansion switch of the to-be-expanded service is closed, so that unnecessary time-sharing capacity expansion operation in a specific time period can be avoided, and the stability and the resource utilization efficiency of the system are improved. And preferentially expanding the capacity according to the CPU use maximum value and the storage use maximum value which are set for the preset configuration period, so that enough resources can be allocated for the service to be expanded in advance to cope with the expected high-load condition, and the performance and the reliability of the system in the key period are ensured. Therefore, for the predictable large-flow time, the dynamic adjustment of resources can be realized without restarting the service to be expanded, and the running continuity of the system is ensured.
In some embodiments, the CPU usage maximum value and the storage usage maximum value of a specific period may be configured for the service to be expanded by the resource regulating unit. The specific time period may be set according to specific requirements of a business activity (e.g., shopping festival activity, coupon activity, etc.) of the service to be expanded. The specific period is the preset configuration period. In this embodiment, the specific period may support one-time resource allocation, and also periodic (e.g., a certain period of each day, a certain period of several days each month). When a certain service to be expanded is configured, a timing task can be started through the resource regulation and control unit, the execution period of the timing task is a configuration period, when the time comes within the configuration period of the timing task, the maximum available resource of the service to be expanded is compared with the configured value, if the configured value is larger than the currently available value of the service to be expanded, the maximum available resource of the service to be expanded is adjusted to the configured value, otherwise, no operation is performed.
In some embodiments, whether the current time meets a preset configuration period is determined, and corresponding capacity expansion operation is performed on the to-be-expanded service according to the setting of the preset configuration period. Firstly, the system acquires current time information and compares the current time information with a preset configuration period. The preset configuration period may be a range of time, such as a certain period of time per day or a particular date. The system determines whether the current time is within a preset configuration period. If the current time meets the preset configuration period, the system will perform the following operations: closing the time-sharing capacity expansion switch: the system turns off the time-sharing capacity expansion switch of the service to be expanded. This means that the system does not perform the time-sharing capacity expansion operation in a preset configuration period, so as to avoid frequent capacity expansion in a specified period. The capacity expansion is performed according to the CPU use maximum value and the storage use maximum value which are set according to the preset configuration period: the system can preferentially expand the CPU use and storage use of the service to be expanded at the current time according to the CPU use maximum value and the storage use maximum value which are set in the preset configuration period. This means that the system allocates more CPU resources and memory resources to the service to be expanded in advance according to the requirements of the preset configuration period, so as to meet the expected performance requirements.
Fig. 6 is a block diagram of a cloud resource dynamic capacity expansion device according to an embodiment of the present application. As shown in fig. 6, the cloud resource dynamic capacity expansion device 600 includes a first acquisition module 610, a second acquisition module 620, a third acquisition module 630, and a capacity expansion module 640.
Specifically, the first obtaining module 610 is configured to obtain a duration of the capacity expansion parameter data of the service to be expanded.
The second obtaining module 620 is configured to obtain, from cloud resource usage data of the service to be expanded in the historical duration, target cloud resource usage data that matches the duration of the expansion parameter data according to the duration of the expansion parameter data of the service to be expanded, where the duration of the expansion parameter data is less than or equal to the historical duration.
And a third obtaining module 630, configured to obtain cloud resource usage data of the current time of the service to be expanded.
And the capacity expansion module 640 is configured to expand the cloud resources used by the service to be expanded according to the target cloud resource usage data and the cloud resource usage data of the service to be expanded in the current time.
The cloud resource dynamic capacity expansion device 600 can acquire the capacity expansion parameter data duration of the service to be expanded, acquire target cloud resource usage data matched with the capacity expansion parameter data duration from cloud resource usage data of the service to be expanded in historical duration according to the capacity expansion parameter data duration of the service to be expanded, then acquire cloud resource usage data of the service to be expanded in current time, and expand cloud resources used by the service to be expanded according to the target cloud resource usage data and the cloud resource usage data of the service to be expanded in current time.
In some embodiments, before acquiring the target cloud resource usage data that matches the capacity expansion parameter data duration, the cloud resource dynamic capacity expansion device 600 is further configured to: acquiring historical cloud resource use data of a service to be expanded; according to the historical time length and the statistical step length, analyzing the historical cloud resource use data of the service to be expanded to obtain cloud resource use data of the service to be expanded in the historical time length, wherein the cloud resource use data is CPU use maximum and memory use maximum corresponding to each statistical step length of the service to be expanded in the historical time length.
In some embodiments, before acquiring the target cloud resource usage data that matches the capacity expansion parameter data duration, the cloud resource dynamic capacity expansion device 600 is further configured to: and circularly executing a timing task set for the service to be expanded according to a preset time interval to acquire a CPU use maximum value and a memory use maximum value corresponding to each statistic step length of the service to be expanded in the history time, wherein the preset time interval is an expansion time step length of the service to be expanded, and the expansion time step length is more than or equal to the statistic step length.
In some embodiments, the second acquisition module 620 is configured to: according to the capacity expansion parameter data duration of the service to be expanded, cloud resource use data which is closest to the current time and matches with the capacity expansion parameter data duration are obtained from CPU use maximum values and memory use maximum values corresponding to each statistical step length in the history duration of the service to be expanded; according to the time period information in the current timing task, target cloud resource use data matched with the time period information is obtained from cloud resource use data which is closest to the current time and is matched with the capacity expansion parameter data time length, wherein the target cloud resource use data comprises a CPU use maximum value and a memory use maximum value in the past time period.
In some embodiments, the capacity expansion module 640 is configured to: comparing the CPU usage maximum value in the past period with the CPU usage maximum value at the current time, and comparing the memory usage maximum value in the past period with the memory usage maximum value at the current time; when the CPU usage maximum value is larger than the CPU usage maximum value of the current time in the past period and the memory usage maximum value is larger than the memory usage maximum value of the current time in the past period, correspondingly expanding the CPU usage maximum value and the memory usage maximum value of the service to be expanded in the current time to the CPU usage maximum value and the memory usage maximum value in the past period.
In some embodiments, before the timing tasks set for the service to be expanded are cyclically executed at preset time intervals, the cloud resource dynamic capacity expansion device 600 is further configured to: judging the state of a time-sharing capacity expansion switch of the to-be-expanded service; when the state of the time-sharing capacity-expansion switch is an open state, judging whether the capacity-expansion time step is more than or equal to the statistical step; and when the expansion time step length is greater than or equal to the statistical step length, creating a timing task for the service to be expanded.
In some embodiments, before acquiring the target cloud resource usage data that matches the capacity expansion parameter data duration, the cloud resource dynamic capacity expansion device 600 is further configured to: judging whether cloud resource use data of the service to be expanded in the historical time length are sufficient or not according to the capacity expansion parameter data time length; and if the cloud resource use data of the service to be expanded in the history time is insufficient, sending corresponding prompt information.
In some embodiments, before the timing tasks set for the service to be expanded are cyclically executed at preset time intervals, the cloud resource dynamic capacity expansion device 600 is further configured to: judging whether the current time meets a preset configuration period; if the current time meets the preset configuration period, closing a time-sharing capacity expansion switch of the service to be expanded, and preferentially expanding the capacity according to the CPU use maximum value and the storage use maximum value which are set for the preset configuration period.
Fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
As shown in fig. 7, the electronic apparatus 700 of this embodiment includes: a processor 710, a memory 720, and a computer program 730 stored in the memory 720 and executable on the processor 710. The steps of the various method embodiments described above are implemented by processor 710 when executing computer program 730. Alternatively, the processor 710, when executing the computer program 730, performs the functions of the modules in the apparatus embodiments described above.
The electronic device 700 may be a desktop computer, a notebook computer, a palm computer, a cloud server, or the like. The electronic device 700 may include, but is not limited to, a processor 710 and a memory 720. It will be appreciated by those skilled in the art that fig. 7 is merely an example of an electronic device 700 and is not limiting of the electronic device 700 and may include more or fewer components than shown, or different components.
The processor 710 may be a central processing unit (Central Processing Unit, CPU) or other general purpose processor, digital signal processor (Digital Signal Processor, DSP), application specific integrated circuit (Application Specific Integrated Circuit, ASIC), field programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, or the like.
The memory 720 may be an internal storage unit of the electronic device 700, for example, a hard disk or a memory of the electronic device 700. The memory 720 may also be an external storage device of the electronic device 700, for example, a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash Card (Flash Card) or the like, which are provided on the electronic device 700. Memory 720 may also include both internal and external storage units of electronic device 700. The memory 720 is used to store computer programs and other programs and data required by the electronic device.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-described division of the functional units and modules is illustrated, and in practical application, the above-described functional distribution may be performed by different functional units and modules according to needs, i.e. the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-described functions. The functional units and modules in the embodiment may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit, where the integrated units may be implemented in a form of hardware or a form of a software functional unit.
The integrated module, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a readable storage medium (e.g., a computer readable storage medium). Based on such understanding, the present application may implement all or part of the flow of the method of the above embodiment, or may be implemented by a computer program to instruct related hardware, and the computer program may be stored in a computer readable storage medium, where the computer program, when executed by a processor, may implement the steps of each of the method embodiments described above. The computer program may comprise computer program code, which may be in source code form, object code form, executable file or in some intermediate form, etc. The computer readable medium may include: any entity or device capable of carrying computer program code, a recording medium, a U disk, a removable hard disk, a magnetic disk, an optical disk, a computer Memory, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), an electrical carrier signal, a telecommunications signal, a software distribution medium, and so forth.
The above embodiments are only for illustrating the technical solution of the present application, and are not limiting; although the application has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present application, and are intended to be included in the scope of the present application.

Claims (10)

1. The cloud resource dynamic capacity expansion method is characterized by comprising the following steps of:
acquiring the capacity expansion parameter data duration of the service to be expanded;
acquiring target cloud resource use data matched with the capacity expansion parameter data duration from cloud resource use data of the to-be-expanded service in the history duration according to the capacity expansion parameter data duration of the to-be-expanded service, wherein the capacity expansion parameter data duration is less than or equal to the history duration;
acquiring cloud resource use data of the current time of the service to be expanded;
and expanding the cloud resources used by the service to be expanded according to the target cloud resource use data and the cloud resource use data of the service to be expanded in the current time.
2. The method of claim 1, wherein prior to obtaining target cloud resource usage data that matches the capacity expansion parameter data duration, the method further comprises:
acquiring historical cloud resource use data of the service to be expanded;
and analyzing the historical cloud resource usage data of the service to be expanded according to the historical time length and the statistical step length to obtain cloud resource usage data of the service to be expanded in the historical time length, wherein the cloud resource usage data is CPU usage maximum value and memory usage maximum value corresponding to each statistical step length of the service to be expanded in the historical time length.
3. The method of claim 2, wherein prior to obtaining target cloud resource usage data that matches the capacity expansion parameter data duration, the method further comprises:
circularly executing a timing task set for the service to be expanded according to a preset time interval to obtain a CPU use maximum value and a memory use maximum value corresponding to each statistical step length of the service to be expanded in the historical time, wherein the preset time interval is an expansion time step length of the service to be expanded, and the expansion time step length is greater than or equal to the statistical step length;
according to the capacity expansion parameter data duration of the service to be expanded, obtaining target cloud resource usage data matched with the capacity expansion parameter data duration from cloud resource usage data of the service to be expanded in the history duration comprises the following steps:
according to the capacity expansion parameter data duration of the service to be expanded, cloud resource use data which is closest to the current time and matches with the capacity expansion parameter data duration are obtained from CPU use maximum values and memory use maximum values corresponding to each statistical step length in the history duration of the service to be expanded;
and according to the time period information in the current timing task, acquiring target cloud resource use data matched with the time period information from the cloud resource use data which is closest to the current time and is matched with the capacity expansion parameter data time length, wherein the target cloud resource use data comprises a CPU use maximum value and a memory use maximum value in the time period in the past.
4. The method of claim 3, wherein expanding the cloud resources used by the service to be expanded according to the target cloud resource usage data and the cloud resource usage data of the service to be expanded at the current time comprises:
comparing the CPU usage maximum value in the past period with the CPU usage maximum value in the current time, and comparing the memory usage maximum value in the past period with the memory usage maximum value in the current time;
when the CPU usage maximum value is larger than the CPU usage maximum value of the current time in the period in the past and the memory usage maximum value is larger than the memory usage maximum value of the current time in the period in the past, correspondingly expanding the CPU usage maximum value and the memory usage maximum value of the service to be expanded in the current time to the CPU usage maximum value and the memory usage maximum value in the period in the past.
5. A method according to claim 3, characterized in that before cyclically performing the timing tasks set for the service to be expanded at the preset time intervals, the method further comprises:
judging the state of a time-sharing capacity expansion switch of the to-be-expanded service;
when the state of the time-sharing capacity-expansion switch is an opening state, judging whether the capacity-expansion time step is larger than or equal to the statistic step;
and when the capacity expansion time step length is greater than or equal to the statistical step length, creating the timing task for the service to be expanded.
6. The method of claim 2, wherein prior to obtaining target cloud resource usage data that matches the capacity expansion parameter data duration, the method further comprises:
judging whether cloud resource use data of the service to be expanded in the historical time length are sufficient or not according to the capacity expansion parameter data time length;
and if the cloud resource use data of the service to be expanded in the history time is insufficient, sending corresponding prompt information.
7. A method according to claim 3, characterized in that before cyclically performing the timing tasks set for the service to be expanded at the preset time intervals, the method further comprises:
judging whether the current time meets a preset configuration period;
and if the current time meets the preset configuration period, closing the time-sharing capacity expansion switch of the to-be-expanded service, and preferentially expanding the CPU use maximum value and the storage use maximum value of the to-be-expanded service at the current time according to the CPU use maximum value and the storage use maximum value set for the preset configuration period.
8. The cloud resource dynamic capacity expansion device is characterized by comprising:
the first acquisition module is used for acquiring the capacity expansion parameter data duration of the to-be-expanded service;
the second acquisition module is used for acquiring target cloud resource use data matched with the capacity expansion parameter data duration from cloud resource use data of the to-be-expanded service in the history duration according to the capacity expansion parameter data duration of the to-be-expanded service, wherein the capacity expansion parameter data duration is less than or equal to the history duration;
the third acquisition module is used for acquiring cloud resource use data of the current time of the service to be expanded;
and the capacity expansion module is used for expanding the cloud resources used by the service to be expanded according to the target cloud resource use data and the cloud resource use data of the service to be expanded in the current time.
9. An electronic device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the steps of the method according to any of claims 1 to 7 when the computer program is executed.
10. A readable storage medium storing a computer program, characterized in that the computer program when executed by a processor implements the steps of the method according to any one of claims 1 to 7.
CN202311122954.5A 2023-08-31 2023-08-31 Cloud resource dynamic capacity expansion method and device Pending CN117014304A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311122954.5A CN117014304A (en) 2023-08-31 2023-08-31 Cloud resource dynamic capacity expansion method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311122954.5A CN117014304A (en) 2023-08-31 2023-08-31 Cloud resource dynamic capacity expansion method and device

Publications (1)

Publication Number Publication Date
CN117014304A true CN117014304A (en) 2023-11-07

Family

ID=88567343

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311122954.5A Pending CN117014304A (en) 2023-08-31 2023-08-31 Cloud resource dynamic capacity expansion method and device

Country Status (1)

Country Link
CN (1) CN117014304A (en)

Similar Documents

Publication Publication Date Title
CN110297711B (en) Batch data processing method, device, computer equipment and storage medium
CN107562512B (en) Method, device and system for migrating virtual machine
CN112311617A (en) Configured data monitoring and alarming method and system
CN108243032B (en) Method, device and equipment for acquiring service level information
US20190354983A1 (en) Payment method and device
CN103312566B (en) The method that detection messages port is congested and device
EP2551767B1 (en) Method and device for adjusting clock interrupt cycle
CN111143163A (en) Data monitoring method and device, computer equipment and storage medium
CN111651595A (en) Abnormal log processing method and device
CN112148493A (en) Streaming media task management method and device and data server
CN111124829A (en) Method for monitoring states of kubernetes computing nodes
CN111143165A (en) Monitoring method and device
CN109117279B (en) Electronic device, method for limiting inter-process communication thereof and storage medium
CN110262878B (en) Timed task processing method, device, equipment and computer readable storage medium
CN112084486A (en) User information verification method and device, electronic equipment and storage medium
CN112148504A (en) Target message processing method and device, storage medium and electronic device
Choi et al. An enhanced data-locality-aware task scheduling algorithm for hadoop applications
US8521855B2 (en) Centralized server-directed power management in a distributed computing system
CN112860387A (en) Distributed task scheduling method and device, computer equipment and storage medium
WO2017181520A1 (en) Method and device for data synchronization
CN112596985B (en) IT asset detection method, device, equipment and medium
CN112650566B (en) Timed task processing method and device, computer equipment and storage medium
CN117014304A (en) Cloud resource dynamic capacity expansion method and device
CN109670932B (en) Credit data accounting method, apparatus, system and computer storage medium
CN110795239A (en) Application memory leakage detection method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20240118

Address after: No. 13 Xingxiang Road, Zengjia Town, High tech Zone, Shapingba District, Chongqing, 400039

Applicant after: Chongqing Selis Phoenix Intelligent Innovation Technology Co.,Ltd.

Address before: 401120 No. 618 Liangjiang Avenue, Longxing Town, Yubei District, Chongqing City

Applicant before: Chongqing Celes New Energy Automobile Design Institute Co.,Ltd.