Autoscaling method and apparatus in kubernetes cluster, and storage medium

By interpolating and performing Fourier transform analysis on historical monitoring data of Kubernetes clusters, periodic trends are identified and verified, solving the problem that traditional HPA cannot predict traffic peaks. This enables proactive and precise adjustment of cluster resources, ensuring business stability.

WO2025247074A1PCT designated stage Publication Date: 2025-12-04SHANDONG INSPUR SCI RES INST CO LTD

Patent Information

Application Number
PCT/CN2025/096568
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2024-05-31
Filing Date
2025-05-22
Publication Date
2025-12-04

AI Technical Summary

Technical Problem

In existing Kubernetes clusters, traditional HPA cannot effectively predict traffic peaks, leading to insufficient resources that affect business stability, and also has a strong lag in scaling.

Method used

By interpolating and supplementing historical monitoring data, performing fast Fourier transform and spectrum analysis, identifying candidate periods, and using correlation coefficient calculation functions to verify the main period, we can predict future resource demand and perform expansion or contraction operations before traffic peaks.

Benefits of technology

It enables proactive and accurate prediction of traffic fluctuations, ensuring timely resource adjustments and improving business stability and resource utilization efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2025096568_04122025_PF_FP_ABST
    Figure CN2025096568_04122025_PF_FP_ABST
Patent Text Reader

Abstract

An autoscaling method and apparatus in a Kubernetes cluster, which method and apparatus are applied to the technical field of computers. The method comprises: in historical monitoring data, using an interpolation method to impute missing data between adjacent data points to obtain preprocessed sequence data; performing a fast discrete Fourier transform on the preprocessed sequence data to obtain a spectrogram of original data; analyzing the spectrogram, and identifying candidate periods in the spectrogram; using a preset correlation coefficient calculation function to verify the candidate periods to obtain a dominant period; on the basis of the dominant period and operation data in a cluster, performing peak prediction; and when a predicted peak exceeds a preset autoscaling threshold, triggering a scale-up or scale-down operation corresponding to a system. By means of the present disclosure, the requirement for resources in a period of time in the future can be predicted, and scaling up or scaling down can be performed, so that a more active and accurate resource allocation policy is realized, and the stability of a service is ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Elastic scaling methods, devices, and storage media in Kubernetes clusters

[0001] This application claims priority to Chinese Patent Application No. 202410700705.8, filed on May 31, 2024, entitled "Elastic Scaling Method, Apparatus and Storage Medium in Kubernetes Cluster", the entire contents of which are incorporated herein by reference. Technical Field

[0002] This application relates to the field of computer technology, and for example to a method, apparatus and storage medium for elastic scaling in a Kubernetes cluster. Background Technology

[0003] With the development of cloud-native technologies, the pay-as-you-go model has driven the widespread application of auto-scaling (HPA) technology to dynamically adapt to changes in resource demand and optimize costs. In Kubernetes, a Pod is the smallest atomic scheduling unit in a Kubernetes cluster. Horizontal Pod Auto-Scaling (HPA) is a fundamental and critical elastic scaling technology used to automatically increase or decrease the number of Pods based on CPU utilization or other metrics. However, traditional HPA faces challenges such as difficult configuration, untimely elastic response, and low observability, which limit its efficiency and reliability. The default elastic scaling service in Kubernetes clusters is implemented by passively responding to monitoring data. When user access demand is high and HPA detects insufficient cluster resources, it passively expands Pods. However, the startup and warm-up of new Pods usually takes time, causing a certain lag in the default HPA. By the time the expansion is complete, the cluster's resource status has typically changed. Furthermore, user access traffic has a certain periodicity, which varies with the nature of the business. For example, shopping websites have higher user traffic. Traditional HPA services cannot predict peak access times in advance. When passive expansion occurs, the peak access time has already happened, leading to insufficient cluster service resources and impacting business stability.

[0004] Therefore, existing technical solutions cannot predict traffic peaks, which can easily lead to insufficient cluster service resources and affect business stability.

