Server resource allocation methods and devices

By constructing a cloud computing-enhanced environment, applying traffic and periodic fluctuations, and utilizing a hybrid load model and intelligent fault injection, the problem of low testing efficiency in cloud computing resource scheduling was solved, achieving efficient dynamic resource allocation and anomaly detection, and improving system resilience and fault self-healing capabilities.

CN120723484BActive Publication Date: 2025-11-14INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511232673.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-08-29
Publication Date
2025-11-14
Estimated Expiration
2045-08-29

AI Technical Summary

Technical Problem

Existing software testing methods for cloud computing resource scheduling are inefficient, costly in terms of time and manpower, and rely on human intervention, resulting in large errors and low accuracy.

Method used

By constructing a cloud computing-enhanced environment, applying traffic and periodic fluctuations that meet preset requirements, and utilizing a hybrid load model and intelligent fault injection, load prediction test data and scheduling strategy efficiency test data are obtained. Elastic scaling tests and regional fault scenario simulations are then conducted to achieve dynamic resource allocation.

Benefits of technology

It significantly shortens the time for anomaly detection and fault repair, improves resource utilization and anomaly detection coverage, and overcomes the limitations of a single tool in high-concurrency and complex scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120723484B_ABST
    Figure CN120723484B_ABST
Patent Text Reader

Abstract

This application discloses a server resource allocation method and apparatus, relating to the field of cloud computing resource scheduling technology. The method includes: establishing a cloud computing infrastructure environment and enhancing its deployment to create a cloud computing enhanced environment; secondly, performing algorithm verification and end-to-end verification enhancement operations on the cloud computing enhanced environment to dynamically allocate server resources within the cloud computing environment. This addresses the technical problems in related technologies, such as low software testing efficiency, high time and labor costs, and excessive reliance on manual intervention leading to large errors and low accuracy. It achieves significant reductions in anomaly detection time and average fault repair time through the use of AI prediction models, and employs a tiered pressure and behavioral simulation-based collaborative testing strategy to overcome the limitations of single tools in high-concurrency, complex scenarios, thereby improving resource utilization and anomaly detection coverage.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of cloud computing resource scheduling technology, and in particular to a method and apparatus for allocating server resources. Background Technology

[0002] Cloud computing resource scheduling is a dynamic resource management technology based on intelligent algorithms. This technology can automatically allocate physical and virtualized resources (such as processors, memory, and networks) by monitoring system load in real time, thereby optimizing resource utilization while ensuring service quality. For example, cloud computing resource scheduling technology can leverage container orchestration platforms to automatically increase computing resources during peak business periods to ensure service stability, and automatically reclaim idle resources during off-peak periods to reduce operating costs. This enables fine-grained microservice resource scheduling while optimizing communication efficiency between distributed nodes, ensuring high-performance operation of the overall system.

[0003] To ensure the stability of dynamic resource scheduling, relevant software testing methods can be implemented by test engineers strictly following preset operating procedures after the test cases have been designed and reviewed by experts. This allows for comparison of the actual system operation results with the expected goals, thereby verifying the reliability of the software testing.

[0004] However, the relevant software testing methods are inefficient, costly in terms of time and manpower, and rely too much on human intervention, resulting in large errors and low accuracy, which urgently need to be addressed. Summary of the Invention

[0005] This application provides a server resource allocation method and apparatus to at least solve the technical problems in related technologies, such as low software testing efficiency, high time and labor costs, and excessive reliance on manual intervention, resulting in large errors and low accuracy.

[0006] This application provides a server resource allocation method, comprising the following steps: applying traffic and periodic fluctuations that meet preset requirements to a pre-built cloud computing infrastructure environment to establish a corresponding cloud computing enhancement environment; obtaining test error values ​​and at least one key indicator value of the cloud computing enhancement environment, and determining whether the test error values ​​and at least one key indicator value meet the corresponding preset verification requirements, so as to obtain corresponding load prediction test data and scheduling strategy efficiency test data when the test error values ​​and at least one key indicator value meet the preset verification requirements; performing elastic scaling tests and regional fault scenario simulations on the cloud computing enhancement environment to generate corresponding elastic scaling test data and cross-regional disaster recovery test data, so as to dynamically allocate resources to the target server based on the load prediction test data, the scheduling strategy efficiency test data, the elastic scaling test data, and the cross-regional disaster recovery test data.

[0007] This application also provides a server resource allocation device, comprising: an environment setup module, used to apply traffic and periodic fluctuations that meet preset requirements to a pre-built cloud computing infrastructure environment to establish a corresponding cloud computing enhancement environment; a testing module, used to acquire test error values ​​and at least one key indicator value of the cloud computing enhancement environment, and to determine whether the test error values ​​and the at least one key indicator value meet the corresponding preset verification requirements, so as to acquire corresponding load prediction test data and scheduling strategy efficiency test data when the test error values ​​and the at least one key indicator value meet the preset verification requirements; and a resource allocation module, used to perform elastic scaling tests and regional fault scenario simulations on the cloud computing enhancement environment to generate corresponding elastic scaling test data and cross-regional disaster recovery test data, so as to dynamically allocate resources to the target server based on the load prediction test data, the scheduling strategy efficiency test data, the elastic scaling test data, and the cross-regional disaster recovery test data.

[0008] This application also provides an electronic device, including: a memory for storing a computer program; and a processor for executing the computer program to implement the resource allocation method of any of the above-described servers.

[0009] This application also provides a non-volatile computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the steps of any of the above-described server resource allocation methods.

[0010] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of any of the above-described server resource allocation methods.

[0011] This application allows for the application of applying traffic and periodic fluctuations that meet preset requirements to a pre-built cloud computing infrastructure environment to establish a corresponding cloud computing enhancement environment. It also allows for the acquisition of test error values ​​and at least one key indicator value for the enhanced environment, and the determination of whether these values ​​meet corresponding preset verification requirements. When the test error values ​​and at least one key indicator value meet the preset verification requirements, corresponding load prediction test data and scheduling strategy efficiency test data are obtained. Furthermore, it enables the application to perform elastic scaling tests and regional fault scenario simulations on the enhanced environment to generate corresponding elastic scaling test data and cross-regional disaster recovery test data, based on... Load prediction test data, scheduling strategy efficiency test data, elastic scaling test data, and cross-regional disaster recovery test data are used to dynamically allocate resources to the target server. Therefore, it can solve the technical problems of low software testing efficiency, high time and manpower costs, and excessive reliance on manual intervention, resulting in large errors and low accuracy. It achieves significant reduction in anomaly detection time and average fault repair time by using artificial intelligence prediction models, and solves the limitations of single tools in high-concurrency and complex scenarios by adopting a division of labor and collaborative testing strategy of tiered pressure and behavioral simulation, thereby improving resource utilization and anomaly detection coverage. Attached Figure Description

[0012] To more clearly illustrate the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0013] Figure 1 This is a flowchart illustrating a server resource allocation method according to an embodiment of this application;

[0014] Figure 2 A schematic diagram illustrating the process of building a hybrid load model using Locust and JMeter, as provided in one embodiment of this application;

[0015] Figure 3 A schematic diagram of a load prediction test process based on a converter model is provided for one embodiment of this application;

[0016] Figure 4 A schematic diagram illustrating the execution logic of a server resource allocation method provided in one embodiment of this application;

[0017] Figure 5 This is an example diagram of a server resource allocation device according to an embodiment of this application.

[0018] Among them, 10 is the server resource allocation device, 100 is the environment setup module, 200 is the testing module, and 300 is the resource allocation module. Detailed Implementation

[0019] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the protection scope of this application.

[0020] It should be noted that, in the description of this application, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. The terms "first," "second," etc., in this application are used to distinguish similar objects and are not used to describe a specific order or sequence.

[0021] To enable those skilled in the art to better understand the present application, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0022] The specific application environment architecture or specific hardware architecture on which the execution of the server resource allocation method depends is described here.

[0023] The embodiments of this application provide a method for allocating server resources.

[0024] like Figure 1 The diagram shown is a flowchart of a server resource allocation method according to an embodiment of this application. The server resource allocation method includes the following steps:

