Computing resource dynamic allocation method oriented to frequency fluctuation

By building an adaptive prediction model and dynamic segmentation processing technology, the resource allocation problem of complex fluctuating loads in the edge computing environment is solved, and efficient resource utilization and accurate load prediction are achieved.

CN120123100AActive Publication Date: 2025-06-10CHINA TOWER CO LTD

Patent Information

Application Number
CN202510586442.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-08
Publication Date
2025-06-10
Estimated Expiration
2045-05-08

AI Technical Summary

Technical Problem

When facing complex fluctuating loads in an edge computing environment, it is difficult to accurately identify and process different types of load fluctuations, resulting in improper resource allocation and affecting service quality.

Method used

By obtaining historical and real-time resource load data, extracting fluctuation mode feature vectors, building an adaptive prediction model, dynamic segmentation processing and pattern recognition, the frequency fluctuation rate prediction and resource allocation strategy calculation are realized.

Benefits of technology

It realizes fine identification and processing of different types of load fluctuations, improves resource utilization and prediction accuracy of burst load changes, and ensures system performance and user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120123100A_ABST
    Figure CN120123100A_ABST
Patent Text Reader

Abstract

The invention discloses a frequency fluctuation-oriented computing resource dynamic allocation method, which comprises the following steps of: acquiring historical resource load data, extracting a fluctuation mode feature vector and constructing a self-adaptive prediction model; acquiring real-time resource load data, performing dynamic segmentation processing, identifying a fluctuation mode type and calculating a mixed mode weight; inputting the data into a self-adaptive prediction model, and performing frequency fluctuation rate prediction; and according to the predicted load data and the fluctuation mode type, calculating a resource allocation strategy and dynamically adjusting calculation resource configuration. According to the method, the fluctuation mode is represented through the four-dimensional feature vector, the prediction precision is improved by using the hyperbolic rate mapping model of direction perception, efficient dynamic allocation of resources is realized, and load fluctuation in an edge computing environment is effectively coped with.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of dynamic resource allocation, and in particular, relates to a method for dynamically allocating computing resources facing frequency fluctuations. Background Art

[0002] As an extension and supplement to cloud computing, edge computing effectively solves problems such as data transmission delay, bandwidth pressure, and privacy protection by deploying computing resources at the network edge, providing a solid infrastructure support for applications such as the Internet of Things, smart cities, and industries. With the explosive growth of the number of edge devices and the diversification of application scenarios, the resource load in the edge computing environment shows highly dynamic and complex fluctuation characteristics, making it a key issue in current research how to provide stable and efficient services under limited resource constraints. Under frequently fluctuating load conditions, the accuracy and timeliness of resource allocation directly affect system performance, user experience, and energy consumption. Therefore, the research on the method for dynamically allocating computing resources facing frequency fluctuations has important theoretical significance and application value.

[0003] Current research on edge computing resource allocation mainly focuses on static allocation, threshold-based dynamic adjustment, and simple prediction models. Static allocation methods usually pre-allocate fixed resources based on peak demand. Although simple to implement, the resource utilization rate is low; threshold-based dynamic adjustment methods use preset upper and lower limits of resource utilization rate to trigger resource scaling, which can adapt to load changes but the response is relatively lagged; while single prediction models such as ARIMA, exponential smoothing, etc. based on time series prediction can only handle specific types of load patterns. In recent years, deep learning and reinforcement learning methods have been introduced into the field of resource allocation, and end-to-end resource allocation decision models are constructed through technologies such as neural networks or Q-learning. However, most studies focus on static features or overall trends, lacking fine recognition and specific processing of load fluctuation patterns.

[0004] However, when existing resource allocation methods face complex fluctuating loads in the real edge computing environment, situations of over-allocation or under-allocation of resources often occur, wasting resources and affecting service quality. Specifically, first, most methods fail to effectively identify and distinguish different types of load fluctuation patterns (such as periodic, bursty, trend, and random types), resulting in a "one-size-fits-all" resource allocation strategy and unable to optimize targeted; second, traditional prediction models lack the ability to perceive the directional changes of the load, especially the prediction accuracy drops significantly at the inflection points of fluctuations and cannot accurately capture the changing trend of bursty loads; finally, existing methods generally lack an adaptive segmentation mechanism and cannot identify the dynamic conversion points of load characteristics, resulting in poor prediction effects in mixed fluctuation patterns. There is an urgent need for a new method for dynamic resource allocation that can accurately identify fluctuation patterns, perceive directional changes, and achieve multi-model fusion. Summary of the Invention

[0005] Objective of the Invention: To provide a dynamic allocation method for computing resources facing frequency fluctuations, aiming to solve at least one technical problem existing in the prior art.

[0006] Technical Solution: A dynamic allocation method for computing resources facing frequency fluctuations includes:

[0007] Obtain historical resource load data, preprocess it and extract the fluctuation pattern feature vector from it, and construct an adaptive prediction model based on the historical resource load data;

[0008] Obtain real-time resource load data, perform dynamic segmentation processing on it using the fluctuation pattern feature vector, perform fluctuation pattern recognition and matching on each segment, obtain the fluctuation pattern type and the hybrid mode weight and input them into the adaptive prediction model to predict the frequency fluctuation rate and obtain the predicted load data;

[0009] According to the predicted load data and the fluctuation pattern type, calculate the resource allocation strategy and apply it to the edge computing environment to dynamically adjust the computing resource configuration.

[0010] Beneficial Effects: The present invention overcomes the limitation that traditional single indicators cannot comprehensively represent the load characteristics, enabling the system to distinguish different types of fluctuation patterns; adopting differentiated resource allocation strategies for different fluctuation patterns, realizing efficient dynamic allocation of resources, improving resource utilization rate and the prediction accuracy of bursty load changes, and effectively identifying the conversion points of load characteristics. Description of the Drawings

[0011] Figure 1 It is a flowchart of the steps of a dynamic allocation method for computing resources facing frequency fluctuations provided by an embodiment of the present application.

[0012] Figure 2 It is a flowchart of the steps of extracting the fluctuation pattern feature vector provided by an embodiment of the present application.

[0013] Figure 3 It is a flowchart of the steps of performing dynamic segmentation processing provided by an embodiment of the present application.

[0014] Figure 4 It is a flowchart of the steps of performing fluctuation pattern recognition and matching on each segment provided by an embodiment of the present application. Detailed Embodiments

[0015] To enable those skilled in the art to better understand the solution of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the scope of protection of the present invention.

[0016] It should be specifically noted that, for clearly showing the step flow of the present application, serial numbers are marked for each step in the specification. These serial numbers are only for the convenience of description and do not limit the execution order of the steps. In actual operation, according to the technical requirements of the specific implementation scenario, each step can be executed in a different order from that shown in the specification, and in some cases, parallel processing between steps can also be achieved.

[0017] As Figure 1 shown, the method for dynamically allocating computing resources for frequency fluctuations includes the following steps:

[0018] S1. Obtain historical resource load data, preprocess it and extract the fluctuation pattern feature vector therefrom, and construct an adaptive prediction model based on the historical resource load data;

[0019] Specifically, the historical resource load data includes multi-dimensional indicators such as CPU usage rate, memory occupancy rate, network traffic, and request frequency. The fluctuation pattern feature vector includes periodic indicators, sudden indicators, trend indicators, and random indicators. According to the historical resource load data, corresponding prediction models are constructed for different fluctuation patterns.

[0020] S2. Obtain real-time resource load data, perform dynamic segmentation processing on it using the fluctuation pattern feature vector, perform fluctuation pattern recognition and matching on each segment, and obtain the fluctuation pattern type and the hybrid pattern weight;

[0021] Specifically, the real-time resource load data usually shows a trend of continuous fluctuation and irregular change. The feature in the fluctuation pattern feature vector is used to divide the entire continuous load data into multiple paragraphs according to its fluctuation characteristics. For the already segmented data, each segment may exhibit a certain specific fluctuation pattern (such as stable, rising, falling, periodic fluctuation, etc.). Analyze the fluctuation form in each data segment and match it with the preset standard fluctuation pattern to determine which pattern the segment of data most conforms to.

[0022] S3. Input the fluctuation pattern type and the hybrid pattern weight into the adaptive prediction model, perform frequency fluctuation rate prediction, and obtain the predicted load data;

[0023] Specifically, the adaptive prediction model can automatically adjust prediction parameters according to continuously updated data. It simulates and predicts the rate of frequency fluctuations in resource usage data, that is, the speed and frequency of fluctuations and changes in the prediction data.

[0024] S4. Calculate the resource allocation strategy based on the predicted load data and the type of fluctuation pattern, and apply it to the edge computing environment to dynamically adjust the computing resource configuration.

[0025] Specifically, the resource allocation strategy determines how much computing resources need to be increased or decreased and when and where. For example, if a fluctuation pattern of a sharp increase in resource demand is predicted in a future period, the strategy may suggest reserving or scheduling more computing resources on edge nodes in advance; conversely, if the load fluctuation shows low demand, the resource configuration can be reduced to save energy consumption and costs.

[0026] This embodiment can accurately sort out the resource usage rules and fluctuation characteristics of the system in different time periods, enabling subsequent model construction to capture subtle and critical load changes, thereby improving the prediction accuracy; realizing real-time tracking and prediction of the current load, being able to respond more promptly to system changes, and avoiding overload or waste of idle resources; formulating or adjusting the resource allocation strategy in advance, quickly updating the load estimate in the prediction stage, realizing efficient dynamic allocation of resources, and effectively coping with load fluctuations in the edge computing environment.

[0027] As Figure 2 shown, according to one aspect of the present application, the steps of extracting the fluctuation pattern feature vector and constructing the adaptive prediction model include:

[0028] S11. Clean the historical resource load data, identify and remove outliers, obtain the cleaned historical load data and standardize it to form the normalized historical load data;

[0029] S12. Based on the normalized historical load data, calculate the periodicity index, the suddenness index, the trend index and the randomness index;

[0030] S13. Combine the periodicity index, the suddenness index, the trend index and the randomness index into a four-dimensional vector to form the fluctuation pattern feature vector;

[0031] S14. Based on the normalized historical load data, construct corresponding prediction models for different fluctuation patterns, and integrate the parameters of each prediction model and the fluctuation pattern feature vector into an adaptive prediction model.

[0032] Specifically, through the monitoring interface of the edge server, the original load data of the past N time windows is collected, including multi-dimensional metrics such as CPU usage rate, memory occupancy rate, network traffic, and request frequency, to form historical resource load data. The historical resource load data is cleaned, outliers are identified and removed, and missing data points are replaced with moving medians to obtain the cleaned historical load data. The cleaned historical load data is normalized to unify load metrics of different dimensions into the interval [0, 1] to form the normalized historical load data.

[0033] Based on the normalized historical load data, the periodicity metric P is calculated. The specific steps are as follows: perform autocorrelation analysis on the data sequence to obtain the autocorrelation function ACF; locate the position of the first significant peak of the autocorrelation function ACF and denote it as the periodicity metric P; if there is no significant peak, set the periodicity metric P to 0. Based on the normalized historical load data, the burstiness metric B is calculated. The specific steps are as follows: calculate the average rate of change D_short within a short time window (with a length of m); calculate the ratio of the maximum value to the average value of D_short and denote it as the burstiness metric B. Based on the normalized historical load data, the trend metric T is calculated. The specific steps are as follows: perform linear regression on the data sequence to obtain the regression slope Slope; calculate the standard deviation SD of the data sequence; calculate the ratio of the regression slope Slope to the standard deviation SD and denote it as the trend metric T. Based on the normalized historical load data, the randomness metric R is calculated. The specific steps are as follows: calculate the entropy value of the data sequence using the sample entropy algorithm; normalize the calculation result to the interval [0, 1] and denote it as the randomness metric R. The periodicity metric P, burstiness metric B, trend metric T, and randomness metric R are combined into a four-dimensional vector to form the fluctuation pattern feature vector F.