[0005] It should be noted that the information disclosed in the background section above is only used to enhance the understanding of the background of this application, and therefore may include information that does not constitute prior art known to those skilled in the art. Summary of the Invention

[0006] To provide a basic understanding of some aspects of the disclosed embodiments, a brief summary is given below. This summary is not intended as a general commentary, nor is it intended to identify key / important components or describe the scope of protection of these embodiments, but rather as a prelude to the detailed description that follows.

[0007] This disclosure provides an elastic scaling method, apparatus, and storage medium in a Kubernetes cluster.

[0008] In some embodiments, an elastic scaling method in a Kubernetes cluster includes:

[0009] In historical monitoring data, interpolation is used to fill in missing data between adjacent data points to obtain preprocessed sequence data;

[0010] Perform a fast discrete Fourier transform on the preprocessed sequence data to obtain the spectrum of the original data;

[0011] Analyze the spectrogram to identify candidate periods in the spectrogram;

[0012] The candidate period is verified using a preset correlation coefficient calculation function to obtain the main period;

[0013] Peak prediction is performed based on the master cycle and the running data of the Kubernetes cluster.

[0014] When the predicted peak value exceeds the pre-set elastic scaling threshold, the system will trigger the corresponding expansion or contraction operation.

[0015] In some embodiments, interpolation is used to fill in missing data between adjacent data points in historical monitoring data to obtain preprocessed sequence data, including:

[0016] In historical monitoring data, interpolation methods are used to fill in missing data between adjacent data points;

[0017] The completed data is filtered for outliers according to the upper and lower thresholds to obtain preprocessed sequence data.

[0018] In some embodiments, each point on the spectrum of the original data corresponds to a discrete frequency component, the amplitude of which represents the intensity of the frequency component in the original signal, and the corresponding period is an N / K sampling interval.

[0019] In some embodiments, analyzing the spectrogram to identify candidate periods in the spectrogram includes:

[0020] The original data corresponding to the spectrum diagram are randomly arranged to generate multiple new sequence data.

[0021] Perform a Fast Fourier Transform on the generated new sequence data to obtain multiple spectrograms, record the maximum value in each spectrogram, and determine the candidate threshold based on the maximum value;

[0022] Traverse the spectrum of the original data. If the absolute value of a certain frequency component is greater than the candidate threshold, the period corresponding to that frequency component is recorded as a candidate period.

[0023] In some embodiments, a preset correlation coefficient calculation function is used to verify the candidate period to obtain the main period, including:

[0024] The preprocessed sequence data is expanded based on the candidate period to obtain expanded sequence data;

[0025] The autocorrelation coefficient of the expanded sequence data is calculated based on a preset correlation coefficient calculation function.

[0026] For each candidate period T, we check whether its corresponding autocorrelation coefficient is a peak value, and the largest peak value is taken as the main period of the original time series.

[0027] In some embodiments, the elastic scaling device in a Kubernetes cluster includes:

[0028] The processing module is used to fill in missing data between adjacent data points in historical monitoring data using interpolation methods to obtain preprocessed sequence data.

[0029] The processing module is also used to perform a fast discrete Fourier transform on the preprocessed sequence data to obtain the spectrum of the original data.

[0030] The analysis module is used to analyze the spectrum and identify candidate periods in the spectrum.

[0031] The verification module is used to verify the candidate period using a preset correlation coefficient calculation function to obtain the main period;

[0032] The prediction module is used to perform peak prediction based on the master cycle and the runtime data in the Kubernetes cluster.

[0033] The trigger module is used to trigger the system's expansion operation when the predicted peak value exceeds the preset elastic scaling threshold.

[0034] In some embodiments, the processing module is further configured to use interpolation to fill in missing data between adjacent data points in historical monitoring data; and to filter out abnormal data in the filled data according to upper and lower thresholds to obtain preprocessed sequence data.

[0035] The elastic scaling method, apparatus, and storage medium in the Kubernetes cluster provided in this disclosure can achieve the following technical effects:

[0036] This approach employs a flexible decision-making process optimized by combining historical data analysis and future trend prediction. By introducing a time-series forecasting model and collecting historical system operation and maintenance data, it can predict resource demand over a future period. This allows for proactive and precise resource adjustment strategies, enabling capacity expansion before peak traffic periods and capacity reduction before traffic troughs. Furthermore, this method supports elastic configuration, allowing for capacity expansion based on user-configured timeframes to adapt to periodic or anticipated traffic fluctuations and ensure business stability.

[0037] The above general description and the description below are exemplary and illustrative only and are not intended to limit this application. Attached Figure Description

[0038] One or more embodiments are illustrated by way of example with reference to the accompanying drawings. These illustrations and drawings do not constitute a limitation on the embodiments. Elements having the same reference numerals in the drawings are shown as similar elements. The drawings are not to be scaled. And wherein:

[0039] Figure 1 is a flowchart illustrating an elastic scaling method in a Kubernetes cluster provided in an embodiment of this disclosure;

[0040] Figure 2 is a schematic diagram of the structure of an elastic scaling device in a Kubernetes cluster provided in an embodiment of this disclosure;

[0041] Figure 3 is a schematic diagram of an elastic scaling system architecture in a Kubernetes cluster provided in an embodiment of this disclosure. Detailed Implementation

[0042] To provide a more detailed understanding of the features and technical content of the embodiments of this disclosure, the implementation of the embodiments of this disclosure will be described in detail below with reference to the accompanying drawings. The accompanying drawings are for illustrative purposes only and are not intended to limit the embodiments of this disclosure. In the following technical description, for ease of explanation, several details are used to provide a full understanding of the disclosed embodiments. However, one or more embodiments may still be implemented without these details. In other cases, well-known structures and devices may be simplified in their depiction to simplify the drawings.

[0043] The terms "first," "second," etc., used in the embodiments of this disclosure are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate for the embodiments of this disclosure described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion.

[0044] Unless otherwise stated, the term "multiple" means two or more.

[0045] In this embodiment of the disclosure, the character " / " indicates that the objects before and after it are in an "or" relationship. For example, A / B means: A or B.

[0046] The term "and / or" describes an association between objects, indicating that three relationships can exist. For example, A and / or B means: A or B, or A and B.

[0047] The term "correspondence" can refer to an association or binding relationship. The correspondence between A and B means that there is an association or binding relationship between A and B.

[0048] The elastic scaling method, apparatus, and storage medium in the Kubernetes cluster provided in this disclosure are described below with reference to the accompanying drawings.

[0049] Figure 1 is a schematic diagram of an elastic scaling method in a Kubernetes cluster provided in an embodiment of this disclosure.

[0050] As shown in Figure 1, the elastic scaling method in the Kubernetes cluster provided in this disclosure may include:

[0051] S01, In historical monitoring data, interpolation is used to fill in the missing data between adjacent data points to obtain preprocessed sequence data;

[0052] S02, perform a fast discrete Fourier transform on the preprocessed sequence data to obtain the spectrum of the original data;

[0053] S03, Analyze the spectrum and identify candidate periods in the spectrum;

[0054] S04, use the preset correlation coefficient calculation function to verify the candidate period and obtain the main period;

[0055] S05, based on the master cycle, performs peak prediction based on the running data in the Kubernetes cluster;

[0056] S06, when the predicted peak value exceeds the preset elastic scaling threshold, the system will trigger the corresponding expansion or contraction operation.

[0057] This disclosure presents a flexible decision-making process optimized by combining historical data analysis and future trend prediction. By introducing a time-series forecasting model and collecting historical system operation and maintenance data, this method can predict resource demand over a future period. It can then scale up Pods before traffic peaks and scale down Pods before traffic troughs, achieving a more proactive and precise resource adjustment strategy. Furthermore, this method supports Cron-based flexible configuration, allowing scaling up based on user-configured timeframes to adapt to periodic or anticipated traffic fluctuations and ensure business stability.

[0058] In some embodiments, interpolation is used to fill in missing data between adjacent data points in historical monitoring data to obtain preprocessed sequence data, including:

[0059] In historical monitoring data, interpolation methods are used to fill in missing data between adjacent data points;