[0025] In step S101, traffic and periodic fluctuations that meet preset requirements are applied to the pre-built cloud computing infrastructure environment to establish a corresponding cloud computing enhancement environment.

[0026] Those skilled in the art should understand that cloud computing resource scheduling refers to the core technical mechanism of dynamically allocating physical / virtual resources through intelligent strategies to optimize resource utilization, ensure quality of service (QoS), and reduce operating costs. It can achieve dynamic resource allocation and automatically adjust resource ratios according to real-time load changes. For example, it can automatically expand computing nodes under sudden traffic surges, release idle resources during off-peak periods, and use containerization technologies (such as Kubernetes HPA (Horizontal Pod Autoscaler)) to achieve microservice-level elastic scaling and optimize cross-node communication efficiency.

[0027] Therefore, the embodiments of this application can first construct a basic cloud computing environment and then perform environment enhancement deployment operations on the basic environment to establish a corresponding cloud computing enhancement environment, providing reliable technical support for the execution of subsequent corresponding algorithm verification operations.

[0028] Optionally, in one embodiment of this application, before applying traffic and periodic fluctuations that meet preset requirements to the pre-built cloud computing infrastructure environment, the method further includes: deploying a preset monitoring system automated management component and integrating a target log analysis stack to build a dynamic resource monitoring layer through the monitoring system automated management component and the target log analysis stack; building a hybrid load model to obtain the traffic characteristics and periodic fluctuation characteristics of the target server, and establishing an automated testing toolchain based on the hybrid load model and a preset fault injection mechanism; and building the cloud computing infrastructure environment based on the automated testing toolchain and the dynamic resource monitoring layer.

[0029] It should be noted that the embodiments of this application can build a cloud computing infrastructure environment by constructing a dynamic resource monitoring layer and an automated testing toolchain, as described below:

[0030] 1. Dynamic Resource Monitoring Layer:

[0031] The embodiments of this application can deploy automated management components for monitoring systems, such as Prometheus-Operator, to collect multi-dimensional metrics such as processor, memory, and network, and integrate the EFK (Elasticsearch Filebeat Kibana) log analysis stack to capture abnormal events in real time;

[0032] 2. Automated testing toolchain:

[0033] (1) Stress test: The embodiments of this application can construct a hybrid load model of Locust and JMeter to obtain the traffic characteristics and periodic fluctuation characteristics of the server's burst traffic, etc.

[0034] (2) Fault Injection: The embodiments of this application can support the topology-aware fault mode library through the ChaosMesh Enhanced Edition. In addition, in the embodiments of this application, fault injection includes Pod-level fault injection, network fault injection, storage system fault injection, Kubernetes control plane fault injection, and mixed fault scenario injection, as detailed below:

[0035] 1. Pod-level fault injection:

[0036] (1) Pod termination:

[0037] 1) pod-kill: Randomly terminates Pods with specified tags, simulating a Kubernetes node crash scenario;

[0038] 2) pod-failure: Makes the Pod continuously unavailable to test the service's self-healing ability (duration can be configured to 10-60 minutes).

[0039] (2) Resource constraints:

[0040] 1) Processor stress: Limit the number of processor cores available to a Pod to simulate a resource contention scenario;

[0041] 2) Memory exhaustion: Test the memory reclamation mechanism by injecting an OOM (Out Of Memory) error.

[0042] 2. Network fault injection:

[0043] (1) Basic network interference:

[0044] 1) Delayed injection: 50ms-5s controllable delay to simulate cross-regional communication scenarios;

[0045] 2) Packet loss rate: Set a packet loss rate of 1%-30% to test fault tolerance in weak networks;

[0046] 3) Network partitioning: Isolates Pod communication within a specific namespace.

[0047] (2) Advanced network scenarios:

[0048] 1) DNS (Domain Name System) pollution: tampering with the resolution results of a specific domain name;

[0049] 2) Bandwidth limitation: Limit the Pod's outgoing bandwidth (e.g., 10Mbps).

[0050] 3. Storage system failure:

[0051] (1) I / O (Input / Output) exception:

[0052] 1) Delayed injection: File read / write latency increases by 100ms-2s;

[0053] 2) Error injection: Simulate bad blocks on the disk and return EIO (Input / Output Error).

[0054] (2) File system failure:

[0055] 1) rm -rf attack: randomly deletes files inside a container;

[0056] 2) Disk full: Quickly fill storage space using the dd command.

[0057] 4. Kubernetes control plane failure:

[0058] (1) API (Application Programming Interface) Server Interference:

[0059] 1) Simulate etcd connection timeout and test the controller's retry logic;

[0060] 2) Inject a 500 error response to verify the client's fault tolerance.

[0061] (2) Scheduler interference:

[0062] 1) Node is marked as unschedulable;

[0063] 2) Insufficient simulation resources lead to a Pending state.

[0064] 5. Mixed fault scenarios:

[0065] (1) Cascade Fault Test:

[0066] 1) Simultaneously inject network latency and Pod termination to verify the service degradation strategy;

[0067] 2) Combined test of processor stress and disk I / O latency.

[0068] (2) Timing control:

[0069] 1) Periodic failures (such as a 5-minute network interruption triggered once per hour);

[0070] 2) Conditional trigger (automatically inject memory leaks when processor stress > 80%).

[0071] In the specific implementation process, all fault injections in the embodiments of this application can be configured visually through Chaos Dashboard, and the impact indicators can be monitored in real time.

[0072] Therefore, the embodiments of this application achieve full-stack observability and high availability verification of the cloud computing environment through dynamic resource monitoring and intelligent fault injection, which significantly improves system resilience, fault self-healing ability and operation and maintenance efficiency.

[0073] Optionally, in one embodiment of this application, constructing a hybrid load model to obtain the traffic characteristics and periodic fluctuation characteristics of the target server includes: inserting a tiered thread group plugin based on the tiered stress configuration of a preset stress testing tool to generate corresponding stress test results through the tiered thread group plugin; performing scenario modeling operations through a preset load testing tool to generate corresponding load test statistics; writing the stress test results into the target time-series database through a preset backend listener, and connecting the load test statistics to a preset visualization monitoring dashboard, and performing aggregate calculations on multiple system performance indicators based on the stress test results and load test statistics to obtain corresponding aggregate indicators; determining the stress testing mechanism and load testing mechanism corresponding to the stress testing tool and the load testing tool, and constructing a hybrid load model based on the stress testing mechanism and the load testing mechanism; detecting whether the CPU utilization rate corresponding to the stress testing tool is greater than a preset utilization rate threshold based on the aggregate indicators and the hybrid load model, and determining whether the load testing tool has detected a target type error; automatically capturing the stack log of the target server when the CPU utilization rate corresponding to the stress testing tool is greater than the preset utilization rate threshold; and analyzing the corresponding payment interface parameters when the load testing tool detects a target type error.

[0074] Specifically, Figure 2 This diagram illustrates the process of building the hybrid Locust and JMeter workload model for this application. Figure 2 As shown, the process of building the Locust and JMeter hybrid load model in this application is as follows:

[0075] S201: Configure tiered stress using a stress testing tool and insert the tiered thread group plugin:

[0076] JMeter step pressure configuration, insert the stepping thread group (STG) plugin;

[0077] S202: Load testing tools for complex scenario modeling:

[0078] Locust complex scene modeling, the specific procedure is as follows:

[0079] from locust import HttpUser, task, between

[0080] import random

[0081] class HybridUser(HttpUser):

[0082] wait_time = between(1, 3)

[0083] @task(3)# 70% probability of executing browsing

[0084] def browse(self):

[0085] categories = ["electronics", "books"]

[0086] self.client.get(f" / product?cat={random.choice(categories)}")

[0087] @task(1)# 30% probability of executing payment

[0088] def checkout(self):

[0089] self.client.post(" / order", json={"items": [101, 205]})# Dynamically construct the order: ml-citation{ref="2,10" data="citationList"};

[0090] S203: Write the stress test results to the target time-series database through the preset backend listener, and connect the load test statistics to the preset visual monitoring dashboard:

[0091] Real-time data fusion writes JMeter results (i.e., stress test results) to InfluxDB5 via Backend Listener, and Locust statistics (i.e., load test statistics) to Grafana dashboard;

[0092] S204: Based on the stress test results and load test statistics, aggregate and calculate multiple system performance indicators (i.e. key indicators) such as throughput, error rate, and response time to obtain the corresponding aggregate indicators;

[0093] S205: Resource Bottleneck Detection

[0094] When JMeter triggers a processor stress greater than 80%, it automatically captures the stack log; when Locust detects an HTTP 500 error, it correlates and analyzes the payment interface parameters.

[0095] It is understood that the embodiments of this application can solve the limitations of a single tool in high-concurrency complex scenarios by dividing and coordinating the tasks of tiered pressure and behavioral simulation, and greatly improve the anomaly detection coverage through the hybrid load model, while also effectively reducing the consumption of test resources.

[0096] Optionally, in one embodiment of this application, applying traffic and periodic fluctuations that meet preset requirements to a pre-built cloud computing infrastructure environment to establish a corresponding cloud computing enhancement environment includes: deploying a service mesh in the cloud computing infrastructure environment through a preset container orchestration cluster to containerize the cloud computing infrastructure environment and obtain a corresponding containerized test environment; applying traffic and periodic fluctuations that meet preset requirements through a hybrid load model in the containerized test environment to enhance the containerized test environment and obtain a cloud computing enhancement environment.

[0097] It should be noted that the embodiments of this application can build a highly realistic containerized test environment based on a Kubernetes cluster, and achieve fine-grained traffic management and service orchestration by deploying an Istio service mesh.

[0098] Specifically, this application embodiment can first utilize Istio's traffic mirroring and dynamic routing functions to isolate test traffic from production environment traffic, while simulating abnormal scenarios such as service call latency, retries, and circuit breakers; secondly, this application embodiment can use Istio's monitoring and tracing capabilities to collect service call chains, resource utilization (processor / memory utilization, network throughput), and other indicators in real time, providing end-to-end observability support for load testing.

[0099] Subsequently, embodiments of this application can design a hybrid load model based on both sudden traffic surges and long-term fluctuations, as detailed below:

[0100] 1. Surge in traffic scenarios:

[0101] Construct a short-term impact model with 300% peak traffic (e.g., lasting 5 minutes). This traffic is injected in a step-by-step increasing manner to simulate the impact of sudden requests (e.g., flash sales, live streaming) on ​​the system in real business scenarios. The focus is on verifying the service's cold start warm-up mechanism (e.g., the efficiency of rapid expansion of container instances, cache warm-up completion time, and the initialization response speed of dependent services) to ensure that the system can respond quickly and without request timeouts when traffic surges.

[0102] 2. Long-cycle fluctuation scenario:

[0103] This application embodiment can design a 24-hour periodic load curve, using a sine wave to simulate the regular traffic fluctuations of daily business (such as the difference in traffic peaks between weekdays and nighttimes), while superimposing random pulse interference (such as short-term, small-amplitude traffic jitter) to simulate the uncertainty of user behavior. This application embodiment can use this model to verify the system's adaptive capability to periodic loads (such as the smoothness of dynamic resource scaling and the automatic adjustment efficiency of the database connection pool) and fault tolerance to random interference during long-term operation.

[0104] Therefore, the embodiments of this application achieve high consistency between the test environment and the production environment by combining a containerized environment with a service mesh. At the same time, through fine-grained traffic control and full-link monitoring, the authenticity of load testing and the efficiency of problem localization are improved. In addition, the hybrid load model in the embodiments of this application covers sudden impact and long-term fluctuation scenarios, which can comprehensively verify the cold start performance, elastic scaling capability and long-term stability of the system, expose potential risks under extreme traffic in advance, and provide a reliable basis for resource allocation optimization and fault tolerance mechanism design in the production environment.

[0105] In step S102, the test error value and at least one key indicator value of the cloud computing enhanced environment are obtained, and it is determined whether the test error value and at least one key indicator value meet the corresponding preset verification requirements. When the test error value and at least one key indicator value meet the preset verification requirements, the corresponding load prediction test data and scheduling strategy efficiency test data are obtained.

[0106] Furthermore, embodiments of this application also require the use of the Transformer model to conduct load prediction tests on the cloud computing enhanced environment to output the mean absolute percentage error of the prediction results; at the same time, a multi-objective optimization algorithm is used to verify the scheduling strategy and generate at least one key indicator value; subsequently, embodiments of this application can determine whether the test error value (such as the mean absolute percentage error) and the key indicator value meet their respective preset verification standards, and finally obtain the load prediction test data and the scheduling strategy efficiency test data.

[0107] Therefore, the embodiments of this application, by combining the converter model with the multi-objective optimization algorithm, achieve dual verification of the load prediction accuracy and scheduling strategy efficiency in the cloud computing environment, making the testing dimensions more comprehensive. In addition, the embodiments of this application quantify the evaluation results through preset verification standards, thereby providing a clear basis for subsequent optimization of the load prediction model and scheduling strategy, and improving the reliability and adaptability of cloud computing resource scheduling.

[0108] Optionally, in one embodiment of this application, obtaining the test error value and at least one key indicator value of the cloud computing enhanced environment, and determining whether the test error value and at least one key indicator value meet the corresponding preset verification requirements, so as to obtain the corresponding load prediction test data and scheduling strategy efficiency test data when the test error value and at least one key indicator value meet the preset verification requirements, includes: performing load prediction tests on the cloud computing enhanced environment based on a pre-built converter model to calculate the test error value, and verifying whether the test error value is less than a preset prediction error threshold to obtain load prediction test data; using a preset multi-objective optimization algorithm to verify the scheduling strategy of the cloud computing enhanced environment to calculate at least one key indicator value, and verifying whether at least one key indicator value is less than or equal to a preset indicator threshold to obtain scheduling strategy efficiency test data.

[0109] In actual implementation, the embodiments of this application perform load prediction testing on a cloud computing-enhanced environment using a converter model, mainly including two parts: model comparison and accuracy control, and a real-time data stream processing mechanism, as described below:

[0110] 1. Model comparison and accuracy control:

[0111] In this application embodiment, the Transformer model can be selected as the core prediction model and compared with traditional time series models such as LSTM (Long Short-Term Memory) and ARIMA (Auto Regressive Integrated Moving Average) to verify the advantages of Transformer in capturing long-term time-series dependencies and fitting nonlinear load patterns.

[0112] The embodiments of this application can set the prediction accuracy hard index as the test error value, such as the Mean Absolute Percentage Error (MAPE) ≤ 12%, covering typical periodic loads (such as daily business peaks), burst loads (such as traffic pulses) and long-term trend load scenarios in cloud computing environments, ensuring that the model can still maintain high-precision prediction under complex load modes.

[0113] 2. Real-time data stream processing mechanism:

[0114] This application embodiment can use the Flink stream processing framework to realize real-time data access and computation. By configuring sliding windows (such as 5-minute windows or 1-minute sliding steps) or session windows (dynamically dividing window boundaries based on load fluctuation characteristics), incremental processing and feature extraction are performed on real-time generated resource monitoring data (such as processor utilization, memory usage, and request volume) to ensure that the prediction model can dynamically update parameters based on the latest data and achieve near real-time load prediction (latency controlled at the second level).

[0115] In actual implementation, the process of verifying the scheduling strategy of the cloud computing enhanced environment using a multi-objective optimization algorithm in this embodiment mainly includes two parts: multi-objective optimization algorithm design and resource fragmentation control, as described below:

[0116] 1. Multi-objective optimization algorithm design:

[0117] The embodiments of this application can use improved multi-objective optimization algorithms (such as NSGA-III (Non-dominated Sorting Genetic Algorithm III) and MOEA / D (Multi-Objective Evolutionary Algorithm based on Decomposition) to verify the scheduling strategy. The optimization objectives cover resource utilization (processor / memory utilization), service response time, energy consumption cost and resource balance. The priority of different objectives is balanced by weight allocation (such as prioritizing response time during high load periods and prioritizing resource utilization during low load periods).

[0118] 2. Resource fragmentation control:

[0119] This application embodiment can use the resource fragmentation index (an indicator that measures the proportion of discrete idle resource blocks) as the core verification indicator, requiring that the index is not greater than 0.12; in addition, this application embodiment can dynamically adjust the granularity of resource allocation through algorithms (such as virtual machine / container specification matching, cross-node resource aggregation), reduce the number of "small and scattered" idle resource blocks, and avoid the problem of excessive single-point load caused by over-centralized allocation, so as to ensure that resource allocation achieves the optimal balance between compactness and balance.

[0120] Therefore, the embodiments of this application can ensure high accuracy of load prediction by comparing the converter model with the traditional model and combining it with MAPE precision control, providing a reliable basis for resource scheduling. Furthermore, the real-time performance of Flink window calculation can support dynamic adaptation to load fluctuations and avoid improper resource allocation due to prediction lag. In addition, the embodiments of this application can also balance resource efficiency and service quality through multi-objective optimization algorithms, combined with resource fragmentation index control, which can reduce resource waste, lower operating costs, ensure service stability, and improve the overall resource scheduling efficiency of the cloud computing environment.

[0121] Optionally, in one embodiment of this application, load prediction testing is performed on a cloud computing-enhanced environment based on a pre-built converter model to calculate a test error value and verify whether the test error value is less than a preset prediction error threshold, thereby obtaining load prediction test data. This includes: acquiring historical load data, meteorological data, holiday-marked data, and target time period load values ​​of the target server; constructing corresponding training and test datasets based on the historical load data, meteorological data, holiday-marked data, and target time period load values; normalizing the training and test datasets to obtain standard training and standard test datasets; and configuring multiple hyperparameters of the converter model. The converter model with multiple hyperparameters is trained using a standard training dataset; its performance is tested using a standard test dataset to obtain the test error value; the test error value is then checked against a preset prediction error threshold. If the test error value is less than the preset prediction error threshold, the trained converter model generates the corresponding prediction curve at the target time. The prediction curve is then distributed to the corresponding computing nodes on the target server to calculate the corresponding prediction deviation value, and the prediction deviation value is checked against a preset deviation threshold. If the prediction deviation value is greater than the preset deviation threshold, dynamic expansion of computing resources is performed.

[0122] Specifically, Figure 3 This is a schematic diagram of the load prediction test process based on the converter model in this application. Figure 3 As shown, the load prediction test process based on the converter model in this application is as follows:

[0123] S301: Construct the training and test datasets and perform normalization:

[0124] In the embodiments of this application, the input features of the converter model include: historical load data (time stamp, power value), meteorological data (temperature, humidity), and holiday markers; the output target is: load value for the next 24 hours (sampling interval of 15 minutes).

[0125] Therefore, the embodiments of this application can obtain historical load data, meteorological data, holiday marking data and target time period load values ​​(such as load values ​​for the next 24 hours) of the server to construct corresponding training datasets and test datasets, and perform Z-Score normalization on the training datasets and test datasets to obtain standard training datasets and standard test datasets.

[0126] S302: Configure the hyperparameters of the converter model and train the converter model using the normalized training dataset:

[0127] In the specific implementation process, the embodiments of this application mainly configure various hyperparameters of the converter model, such as the number of encoder layers, training period, batch size, and learning rate scheduling. As one possible approach, the number of encoder layers can be set to 3 (where the hidden layer dimension d_model=64 and the number of attention heads nhead=4); the training period can be set to a maximum of 200 epochs (early stopping threshold=10); the batch size is set to 256 (gradient accumulation steps are set to 4); the loss function is set to HuberLoss (δ=1.0) to balance the advantages of MSE (Mean Squared Error) and MAE (Mean Absolute Error); the learning rate scheduling is Cosine annealing (initial lr=5e-4, minimum lr=1e-5).

[0128] S303: Ensure that the test error value (such as mean absolute percentage error) of the test dataset is not greater than the preset prediction error threshold (such as 12%) to meet industrial-grade standards.

[0129] S304: The trained converter model generates the corresponding prediction curve at the target time and distributes the prediction curve to the corresponding computing nodes of the target server to calculate the corresponding prediction deviation value and determine whether the prediction deviation value is greater than the preset deviation threshold. If the prediction deviation value is greater than the preset deviation threshold, a dynamic expansion operation of computing resources is performed.

[0130] In actual execution, the converter model can generate a prediction curve at 0:00 every day, distribute it to each computing node through Flink broadcast status, calculate the prediction deviation between the real-time window data and the prediction value, and trigger dynamic scheduling to expand computing resources when the prediction deviation value is greater than 15%.

[0131] Therefore, the embodiments of this application can identify nonlinear correlations spanning more than 72 hours in historical load data through a self-attention mechanism, which greatly reduces prediction error compared to the LSTM model. Furthermore, the multi-scale converter model of the embodiments of this application effectively reduces the mean absolute percentage error by iteratively refining the predictions at different time granularities.

[0132] Furthermore, as one possible approach, embodiments of this application can also optimize and fine-tune the converter model based on real-time prediction results, as described below:

[0133] Step 1: Collect server load test data in real time, combine it with the prediction curve generated daily by the Transformer model, calculate the deviation rate between the real-time window data and the predicted value, and establish a deviation-feature association library to record the historical load, weather and holiday characteristics corresponding to the deviation rate exceeding 15%.

[0134] Step 2: Set up a dynamic fine-tuning trigger mechanism. When the deviation rate of three consecutive 15-minute sampling intervals exceeds 15%, or when there are four or more periods with a cumulative deviation of 15% in a single day, start model fine-tuning.

[0135] Step 3: Extract a subset of abnormal features based on the bias-feature association library, fine-tune the model using incremental training, freeze the parameters of the first two encoder layers, and adjust only the third encoder layer (keeping the hidden layer dimension at 64, and dynamically adapting the number of attention heads to the dimension of abnormal features).

[0136] Step 4: Optimize the fine-tuning strategy. The loss function adopts weighted Huber Loss (the weight of samples with a bias of more than 15% is increased to 1.5). The initial value of the learning rate is set to 1 / 5 of the original learning rate (1e-4). The training period is 1 / 4 of the original period (maximum 50 epochs, early stopping threshold 5).

[0137] Step 5: If the fine-tuned model passes the test set validation (MAPE≤10%), replace the original model and update the Flink broadcast state; otherwise, backtrack to the most recent effective model and mark anomalous features for data augmentation in the next training round.

[0138] Step 6: Perform full feature fine-tuning every 7 days, integrate intra-week deviation data to optimize attention weight distribution, and ensure that the model adapts to long-term load change trends.

[0139] It should be noted that in the above process, step 1 establishes the correlation between bias and features, providing a targeted basis for fine-tuning; the dynamic triggering mechanism in step 2 avoids frequent fine-tuning and ensures model stability; incremental training and parameter freezing in step 3 balance fine-tuning efficiency and model performance; the weighted loss function in step 4 focuses on high-bias samples and improves the accuracy of fine-tuning; steps 5-6 form a closed loop of short-term correction and long-term optimization, which is logically coherent and can adapt to dynamic changes in load, innovatively realizing adaptive optimization of the model.

[0140] Therefore, the embodiments of this application improve the real-time adaptability of the model through a dynamic fine-tuning mechanism, focus on optimizing the accuracy of high-biased samples, enhance the reliability of server load prediction, and effectively ensure the accuracy of load testing and verification and the rationality of resource scheduling.

[0141] Optionally, in one embodiment of this application, a preset multi-objective optimization algorithm is used to verify the scheduling strategy of the cloud computing enhancement environment to calculate at least one key indicator value, including: obtaining the number of defaulted tasks, the total number of tasks, the unused resource blocks, and the total resources corresponding to the target server in the cloud computing enhancement environment; calculating the service level agreement default rate based on the number of defaulted tasks and the total number of tasks, and calculating the resource fragmentation index using the unused resource blocks and the total resources; and determining at least one key indicator value based on the service level agreement default rate and the resource fragmentation index.

[0142] It should be noted that the embodiments of this application can first construct a multi-objective optimization framework based on the NSGA-II algorithm. In actual execution, the embodiments of this application can use NSGA-II as the core optimization algorithm, and search for the Pareto optimal solution set in the solution space that simultaneously optimizes the SLA default rate and the resource fragmentation index through fast non-dominated sorting, crowding calculation and elite retention strategies. The specific process is as follows:

[0143] 1. When initializing the population, this application embodiment can encode key parameters of the scheduling strategy (such as resource allocation threshold, task priority weight, migration triggering conditions, etc.) into chromosomes to ensure population diversity;

[0144] 2. During the iteration process, offspring solutions are generated through crossover and mutation operations. The parent and offspring solutions are then combined for non-dominated sorting to select individuals that perform better on both objective functions. This results in the Pareto front solution set, which contains multiple non-dominated solutions. Each solution corresponds to a set of scheduling strategy parameters, allowing for different degrees of trade-offs between SLA (Service-Level Agreement) default rate and resource fragmentation index (e.g., prioritizing solutions that guarantee SLA or prioritizing solutions that reduce resource fragmentation).

[0145] Secondly, the embodiments of this application can perform SLA default rate quantification and control operations, as detailed below:

[0146] 1. Objective function f1(x) = Number of defaulted tasks / Total number of tasks, where defaulted tasks refer to tasks that fail to meet the indicators agreed in the service level agreement (such as response time exceeding the threshold, availability being lower than the promised value, data transmission latency exceeding the limit, etc.).

[0147] 2. During testing, task flows with different priorities (high-priority tasks correspond to more stringent SLA metrics) are injected to simulate real business scenarios, requiring f1(x) < 1% after optimization to ensure the service quality stability of core businesses.

[0148] Subsequently, this application embodiment can perform precise measurement and optimization of the resource fragmentation index, as detailed below:

[0149] 1. The objective function f2(x) = unused resource blocks / total resources, where unused resource blocks refer to scattered resource units that cannot be effectively allocated (such as scattered memory pages in a physical machine that are not occupied by virtual machines, fragmented idle time of processor cores, disk blocks in storage media that are not allocated contiguously).

[0150] 2. The test covers multiple resource types (such as processor, memory, network bandwidth). By calculating the fragmentation index of different resource dimensions and weighting and merging them, the optimized f2(x) is required to be ≤0.15 to ensure the regularity of resource allocation and reduce the waste of small and scattered idle resources.

[0151] Therefore, the embodiments of this application generate Pareto front solution sets through the NSGA-II algorithm, achieving a dynamic balance between service quality and resource efficiency while strictly controlling the SLA default rate and resource fragmentation index, thus adapting to diverse business needs. Secondly, the embodiments of this application significantly improve anomaly response speed and fault recovery capability through the synergy of predictive models and dynamic scheduling, enhancing system stability and reliability. Furthermore, the embodiments of this application directly reduce resource waste by 40% and lower operating costs through refined resource fragmentation control (processor / memory fragmentation rate not greater than 0.12), while improving user satisfaction by prioritizing and layering core business SLAs.

[0152] In step S103, elastic scaling tests and regional fault scenario simulations are performed on the cloud computing enhanced environment to generate corresponding elastic scaling test data and cross-regional disaster recovery test data. Based on the load prediction test data, scheduling strategy efficiency test data, elastic scaling test data, and cross-regional disaster recovery test data, resources are dynamically allocated to the target server.

[0153] Subsequently, the embodiments of this application perform end-to-end enhancement verification on the cloud computing enhanced environment to generate elastic scaling test data and cross-regional disaster recovery test data; secondly, the embodiments of this application can integrate the previously acquired load prediction test data and scheduling strategy efficiency test data, and combine them with the elastic scaling test data and cross-regional disaster recovery test data to jointly serve as data basis for dynamic resource allocation of the server.

[0154] Therefore, the embodiments of this application cover elastic scaling and cross-regional disaster recovery scenarios through full-link verification, and combine load prediction and scheduling efficiency data to achieve comprehensiveness of resource allocation basis and improve the scientific nature of decision-making. In addition, the embodiments of this application can also support dynamic allocation through multi-dimensional test data linkage, thereby ensuring that server resources are more adaptable and stable in dealing with load fluctuations, fault disaster recovery and other scenarios, and optimizing the overall service quality.

[0155] Optionally, in one embodiment of this application, elastic scaling tests and regional failure scenario simulations are performed on the cloud computing enhanced environment to generate corresponding elastic scaling test data and cross-regional disaster recovery test data. This includes: performing elastic scaling tests on the cloud computing enhanced environment to obtain the corresponding service startup time and network traffic switching latency, and verifying whether the service startup time and network traffic switching latency are less than the corresponding scaling test thresholds to generate elastic scaling test data; simulating regional failure scenarios corresponding to the cloud computing enhanced environment to perform cross-regional disaster recovery tests on the cloud computing enhanced environment based on the regional failure scenarios to obtain the cluster self-healing time in the regional failure scenarios, and verifying whether the cluster self-healing time is less than a preset self-healing time threshold to obtain cross-regional disaster recovery test data.

[0156] It should be noted that the embodiments of this application mainly perform end-to-end verification enhancement operations through elastic scaling tests and cross-regional disaster recovery tests, the specific process of which is as follows:

[0157] (1) Elastic stretching test:

[0158] Preheating pool mechanism design: The embodiments of this application can construct a dynamic preheating pool, which automatically maintains a certain number of standby Java service instances (instance specifications match the mainstream business load characteristics) based on historical load peaks and real-time predicted traffic, and completes instance preheating by preloading core class libraries and initializing cache connections (such as database connection pools and Redis connections).

[0159] Startup time verification: For Java service instances in the preheating pool, simulate startup triggering under real business scenarios (such as traffic threshold triggering expansion), and monitor the entire process time from "instance wake-up" to "receiving requests" through instrumentation, requiring this time to be no more than 10 seconds; at the same time, test the difference in time consumption between cold start (non-preheating instance) and preheating start to verify the effectiveness of the preheating mechanism.

[0160] Mesh Traffic Switching Test: Implement dynamic traffic scheduling based on service mesh (such as Istio) to simulate traffic switching in a scaling scenario (from existing instances to newly added preheated instances). Measure request latency fluctuations during the traffic switching process using a full-link tracing tool (such as Jaeger). The switching latency (from the start of traffic migration to stable allocation) should not exceed 50ms, and there should be no request loss or timeout during the switching process.

[0161] (2) Cross-regional disaster recovery test:

[0162] AZ (Availability Zone) level fault simulation: Simulate sudden failures (such as data center power outages or network interruptions) across the entire availability zone through network isolation, power cut-off, etc., triggering cross-regional disaster recovery mechanisms, and focusing on testing the self-healing capabilities and data consistency of core components.

[0163] etcd cluster self-healing verification: Monitor the node status (number of surviving nodes, etc.) of the etcd cluster after an AZ failure, and verify whether the cluster can automatically complete data sharding and redistribution within 30 seconds and resume providing services (confirmed through health check interface and data read / write test).

[0164] Redis Cluster Split-Brain Protection Verification: When simulating an Availability Zone (AZ) network partition (inter-zone communication interruption), test the Redis cluster's split-brain protection mechanism (such as quorum mechanism, min-replicas-to-write configuration) to verify whether dual-master node write conflicts will occur in the partition state; after the partition is recovered, check whether the cluster can automatically merge data without loss to ensure data consistency.

[0165] Therefore, the elastic scaling test in this application embodiment can ensure that the service can quickly scale up and respond during traffic surges through a preheating pool and a fast traffic switching mechanism, controlling the Java service startup latency to within 10 seconds and the traffic switching latency to within 50ms, significantly improving user experience and system elasticity. Secondly, the cross-region disaster recovery test in this application embodiment verifies the self-healing capability of core components under extreme failures (etcd cluster self-healing within 30 seconds) and data consistency (Redis split-brain protection), greatly improving the system's resilience to regional failures and reducing business interruption time and data loss. In addition, the end-to-end verification covers key scenarios from resource elasticity to disaster recovery, providing quantitative evidence for the high availability design of cloud computing environments and ensuring business continuity and stability.

[0166] Optionally, in one embodiment of this application, an elastic scaling test is performed on the cloud computing enhanced environment to obtain the corresponding service startup time and network traffic switching latency, and to verify whether the service startup time and network traffic switching latency are less than the corresponding scaling test threshold, so as to generate elastic scaling test data. This includes: collecting multi-dimensional performance indicators of computing nodes in the target server, and generating expansion trigger conditions with time persistence and spatial correlation based on the multi-dimensional performance indicators and a preset historical load feature library, so as to obtain expansion decision instructions corresponding to the expansion trigger conditions; selecting matching instance specifications from the preheated container resource pool according to the expansion decision instructions, so as to execute corresponding deployment and initialization operations using the matching instance specifications, so as to generate a new instance ready status signal; monitoring the service startup process of the target server based on the new instance ready status signal, so as to obtain the corresponding service startup time, and verifying whether the service startup time meets the preset startup requirements, so as to obtain a service startup verification result; tracking the business traffic migration process of the target server through a traffic monitoring component, so as to obtain the corresponding network traffic switching latency, and verifying whether the network traffic switching latency meets the preset compliance requirements, so as to obtain a traffic switching verification result; and generating elastic scaling test data based on the service startup verification result and the traffic switching verification result.

[0167] Specifically, embodiments of this application can generate elastic scaling test data through operations such as multi-dimensional trigger condition design, preheating resource pools and rapid deployment, and service startup and traffic switching verification, as described below:

[0168] 1. Multidimensional trigger condition design:

[0169] The system collects multi-dimensional performance indicators such as processor utilization, memory usage, and network throughput of computing nodes in real time. Combined with a preset historical load feature library (containing load fluctuation patterns under different business scenarios), it generates expansion trigger conditions that have both time continuity (such as processor utilization greater than 70% for 2 minutes) and spatial correlation (multi-node load collaborative triggering). This ensures that the triggering time accurately matches the actual load demand and outputs the corresponding expansion decision instructions.

[0170] 2. Preheating resource pool and rapid deployment:

[0171] Based on the scaling decision command, select instance specifications that match the current business load from the preheated container resource pool (such as preset JVM (Java Virtual Machine) parameters and preloaded core dependent containers), perform lightweight deployment and initialization operations (skip basic environment configuration and only activate business processes), and monitor the entire process time from alarm triggering to new Pod readiness, requiring the scaling action to take no more than 8 seconds.

[0172] 3. Service startup and traffic switching verification:

[0173] Track the service startup process of the new instance from initialization to receiving requests in real time, record the startup time and verify whether it meets the preset requirements; track the migration process of business traffic from the original instance to the new instance through the traffic monitoring component of Nginx reverse proxy, measure the switching latency (required to be less than 100ms), ensure that no requests are lost during the switching process, and finally combine the service startup verification results and traffic switching verification results to generate elastic scaling test data.

[0174] Therefore, the embodiments of this application can achieve rapid response to sudden load changes through precise triggering, rapid capacity expansion, and low-latency switching, thereby effectively ensuring service continuity and improving resource elasticity and user experience.

[0175] Furthermore, as one possible approach, embodiments of this application can also perform multi-level fault disaster recovery testing and verification operations in a cloud computing environment through the following methods, the specific process of which is described below:

[0176] Step 1: Simulate fault scenarios in a tiered manner. Data center level faults are simulated by a 40% node downtime gradient (increasing by 15% / min), while AZ level faults simulate a combined scenario of network partitioning and power outage.

[0177] Step 2: Trigger the intelligent scheduling mechanism, based on the K8s topology-aware scheduling upgrade service dependency graph and node health dynamic weights, prioritize the migration of critical services to pre-marked disaster recovery core nodes, and record the migration completion time;

[0178] Step 3: Perform data consistency verification. After the Redis cluster recovers, simultaneously verify that the AOF (Append Only File) log has zero loss and that the incremental hash fingerprint of the data before and after the failure matches. During the self-healing process of the AZ-level failure, the etcd cluster coordinates with cross-region replicas to accelerate synchronization.

[0179] Step 4: Verify disaster recovery and self-healing indicators. The etcd cluster should have a self-healing time of less than 30 seconds, and the Redis cluster should implement split-brain protection through the AZ weight arbitration mechanism. There should be no data conflicts after the migration of critical services.

[0180] It should be noted that, in the embodiments of this application, step 1 above simulates a more realistic fault evolution process through gradient crash simulation, avoiding the extreme nature of instantaneous full-scale crash; step 2's intelligent scheduling combines service dependencies and node health to improve migration accuracy and efficiency; step 3's incremental hash verification supplements AOF log verification, strengthening data consistency and reliability; step 4's AZ weight arbitration enables Redis split-brain protection to adapt to cross-region scenarios, and etcd cross-region replica synchronization accelerates the self-healing process, forming a closed loop of "fault simulation - intelligent migration - data verification - self-healing verification".

[0181] Therefore, the embodiments of this application improve migration efficiency through gradient fault simulation and intelligent scheduling, and strengthen consistency through multi-dimensional data verification and cross-regional collaborative self-healing, ensuring business continuity, significantly enhancing the disaster recovery reliability of the cloud computing environment, further ensuring dynamic allocation of server resources, and ensuring a more stable resource allocation system.

[0182] The execution logic of the server resource allocation method of this application will be described below with reference to the accompanying drawings.

[0183] Figure 4 This is a schematic diagram illustrating the execution logic of the server resource allocation method described in this application. Figure 4 As shown, the execution process of the server resource allocation method of this application is as follows:

[0184] S401: Build a dynamic resource monitoring layer and an automated testing toolchain to establish a cloud computing infrastructure environment based on the dynamic resource monitoring layer and the automated testing toolchain;

[0185] S402: Construct a containerized test environment corresponding to the cloud computing infrastructure environment, and apply traffic and periodic fluctuations that meet preset requirements through a hybrid load model to enhance the containerized test environment and obtain a cloud computing enhanced environment.

[0186] S403: Perform load prediction testing and scheduling strategy verification on the cloud computing enhanced environment, so as to generate corresponding load prediction test data and scheduling strategy efficiency test data if the corresponding test or verification requirements are met.

[0187] S404: Perform elastic scaling and cross-region disaster recovery tests on the cloud computing enhanced environment. If the corresponding test requirements are met, generate corresponding elastic scaling test data and cross-region disaster recovery test data. Based on the load prediction test data, scheduling strategy efficiency test data, elastic scaling test data, and cross-region disaster recovery test data, generate server allocation resources.

[0188] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method.

[0189] Embodiments of this application also provide a server resource allocation device.

[0190] like Figure 5 As shown, the server resource allocation device 10 includes: an environment setup module 100, a testing module 200, and a resource allocation module 300.

[0191] The environment setup module 100 is used to apply traffic and periodic fluctuations that meet preset requirements to the pre-built cloud computing infrastructure environment in order to establish a corresponding cloud computing enhancement environment.

[0192] The testing module 200 is used to obtain the test error value and at least one key indicator value of the cloud computing enhanced environment, and to determine whether the test error value and at least one key indicator value meet the corresponding preset verification requirements. When the test error value and at least one key indicator value meet the preset verification requirements, the corresponding load prediction test data and scheduling strategy efficiency test data are obtained.

[0193] The resource allocation module 300 is used to perform elastic scaling tests and regional failure scenario simulations on the cloud computing enhanced environment to generate corresponding elastic scaling test data and cross-regional disaster recovery test data. Based on the load prediction test data, scheduling strategy efficiency test data, elastic scaling test data, and cross-regional disaster recovery test data, the module dynamically allocates resources to the target server.

[0194] Optionally, in one embodiment of this application, the server resource allocation device 10 further includes a deployment module, an establishment module, and a construction module.

[0195] The deployment module is used to deploy a pre-defined monitoring system automated management component before applying traffic and periodic fluctuations that meet preset requirements to the pre-built cloud computing infrastructure environment, and to integrate a target log analysis stack to build a dynamic resource monitoring layer through the monitoring system automated management component and the target log analysis stack.

[0196] A module is established to build a hybrid load model that acquires the traffic characteristics and periodic fluctuation characteristics of the target server. Based on the hybrid load model and a preset fault injection mechanism, an automated testing toolchain is built.

[0197] Build modules are used to construct a cloud computing infrastructure environment based on an automated testing toolchain and a dynamic resource monitoring layer.

[0198] Optionally, in one embodiment of this application, the environment building module 100 includes a containerization processing unit and an enhancement unit.

[0199] The containerization processing unit is used to deploy a service mesh in the cloud computing infrastructure environment through a preset container orchestration cluster, so as to containerize the cloud computing infrastructure environment and obtain the corresponding containerized test environment.

[0200] The reinforcement unit is used to apply traffic and periodic fluctuations that meet preset requirements through a hybrid load model in the containerized test environment to reinforce the containerized test environment and obtain a cloud computing reinforced environment.

[0201] Optionally, in one embodiment of this application, the test module 200 includes: a first verification unit and a second verification unit.

[0202] The first verification unit is used to perform load prediction tests on the cloud computing enhanced environment based on a pre-built converter model, to calculate the test error value, and to verify whether the test error value is less than the preset prediction error threshold, so as to obtain load prediction test data.

[0203] The second verification unit is used to verify the scheduling strategy of the cloud computing enhanced environment using a preset multi-objective optimization algorithm, to calculate at least one key indicator value, and to verify whether at least one key indicator value is less than or equal to a preset indicator threshold, so as to obtain scheduling strategy efficiency test data.

[0204] Optionally, in one embodiment of this application, the resource allocation module 300 includes: an elastic scaling test unit and a scenario simulation unit.

[0205] The elastic scaling test unit is used to perform elastic scaling tests on the cloud computing enhanced environment to obtain the corresponding service startup time and network traffic switching latency, and to verify whether the service startup time and network traffic switching latency are less than the corresponding scaling test threshold, so as to generate elastic scaling test data.

[0206] The scenario simulation unit is used to simulate regional failure scenarios corresponding to the cloud computing enhanced environment, so as to conduct cross-regional disaster recovery tests on the cloud computing enhanced environment based on the regional failure scenarios, to obtain the cluster self-healing time in the regional failure scenarios, and to verify whether the cluster self-healing time is less than the preset self-healing time threshold, so as to obtain cross-regional disaster recovery test data.

[0207] Optionally, in one embodiment of this application, the establishment module includes: a generation unit, a scene modeling unit, an aggregation unit, a determination unit, a judgment unit, a capture unit, and an association unit.

[0208] The generation unit is used to insert a tiered thread group plugin based on the tiered stress configuration of a preset stress testing tool, so as to generate the corresponding stress test results through the tiered thread group plugin.

[0209] The scenario modeling unit is used to perform scenario modeling operations using preset load testing tools to generate corresponding load test statistics.

[0210] The aggregation unit is used to write stress test results into the target time-series database through a preset backend listener, connect the load test statistics to a preset visual monitoring dashboard, and perform aggregate calculations on multiple system performance indicators based on the stress test results and load test statistics to obtain the corresponding aggregate indicators.

[0211] The determination unit is used to determine the stress testing mechanism and load testing mechanism corresponding to the stress testing tool and load testing tool, so as to build a hybrid load model based on the stress testing mechanism and load testing mechanism.

[0212] The judgment unit is used to detect whether the CPU utilization rate of the stress testing tool is greater than the preset utilization rate threshold based on aggregated metrics and hybrid load models, and to determine whether the load testing tool has detected a target type error.

[0213] The capture unit is used to automatically capture the stack logs of the target server when the CPU utilization rate of the stress testing tool exceeds a preset utilization rate threshold.

[0214] The association unit is used to analyze the corresponding payment interface parameters when the load testing tool detects an error in the target type.

[0215] Optionally, in one embodiment of this application, the first verification unit includes: a first acquisition subunit, a normalization subunit, a performance testing subunit, a control subunit, and a distribution subunit.

[0216] The first acquisition subunit is used to acquire historical load data, meteorological data, holiday marker data, and target time period load values ​​of the target server, so as to construct corresponding training datasets and test datasets based on the historical load data, meteorological data, holiday marker data, and target time period load values.

[0217] The normalization subunit is used to normalize the training and test datasets to obtain standard training and test datasets, configure multiple hyperparameters of the converter model, and train the converter model with multiple hyperparameters configured using the standard training dataset.

[0218] The performance testing subunit is used to perform performance testing on the converter model using a standard test dataset to obtain the test error value of the converter model.

[0219] The control subunit is used to determine whether the test error value is less than the preset prediction error threshold. If the test error value is less than the preset prediction error threshold, the trained converter model is controlled to generate the corresponding prediction curve at the target time.

[0220] The distribution subunit is used to distribute the prediction curve to the corresponding computing nodes of the target server to calculate the corresponding prediction deviation value and determine whether the prediction deviation value is greater than the preset deviation threshold. If the prediction deviation value is greater than the preset deviation threshold, a dynamic expansion operation of computing resources is performed.

[0221] Optionally, in one embodiment of this application, the second verification unit includes: a second acquisition subunit, a first calculation subunit, and a second calculation subunit.

[0222] The second acquisition subunit is used to acquire the number of defaulted tasks, the total number of tasks, the unused resource blocks, and the total resources corresponding to the target server in the cloud computing enhancement environment.

[0223] The first calculation subunit is used to calculate the service level agreement default rate based on the number of defaulted tasks and the total number of tasks, and to calculate the resource fragmentation index using unused resource blocks and total resources.

[0224] The second calculation subunit is used to determine at least one key indicator value based on the service level agreement default rate and resource fragmentation index.

[0225] Optionally, in one embodiment of this application, the elastic stretching test unit includes: a data acquisition subunit, a selection subunit, a monitoring subunit, a tracking subunit, and a test data generation subunit.

[0226] The acquisition subunit is used to collect multi-dimensional performance indicators of computing nodes in the target server, and based on the multi-dimensional performance indicators and the preset historical load feature library, generate expansion trigger conditions with time persistence and spatial correlation, so as to obtain the expansion decision instructions corresponding to the expansion trigger conditions.

[0227] The selection sub-unit is used to select a matching instance specification from the preheated container resource pool according to the expansion decision instruction, so as to perform the corresponding deployment and initialization operations using the matching instance specification to generate a new instance ready status signal.

[0228] The monitoring subunit is used to monitor the service startup process of the target server based on the new instance ready status signal, so as to obtain the corresponding service startup time and verify whether the service startup time meets the preset startup requirements, so as to obtain the service startup verification result.

[0229] The tracking subunit is used to track the business traffic migration process of the target server through the traffic monitoring component, so as to obtain the corresponding network traffic switching delay and verify whether the network traffic switching delay meets the preset compliance requirements, so as to obtain the traffic switching verification result.

[0230] The test data generation subunit is used to generate elastic scaling test data based on service startup verification results and traffic switching verification results.

[0231] For a description of the features in the embodiment corresponding to the server resource allocation device, please refer to the relevant description in the embodiment corresponding to the server resource allocation method, which will not be repeated here.

[0232] Embodiments of this application also provide an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to perform the steps in any of the above-described server resource allocation method embodiments.

[0233] Embodiments of this application also provide a non-volatile computer-readable storage medium storing a computer program, wherein the computer program is configured to execute the steps in any of the above-described server resource allocation method embodiments when running.

[0234] In one exemplary embodiment, the aforementioned non-volatile computer-readable storage medium may include, but is not limited to, various media capable of storing computer programs, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.

[0235] The embodiments of this application also provide a computer program product, which includes a computer program that, when executed by a processor, implements the steps in any of the above-described server resource allocation method embodiments.

[0236] Embodiments of this application also provide another computer program product, including a non-volatile computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps in any of the above-described server resource allocation method embodiments.

[0237] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0238] The resource allocation method, apparatus, device, and medium for a server provided in this application have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the embodiments above are merely for the purpose of helping to understand the method and its core ideas. It should be noted that those skilled in the art can make various improvements and modifications to this application without departing from its principles, and these improvements and modifications also fall within the protection scope of the claims of this application.