[0034] According to the normalized historical load data, corresponding prediction models are constructed for different fluctuation patterns: periodic pattern: configure the autoregressive prediction model AR; burst pattern: configure the direction-aware hyperbolic speed mapping model DA-HSRM; trend pattern: configure the non-linear trend prediction model NLT; random pattern: configure the robust exponentially weighted moving average model EWMA. The parameters of each model and the fluctuation pattern feature vector F are integrated into an adaptive prediction model for subsequent prediction of real-time data.

[0035] As Figure 3 shown, according to one aspect of the present application, the steps of performing dynamic segmentation processing include:

[0036] S21. Preprocess the real-time resource load data to obtain the normalized real-time load data;

[0037] S22. Using the fluctuation pattern eigenvector as a reference, for each time point of the normalized real-time load data, calculate the local eigenvector within the dynamic sliding window centered at this time point;

[0038] S23. Based on the distribution characteristics of the fluctuation pattern eigenvector, calculate the Mahalanobis distance between the local eigenvectors of adjacent time points, and set an adaptive threshold based on the historical segmentation frequency;

[0039] S24. When the Mahalanobis distance exceeds the adaptive threshold, mark the corresponding time point as a fluctuation segmentation point, and divide the data sequence into different fluctuation segmentation sequences.

[0040] As Figure 4 shown, according to one aspect of the present application, the steps of performing fluctuation pattern recognition and matching on each segment to obtain the fluctuation pattern type and the hybrid pattern weight include:

[0041] S25. For each fluctuation segmentation sequence, calculate its overall fluctuation pattern eigenvector;

[0042] S26. Calculate the Euclidean distance between the overall fluctuation pattern eigenvector of the fluctuation segmentation sequence and each predefined fluctuation pattern prototype to obtain a pattern distance vector;

[0043] S27. Based on the pattern distance vector, use the softmax function to calculate the matching probability of each pattern to obtain the hybrid pattern weight;

[0044] S28. Select the pattern with the largest hybrid pattern weight as the dominant fluctuation pattern type, and at the same time retain the hybrid pattern weight for subsequent prediction model configuration; where the fluctuation pattern prototypes include periodic, bursty, trend, and random fluctuation patterns.

[0045] Specifically, obtain the raw load data of the current time window from the edge computing resource management system in real time as the real-time resource load data. Preprocess the real-time resource load data by applying the same cleaning and standardization methods as the historical resource load data to obtain the normalized real-time load data. Initialize the dynamic sliding window W with a window size of K data points for calculating the local fluctuation pattern feature vector F_local. For each time point t of the normalized real-time load data, calculate the local feature vector F_local(t) within the dynamic sliding window W centered at t. Calculate the Mahalanobis distance D_m(t, t + 1) between the local feature vectors F_local of adjacent time points t and t + 1, using the fluctuation pattern feature vector F as a reference. Initialize the adaptive threshold λ, which is set as a function of the base threshold λ_base and the historical segmentation frequency: λ(t) = λ_base × (1 + k× log(1 + N_seg / N_total)), where N_seg is the number of historical segmentations, N_total is the total number of observations, and k is the adjustment coefficient. When D_m(t, t + 1) > λ(t), mark the time point t + 1 as a fluctuation segmentation point and divide the data sequence before and after t + 1 into two fluctuation segmentation sequences. For each fluctuation segmentation sequence, calculate its overall fluctuation pattern feature vector F_segment.

[0046] Pre-define four basic fluctuation pattern prototypes: Periodic pattern prototype: P high, B low, T low, R low; Burst pattern prototype: P low, B high, T medium, R medium; Trend pattern prototype: P low, B low, T high, R low; Random pattern prototype: P low, B medium, T low, R high. Calculate the Euclidean distance between the fluctuation pattern feature vector F_segment of the current fluctuation segmentation sequence and each fluctuation pattern prototype to obtain the pattern distance vector D_pattern. Based on the pattern distance vector D_pattern, use the softmax function to calculate the matching probability of each pattern to obtain the mixed pattern weight W_mix: W_mix(i) = exp(-D_pattern(i) / τ) / Σ(exp(-D_pattern(j) / τ)), where τ is the temperature parameter that controls the smoothness of the probability distribution. Select the pattern with the largest mixed pattern weight W_mix as the dominant fluctuation pattern type, and also retain the mixed pattern weight W_mix for subsequent prediction model configuration.

[0047] According to one aspect of the present application, the step of calculating the Mahalanobis distance between the local feature vectors of adjacent time points includes:

[0048] Use the fluctuation pattern feature vector in the historical data to calculate the covariance matrix of the four feature dimensions;

[0049] When the covariance matrix is close to a singular matrix, regularization processing is applied to calculate the diagonal regularization matrix and correct the covariance matrix;

[0050] Using the corrected covariance matrix, calculate the Mahalanobis distance between local eigenvectors at adjacent time points.

[0051] According to one aspect of the present application, the steps of predicting the frequency fluctuation rate to obtain the predicted load data include:

[0052] S31. Input the normalized real-time load data, fluctuation pattern type, and hybrid mode weight into the adaptive prediction model, and activate the corresponding basic prediction model according to the fluctuation pattern type;

[0053] S32. Use the autoregressive prediction model, hyperbolic rate mapping model, non-linear trend prediction model, and robust exponentially weighted moving average model to perform predictions respectively, and obtain the prediction values of the autoregressive prediction model, hyperbolic rate mapping model, non-linear trend prediction model, and robust exponentially weighted moving average model;

[0054] S33. Obtain the prediction values of the autoregressive prediction model, hyperbolic rate mapping model, non-linear trend prediction model, and robust exponentially weighted moving average model, calculate the weighted contributions of all models according to their corresponding hybrid mode weights and add them up to form a preliminary comprehensive prediction result;

[0055] S34. Based on the minimum and maximum values of the historical data, set a reasonable range for the prediction value. When the preliminary comprehensive prediction result exceeds the reasonable range, adjust it to the range boundary to obtain the adjusted prediction result; that is, the predicted load data.

[0056] According to one aspect of the present application, the adaptive prediction model includes:

[0057] The periodic fluctuation pattern is configured with an autoregressive prediction model, and its order is determined based on the periodicity index;

[0058] The burst-type fluctuation pattern is configured with a direction-aware hyperbolic rate mapping model, including calculating the directional change rate, direction turning index, and hyperbolic function mapping;

[0059] The trend-type fluctuation pattern is configured with a non-linear trend prediction model, and an appropriate non-linear function is selected according to the trend index;

[0060] The random-type fluctuation pattern is configured with a robust exponentially weighted moving average model, and a smoothing parameter is set to reduce the sensitivity to random fluctuations.

[0061] Specifically, the normalized real-time load data, the fluctuation pattern type, and the hybrid mode weight W_mix are input into the adaptive prediction model. According to the fluctuation pattern type, the corresponding basic prediction model is activated. The autoregressive prediction model AR is used for prediction: based on the last AR_order values of the normalized real-time load data, applying the AR parameters AR_params, the autoregressive prediction value is calculated: S_AR(t + 1)=Σ(AR_params(i)×Y(t - i + 1)), where i ranges from 1 to AR_order, and the AR model prediction value S_AR(t + 1) is output; the hyperbolic rate mapping model DA-HSRM is used for prediction: obtaining the most recent actual value Y(t), prediction value S(t), and short-term directional change rate D_short(t) in the normalized real-time load data, according to the sign of D_short(t), applying the corresponding prediction formula: if D_short(t)>0 (upward trend): S_HSRM(t + 1)=S(t)+α(t)×(Y(t)-S(t))+β_up×D_short(t); otherwise (downward trend): S_HSRM(t + 1)=S(t)+α(t)×(Y(t)-S(t))+β_down×D_short(t), where β_up and β_down are different directional enhancement coefficients for the upward trend and downward trend respectively, and usually the absolute value of β_down should be greater than or equal to β_up to provide a more sensitive response in the downward trend, and the DA-HSRM model prediction value S_HSRM(t + 1) is output. The non-linear trend prediction model NLT is used for prediction: according to the selected non-linear function and parameters NLT_params, applying them to the most recent data points of the normalized real-time load data, the trend prediction value is calculated: S_NLT(t + 1)=f_NLT(t + 1, NLT_params), where f_NLT is the selected non-linear function (exponential, logarithmic or polynomial), and the NLT model prediction value S_NLT(t + 1) is output. The robust exponentially weighted moving average model EWMA is used for prediction: obtaining the most recent actual value Y(t) and prediction value S(t) in the normalized real-time load data, applying the EWMA formula: S_EWMA(t + 1)=α_EWMA×Y(t)+(1 - α_EWMA)×S(t), and the EWMA model prediction value S_EWMA(t + 1) is output.

[0062] Create the vector of predicted values of each model S_models(t+1): S_models(t+1) = [S_AR(t+1), S_HSRM(t+1), S_NLT(t+1), S_EWMA(t+1)]; Calculate the weighted average predicted value using the hybrid mode weight W_mix: S(t+1) = W_mix(1) × S_AR(t+1) + W_mix(2) × S_HSRM(t+1) + W_mix(3) × S_NLT(t+1)+ W_mix(4) × S_EWMA(t+1). Conduct a rationality check on the predicted value: Set a reasonable range [Y_min, Y_max], usually based on the minimum and maximum values of historical data. If S(t+1) < Y_min, then adjust S(t+1) = Y_min; if S(t+1) > Y_max, then adjust S(t+1) = Y_max. Take the calculated comprehensive predicted value S(t+1) as the predicted load data at time t+1. Perform denormalization on the predicted load data S(t+1) to restore it to the original data scale, obtaining the predicted load data Y_pred(t+1) at the original scale.

[0063] According to one aspect of the present application, for the direction-aware hyperbolic rate mapping model, the construction process includes:

[0064] Extract training data from the preprocessed historical resource load data, and calculate the directional change rate at each time point, including the short-term directional change rate Ds and the long-term directional change rate Dl, where the short-term window size is smaller than the long-term window size; Based on the directional change rate, calculate the direction turning index T(t) = sign(Ds(t) × Dl(t)) × |Ds(t) - Dl(t)|;

[0065] Determine the smoothing parameter α(t) = a + b × tanh(γ × T(t)) through the hyperbolic function, where a and b are fixed values, and γ is the sensitivity;

[0066] Configure the direction-aware prediction formula. If Ds(t) > 0: S(t+1) = S(t) + α(t)×(Y(t) - S(t)) + β_up× Ds(t), otherwise: S(t+1) = S(t) + α(t) × (Y(t) - S(t)) + β_down × Ds(t); where β_up and β_down are the direction enhancement coefficients for the upward and downward trends respectively, strengthening the prediction's perception of the trend direction; S(t) and S(t+1) are the predicted values of the hyperbolic rate mapping model at times t and t+1, and Y(t) is the actual value.

[0067] According to one aspect of the present application, the steps of calculating the direction turning index include:

[0068] For each time point, calculate the product sign of the short-term and long-term directional change rates;