[0060] The completed data is filtered for outliers according to the upper and lower thresholds to obtain preprocessed sequence data.

[0061] Specifically, because data may be missing at certain points in the monitoring time series data, interpolation can be used to fill in the missing data between adjacent data points. At the same time, the monitoring time series data may also contain some abnormal data, which are characterized by data values ​​significantly exceeding or falling below the normal range. The values ​​of P99.0 and P0.1 in the monitoring time series can be selected as the upper and lower thresholds of the time series data, respectively. When the data at a certain sampling point is higher than the upper threshold or lower than the lower threshold, the threshold is reset to the value of the previous sampling point.

[0062] In some embodiments, each point on the spectrum of the original data corresponds to a discrete frequency component, the amplitude of which represents the strength of the frequency component in the original signal, and the corresponding period is an N / K sampling interval, where N represents the number of sampling points, and K represents the frequency index in the spectrum, which is an integer with a value range of (N-1) and is used to identify different frequency points in the spectrum. Each K index corresponds to a specific discrete frequency component on the spectrum.

[0063] In other words, a Fast Discrete Fourier Transform (FFT) is performed on the preprocessed sequence data x(n) (where n is the number of sampling points in the sequence) to obtain the spectrum x(m) of the original data. The FFT is a technique for converting a time-domain signal into a frequency-domain signal. Each point m on the spectrum corresponds to a discrete frequency component, whose amplitude represents the intensity of that frequency component in the original signal. The period corresponding to point m is N / K sampling intervals (s). Due to the conjugate symmetry of the FFT result, only the first half of the spectrum needs to be analyzed.

[0064] In some embodiments, analyzing the spectrogram to identify candidate periods in the spectrogram includes:

[0065] The original data corresponding to the spectrum diagram are randomly arranged to generate multiple new sequence data.

[0066] Perform a Fast Fourier Transform on the generated new sequence data to obtain multiple spectrograms, record the maximum value in each spectrogram, and determine the candidate threshold based on the maximum value;

[0067] Traverse the spectrum of the original data. If the absolute value of a certain frequency component is greater than the candidate threshold, the period corresponding to that frequency component is recorded as a candidate period.

[0068] In some specific examples, candidate periods are identified by analyzing the spectrograms. Specifically, the original sequence data x(n) is first randomly rearranged to generate multiple new sequences x`(n). The original sequence data is a set of data consisting of multiple sampling points; the rearrangement process changes the order of the original data, resulting in a new sequence. A Fast Fourier Transform (FFT) is performed on all rearranged sequences x`(n) to obtain multiple spectrograms x`(m). The maximum value in each x`(m) is recorded, and the 99th percentile of these maximum values ​​is used as a threshold. The spectrograms x(m) of the original data are then iterated over. If the absolute value of a frequency component m is greater than the threshold, the period T corresponding to that frequency component m is recorded as a candidate period.

[0069] In some embodiments, a preset correlation coefficient calculation function is used to verify the candidate period to obtain the main period, including:

[0070] The preprocessed sequence data is expanded based on the candidate period to obtain expanded sequence data;

[0071] The autocorrelation coefficient of the expanded sequence data is calculated based on a preset correlation coefficient calculation function.

[0072] For each candidate period T, we check whether its corresponding autocorrelation coefficient is a peak value, and the largest peak value is taken as the main period of the original time series.

[0073] In other words, a preset correlation coefficient calculation function can be used to verify the candidate periods and obtain the main period. The time series x(n) is expanded by using the above candidate periods T as the period to obtain x``(n), and the correlation coefficient calculation function ACF(n) of x``(n) is calculated. For each candidate period T, it is checked whether its corresponding autocorrelation coefficient is a peak. The largest peak is taken as the main period of the original time series, and subsequent predictions will be based on this main period.

[0074] Based on the main period T obtained from the above steps, the time when the next peak Vmax will occur is predicted. The peak value is the maximum value in one period T forward from the current time, which is the peak value in the next period. This peak value is used to link with the cluster elastic scaling controller module. When the peak value exceeds the preset elastic scaling threshold, the elastic scaling operation of the system is triggered.