Claims

1. A method for allocating server resources, characterized in that, Includes the following steps: Apply traffic and periodic fluctuations that meet preset requirements to a pre-built cloud computing infrastructure environment to establish a corresponding cloud computing enhancement environment; The test error value and at least one key indicator value of the cloud computing enhanced environment are obtained, and it is determined whether the test error value and the at least one key indicator value meet the corresponding preset verification requirements. When the test error value and the at least one key indicator value meet the preset verification requirements, the corresponding load prediction test data and scheduling strategy efficiency test data are obtained. Elastic scaling tests and regional fault scenario simulations are performed on the cloud computing enhanced environment to generate corresponding elastic scaling test data and cross-regional disaster recovery test data. Based on the load prediction test data, the scheduling strategy efficiency test data, the elastic scaling test data, and the cross-regional disaster recovery test data, resources are dynamically allocated to the target server. The resource allocation method for the server further includes the following steps before applying traffic and periodic fluctuations that meet preset requirements to the pre-built cloud computing infrastructure: Deploy a pre-defined automated management component for the monitoring system and integrate a target log analysis stack to build a dynamic resource monitoring layer through the automated management component for the monitoring system and the target log analysis stack; Construct a hybrid load model to obtain the traffic characteristics and periodic fluctuation characteristics of the target server, and establish an automated testing toolchain based on the hybrid load model and a preset fault injection mechanism; Based on the automated testing toolchain and the dynamic resource monitoring layer, the cloud computing infrastructure environment is constructed. The process of applying traffic and periodic fluctuations that meet preset requirements to a pre-built cloud computing infrastructure environment to establish a corresponding cloud computing enhancement environment includes: In the cloud computing infrastructure environment, a service mesh is deployed through a preset container orchestration cluster to containerize the cloud computing infrastructure environment and obtain a corresponding containerized test environment. By applying traffic and periodic fluctuations that meet preset requirements to the hybrid load model in the containerized test environment, the containerized test environment is strengthened, thus obtaining the cloud computing strengthened environment; The process of obtaining test error values ​​and at least one key indicator value of the cloud computing enhanced environment, and determining whether the test error values ​​and at least one key indicator value meet the corresponding preset verification requirements, to obtain corresponding load prediction test data and scheduling strategy efficiency test data when the test error values ​​and at least one key indicator value meet the preset verification requirements, includes: Based on a pre-built converter model, a load prediction test is performed on the cloud computing enhanced environment to calculate the test error value and verify whether the test error value is less than a preset prediction error threshold, so as to obtain the load prediction test data. A preset multi-objective optimization algorithm is used to verify the scheduling strategy of the cloud computing enhancement environment, to calculate at least one key indicator value, and to verify whether the at least one key indicator value is less than or equal to a preset indicator threshold, so as to obtain the scheduling strategy efficiency test data.