[0069] When the signs of the short-term and long-term directional change rates are the same, the sign is positive, indicating a consistent trend; when the signs of the short-term and long-term directional change rates are opposite, the sign is negative, indicating that a turning point may occur;

[0070] Calculate the absolute difference between the short-term and long-term directional change rates, indicating the intensity of the turn;

[0071] Multiply the product sign by the absolute difference to obtain the direction turning index, which is used for calculating the smoothing parameter in the hyperbolic function mapping.

[0072] According to one aspect of the present application, the steps of calculating a resource allocation strategy and applying it to an edge computing environment to dynamically adjust the computing resource configuration include:

[0073] S41. Analyze the fluctuation pattern type and predict the load data, determine the resource allocation strategy, calculate the specific allocation amounts of resources in each dimension, and generate a structured resource allocation instruction;

[0074] S42. Invoke the resource management interface of the edge computing environment, send the resource allocation instruction, and perform resource reconfiguration;

[0075] S43. Obtain the execution result of the resource reconfiguration, record it as the configuration execution result; monitor the actual performance of the system after the resource reconfiguration, collect the system performance metrics; integrate and store the real-time resource load data, predicted load data, configuration execution result, and system performance metrics in the current time window, and update the historical resource load database.

[0076] Specifically, analyze the fluctuation pattern type and predict the load data Y_pred(t+1) to determine the resource allocation strategy: Periodic pattern: Adopt a smooth resource allocation strategy and pre-allocate resources at 80% of the predicted peak; Burst pattern: Adopt an aggressive resource allocation strategy and pre-allocate resources at 120% of the predicted peak; Trend pattern: Adopt a forward-looking resource allocation strategy and scale resources up or down in advance according to the predicted trend; Random pattern: Adopt a conservative resource allocation strategy to maintain a relatively stable resource configuration. Calculate the specific allocation amounts of resources in each dimension: CPU allocation amount = f_cpu(predicted load data Y_pred(t+1), fluctuation pattern type); Memory allocation amount = f_mem(predicted load data Y_pred(t+1), fluctuation pattern type); Bandwidth allocation amount = f_bw(predicted load data Y_pred(t+1), fluctuation pattern type); where f_cpu, f_mem, and f_bw are resource mapping functions that consider the characteristics and dependencies of different resource types. Generate a structured resource allocation instruction JSON, including: target edge node identifier, allocation amounts of resources in each dimension, execution time, and priority. Call the resource management interface of the edge computing environment, send the resource allocation instruction JSON, and execute resource reconfiguration. Obtain the execution result of resource reconfiguration, including the execution status and actual configuration values, and record it as the configuration execution result. Monitor the actual performance of the system after resource reconfiguration, collect system performance metrics, including: service response time, request success rate, and resource utilization rate. Integrate and store the real-time resource load data, predicted load data Y_pred(t+1), configuration execution result, and system performance metrics in the current time window, and update the historical resource load database. Periodically update the fluctuation pattern feature vector F and adaptive prediction model parameters based on the latest historical resource load data to complete a full resource allocation cycle.

[0077] According to one aspect of the present application, the steps for calculating the resource allocation strategy include:

[0078] Determine the basic strategy parameters for resource allocation according to the fluctuation pattern type, including the reservation coefficient, smoothing window size, and resource release rate;

[0079] Apply a smoothing window to process the predicted load data, and additionally apply forward-looking prediction to the trend-type fluctuation pattern therein to generate smoothed predicted load;

[0080] Calculate the CPU allocation amount based on the smoothed predicted load and the reservation coefficient; based on the CPU allocation amount, calculate the memory and bandwidth allocation amounts;

[0081] Combine the resource release rate, apply resource upper and lower limit constraints and smooth control of resource changes to optimize the CPU, memory, and bandwidth allocation amounts, and combine them with the corresponding fluctuation pattern type to form a resource allocation strategy;

[0082] For the hybrid fluctuation mode, the weighted average of the basic policy parameters is calculated according to the hybrid mode weight.

[0083] According to one aspect of the present application, the steps of applying resource change smoothing control include:

[0084] Obtain the current resource configuration status, including the current allocation values of CPU, memory, and bandwidth;

[0085] Set the maximum resource growth rate to limit the single - time growth amplitude of resource allocation;

[0086] For the case of resource increase, ensure that the new allocation amount does not exceed the result of multiplying the current allocation amount by the maximum growth rate;

[0087] For the case of resource decrease, ensure that the new allocation amount is not lower than the result of multiplying the current allocation amount by the resource release rate;

[0088] Apply specific resource optimization strategies for different fluctuation mode types. For example, for the periodic mode, prepare resources in advance for the peak; for the burst mode, set a short resource retention time; for the trend mode, allocate or release resources in advance according to the trend slope; for the random mode, maintain a relatively stable resource allocation.

[0089] According to one aspect of the present application, a method for dynamically allocating computing resources for frequency fluctuations can also be:

[0090] Obtain the historical resource load data and real - time resource load data of the edge computing environment, perform data pre - processing, and extract the fluctuation mode feature vector based on the processed data;

[0091] Use the fluctuation mode feature vector to perform dynamic segmentation processing, and perform fluctuation mode recognition and matching for each segment to determine the fluctuation mode type and the hybrid mode weight;

[0092] Based on the fluctuation mode type and the hybrid mode weight, construct an adaptive prediction model and predict the frequency fluctuation rate of the normalized load data to obtain the predicted load data;

[0093] According to the predicted load data and the fluctuation mode type, calculate the optimal resource allocation strategy and apply it to the edge computing environment, dynamically adjust the computing resource configuration, and update the historical resource load data at the same time.

[0094] In a specific embodiment of the present application, the method for dynamically allocating computing resources for frequency fluctuations is applied to an edge computing environment, which includes 10 edge server nodes, and each node provides computing, memory, and bandwidth resources. The system needs to dynamically allocate resources according to the load fluctuations to ensure service quality and optimize resource utilization. The specific steps are as follows:

[0095] Step 1: Historical Data Processing and Model Building.

[0096] 1.1. Collect historical resource load data. Through the monitoring interface of the edge server, collect the original load data of the past 30 days, with a sampling point every 5 minutes, including CPU usage rate, memory occupancy rate, network traffic, and request frequency, for a total of 8,640 sampling points.

[0097] 1.2. Data cleaning. Clean the historical resource load data, identify and remove outliers. Define the outlier detection rule: If a data point deviates from the mean of the previous and next 10 points by more than 3 standard deviations, it is marked as an outlier. In the example calculation: For the CPU usage rate value at t = 1000, which is 95%, calculate the mean of the time period from t = 990 to t = 1010 (excluding t = 1000) as 45%, and the standard deviation as 10%. Since |95% - 45%| = 50% > 3×10% = 30%, the value at t = 1000 is marked as an outlier; use the moving median to replace it: Take the median of the previous and next 5 points, which is 48%, to replace the outlier.

[0098] 1.3. Data standardization processing. Standardize the cleaned historical load data: For CPU usage rate (original range 0 - 100%): Y_norm = Y_orig / 100; For memory occupancy rate (original range 0 - 100%): Y_norm = Y_orig / 100; For network traffic (original range 0 - 1000 Mbps): Y_norm = Y_orig / 1000; For request frequency (original range 0 - 5000 times / minute): Y_norm = Y_orig / 5000. Where Y_norm is the standardized data and Y_orig is the original data.

[0099] 1.4. Calculate the periodicity index P. The periodicity index P = the position of the first significant peak of the autocorrelation function ACF; where: ACF(k) = Σ[(Y_t - Y_avg)·(Y_t + k - Y_avg)] / (n - k)·σ 2 ; ACF(k) is the autocorrelation coefficient at a lag of k time units; Y_t is the standardized load value at time t; Y_avg is the sequence mean; n is the sequence length; σ 2 is the sequence variance; k is the lag time unit. The specific calculation process: Calculate the ACF value of the CPU usage rate sequence: The sequence mean Y_avg = 0.45 (after standardization), and the sequence variance σ 2= 0.023, calculate ACF(1) to ACF(500). The results show that ACF(1) = 0.92, ACF(2) = 0.85, ..., ACF(288) = 0.78, .... Detect significant peaks: Set the significance threshold to 0.7. It is found that ACF(288) is 0.78, exceeding the significance threshold and being a local maximum. Therefore, the periodicity index P = 288 (corresponding to a one-day period because there is one sampling point every 5 minutes, and 288 = 24×60 / 5).

[0100] 1.5. Calculate the burstiness index B. The burstiness index B = MAX(D_short) / AVG(D_short); where: D_short(t) = |Y(t) - Y(t - 1)| / Δt; D_short(t) is the short-term change rate at time t; Y(t) is the normalized load value at time t; Δt is the sampling time interval; MAX(D_short) is the maximum value of D_short; AVG(D_short) is the average value of D_short. Specific calculation process: Set the short-time window size m = 12 (corresponding to 1 hour); calculate the short-term change rate at each time point: D_short(1001) = |Y(1001) - Y(1000)| / 5 = |0.52 - 0.48| / 5 = 0.008 / minute, and calculate all points in this way. Calculate the maximum value and average value of D_short: MAX(D_short) = 0.042 / minute (corresponding to the bursty load change); AVG(D_short) = 0.005 / minute. Calculate the burstiness index: B = 0.042 / 0.005 = 8.4.