[0075] In some embodiments, the elastic scaling method in the Kubernetes cluster provided in Figure 1 can also save configuration information during the elastic scaling process, including the minimum automatic scaling down, the maximum automatic scaling up, and elastic scaling threshold information. The minimum automatic scaling down is the minimum number of Pods retained after system scaling down, and the maximum automatic scaling up is the maximum number of Pods retained after system scaling up. The elastic scaling threshold information refers to the system's automatic elastic scaling up or down when a certain monitoring metric is predicted to exceed or fall below a certain value. The predicted threshold information can define multiple system monitoring metrics, including CPU utilization, network traffic, and memory usage.

[0076] In addition, it can collect monitoring metrics for the entire cluster and store the operational data in a database. This monitoring system can be a common monitoring and alerting system such as Prometheus.

[0077] Furthermore, this method can connect to the monitoring system via API to collect historical monitoring indicator time series data from the business system. Using digital signal processing technology, it can predict monitoring indicators for the next period based on historical data, thus enabling proactive response to sudden traffic surges and allowing for proactive scaling up or down. Historical monitoring indicator time series data records the changes in monitoring indicators over time. It is derived from grouping / aggregating a series of attribute-based values ​​that change over time, and can generally be plotted as a time-related chart.

[0078] This method can also monitor the monitoring metric parameters of the next cycle of the prediction output in real time, and at the same time obtain the saved configuration. When it is found that the predicted monitoring metric exceeds the elastic scaling threshold, such as when the prediction module predicts that the CPU load is about to exceed the elastic scaling threshold, it will call the elastic scaling interface in the Kubernetes cluster to realize the dynamic scaling of the cluster.

[0079] Corresponding to the method embodiment in Figure 1, this disclosure also provides an elastic scaling device in a Kubernetes cluster. Figure 2 is a schematic diagram of the structure of the elastic scaling device in a Kubernetes cluster provided in the embodiment of this disclosure. As shown in Figure 2, the elastic scaling device in a Kubernetes cluster may include:

[0080] The processing module 201 is used to fill in the missing data between adjacent data points in historical monitoring data using interpolation methods to obtain preprocessed sequence data.

[0081] The processing module 201 is also used to perform a fast discrete Fourier transform on the preprocessed sequence data to obtain the spectrum of the original data;

[0082] Analysis module 202 is used to analyze the spectrum and identify candidate periods in the spectrum;

[0083] Verification module 203 is used to verify the candidate period using a preset correlation coefficient calculation function to obtain the main period;

[0084] Prediction module 204 is used to perform peak prediction based on the master cycle and the running data in the Kubernetes cluster;

[0085] Trigger module 205 is used to trigger the system's expansion operation when the predicted peak value exceeds the preset elastic scaling threshold.

[0086] In some embodiments, the processing module 201 is further configured to use interpolation to fill in missing data between adjacent data points in historical monitoring data; and to filter out abnormal data in the filled data according to an upper limit threshold and a lower limit threshold to obtain preprocessed sequence data.

[0087] Each point on the spectrum of the original data corresponds to a discrete frequency component. The amplitude represents the intensity of that frequency component in the original signal, and the corresponding period is the N / K sampling interval.

[0088] The analysis module 202 is also used to randomly arrange the original data corresponding to the spectrum graph to generate multiple new sequence data; perform fast Fourier transform on the multiple new sequence data to obtain multiple spectrum graphs, record the maximum value in each spectrum graph, and determine the candidate threshold based on the maximum value; traverse the spectrum graph of the original data, and if the absolute value of a certain frequency component is greater than the candidate threshold, the period corresponding to the frequency component is recorded as the candidate period.

[0089] Traverse the spectrum of the original data. If the absolute value of a certain frequency component is greater than the above threshold, the period corresponding to that frequency component is recorded as a candidate period.