2. The server resource allocation method according to claim 1, characterized in that, The process of performing elastic scaling tests and regional failure scenario simulations on the cloud computing enhanced environment to generate corresponding elastic scaling test data and cross-regional disaster recovery test data includes: Elastic scaling tests are performed on the cloud computing enhanced environment to obtain the corresponding service startup time and network traffic switching delay, and to verify whether the service startup time and the network traffic switching delay are less than the corresponding scaling test threshold, so as to generate the elastic scaling test data. Simulate regional fault scenarios corresponding to the cloud computing enhanced environment, and conduct cross-regional disaster recovery tests on the cloud computing enhanced environment based on the regional fault scenarios to obtain the cluster self-healing time in the regional fault scenarios, and verify whether the cluster self-healing time is less than a preset self-healing time threshold, so as to obtain the cross-regional disaster recovery test data.

3. The server resource allocation method according to claim 1, characterized in that, The construction of a hybrid load model to obtain the traffic characteristics and periodic fluctuation characteristics of the target server includes: Based on the tiered stress configuration of the preset stress testing tool, a tiered thread group plugin is inserted to generate corresponding stress test results through the tiered thread group plugin. Scenario modeling is performed using a pre-set load testing tool to generate corresponding load test statistics. The stress test results are written to the target time series database through a preset backend listener, and the load test statistics are connected to a preset visual monitoring dashboard. Multiple system performance indicators are aggregated and calculated based on the stress test results and the load test statistics to obtain the corresponding aggregated indicators. Determine the stress testing mechanism and load testing mechanism corresponding to the stress testing tool and the load testing tool, and construct the hybrid load model based on the stress testing mechanism and the load testing mechanism; Based on the aggregated metrics and the hybrid load model, it is determined whether the CPU utilization rate corresponding to the stress testing tool is greater than a preset utilization rate threshold, and whether the load testing tool has detected a target type error. When the CPU utilization rate of the stress testing tool exceeds the preset utilization rate threshold, the stack log of the target server is automatically captured. When the load testing tool detects an error in the target type, it performs correlation analysis on the corresponding payment interface parameters.