[0101] 1.6. Calculate the trendiness index T. The trendiness index T = |Slope| / (σ / sqrt(n)); where Slope is the linear regression slope, and the calculation formula is Slope = Σ[(t - t_avg)·(Y_t - Y_avg)] / Σ[(t - t_avg) 2 ; σ is the sequence standard deviation; n is the sequence length; t is the time index; t_avg is the average value of the time index; Y_t is the normalized load value at time t; Y_avg is the sequence mean. Specific calculation process: Perform linear regression on the CPU usage rate sequence: The time index t ranges from 1 to 8640, t_avg = 4320.5; Y_avg = 0.45; calculate Slope = Σ[(t - 4320.5)·(Y_t - 0.45)] / Σ[(t - 4320.5) 2= 0.000015. Calculate the standard deviation and the trend index: σ = 0.152; T = |0.000015| / (0.152 / sqrt(8640)) = 0.000015 / (0.152 / 93) = 0.000015 / 0.00163 = 9.2.

[0102] 1.7. Calculate the randomness index R. The randomness index R = SampEn(m, r, Y); where SampEn is the sample entropy; m is the pattern length, with a value of 2; r is the similarity threshold, with a value of 0.2×σ; Y is the standardized load sequence; σ is the sequence standard deviation. Specific calculation process: Set parameters: pattern length m = 2; similarity threshold r = 0.2 × 0.152 = 0.0304. Calculate the sample entropy of the CPU usage rate sequence: Construct patterns of length m: {Y(1), Y(2)}, {Y(2), Y(3)},...; Calculate the pattern distances and count the number less than r, and finally calculate SampEn = 0.68; Normalize to the [0, 1] interval: Set the maximum entropy reference value to 2.5, R = 0.68 / 2.5 = 0.272.

[0103] 1.8. Form the fluctuation pattern feature vector. The fluctuation pattern feature vector F = [P, B, T, R] = [288, 8.4, 9.2, 0.272].

[0104] 1.9. Build prediction models for different fluctuation patterns.

[0105] 1.9.1. Configure the autoregressive prediction model AR (periodic pattern). The AR model formula is S_AR(t+1) = Σ[AR_params(i) × Y(t-i+1)], where i ranges from 1 to AR_order; where S_AR(t+1) is the predicted value at time t+1; AR_params are the AR model parameters; Y(t) is the actual value at time t; AR_order is the AR model order, determined according to the periodicity index P. Specific configuration process: According to the periodicity index P = 288, set the AR model order: AR_order = min(P, 24) = 24 (limit the maximum order for computational efficiency); Use historical data to estimate the AR model parameters: AR_params = [0.85, 0.05, -0.03, 0.02,..., 0.12] (a parameter vector of length 24); Verify the model: Use the last 24 points to predict the next point, and the predicted value S_AR(8641) = 0.85×0.47 + 0.05×0.46 +... + 0.12×0.44 = 0.465.

[0106] 1.9.2. Configure the direction-aware hyperbolic rate mapping model DA-HSRM (burst mode). The predicted value S_HSRM(t + 1) = S(t) + α(t) × (Y(t) - S(t)) + β × D_short(t); where S(t) is the predicted value at time t; Y(t) is the actual value at time t; α(t) is the smoothing parameter, calculated by the hyperbolic function; β is the direction enhancement coefficient; D_short(t) is the short-term directional change rate at time t. Specific configuration process: Calculate the directional change rate: Short-term window size = 12 (1 hour); Long-term window size = 72 (6 hours); Short-term directional change rate D_short(t) = (Y(t) - Y(t - 12)) / 12; Long-term directional change rate D_long(t) = (Y(t) - Y(t - 72)) / 72. Calculate the direction turning index: DirChange(t) = sign(D_short(t) × D_long(t)) × |D_short(t) - D_long(t)|; For example: D_short(8000) = 0.015, D_long(8000) = -0.002; DirChange(8000) = sign(0.015 × (-0.002)) × |0.015 - (-0.002)| = -1 × 0.017 = -0.017. Set the hyperbolic function parameters: Sensitivity parameter λ = 50; Direction enhancement coefficient β = 1.5. Apply the hyperbolic function to determine the smoothing parameter: α(t) = 0.5 + 0.4 × tanh(λ × DirChange(t)); For DirChange(8000) = -0.017: α(8000) = 0.5 + 0.4 × tanh(50 × (-0.017)) = 0.5 + 0.4 × (-0.648) = 0.241.According to the sign of the short-term directional change rate, different prediction strategies are applied: when D_short(t) > 0: S_HSRM(t+1) = S(t) + α(t) ×(Y(t) - S(t)) + β_up× D_short(t); when D_short(t) ≤ 0: S_HSRM(t+1) = S(t) + α(t) × (Y(t) - S(t)) + β_down × D_short(t); For D_short(8000) = 0.015 > 0: S_HSRM(8001) = 0.46 + 0.241 × (0.48 - 0.46) + 1.5 × 0.015 = 0.46 + 0.00482 +0.0225 = 0.487.

[0107] 1.9.3. Configure the non-linear trend prediction model NLT (trend type pattern). The non-linear trend function is S_NLT(t+1)= a + b × ln(t+1-t_0) + c × (t+1-t_0); where S_NLT(t+1) is the predicted value at time t+1; a, b, c are model parameters; t_0 is the starting time of the trend; ln is the natural logarithm function. The specific configuration process: According to the trend index T = 9.2, select the logarithmic-linear mixed model; Use historical data to estimate the model parameters: Set the starting time of the trend t_0 = 8000 (based on data analysis); Parameter estimation: a = 0.45, b = 0.02, c = 0.001; Verify the model: For t = 8640, calculate the predicted value: S_NLT(8641) = 0.45 + 0.02 × ln(8641-8000) + 0.001 × (8641-8000)=0.45 + 0.02 × ln(641) + 0.001 × 641= 0.45 + 0.02 × 6.463 + 0.641= 0.45 +0.129 + 0.641 = 1.22. Since the predicted value exceeds the range [0, 1], truncation processing is performed: S_NLT(8641) = 1.0.

[0108] 1.9.4、Configure the robust exponentially weighted moving average model EWMA (random mode). S_EWMA(t+1) = α_EWMA × Y(t) + (1-α_EWMA) × S(t); where S_EWMA(t+1) is the predicted value at time t+1; Y(t) is the actual value at time t; S(t) is the predicted value at time t; α_EWMA is the smoothing coefficient, and its value range is [0, 1]. Specific configuration process: According to the randomness index R = 0.272, set the smoothing coefficient: α_EWMA = 0.3 - 0.25 × R = 0.3 - 0.25 ×0.272 = 0.232. Verification model: Assume that at t = 8640, Y(8640) = 0.47, S(8640) = 0.45; S_EWMA(8641) = 0.232 × 0.47 + (1-0.232) × 0.45 = 0.10904 + 0.3456 = 0.45464.

[0109] 1.10. Integrate the adaptive prediction model. Integrate the fluctuation pattern feature vector F = [288, 8.4, 9.2, 0.272] and the four prediction model parameters into an adaptive prediction model for subsequent prediction of real-time data.

[0110] This embodiment uses a four-dimensional feature vector (periodicity, burstiness, trend, and randomness) to perform multi-dimensional characterization of load fluctuation patterns, achieves accurate characterization and classification of load characteristics, overcomes the limitation that traditional single indicators (such as variance or rate of change) cannot fully characterize load characteristics, and enables the system to distinguish different types of fluctuation patterns. In the edge computing environment, load fluctuations present diverse characteristics, such as periodic fluctuations caused by scheduled tasks, peak loads caused by emergencies, long-term growth trends, and random fluctuations. Through this precise characterization, the system can adopt differentiated resource allocation strategies for different fluctuation patterns, avoid a "one-size-fits-all" resource allocation method, and improve resource utilization. Actual measurements show that compared with traditional single indicators, this embodiment increases the accuracy of fluctuation pattern recognition from 82% to 95%, laying the foundation for subsequent precise resource allocation.

[0111] Step 2: Real-time data segmentation and pattern recognition.

[0112] 2.1. Obtain real-time resource load data. Obtain the original load data for the current time window in real time from the edge computing resource management system. The sampling points are from t = 8641 to t = 8660 (20 new data points): CPU utilization rate: [46%, 47%, 49%, 52%, 56%, 60%, 65%, 68%, 69%, 67%, 64%, 60%, 56%, 54%, 53%, 52%, 51%, 50%, 49%, 48%].

[0113] 2.2. Preprocess the real-time load data. Apply the same cleaning and standardization methods as before: The standardized CPU utilization rate is: [0.46, 0.47, 0.49, 0.52, 0.56, 0.60, 0.65, 0.68, 0.69, 0.67, 0.64, 0.60, 0.56, 0.54, 0.53, 0.52, 0.51, 0.50, 0.49, 0.48].

[0114] 2.3. Initialize the dynamic sliding window. Initialize the dynamic sliding window W with a window size K = 12 for calculating the local fluctuation pattern feature vector F_local.

[0115] 2.4. Calculate the local feature vector. For each time point t, calculate the local feature vector within the dynamic sliding window centered at t. For example, for t = 8650: Take the window data: [0.49, 0.52, 0.56, 0.60, 0.65, 0.68, 0.69, 0.67, 0.64, 0.60, 0.56, 0.54]; Calculate the local periodicity index P_local: No significant peak, set it to 0; Calculate the local burstiness index B_local: MAX(D_short_local) = 0.05; AVG(D_short_local) = 0.02; B_local = 0.05 / 0.02 = 2.5. Calculate the local trendiness index T_local: The local linear regression slope Slope_local = 0.01; The local standard deviation σ_local = 0.06; T_local = 0.01 / (0.06 / sqrt(12)) = 0.01 / 0.0173 = 0.578. Calculate the local randomness index R_local = 0.15; The local feature vector F_local(8650) = [0, 2.5, 0.578, 0.15].

[0116] 2.5. Calculate the Mahalanobis distance. Obtain the fluctuation pattern eigenvectors F_local(t) and F_local(t + 1) at adjacent time points t and t + 1. Calculate the covariance matrix Σ of each dimension of the eigenvector: Use the set of fluctuation pattern eigenvector F_local samples in historical data to calculate the covariance matrix of the four eigen-dimensions (periodicity, suddenness, trend, randomness): Σ = cov([P_1,..., P_n], [B_1,..., B_n], [T_1,..., T_n], [R_1,..., R_n]). Apply the covariance matrix Σ to calculate the Mahalanobis distance between eigenvectors: D_m(t, t + 1) = sqrt[(F_local(t + 1) - F_local(t)) T × Σ -1 × (F_local(t + 1) - F_local(t))]; where F_local(t) is the local eigenvector at time t; Σ is the eigenvector covariance matrix; Σ -1 is the inverse matrix of the covariance matrix, T is the transpose. When the covariance matrix Σ is close to a singular matrix (non-invertible), regularization is adopted: Calculate the diagonal regularization matrix Δ = diag(Δ_1, Δ_2, Δ_3, Δ_4), where Δ_i is a small positive number (such as 0.01); Modify the covariance matrix: Σ_reg = Σ + Δ; Use Σ_reg to replace Σ to calculate the Mahalanobis distance.

[0117] Specific calculation process: Use the fluctuation pattern eigenvector samples in historical data to calculate the covariance matrix: The covariance matrix Σ of the four eigen-dimensions is a 4×4 matrix. For example: Σ = [[2500, 15, 10, -5], [15, 25, 3, 1], [10, 3, 40, -2], [-5, 1, -2, 0.05]]. Calculate the inverse matrix Σ -1 ; Calculate the Mahalanobis distance between the local eigenvectors at adjacent time points t = 8650 and t = 8651: F_local(8650) = [0, 2.5, 0.578, 0.15]; F_local(8651) = [0, 2.2, 0.425, 0.16]; Difference vector: [0, 0.3, 0.153, -0.01]; D_m(8650, 8651) = sqrt[Difference vector T × Σ -1 × Difference vector] = 1.85.

[0118] 2.6. Initialize the adaptive threshold. Read the base threshold parameter λ_base from the system configuration. This parameter controls the benchmark value of segment sensitivity and is usually set between 1.5 and 3.0. Obtain the cumulative number of observations N_total and the historical number of segments N_seg from the historical records. Calculate the historical segment frequency ratio R_seg = N_seg / N_total, which reflects the density of historical segments in the system. Apply the logarithmic adjustment function to calculate the segment frequency adjustment factor Adj_factor: Adj_factor = k × log(1 + R_seg), where k is the adjustment coefficient, usually taking values from 0.5 to 2.0, which controls the influence intensity of the historical segment frequency on the current threshold. Calculate the adaptive threshold λ(t) at the current time point: λ(t) = λ_base × (1 + Adj_factor); when R_seg is large, λ(t) will increase accordingly, reducing over-segmentation; when R_seg is small, λ(t) approaches λ_base, maintaining the basic sensitivity. Here, log is the natural logarithm.

[0119] Specific calculation process: Set the base threshold λ_base = 2.0; set the adjustment coefficient k = 0.5; there are N_seg = 32 segment points and a total of N_total = 8640 observations in the historical data. Calculate the adaptive threshold: λ(8650) = 2.0 × (1 + 0.5 × log(1 + 32 / 8640)) = 2.0 × (1 + 0.5 × log(1.0037)) = 2.0 × (1 + 0.5 × 0.0037) = 2.0 × 1.00185 = 2.0037.

[0120] 2.7. Mark the fluctuation segmentation points. Compare the Mahalanobis distance \(D_m(t, t + 1)\) with the adaptive threshold \(\lambda(t)\): If \(D_m(t, t + 1)> \lambda(t)\), then mark the time point \(t + 1\) as a candidate segmentation point; otherwise, the time point \(t + 1\) is not a segmentation point, and continue to process the next time point. For the marked candidate segmentation points, apply the minimum segmentation interval constraint: Obtain the position of the previous segmentation point \(last\_seg\_point\); Calculate the distance between the current candidate point and the nearest segmentation point: \(seg\_dist=t + 1-last\_seg\_point\); If \(seg\_dist < min\_seg\_length\) (the minimum segmentation length, usually set to 3 - 5), then cancel the segmentation mark of the current candidate point; otherwise, confirm that the time point \(t + 1\) is a valid fluctuation segmentation point. When the time point \(t + 1\) is confirmed as a fluctuation segmentation point: Mark the data sequence before \(t + 1\) (from the previous segmentation point to \(t\)) as a complete fluctuation segmentation sequence, and update \(N\_seg=N\_seg + 1\); Update \(last\_seg\_point=t + 1\). Save the current fluctuation segmentation point and the corresponding fluctuation segmentation sequence information for subsequent fluctuation pattern recognition.

[0121] Specific calculation process: Compare the Mahalanobis distance with the adaptive threshold: \(D_m(8650, 8651)=1.85 < \lambda(8650)=2.0037\), not marked as a segmentation point; \(D_m(8654, 8655)=2.35 > \lambda(8654)=2.0037\), mark \(t = 8655\) as a fluctuation segmentation point. Divide the data sequence into two fluctuation segments: Segment 1: \(t = 8641\) to \(t = 8654\); Segment 2: \(t = 8655\) to \(t = 8660\).

[0122] 2.8. Calculate the feature vectors of the fluctuation segmentation sequences. For each fluctuation segmentation sequence, calculate the overall fluctuation pattern feature vector. For example, for Segment 1 (\(t = 8641\) to \(t = 8654\)): Data of Segment 1: \([0.46, 0.47, 0.49, 0.52, 0.56, 0.60, 0.65, 0.68, 0.69, 0.67, 0.64, 0.60, 0.56, 0.54]\); Calculate the fluctuation pattern feature vector \(F\_segment1\) of Segment 1: \(P\_segment1 = 0\) (no obvious periodicity); \(B\_segment1 = 4.8\) (higher suddenness); \(T\_segment1 = 5.2\) (medium trendiness); \(R\_segment1 = 0.18\) (low randomness); \(F\_segment1=[0, 4.8, 5.2, 0.18]\).

[0123] 2.9. Define the basic fluctuation pattern prototypes. Four basic fluctuation pattern prototypes are predefined: Periodic pattern prototype: [200, 1.5, 1.0, 0.1] (High P, Low B, Low T, Low R); Burst pattern prototype: [0, 5.0, 3.0, 0.3] (Low P, High B, Medium T, Medium R); Trend pattern prototype: [0, 1.5, 6.0, 0.1] (Low P, Low B, High T, Low R); Random pattern prototype: [0, 3.0, 1.0, 0.6] (Low P, Medium B, Low T, High R).

[0124] 2.10. Calculate the distance from the pattern prototypes. Euclidean distance D_pattern(i) = sqrt[Σ(F_segment(j)- Prototype_i(j)) 2 ; where F_segment is the feature vector of the fluctuation segment; Prototype_i is the i-th fluctuation pattern prototype; j is the feature dimension index.

[0125] Specific calculation process: For segment 1, calculate its Euclidean distance from each fluctuation pattern prototype: Distance from the periodic pattern prototype: D_pattern(1) = sqrt[(0 - 200) 2 + (4.8 - 1.5) 2 + (5.2 - 1.0) 2 + (0.18 - 0.1) 2 =sqrt[40000 + 10.89 + 17.64 + 0.0064] = sqrt(40028.54) = 200.07; Distance from the burst pattern prototype: D_pattern(2) = sqrt[(0 - 0) 2 + (4.8 - 5.0) 2 + (5.2 - 3.0) 2 + (0.18 - 0.3) 2 =sqrt[0 + 0.04 + 4.84 + 0.0144] = sqrt(4.89) = 2.21; Distance from the trend pattern prototype: D_pattern(3) = sqrt[(0 - 0) 2 + (4.8 - 1.5) 2 + (5.2 - 6.0) 2 + (0.18 - 0.1) 2 =sqrt[0 +10.89 + 0.64 + 0.0064] =sqrt(11.54) = 3.40; Distance from the random pattern prototype: D_pattern(4) = sqrt[(0 - 0)2 + (4.8 - 3.0) 2 + (5.2 - 1.0) 2 + (0.18 - 0.6) 2 =sqrt[0 + 3.24 + 17.64 + 0.1764] = sqrt(21.06) = 4.59; The pattern distance vector D_pattern = [200.07, 2.21, 3.40, 4.59].

[0126] 2.11. Calculate the hybrid mode weights. Obtain the Euclidean distances D_pattern between the current fluctuation segmented sequence and each fluctuation mode prototype, which contains four components: D_pattern = [D_periodic, D_burst, D_trend, D_random]. Set the temperature parameter τ, which controls the smoothness of the softmax function: a smaller τ value makes the probability distribution more "sharp", highlighting the mode with the smallest distance; a larger τ value makes the probability distribution smoother, allowing multi-mode mixing; according to the fluctuation characteristics of the edge computing environment, the initial τ value is usually set to 0.1 to 0.5. Calculate the exponential mapping values Exp_values of the negative distances: for each mode i, calculate Exp_value_i = exp(-D_pattern(i) / τ); generate the mapping value vector Exp_values = [Exp_value_1, Exp_value_2, Exp_value_3, Exp_value_4]. Calculate the sum Sum_exp of the exponential mapping values: Sum_exp = Exp_value_1 + Exp_value_2 + Exp_value_3 + Exp_value_4. Apply the softmax function to calculate the matching probabilities of each mode to obtain the initial hybrid mode weights W_mix_init: for each mode i, calculate W_mix_init(i) = Exp_value_i / Sum_exp; generate the weight vector W_mix_init = [W_periodic, W_burst, W_trend, W_random]. Apply the minimum weight threshold min_weight (usually set to 0.05) for correction: for each mode i, if W_mix_init(i) < min_weight, then set W_mix_init(i) = min_weight, and renormalize the corrected weights to ensure the sum is 1: W_mix(i) = W_mix_init(i) / Σ(W_mix_init(j)), j from 1 to 4. Check if there is a dominant mode, that is, a mode with a weight significantly higher than other modes: dominant determination condition: the maximum weight max(W_mix) > dominant_threshold (usually set to 0.7); if there is a dominant mode, sharpen the weights: W_mix(i) = W_mix(i) 2 / Σ(W_mix(j) 2), where j ranges from 1 to 4. Save the calculated final hybrid mode weight W_mix for subsequent prediction model configuration and combination. Determine the dominant fluctuation mode type, that is, the mode type with the largest weight in W_mix, as the main output of pattern recognition. Here, W_mix(i) is the weight of the i-th mode; D_pattern(i) is the distance to the i-th mode.

[0127] Specific calculation process: Set the temperature parameter τ = 2.0; Calculate the hybrid mode weights for segment 1: exp(-D_pattern(1) / τ) = exp(-200.07 / 2.0) ≈ 0; exp(-D_pattern(2) / τ) = exp(-2.21 / 2.0) = 0.332; exp(-D_pattern(3) / τ) = exp(-3.40 / 2.0) = 0.182; exp(-D_pattern(4) / τ) = exp(-4.59 / 2.0) = 0.100; Normalization factor = 0 + 0.332 + 0.182 + 0.100 = 0.614; W_mix(1) = 0 / 0.614 = 0; W_mix(2) = 0.332 / 0.614 = 0.541; W_mix(3) = 0.182 / 0.614 = 0.296; W_mix(4) = 0.100 / 0.614 = 0.163; The hybrid mode weight vector W_mix = [0, 0.541, 0.296, 0.163].

[0128] 2.12. Determine the fluctuation mode type. Select the mode with the largest hybrid mode weight W_mix as the dominant fluctuation mode type: The largest weight is W_mix(2) = 0.541, corresponding to the burst type mode. The fluctuation mode type of segment 1 is the burst type mode.

[0129] The dynamic segmentation processing based on Mahalanobis distance and adaptive threshold in this embodiment solves the problem of segmenting load sequences under complex fluctuation patterns, effectively identifying the transition points of load characteristics. By calculating the Mahalanobis distance between local feature vectors in the multi-dimensional feature space, the correlation between features is considered, which can more accurately reflect the true distance in the feature space than the Euclidean distance. At the same time, the adaptive threshold λ(t) is dynamically adjusted according to the historical segmentation frequency to meet the segmentation requirements of different systems. In the edge computing scenario, the load pattern often changes dynamically over time, such as from periodic fluctuations to burst fluctuations and then evolving into long-term trend changes. Traditional fixed-window or fixed-threshold segmentation methods cannot adapt to such complex changes, resulting in incorrect identification of fluctuation patterns. This embodiment improves the stability of Mahalanobis distance calculation by regularizing the covariance matrix and corrects the threshold based on the historical segmentation frequency, making the segmentation decision more in line with the system characteristics. The test results show that compared with the fixed-threshold method, this embodiment improves the segmentation accuracy by 31%, providing a high-quality segmented sequence for subsequent fluctuation pattern recognition.

[0130] Step 3: Application and prediction of the prediction model.

[0131] 3.1 Input the adaptive prediction model. Input the normalized real-time load data, the type of fluctuation pattern (burst type), and the hybrid mode weight W_mix = [0, 0.541, 0.296, 0.163] into the adaptive prediction model.

[0132] 3.2 Activate the corresponding basic prediction model. According to the burst type of the pattern, mainly activate the direction-aware hyperbolic rate mapping model DA-HSRM, and at the same time, partially activate other models according to the hybrid mode weight.

[0133] 3.3. Execute the predictions of each model. Separate predictions are made using four basic models: the autoregressive prediction model AR, with the predicted value S_AR(8661) = 0.475; the direction-aware hyperbolic rate mapping model DA-HSRM, with the predicted value S_HSRM(8661) = 0.465. Specific calculation process: The predicted value S(8660) = 0.50 at t = 8660; the actual value Y(8660) = 0.48 at t = 8660. Calculate the short-term directional change rate: D_short(8660) = (Y(8660) - Y(8648)) / 12 = (0.48 - 0.68) / 12 = -0.0167; calculate the long-term directional change rate: D_long(8660) = (Y(8660) - Y(8588)) / 72 = (0.48 - 0.52) / 72 = -0.00056. Calculate the direction change index: DirChange(8660) = sign(-0.0167× (-0.00056)) × |-0.0167 - (-0.00056)| = 1 × 0.0161 = 0.0161. Apply the hyperbolic function to determine the smoothing parameter: α(8660) = 0.5 + 0.4 × tanh(50 × 0.0161) = 0.5 + 0.4 × 0.627 = 0.751. Since D_short(8660) < 0, apply the corresponding prediction formula: S_HSRM(8661) = 0.50 + 0.751× (0.48 - 0.50) + 1.5 × (-0.0167) = 0.50 - 0.01502 - 0.02505 = 0.465.

[0134] The predicted value of the non-linear trend prediction model NLT is S_NLT(8661) = 0.435. Specific calculation process: Use the parameters of the configured non-linear trend prediction model: a = 0.45, b = 0.02, c = 0.001; the starting time of the trend t_0 = 8640; S_NLT(8661) = 0.45 + 0.02 × ln(8661 - 8640) + 0.001 × (8661 - 8640) = 0.45 + 0.02 × ln(21) + 0.001 × 21 = 0.45 + 0.02 × 3.045 + 0.021 = 0.45 + 0.0609 + 0.021 = 0.532. Since the current trend shows a decline, special processing is performed on the predicted value: S_NLT(8661) = 0.435.

[0135] The predicted value of the robust exponentially weighted moving average model EWMA, S_EWMA(8661) = 0.484. Specific calculation process: Using the parameters of the configured robust exponentially weighted moving average model: α_EWMA = 0.232; S_EWMA(8661) = 0.232×0.48 + (1 - 0.232)×0.50 = 0.11136 + 0.384 = 0.49536. Taking three decimal places precision: S_EWMA(8661) = 0.495.

[0136] 3.4. Create the predicted value vectors of each model. S_models(t + 1) = [S_AR(t + 1), S_HSRM(t + 1), S_NLT(t + 1), S_EWMA(t + 1)], and the predicted value vector of each model is S_models(8661) = [0.475, 0.465, 0.435, 0.495].

[0137] 3.5. Apply the hybrid mode weights to calculate the weighted average predicted value. S(t + 1) = W_mix(1)×S_AR(t + 1)+W_mix(2)×S_HSRM(t + 1)+W_mix(3)×S_NLT(t + 1)+W_mix(4)×S_EWMA(t + 1), where: S(t + 1) is the comprehensive predicted value at time t + 1; W_mix(i) is the weight of the i-th mode. Specific calculation process: Using the calculated hybrid mode weights W_mix = [0, 0.541, 0.296, 0.163], calculate the weighted average predicted value: S(8661)=0×0.475 + 0.541×0.465 + 0.296×0.435 + 0.163×0.495 = 0 + 0.25157 + 0.12876 + 0.08069 = 0.46102, taking three decimal places precision: S(8661) = 0.461.

[0138] 3.6. Check the reasonableness of the predicted value. Set the reasonable range [Y_min, Y_max], usually based on the minimum and maximum values of historical data; if S(t + 1) < Y_min, then adjust S(t + 1) = Y_min; if S(t + 1) > Y_max, then adjust S(t + 1) = Y_max; where S(t + 1) is the predicted value at time t + 1; Y_min is the historical minimum value; Y_max is the historical maximum value.

[0139] Specific calculation process: Set a reasonable range [Y_min, Y_max] = [0.1, 0.9], based on the minimum and maximum values of historical data. Check the predicted value: S(8661) = 0.461 ∈ [0.1, 0.9], within the reasonable range, no adjustment is required.

[0140] 3.7. Determine the predicted load data. Use S(t + 1) as the predicted load data at time t + 1 and apply it to the next time window. Specifically: Take the calculated comprehensive predicted value S(8661) = 0.461 as the predicted load data at time t = 8661.

[0141] 3.8. Inverse normalization processing. Perform inverse normalization processing on the predicted load data to restore it to the original data scale, obtaining the predicted load data Y_pred(t + 1) at the original scale. Specifically: The predicted value of CPU usage rate Y_pred(8661) = S(8661) × 100 = 0.461 × 100 = 46.1%. Save the predicted load data Y_pred(t + 1) at the original scale together with the fluctuation pattern type for subsequent resource allocation calculations.

[0142] 3.9. Dynamically adjust the hybrid mode weight W_mix according to the historical prediction accuracy to optimize subsequent predictions. Calculate the prediction error of each basic model E_i(t) = |S_i(t) - Y(t)| / Y(t); Update the hybrid mode weight W_mix based on the historical prediction error: W_mix'(i) = W_mix(i) × exp(-η × E_i(t)); W_mix(i) = W_mix'(i) / Σ(W_mix'(j)), where η is the learning rate that controls the weight adjustment speed.

[0143] Specifically, after the new actual observation value Y(t+1) becomes available, calculate the prediction errors of each basic model: E_AR(t+1) = |S_AR(t+1) - Y(t+1)| / Y(t+1); E_HSRM(t+1) = |S_HSRM(t+1) - Y(t+1)| / Y(t+1); E_NLT(t+1) = |S_NLT(t+1) - Y(t+1)| / Y(t+1); E_EWMA(t+1) = |S_EWMA(t+1) - Y(t+1)| / Y(t+1). Form the prediction error vector E_models(t+1): E_models(t+1) = [E_AR(t+1), E_HSRM(t+1), E_NLT(t+1), E_EWMA(t+1)]. Set the learning rate parameter η to control the speed of weight adjustment: For the edge computing environment, usually η = 0.3, allowing for a faster adaptation to changes; it can be dynamically adjusted according to the degree of volatility: η_dynamic = 0.2 + 0.2 × burstiness index B. Based on the prediction error, calculate the preliminarily updated weight W_mix_temp: For each mode i, calculate W_mix_temp(i) = W_mix(i) × exp(-η × E_models(i)); generate the updated weight vector W_mix_temp. Normalize the preliminarily updated weights: Calculate the sum of weights: Sum_W = Σ(W_mix_temp(i)), i from 1 to 4; for each mode i, calculate the normalized weight: W_mix_new(i) = W_mix_temp(i) / Sum_W. Apply a smooth transition mechanism to avoid sudden weight changes: Set the smoothing factor smooth_factor = 0.7 to control the balance between the old and new weights; for each mode i, calculate the smoothly transitioned weight: W_mix_updated(i) = smooth_factor × W_mix_new(i) + (1 - smooth_factor) × W_mix(i). Check the validity of the updated weights: Ensure that all weights are non-negative: For any i, if W_mix_updated(i) < 0, then set W_mix_updated(i)= 0; ensure that the sum of weights is 1: Renormalize W_mix_updated. Update the model weights for prediction in the next time window: W_mix = W_mix_updated. Save the updated mixed-mode weights W_mix for subsequent prediction loops.

[0144] The calculation of the hybrid mode weight and the multi-model fusion prediction use the softmax function to transform the distance between the segmented fluctuations and the mode prototypes into the matching probabilities of each mode, achieving the adaptive fusion of multiple prediction models. It not only identifies the dominant fluctuation mode but also retains the influence of the secondary mode, avoiding the limitations of single-model prediction. In a complex edge computing environment, the actual load is often a mixture of multiple fluctuation modes, such as a hybrid mode with both periodicity and trend, or a composite load with both suddenness and certain randomness. Traditional methods often only use the single model with the best match for prediction and cannot handle this complexity. In this embodiment, the temperature parameter τ is used to adjust the smoothness of the probability distribution, reasonably incorporating the contribution of the secondary mode while maintaining the main influence of the dominant mode. During the fusion prediction process, the system also conducts a rationality check on the predicted values to ensure that the results are within the range of historical data, avoiding abnormal predictions. Experiments have shown that compared with the single best model, this embodiment reduces the mean squared error of the prediction by 26%, especially showing stronger stability and accuracy during mode transitions.

[0145] Step 4: Resource allocation and system update.

[0146] 4.1. Analyze the fluctuation mode to determine the resource allocation strategy. Select the resource allocation strategy parameters (PreRatio, SmoothWindow, ReleaseRate) based on the type of fluctuation mode; where: PreRatio is the reservation coefficient; SmoothWindow is the size of the smoothing window; ReleaseRate is the resource release rate. For the hybrid mode, calculate the weighted average strategy parameters according to the hybrid mode weight W_mix: PreRatio_mix = Σ(W_mix(i) × PreRatio_i); SmoothWindow_mix = round(Σ(W_mix(i) × SmoothWindow_i)); ReleaseRate_mix = Σ(W_mix(i) × ReleaseRate_i).

[0147] Specific calculation process: According to the burst mode type, set the basic policy parameters: reservation coefficient PreRatio = 1.2 (pre-allocate 120% resources for the burst mode); smoothing window size SmoothWindow = 4 (use a smaller window for the burst mode to respond quickly); resource release rate ReleaseRate = 0.9 (set a faster resource release rate for the burst mode). Calculate the weighted average policy parameters according to the hybrid mode weights: Periodic mode parameters: PreRatio_1 = 0.8, SmoothWindow_1 = 12, ReleaseRate_1 = 0.95; Burst mode parameters: PreRatio_2 = 1.2, SmoothWindow_2 = 4, ReleaseRate_2 = 0.9; Trend mode parameters: PreRatio_3 = 1.0, SmoothWindow_3 = 8, ReleaseRate_3 = 0.92; Random mode parameters: PreRatio_4 = 0.9, SmoothWindow_4 = 6, ReleaseRate_4 = 0.93. Weighted calculation: PreRatio_mix = 0 × 0.8 + 0.541 × 1.2 + 0.296 × 1.0 + 0.163 × 0.9 = 0 + 0.6492 + 0.296 + 0.1467 = 1.0919; SmoothWindow_mix = round(0 × 12 + 0.541 × 4 + 0.296 × 8 + 0.163 × 6) = round(0 + 2.164 + 2.368 + 0.978) = round(5.51) = 6; ReleaseRate_mix = 0 × 0.95 + 0.541 × 0.9 + 0.296 × 0.92 + 0.163 × 0.93 = 0 + 0.4869 + 0.2723 + 0.1516 = 0.9108.

[0148] 4.2. Calculate the amount of computing resource allocation.

[0149] 4.2.1. Apply a smoothing window to process the predicted load data. The smoothed predicted load Y_smooth(t) = avg(Y_pred(t - SmoothWindow + 1)); where Y_smooth(t) is the smoothed predicted load at time t; Y_pred is the predicted load data; and SmoothWindow is the size of the smoothing window. For trend patterns, apply forward-looking prediction: Based on the trend of historical data, predict the next n time points (n is usually 2 - 3), and adjust the smoothed predicted load Y_smooth to incorporate the trend prediction factor. Specific calculation process: Use a smoothing window with SmoothWindow = 6 to process the predicted load data: Y_smooth(8661) = avg(Y_pred(8656:8661)) = avg([45.8%, 46.3%, 46.9%, 47.2%, 46.8%, 46.1%]) = 46.52%.

[0150] 4.2.2. Design a CPU resource mapping function. The CPU allocation = f_cpu(Y_smooth, PreRatio) = min(Y_smooth × PreRatio × MaxCPU, MaxCPU); where Y_smooth is the smoothed predicted load; PreRatio is the reservation coefficient; and MaxCPU is the maximum allocable CPU resource. Specific calculation process: Set the maximum allocable CPU resource MaxCPU = 8 cores; calculate the CPU allocation: CPU allocation = min(46.52% × 1.0919 × 8, 8) = min(4.06, 8) = 4.06 cores, rounded to 0.5 core precision: CPU allocation = 4.0 cores.

[0151] 4.2.3. Design the memory resource mapping function. Memory allocation = f_mem(Y_smooth, PreRatio, CPU allocation) = min(BaseMemory + MemPerCPU × CPU allocation, MaxMemory); where Y_smooth is the smooth predicted load; PreRatio is the reservation coefficient; BaseMemory is the basic memory allocation; MemPerCPU is the memory amount corresponding to each CPU core; MaxMemory is the maximum allocable memory resource. Specific calculation process: Set parameters: Basic memory allocation BaseMemory = 2GB; Memory amount corresponding to each CPU core MemPerCPU = 1GB; Maximum allocable memory resource MaxMemory = 16GB. Calculate the memory allocation: Memory allocation = min(2 + 1 × 4.0, 16) = min(6.0, 16) = 6.0GB.

[0152] 4.2.4. Design the bandwidth resource mapping function. Bandwidth allocation = f_bw(Y_smooth, PreRatio, CPU allocation, memory allocation) = min(BaseBW × (1 + log(CPU allocation) + sqrt(memory allocation / BaseMemory)), MaxBW); where Y_smooth is the smooth predicted load; PreRatio is the reservation coefficient; BaseBW is the basic bandwidth allocation; MaxBW is the maximum allocable bandwidth resource; log is the natural logarithm; sqrt is the square root function. Specific calculation process: Set parameters: Basic bandwidth allocation BaseBW = 100Mbps; Maximum allocable bandwidth resource MaxBW = 1000Mbps. Calculate the bandwidth allocation: Bandwidth allocation = min(100 × (1 + log(4.0) + sqrt(6.0 / 2)), 1000) = min(100 × (1 + 1.386 + 1.732), 1000) = min(100 × 4.118, 1000) = min(411.8, 1000) = 411.8Mbps, rounding: Bandwidth allocation = 412Mbps.

[0153] 4.3. Generate resource allocation instructions. Save the final resource allocation amount together with the corresponding fluctuation pattern type, and generate a structured resource allocation instruction JSON: json{"targetNodeId": "edge-node-03", "resourceAllocation": {"cpu": 4.0, "memory": 6.0, "bandwidth": 412}, "executeTime": "2023-09-15T14:35:00Z", "priority": "high"}.

[0154] 4.4. Send resource allocation instructions. Call the resource management interface of the edge computing environment, send the resource allocation instruction JSON, and perform resource reconfiguration.

[0155] 4.5. Obtain the execution result. Obtain the execution result of resource reconfiguration: Execution status: Success; Actual configuration value: CPU = 4.0 cores, Memory = 6.0GB, Bandwidth = 412Mbps.

[0156] 4.6. Monitor system performance. Monitor the actual performance of the system after resource reconfiguration: Service response time: Reduced from an average of 250ms to 120ms; Request success rate: Increased from 98.5% to 99.7%; Resource utilization rate: The CPU utilization rate stabilized at a moderate level (75%) from the overloaded state (95%).

[0157] 4.7. Update historical data. Integrate and store the real-time resource load data, predicted load data, configuration execution results, and system performance metrics of the current time window, and update the historical resource load database.

[0158] 4.8. Periodically update the model. Based on the latest historical resource load data, periodically (e.g., every 24 hours) update the fluctuation pattern feature vector and adaptive prediction model parameters to complete a full resource allocation cycle.

[0159] Multi-dimensional resource mapping based on fluctuation patterns dynamically adjusts the key parameters of resource allocation (reservation coefficient, smoothing window size, and resource release rate) according to different fluctuation pattern types, and calculates the collaborative allocation amounts of CPU, memory, and bandwidth resources through a non-linear mapping function. It fully considers the resource demand characteristics of different fluctuation patterns, such as preparing resources in advance for the peak in the periodic pattern and setting a shorter resource retention time for the burst pattern. In the edge computing environment, there are complex interdependencies between different resource dimensions (computing, storage, network). Simply allocating according to a single dimension often leads to imbalances in other dimensions. In this embodiment, by designing specific CPU resource mapping functions, memory resource mapping functions, and bandwidth resource mapping functions, the relevance between resources is considered, such as memory allocation increasing with the increase in CPU allocation, and the bandwidth demand having a non-linear relationship with CPU and memory usage. At the same time, the resource change smoothing control mechanism avoids drastic fluctuations in resource allocation and ensures system stability. The actual deployment results show that compared with the traditional fixed ratio allocation, this embodiment improves the resource utilization rate by 24% and reduces the service quality default rate by 78%, achieving a dual optimization of resource efficiency and service quality.

[0160] In this embodiment, the fluctuation pattern is accurately characterized by a four-dimensional feature vector (periodicity, suddenness, trendiness, randomness). In practical applications, the fluctuation pattern feature vector [0, 4.8, 5.2, 0.18] successfully identifies the burst load pattern. The direction change index is introduced for calculation: DirChange(t) = sign(D_short(t) × D_long(t)) × |D_short(t) - D_long(t)|, and the hyperbolic function dynamically adjusts the smoothing parameter: α(t) = 0.5 + 0.4 × tanh(λ× DirChange(t)). In the example, DirChange(8660) = 0.0161, resulting in α(8660) = 0.751, making the model more inclined to adopt new data. The segmentation threshold is dynamically adjusted based on the historical segmented frequency: λ(t) = 2.0 × (1 + 0.5 ×log(1 + 32 / 8640)) = 2.0037, effectively identifying the load pattern change point, such as D_m(8654, 8655) = 2.35 > λ(8654) = 2.0037. The multi-model fusion is achieved through the hybrid mode weight W_mix = [0, 0.541, 0.296, 0.163]. The comprehensive prediction value S(8661) = 0.461 is more accurate than the prediction of a single model. A higher reservation coefficient PreRatio = 1.2 and a smaller smoothing window SmoothWindow = 4 are set for the burst pattern, resulting in the CPU resources increasing from 2.5 cores to 4.0 cores and successfully coping with the sudden increase in load.

[0161] The predicted value of the traditional single EWMA model is 50.0%, the predicted value of this embodiment is 46.1%, and the actual value is 45.8%, with the prediction error reduced by 78%; the CPU utilization rate of the traditional fixed allocation fluctuates between 45% and 95%, while the CPU utilization rate of the dynamic allocation in this embodiment is stable at about 75%, and the resource utilization rate is increased by 20%; the response time is reduced from 250 ms to 120 ms, a reduction of 52%; the request success rate is increased from 98.5% to 99.7%, an increase of 1.2%. In summary, this embodiment details the implementation process of the dynamic allocation method of computing resources for frequency fluctuations. Through fluctuation pattern recognition, direction-aware prediction, and multi-model fusion, efficient dynamic allocation of resources is achieved, effectively coping with load fluctuations in the edge computing environment.

[0162] In another embodiment of the present application, the process of calculating the burstiness index B is as follows: Extract the data subsequence of the most recent m time points from the normalized load data, denoted as the short-term window load data Y_short, where m typically ranges from 3 to 5 and is adjusted according to the characteristics of the edge computing environment. Calculate the point-to-point change rate for the data at adjacent time points in the short-term window load data Y_short: For each time point i (i = 1, 2, ..., m - 1), calculate the point-to-point change rate ΔY_i = (Y_short(i + 1) - Y_short(i)) / Y_short(i), and save all the point-to-point change rates ΔY_i as the change rate sequence ΔY. Take the absolute value of the change rate sequence ΔY to obtain the absolute change rate sequence |ΔY|: For each point-to-point change rate ΔY_i, calculate the absolute change rate |ΔY_i| = |ΔY_i|, and form the absolute change rate sequence |ΔY| with all the absolute change rates |ΔY_i|. Calculate the average value of the absolute change rate sequence |ΔY| as the average change rate AVG_ΔY: AVG_ΔY = (1 / (m - 1)) × Σ|ΔY_i|, where i ranges from 1 to m - 1. Determine the maximum value in the absolute change rate sequence |ΔY| as the maximum change rate MAX_ΔY: MAX_ΔY = max(|ΔY_1|, |ΔY_2|, ..., |ΔY_(m - 1)|). Calculate the ratio of the maximum change rate MAX_ΔY to the average change rate AVG_ΔY to obtain the burstiness index B: Burstiness index B = MAX_ΔY / AVG_ΔY; when AVG_ΔY is close to 0, to avoid division by zero error, set the minimum threshold ε = 0.001, and AVG_ΔY = max(AVG_ΔY, ε). Normalize the burstiness index B and map it to the [0, 1] interval: Set the maximum threshold B_max = 10, representing extremely high burstiness, and the normalized burstiness index B_norm = min(B / B_max, 1). Output the normalized burstiness index B_norm as the final burstiness index B for the construction of the subsequent fluctuation mode feature vector.

[0163] In another embodiment of the present application, the configuration and application of the DA-HSRM model are specifically as follows: Extract the data of the most recent n time points from the normalized load data to form the model training data Y_train. Calculate the directional change rate D(t) at each time point t: For each time point t, D(t) = (Y_train(t) - Y_train(t-1)) / Y_train(t-1), retaining the positive or negative sign of the change rate to form the directional change rate sequence D. Calculate the short-term directional change rate D_short(t): Set the short-term window size m = 3. For each time point t, calculate the average directional change rate of the previous m time points: D_short(t) =(1 / m) × Σ(D(t-i)), where i ranges from 0 to m-1, to generate the short-term directional change rate sequence D_short. Calculate the long-term directional change rate D_long(t): Set the long-term window size n = 10. For each time point t, calculate the average directional change rate of the previous n time points: D_long(t) = (1 / n) × Σ(D(t-i)), where i ranges from 0 to n-1, to generate the long-term directional change rate sequence D_long. Calculate the direction turning point index T(t): For each time point t, calculate T(t) = sign(D_short(t) × D_long(t)) × |D_short(t) - D_long(t)|. When the signs of D_short(t) and D_long(t) are the same, sign(D_short(t) × D_long(t)) = 1; when the signs of D_short(t) and D_long(t) are opposite, sign(D_short(t) × D_long(t)) = -1; when T(t) < 0, it indicates that the short-term and long-term trend directions are opposite, and a turning point may occur, generating the direction turning point index sequence T. Since the burst mode is selected, set the sensitivity parameter γ of the DA-HSRM model to a higher value: For the burst mode, usually γ_burst = 3.0, which is higher than the settings of other modes to improve the sensitivity to sudden changes; when system resources are limited, adaptive sensitivity can be selected: γ_adaptive = 1.0 + 2.0 × burstiness index B. Apply the hyperbolic function mapping to determine the smoothing parameter α(t): For each time point t, calculate α(t) = 0.5 + 0.4 × tanh(γ × T(t)), generating the smoothing parameter sequence α. When T(t) is a large positive value, α(t) is close to 0.9, quickly responding to new data; when T(t) is a large negative value, α(t) is close to 0.1, giving more consideration to historical data.Set the direction enhancement coefficient β to strengthen the perception of the prediction for the trend direction: For the bursty pattern, usually β_burst = 0.3, which is relatively high to enhance the direction sensitivity; for different load characteristics of edge computing, adaptive direction enhancement can be adopted: β_adaptive = 0.1 + 0.2 × burstiness index B. Configure the prediction formula with direction perception: If D_short(t) > 0 (short-term upward trend): S(t+1)= S(t) + α(t) × (Y(t) - S(t)) + β_up × D_short(t); otherwise (short-term downward trend): S(t+1)= S(t) + α(t) × (Y(t) - S(t)) + β_down × D_short(t), where S(t) is the predicted value at time t and Y(t) is the actual observed value at time t. Save the configured DA-HSRM model parameters, including the sensitivity parameter γ, the direction enhancement coefficient β, and the historical smoothing parameter sequence α, for subsequent prediction calculations.

[0164] The direction-aware hyperbolic rate mapping model (DA-HSRM) improves the prediction accuracy for bursty load changes by introducing a direction turning point indicator and a hyperbolic function to dynamically adjust the smoothing parameter. By calculating the product sign and difference of the short-term and long-term directional change rates, it accurately captures the turning points of load growth or decline, and uses the hyperbolic function to flexibly adjust the model's response speed to new data. In the edge computing environment, sudden changes often occur in network traffic and computing demands, such as sudden increases in traffic in areas where mobile users gather or sudden changes in computing loads when industrial equipment starts and stops. Traditional prediction models often lag in such scenarios, resulting in insufficient or excessive resource allocation. The DA-HSRM model responds quickly by increasing the smoothing parameter α(t) at the turning point, while maintaining a moderate smoothness during the stable period, thus improving the sensitivity to mutations while maintaining the prediction stability. In practical applications, this embodiment reduces the prediction error of the bursty load scenario from 24% of the traditional EWMA model to 8.2%, reducing the problem of service quality degradation caused by inaccurate prediction.

[0165] In another embodiment of the present application, the process of forming structured resource allocation instructions may also be as follows: Design the CPU resource mapping function f_cpu: Based on the smoothed predicted load Y_smooth and PreRatio, considering the characteristics of CPU resources (such as the minimum allocation unit, quantization step), calculate the formula: CPU_alloc = ceil(Y_smooth × PreRatio / cpu_unit) × cpu_unit, where cpu_unit is the minimum unit of CPU allocation (such as 0.1 core). Design the memory resource mapping function f_mem: Considering the correlation between CPU allocation and memory allocation, based on the empirical formula: MEM_alloc = base_mem + mem_per_cpu × CPU_alloc, where base_mem is the basic memory requirement and mem_per_cpu is the memory requirement corresponding to each unit of CPU. Design the bandwidth resource mapping function f_bw: Considering the non-linear relationship between bandwidth requirements and CPU and memory usage. Apply the piecewise mapping function: When CPU_alloc < cpu_threshold: BW_alloc = min_bw + bw_factor_low × CPU_alloc; otherwise: BW_alloc = min_bw + bw_factor_low × cpu_threshold + bw_factor_high × (CPU_alloc - cpu_threshold). Where cpu_threshold is the threshold of CPU resource allocation, CPU_alloc is the CPU allocated resource, ceil is the ceiling function, MEM_alloc is the memory allocated resource, BW_alloc is the bandwidth allocated resource, min_bw is the minimum value of bandwidth allocation, and bw_factor_high and bw_factor_low are the impact factors of CPU on bandwidth under high and low load conditions.

[0166] Application resource upper and lower limit constraints: Ensure that the allocated resources are not lower than the minimum requirements: CPU_alloc = max(CPU_alloc, min_cpu); MEM_alloc = max(MEM_alloc, min_mem); BW_alloc = max(BW_alloc, min_bw). Ensure that the allocated resources do not exceed the system capacity: CPU_alloc = min(CPU_alloc, max_cpu); MEM_alloc = min(MEM_alloc, max_mem); BW_alloc = min(BW_alloc, max_bw). Apply smooth control of application resource changes to avoid drastic fluctuations in resource allocation: For the case of resource increase: The final CPU allocation amount CPU_alloc = min(CPU_alloc, current_cpu × (1 + max_increase_rate)); The final memory allocation amount MEM_alloc = min(MEM_alloc, current_mem × (1 + max_increase_rate)); The final bandwidth allocation amount BW_alloc = min(BW_alloc, current_bw × (1 + max_increase_rate)). For the case of resource decrease: CPU_alloc = max(CPU_alloc, current_cpu × (1 - ReleaseRate)); MEM_alloc = max(MEM_alloc, current_mem × (1 - ReleaseRate)); BW_alloc = max(BW_alloc, current_bw × (1 - ReleaseRate)); where max_increase_rate is the maximum allowable resource growth rate, usually set to 0.3. Resource optimization strategies based on specific fluctuation pattern types: For periodic patterns: Check the historical cycle peak time points and prepare resources in advance for the predicted next peak; Gradually release excess resources during the trough period while maintaining the basic capacity. For burst patterns: Apply a fast response mechanism to immediately allocate the required resources; Set a short resource retention time and quickly release resources after the burst ends. For trend patterns: Allocate or release resources in advance according to the trend slope; Apply a higher reservation factor for the upward trend and a lower reservation factor for the downward trend. For random patterns: Maintain a relatively stable resource allocation and reduce frequent adjustments; Establish a resource buffer to absorb short-term random fluctuations. Summarize the final resource allocation amounts and save them together with the corresponding fluctuation pattern types to form structured resource allocation instructions.

[0167] The preferred embodiments of the present invention have been described in detail above. However, the present invention is not limited to the specific details in the above embodiments. Within the scope of the technical concept of the present invention, various equivalent transformations can be made to the technical solutions of the present invention, and these equivalent transformations all fall within the protection scope of the present invention.

Claims

1. A method for dynamically allocating computing resources for frequency fluctuations, characterized in that: include: Obtain historical resource load data, preprocess and extract fluctuation pattern feature vectors from it, and build an adaptive prediction model based on the historical resource load data; Obtain real-time resource load data, perform dynamic segmentation processing on it using the fluctuation pattern feature vector, perform fluctuation pattern recognition and matching on each segment, obtain the fluctuation pattern type and mixed pattern weight and input them into the adaptive prediction model, perform frequency fluctuation rate prediction, and obtain predicted load data; Based on the predicted load data and fluctuation pattern type, the resource allocation strategy is calculated and applied to the edge computing environment to dynamically adjust the computing resource configuration.

2. The method according to claim 1, characterized in that The steps of extracting the wave pattern feature vector include: Clean the historical resource load data, identify and remove outliers, obtain the cleaned historical load data and standardize it to form normalized historical load data; Based on the normalized historical load data, periodicity, burstiness, trend and randomness indicators are calculated and combined to form a four-dimensional fluctuation pattern feature vector.

3. The method according to claim 1, characterized in that The steps to perform dynamic segmentation processing include: Preprocess the real-time resource load data to obtain normalized real-time load data; Using the fluctuation mode eigenvector as a reference, for each time point of the normalized real-time load data, a local eigenvector within a dynamic sliding window centered at the time point is calculated; Based on the distribution characteristics of the fluctuation pattern feature vector, the Mahalanobis distance between the local feature vectors of adjacent time points is calculated, and the adaptive threshold is set based on the historical segmentation frequency; When the Mahalanobis distance exceeds the adaptive threshold, the corresponding time point is marked as a fluctuation segmentation point, and the data sequence is divided into different fluctuation segmentation sequences.

4. The method according to claim 3, characterized in that The steps of performing fluctuation pattern recognition and matching on each segment and obtaining fluctuation pattern type and mixed pattern weight include: For each fluctuation segment sequence, calculate its overall fluctuation pattern eigenvector; Calculate the Euclidean distance between the overall fluctuation pattern feature vector of the fluctuation segment sequence and each predefined fluctuation pattern prototype to obtain a pattern distance vector; Based on the pattern distance vector, the softmax function is used to calculate the matching probability of each pattern and obtain the mixed pattern weight; The mode with the largest mixed mode weight is selected as the dominant fluctuation mode type; The fluctuation pattern prototypes include cyclical, sudden, trend and random fluctuation patterns.

5. The method according to claim 4, characterized in that Adaptive prediction models, including: The cyclical fluctuation pattern is configured with an autoregressive forecasting model, the order of which is determined based on the cyclical indicator; The burst-type fluctuation mode is equipped with a direction-aware hyperbolic rate mapping model, including the calculation of directional change rate, directional turning index and hyperbolic function mapping; The trend-type fluctuation mode is equipped with a nonlinear trend prediction model, and the appropriate nonlinear function is selected according to the trend indicator; The random volatility mode is configured with a robust exponentially weighted moving average model, and the smoothing parameters are set to reduce the sensitivity to random fluctuations.

6. The method according to claim 5, characterized in that The construction process of the direction-aware hyperbolic rate mapping model includes: Extract training data from the preprocessed historical resource load data, calculate the directional change rate at each time point, including the short-term directional change rate Ds and the long-term directional change rate Dl, where the short-term window size is smaller than the long-term window size; and calculate the directional turning index T(t) accordingly; The smoothing parameter α(t) = a + b × tanh(γ × T(t)) is determined by the hyperbolic function, where a and b are constants and γ is the sensitivity; Configure the direction-aware prediction formula: if Ds(t) > 0: S(t+1) = S(t) +α(t)×(Y(t) - S(t))+β_up× Ds(t); otherwise: S(t+1) = S(t) + α(t) × (Y(t) - S(t)) + β_down × Ds(t); where β_up and β_down are the direction enhancement coefficients of the upward and downward trends, respectively, which enhance the prediction's perception of the trend direction; S(t) and S(t+1) are the predicted values ​​of the hyperbolic rate mapping model at time t and t+1, and Y(t) is the actual value.

7. The method according to claim 1, characterized in that The steps to calculate the resource allocation strategy include: According to the fluctuation pattern type, determine the basic policy parameters of resource allocation, including reservation coefficient, smoothing window size and resource release rate; Apply smoothing window to process the forecast load data, and apply forward-looking forecast to the trend-type fluctuation mode to generate smooth forecast load; Calculate CPU allocation based on smoothed predicted load and reservation factor; and calculate memory and bandwidth allocation accordingly; Combined with the resource release rate, the resource upper and lower limit constraints and resource change smoothing control are applied to optimize the CPU, memory and bandwidth allocation, and combined with the corresponding fluctuation pattern type to form a resource allocation strategy; For the mixed volatility model, the basic strategy parameters of the weighted average are calculated according to the mixed model weights.

8. The method according to claim 3, characterized in that The steps of calculating the Mahalanobis distance between local feature vectors at adjacent time points include: Using the volatility pattern eigenvectors in historical data, calculate the covariance matrix of different feature dimensions; When the covariance matrix is ​​close to a singular matrix, regularization is applied to calculate the diagonal regularization matrix and modify the covariance matrix; The modified covariance matrix is ​​applied to calculate the Mahalanobis distance between local eigenvectors at adjacent time points.

9. The method according to claim 6, characterized in that The steps to calculate the directional turning point indicator include: For each time point, the sign of the product of the short-term and long-term directional rate of change was calculated; When the signs of the short-term and long-term directional change rates are the same, the sign is positive, indicating a consistent trend; when the signs of the short-term and long-term directional change rates are opposite, the sign is negative, indicating a possible turning point; Calculate the absolute difference between the short-term and long-term directional change rates to indicate the strength of the turn; Multiplying the product sign by the absolute difference gives the directional turning point indicator.

10. The method according to claim 9, characterized in that The steps to obtain the predicted load data include: Obtain the forecast values ​​of the autoregressive forecast model, the hyperbolic rate mapping model, the nonlinear trend forecast model, and the robust exponentially weighted moving average model, calculate the weighted contributions of all models according to their corresponding mixed mode weights, and add them up to form a preliminary comprehensive forecast result; Based on the minimum and maximum values ​​of historical data, a reasonable range of predicted values ​​is set. When the preliminary comprehensive prediction result exceeds the reasonable range, it is adjusted to the range boundary to obtain the adjusted prediction result, which is the predicted load data.

Citation Information

Patent Citations

  • Performance prediction method applied to enterprise-level operation-maintenance automatic platform

    CN106250306A

  • Intelligent prediction model for predicting papermaking clear water flow based on autoregression model

    CN115470658A

  • Real-time hierarchical distribution method for power cloud resources of digital power grid

    CN119603304A

  • Traffic abnormality monitoring method and apparatus based on model, and device and storage medium

    WO2021072890A1

Cited By

  • Calculation power resource scheduling method based on artificial intelligence

    CN120973541A