[0090] In some embodiments, the verification module 203 can also be used to expand the preprocessed sequence data based on the candidate period to obtain expanded sequence data; calculate the autocorrelation coefficient corresponding to the expanded sequence data based on a preset correlation coefficient calculation function; for each candidate period T, detect whether its corresponding autocorrelation coefficient belongs to the peak value, and the largest peak value is taken as the main period of the original time series.

[0091] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this disclosure is not limited to the described order of actions, because according to this disclosure, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily essential to this disclosure.

[0092] Referring to Figure 3, this embodiment of the disclosure provides an elastic scaling system 300 in a Kubernetes cluster, including a processor 304 and a memory 301. Optionally, the system may further include a communication interface 302 and a bus 303. The processor 304, communication interface 302, and memory 301 can communicate with each other via the bus 303. The communication interface 302 can be used for information transmission. The processor 304 can invoke logical instructions in the memory 301 to execute the elastic scaling method in the Kubernetes cluster described in the above embodiment.

[0093] Furthermore, the logic instructions in the aforementioned memory 301 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium.

[0094] The memory 301, as a computer-readable storage medium, can be used to store software programs and computer-executable programs, such as program instructions / modules corresponding to the methods in the embodiments of this disclosure. The processor 304 executes functional applications and data processing by running the program instructions / modules stored in the memory 301, thereby implementing the elastic scaling method in the Kubernetes cluster in the above embodiments.

[0095] The memory 301 may include a program storage area and a data storage area. The program storage area may store the operating system and applications required for at least one function; the data storage area may store data created based on the use of the terminal device. Furthermore, the memory 301 may include high-speed random access memory and may also include non-volatile memory.

[0096] This disclosure provides a computer-readable storage medium storing computer-executable instructions configured to execute an elastic scaling method in a Kubernetes cluster.

[0097] The aforementioned computer-readable storage medium may be a transient computer-readable storage medium or a non-transitory computer-readable storage medium.

[0098] The technical solutions of this disclosure can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes one or more instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of this disclosure. The aforementioned storage medium can be a non-transitory storage medium, including: a USB flash drive, a portable hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, and other media capable of storing program code; it can also be a transient storage medium.

[0099] The foregoing description and accompanying drawings fully illustrate embodiments of the present disclosure to enable those skilled in the art to practice them. Other embodiments may include structural, logical, electrical, procedural, and other changes. The embodiments represent only possible variations. Individual components and functions are optional unless explicitly required, and the order of operation may vary. Parts and features of some embodiments may be included in or replace parts and features of other embodiments. As used in the description of the embodiments, the singular forms “a” and “an” are intended to include the plural forms as well, unless the context clearly indicates otherwise. Similarly, the term “and / or” as used herein means including one or more of the associated listed items and all possible combinations thereof. Additionally, when used in this application, the terms “comprise” and its variations “comprises” and / or “comprising” refer to the presence of stated features, integrals, steps, operations, elements, and / or components, but do not preclude the presence or addition of one or more other features, integrals, steps, operations, elements, components, and / or groups thereof. Unless otherwise specified, an element defined by the phrase "comprising a..." does not exclude the presence of other identical elements in the process, method, or apparatus that includes the element. In this document, each embodiment may focus on describing the differences from other embodiments, and similar or identical parts between embodiments can be referred to mutually. For methods, products, etc., disclosed in the embodiments, if they correspond to the method section disclosed in the embodiments, then the relevant parts can be referred to the description of the method section.

[0100] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the embodiments of this disclosure. Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0101] The methods and products (including but not limited to devices and equipment) disclosed in the embodiments herein can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For instance, the division of units may be merely a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces, and the indirect coupling or communication connection of devices or units may be electrical, mechanical, or other forms. Units described as separate components may or may not be physically separate, and components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to implement this embodiment according to actual needs. Furthermore, the functional units in the embodiments of this disclosure may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0102] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to embodiments of the present disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code, which contains one or more executable instructions for implementing a specified logical function. In some alternative implementations, the functions marked in the blocks may occur in a different order than that shown in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. In the descriptions corresponding to the flowcharts and block diagrams in the accompanying drawings, the operations or steps corresponding to different blocks may also occur in a different order than disclosed in the description, and sometimes there is no specific order between different operations or steps. For example, two consecutive operations or steps may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. Each block in a block diagram and / or flowchart, and combinations of blocks in a block diagram and / or flowchart, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.