4. The server resource allocation method according to claim 1, characterized in that, The load prediction test is performed on the cloud computing enhancement environment based on the pre-built converter model to calculate the test error value and verify whether the test error value is less than a preset prediction error threshold, so as to obtain the load prediction test data, including: Obtain historical load data, meteorological data, holiday marker data, and target time period load values ​​of the target server, and construct corresponding training and test datasets based on the historical load data, meteorological data, holiday marker data, and target time period load values; The training dataset and the test dataset are normalized to obtain a standard training dataset and a standard test dataset. Multiple hyperparameters of the converter model are configured, and the converter model with the configured hyperparameters is trained using the standard training dataset. The converter model is tested using the standard test dataset to obtain the test error value of the converter model. Determine whether the test error value is less than the preset prediction error threshold, wherein if the test error value is less than the preset prediction error threshold, control the trained converter model to generate the corresponding prediction curve at the target time. The prediction curve is distributed to the corresponding computing nodes of the target server to calculate the corresponding prediction deviation value, and it is determined whether the prediction deviation value is greater than a preset deviation threshold. If the prediction deviation value is greater than the preset deviation threshold, a dynamic expansion operation of computing resources is performed.

5. The server resource allocation method according to claim 1, characterized in that, The step of using a preset multi-objective optimization algorithm to verify the scheduling strategy of the cloud computing enhancement environment, and calculating the at least one key indicator value, includes: Obtain the number of defaulted tasks, total number of tasks, unused resource blocks, and total resources corresponding to the target server in the cloud computing enhancement environment; The service level agreement default rate is calculated based on the number of defaulted tasks and the total number of tasks, and the resource fragmentation index is calculated using the unused resource blocks and the total resources. The at least one key indicator value is determined based on the service level agreement default rate and the resource fragmentation index.

