A virtual machine scheduling heuristic function optimization method based on large language model
By constructing and optimizing heuristic functions using a large language model, we solved the problem of low efficiency of virtual machine scheduling algorithms in dynamic environments, achieved efficient resource utilization and scheduling strategy generation, and improved the performance and cost control of the cloud platform.
Patent Information
- Application Number
- CN202510117346.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-24
- Publication Date
- 2025-09-09
- Estimated Expiration
- 2045-01-24
AI Technical Summary
Existing virtual machine scheduling algorithms are difficult to maintain efficiency in dynamic environments. Heuristic algorithms rely on manual design and are complex. Reinforcement learning model training consumes a lot of resources and is difficult to explain, resulting in inefficient scheduling and low resource utilization.
A large language model is used to construct and optimize heuristic functions. Through data cleaning, feedback mechanism and continuous optimization, virtual machine scheduling strategies are generated and adjusted, and self-improvement is carried out in combination with historical function lists.
It significantly reduces sample complexity, improves scheduling efficiency and resource utilization, and achieves efficient scheduling in dynamic environments.
Smart Images

Figure CN120045283B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of function optimization methods, and in particular to a virtual machine scheduling heuristic function optimization method based on a large language model. Background Art
[0002] Amid the rapid development of modern technology, cloud computing has become a core force driving enterprise digital transformation. By allocating computing resources on demand, cloud computing provides crucial support for enterprises to break free from the constraints of traditional on-premises hardware and accelerate business innovation. Leading global cloud service providers, leveraging their extensive data center infrastructure, offer flexible and efficient resource management capabilities. Within this ecosystem, virtual machine scheduling, as a key resource allocation mechanism, plays a vital role in optimizing cloud platform performance and controlling costs. Optimizing virtual machine scheduling strategies not only improves resource utilization but also significantly reduces energy consumption, ultimately enhancing resource efficiency across the industry.
[0003] The IaaS (Infrastructure as a Service) model of cloud computing provides users with flexible computing, storage, and networking services by abstracting hardware resources and delivering them in a standardized manner. In a multi-tenant environment, efficiently matching resources between virtual machines and physical hosts becomes a key issue affecting the performance and cost of cloud platforms. Modern data centers use virtualization technology to abstract physical resources, significantly improving resource management flexibility. However, virtual machine scheduling faces the challenges of multi-dimensional resource demands, dynamic environmental changes, and complex constraints. Effective virtual machine scheduling strategies can improve hardware resource utilization and reduce energy consumption while ensuring service quality.
[0004] The core task of virtual machine scheduling is solving the mapping problem between virtual machines and physical hosts, a problem often classified as an NP-Hard combinatorial optimization problem. Due to the diversity and uncertainty of virtual machine resource requirements, the complexity of scheduling increases exponentially with system scale. Offline scheduling methods assume that virtual machine resource requirements are known and typically employ precise algorithms such as mixed integer programming. In online scheduling, however, virtual machine resource requirements arrive dynamically, and the system cannot predict future tasks, requiring real-time resource allocation. This places higher demands on scheduling algorithms.
[0005] Among traditional scheduling methods, heuristic algorithms such as "First-Fit" and "Best-Fit" are widely used due to their simplicity and efficiency. However, these algorithms rely on expert design and struggle to maintain efficiency in dynamic, uncertain environments. Meanwhile, machine learning techniques, particularly reinforcement learning, have been introduced to the virtual machine scheduling problem. Reinforcement learning demonstrates strong dynamic optimization capabilities by adaptively adjusting scheduling strategies. However, its training process is resource-intensive and its decision-making process is difficult to interpret, limiting its widespread application in practical applications.
[0006] In recent years, large language models (LLMs), with their powerful natural language processing capabilities, have achieved performance breakthroughs in multiple fields and have gradually expanded to optimization and generation tasks. LLMs based on the Transformer architecture, trained on a wide range of corpora, not only possess exceptional language understanding and generation capabilities but also demonstrate potential for cross-domain problem solving. Their "emergent properties" enable them to adapt to new tasks with a small number of examples and possess complex reasoning capabilities. In the fields of optimization and scheduling, LLMs have the potential to serve as intelligent assistants, improving algorithm performance through reflection and adjustment, iteratively optimizing algorithm design. Summary of the Invention
[0007] In response to the problems of manual reliance on heuristic algorithm design and complex training of reinforcement learning models in online virtual machine scheduling, combined with the automated optimization capabilities of large language models, the purpose of the present invention is to provide a virtual machine scheduling heuristic function optimization method based on large language models. This method realizes the dynamic generation and optimization of scheduling strategies, significantly reduces sample complexity, and improves scheduling efficiency and resource utilization.
[0008] The purpose of the present invention is achieved by adopting the following technical solutions:
[0009] A virtual machine scheduling heuristic function optimization method based on a large language model includes the following steps:
[0010] S1. Use a large language model to construct the initial heuristic function code and perform data cleaning on the virtual machine sequences obtained from the cloud computing environment to build a training set;
[0011] S2. Add a description, improvement suggestions, and the best-performing function in the database to the prompt. best , construct the prompt word and submit it to the large language model, obtain the model response, and extract the optimized heuristic function code from its response. The formula is defined as π new =LLM(π best ,hint,des), where des is the task description, indicating the heuristic function code for large language model optimization, hint is the currently obtained improvement suggestion, π best is the best performing function in the database, π new The optimized function code generated for the large language model (LLM) indicates that the large language model receives the prompt word and outputs the optimized heuristic function. If it does not work properly, repeat this step until the correct code is obtained.
[0012] The reply includes the optimized heuristic function code and a detailed description of the code;
[0013] S3. After obtaining the optimized heuristic function, it is input into the evaluator together with the data set, and the corresponding evaluation result is generated;
[0014] The evaluation result is the number of virtual machines that can be successfully placed under fixed resource capacity constraints;
[0015] S4. Update the heuristic function list in the database, add the newly obtained heuristic function and re-sort it, and select the function with the best evaluation result;
[0016] S5. Sort the heuristic function list of the database from low to high according to the evaluation results, and add the heuristic function list {π i |i=1,…,k}, task description des, and send the hint to the large language model to obtain the improvement suggestion hint of the function from the large language model. The formula is defined as hint=LLM({π i |i=1,…,k},des), where {π i |i=1,…,k} is a list of historically improved heuristic functions, des is a task description, instructing the large language model to extract knowledge based on the list of historically improved heuristic functions, LLM indicates interaction with the large language model, and hint is the obtained improvement suggestion;
[0017] The improvement suggestions are code snippets that are useful for improving the evaluation results, obtained by the large language model based on the analysis of the historical function list;
[0018] S6. If the current number of iterations does not exceed the preset number of iterations, the next iteration is performed, i.e., steps S2-S5 are repeated; if the current number of iterations exceeds the preset number of iterations, the optimization is terminated, and the virtual machine scheduling heuristic function with the best evaluation result in the current database is output.
[0019] Beneficial technical effects of the present invention:
[0020] The present invention provides a virtual machine scheduling heuristic function optimization method based on a large language model. The present invention fully utilizes the large language model's ability to generate code and automatically optimize, adopts a carefully designed prompt strategy, and guides the model to generate innovative heuristic functions from multiple dimensions such as problem background, constraints, and optimization goals.
[0021] This invention incorporates the concept of self-reflection and, by introducing dynamic feedback and continuous optimization mechanisms, enables the system to quickly identify and adjust to optimal parameters and strategies, thereby achieving efficient, stable and excellent performance in complex environments. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Figure 1 is a flow chart of an embodiment of the present invention;
[0023] Figure 2 This is a flowchart of constructing an initial heuristic function using a large language model according to an embodiment of the present invention;
[0024] Figure 3 This is an example diagram of prompt words for optimizing a heuristic function using a large language model according to an embodiment of the present invention;
[0025] Figure 4 This is an example diagram of prompt words for obtaining improvement suggestions using a large language model according to an embodiment of the present invention. DETAILED DESCRIPTION
[0026] In order to make the technical solution of the present invention more clear and specific to those skilled in the art, the present invention is further described in detail below with reference to embodiments and drawings, but the embodiments of the present invention are not limited thereto.
[0027] Example
[0028] See Figure 1 The present invention provides a virtual machine scheduling heuristic function optimization method based on a large language model, comprising the following steps:
[0029] Step S1: See Figure 2 ,Add task instructions and code examples to the prompt words, construct the initial heuristic function code using a large language model, and perform data cleaning on the virtual machine sequences obtained from the cloud computing environment to build a training set;
[0030] Step S2: See Figure 3 Example of a prompt word, adding a description, an improvement suggestion hint, and the best-performing function π in the database to the prompt word (prompt) best , construct the prompt word and submit it to the large language model, obtain the model response, and extract the optimized heuristic function code from its response. The formula is defined as π new =LLM(π best ,hint,des), where des is the task description, indicating the heuristic function code for large language model optimization, hint is the currently obtained improvement suggestion, π best is the best performing function in the database, π new The optimized function code generated for the large language model (LLM) indicates that the large language model receives the prompt word and outputs the optimized heuristic function. If it does not work properly, repeat this step until the correct code is obtained.
[0031] Step S3: After obtaining the optimized heuristic function, it is input into the evaluator together with the dataset, and the corresponding evaluation result is generated. The evaluation result is the number of virtual machines that can be successfully placed under the fixed resource capacity constraint;
[0032] Step S4: updating the heuristic function list in the database, adding the newly acquired heuristic function and re-ordering it, and selecting the function with the best evaluation result;
[0033] Step S5: See Figure 4 First, sort the heuristic function list of the database from low to high according to the evaluation results, and add the heuristic function list {π i |i=1,…,k}, task description des, and send the hint to the large language model to obtain the improvement suggestion hint of the function from the large language model. The formula is defined as hint=LLM({π i |i=1,…,k},des), where {π i |i=1,…,k} is a list of historically improved heuristic functions, des is a task description, instructing the large language model to extract knowledge based on the list of historically improved heuristic functions, LLM indicates interaction with the large language model, and hint is the obtained improvement suggestion, which refers to the code extracted by the large language model from the historical function list that is effective in improving the evaluation results.
[0034] Step S6: If the current number of iterations does not exceed the preset number of iterations, the next round of iterations is performed, i.e., steps S2, S3, S4, and S5 are repeated; if the current number of iterations exceeds the preset number of iterations, the optimization is terminated, and the virtual machine scheduling heuristic function with the best evaluation result in the current database is output.
[0035] The above is only a further embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any technician familiar with the technical field can make equivalent replacements or changes based on the technical solutions and concepts of the present invention within the scope disclosed by the present invention, which fall within the scope of protection of the present invention.
Claims
1. A virtual machine scheduling heuristic function optimization method based on a large language model, characterized in that: The steps include: S1. Use a large language model to construct the initial heuristic function code and perform data cleaning on the virtual machine sequences obtained from the cloud computing environment to build a training set; S2. Add description, improvement suggestions, and the best-performing function π in the database to the prompt word. best , construct the prompt word and submit it to the large language model, obtain the model response, and extract the optimized heuristic function code from its response. The formula is defined as π new =LLM(π best ,hint,des), where des is the task description, indicating the heuristic function code for large language model optimization, hint is the currently obtained improvement suggestion, π best is the best performing function in the database, π new The optimized function code generated for the large language model (LLM) indicates that the large language model receives the prompt word and outputs the optimized heuristic function. If it does not work properly, repeat this step until the correct code is obtained. The reply includes the optimized heuristic function code and a detailed description of the code; S3. After obtaining the optimized heuristic function, it is input into the evaluator together with the data set, and the corresponding evaluation result is generated; The evaluation result is the number of virtual machines that can be successfully placed under the fixed resource capacity constraint; S4. Update the heuristic function list in the database, add the newly obtained heuristic function and re-sort it, and select the function with the best evaluation result; S5. Sort the heuristic function list of the database from low to high according to the evaluation results, and add the heuristic function list {π i |i=1,…,k}, task description des, and send the hint to the large language model to obtain the improvement suggestion hint of the function from the large language model. The formula is defined as hint=LLM({π i |i=1,…,k},des), where {π i |i=1,…,k} is a list of historically improved heuristic functions, des is a task description, instructing the large language model to extract knowledge based on the list of historically improved heuristic functions, LLM indicates interaction with the large language model, and hint is the obtained improvement suggestion; The improvement suggestions are code snippets that are useful for improving the evaluation results, obtained by the large language model based on the analysis of the historical function list; S6. If the current number of iterations does not exceed the preset number of iterations, the next iteration is performed, i.e., steps S2-S5 are repeated; if the current number of iterations exceeds the preset number of iterations, the optimization is terminated, and the virtual machine scheduling heuristic function with the best evaluation result in the current database is output.
Citation Information
Patent Citations
Universal power supply and performance management system of cloud computing center
CN105116987A
Function as a service (FAAS) system enhancements
CN112955869A