Claims

1. An elastic scaling method in a Kubernetes cluster, characterized in that, The method includes: In historical monitoring data, interpolation is used to fill in missing data between adjacent data points to obtain preprocessed sequence data; Perform a fast discrete Fourier transform on the preprocessed sequence data to obtain the spectrum of the original data; The spectrum is analyzed to identify candidate periods in the spectrum; The candidate period is verified using a preset correlation coefficient calculation function to obtain the main period; Based on the aforementioned main cycle, peak prediction is performed using runtime data from the Kubernetes cluster. When the predicted peak value exceeds the pre-set elastic scaling threshold, the system will trigger the corresponding expansion or contraction operation.

2. The method of claim 1, wherein, The process involves using interpolation to fill in missing data between adjacent data points in historical monitoring data, resulting in preprocessed sequence data, including: In historical monitoring data, interpolation methods are used to fill in missing data between adjacent data points; The completed data is filtered for outliers according to the upper and lower thresholds to obtain preprocessed sequence data.

3. The method of claim 1, wherein, Each point on the spectrum of the original data corresponds to a discrete frequency component. The amplitude represents the strength of the frequency component in the original signal, and the corresponding period is an N / K sampling interval, where N represents the number of sampling points and K represents the frequency index in the spectrum.

4. The method of claim 1, wherein, The step of analyzing the spectrum and identifying candidate periods in the spectrum includes: The original data corresponding to the spectrum diagram are randomly arranged to generate multiple new sequence data; Perform a Fast Fourier Transform on the generated new sequence data to obtain multiple spectrograms, record the maximum value in each spectrogram, and determine the candidate threshold based on the maximum value; Traverse the spectrum of the original data. If the absolute value of a certain frequency component is greater than the candidate threshold, the period corresponding to that frequency component is recorded as a candidate period.

5. The method of claim 1, wherein, The step of verifying the candidate period using a preset correlation coefficient calculation function to obtain the main period includes: The preprocessed sequence data is expanded based on the candidate period to obtain expanded sequence data; The autocorrelation coefficient of the expanded sequence data is calculated based on a preset correlation coefficient calculation function. For each candidate period T, we check whether its corresponding autocorrelation coefficient is a peak value, and the largest peak value is taken as the main period of the original time series.

6. An elastic scaling device in a Kubernetes cluster, comprising: The device includes: The processing module is used to fill in missing data between adjacent data points in historical monitoring data using interpolation methods to obtain preprocessed sequence data. The processing module is also used to perform a fast discrete Fourier transform on the preprocessed sequence data to obtain the spectrum of the original data. The analysis module is used to analyze the spectrum and identify candidate periods in the spectrum; The verification module is used to verify the candidate period using a preset correlation coefficient calculation function to obtain the main period; The prediction module is used to predict peak values ​​based on the master cycle and the running data in the Kubernetes cluster. The trigger module is used to trigger the system's expansion operation when the predicted peak value exceeds the preset elastic scaling threshold.

7. The apparatus of claim 6, wherein, The processing module is also used to fill in missing data between adjacent data points in historical monitoring data using interpolation methods; and to filter abnormal data in the filled data according to upper and lower thresholds to obtain preprocessed sequence data.

8. A storage medium storing program instructions, characterized in that, When the program instructions are executed, they perform the elastic scaling method in the Kubernetes cluster as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Container number elastic expansion and contraction method and container number elastic expansion and contraction method system

    CN113010260A

  • Operation and maintenance time sequence data processing method and device, storage medium and electronic equipment

    CN114579554A

  • Elastic scaling method based on Kubernetes cluster

    CN114637650A

  • Load prediction type elastic telescoping system and method based on Kubernetes

    CN116610416A

  • Cloud collaboration container elastic expansion and contraction method and device and electronic equipment

    CN118041787A

Cited By

  • Performance index prediction method and device for Pod and medium

    CN121958053A