6. The server resource allocation method according to claim 2, characterized in that, The process of performing elastic scaling tests on the cloud computing enhanced environment to obtain the corresponding service startup time and network traffic switching latency, and verifying whether the service startup time and network traffic switching latency are less than the corresponding scaling test thresholds, to generate the elastic scaling test data, includes: Collect multi-dimensional performance indicators of computing nodes in the target server, and based on the multi-dimensional performance indicators and a preset historical load feature library, generate expansion trigger conditions with time persistence and spatial correlation, so as to obtain expansion decision instructions corresponding to the expansion trigger conditions. According to the expansion decision instruction, a matching instance specification is selected from the preheated container resource pool to perform the corresponding deployment and initialization operations using the matching instance specification, so as to generate a new instance ready status signal. Based on the new instance ready status signal, monitor the service startup process of the target server to obtain the corresponding service startup time, and verify whether the service startup time meets the preset startup requirements to obtain the service startup verification result; The traffic monitoring component tracks the business traffic migration process of the target server to obtain the corresponding network traffic switching delay, and verifies whether the network traffic switching delay meets the preset compliance requirements to obtain the traffic switching verification result. Based on the service startup verification results and the traffic switching verification results, the elastic scaling test data is generated.

7. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor, configured to implement the steps of the resource allocation method for the server as described in any one of claims 1 to 6 when executing the computer program.

Citation Information

Patent Citations

  • Multi-cluster distributed training-oriented disaster recovery drill and performance evaluation method and system

    CN120104453A

  • Container cloud elastic expansion and contraction method based on load prediction

    CN120216096A