Efficient multi-core processor task allocation method
By building a migration cost evaluation model, taking into account multiple factors, optimizing multi-core processor task allocation and migration strategies, the problems of low task allocation efficiency and incomplete migration cost evaluation in traditional methods are solved, and processor performance and stability are significantly improved .
Patent Information
- Application Number
- CN202411305947.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-19
- Publication Date
- 2025-01-07
AI Technical Summary
Traditional multi-core processor task allocation strategies ignore the dependencies and resource requirements differences between tasks, resulting in inefficiency in execution and waste of resources, and lack of comprehensive consideration of complex factors during task migration, resulting in unnecessary migration operations and performance bottlenecks.
Build a migration cost evaluation model, comprehensively consider data movement costs, context switching overhead and performance losses, formulate task allocation and migration strategies, monitor system status in real time and adjust strategies dynamically to optimize task allocation and migration decisions.
Accurate evaluation and optimization of task allocation is achieved, unnecessary migration times and migration costs are reduced, and the overall performance and stability of multi-core processors are improved.
Smart Images

Figure CN119271369A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of computer multi-core processors, and in particular to an efficient multi-core processor task allocation method. Background Art
[0002] With the rapid advancement of information technology, multi-core processors have become the core components of modern computing systems and are widely used in servers, high-performance computing clusters, embedded systems, personal computers and other fields. The emergence of multi-core processors has greatly improved the parallel processing capabilities and overall performance of computer systems, making it possible to complete complex computing tasks in a shorter time. However, with the increase in the number of processor cores, how to efficiently manage these cores, achieve optimal task allocation and dynamic migration, so as to fully utilize system resources and reduce resource competition and delays has become a technical problem that needs to be solved urgently.
[0003] Traditional task allocation strategies are often based on a simple load balancing principle, that is, trying to evenly distribute tasks to each core to reduce the overload of a single core. However, this strategy ignores the dependencies between tasks, differences in execution time, and differences in resource requirements, resulting in inefficient task execution and waste of resources. In addition, task migration is an important means to balance processor load and optimize system performance, and its cost is also crucial to accurately evaluate. When dealing with task migration, traditional methods often lack comprehensive consideration of the complex factors involved in the migration process, such as data movement costs, context switching overhead, and performance losses that may result after migration. This evaluation method that ignores migration costs can easily lead to unnecessary migration operations, increase system overhead, and cause performance bottlenecks.
[0004] In view of the above situation, it is necessary to optimize the existing efficient multi-core processor task allocation method. By constructing a migration cost evaluation model and comprehensively considering multiple factors, an accurate evaluation of the migration cost can be achieved, and a more reasonable task allocation and migration strategy can be formulated accordingly. Therefore, it is of great significance to develop an efficient multi-core processor task allocation method that can comprehensively realize the above characteristics. Summary of the invention
[0005] The purpose of the present invention is to make up for the shortcomings of the prior art and provide an efficient multi-core processor task allocation method, which can achieve accurate evaluation of the migration cost by constructing a sophisticated migration cost evaluation model, comprehensively considering multiple dimensions such as data movement cost, context switching overhead and performance loss, and on this basis, formulate a more reasonable and efficient task allocation and migration strategy, which not only effectively balances the load of each processor core, but also significantly reduces the number of unnecessary migrations and migration costs, thereby improving the overall performance and stability of the multi-core processor.
[0006] In order to solve the above technical problems, the present invention provides the following technical solutions: an efficient multi-core processor task allocation method, the method comprising the following specific steps:
[0007] S100, task analysis and classification: Analyze the tasks to be assigned and classify them into groups of tasks that can be executed in parallel, tasks that need to be executed sequentially, and tasks with specific dependencies according to the task characteristics and system status;
[0008] S200, Migration cost evaluation model construction: Establish a migration cost evaluation model, comprehensively considering data movement cost, context switching overhead and performance loss;
[0009] S300, task allocation strategy formulation: formulate a task allocation strategy based on task classification and migration cost evaluation results;
[0010] S400, dynamic migration decision: monitor the status of each processor core and the task execution status in real time. When load imbalance and task demand changes are detected, the necessity and feasibility of migration are evaluated according to the migration cost evaluation model, and the solution with the lowest migration cost is selected when implementing the migration decision;
[0011] S500, optimization and adjustment: Dynamically adjust and optimize task allocation and migration strategies based on actual operating results.
[0012] Furthermore, the step S200 includes:
[0013] S201, it is clear that the migration cost includes data movement cost, context switching overhead and performance loss;
[0014] S202, calculating the data movement cost according to the amount of data required to be transmitted for task migration and the cost of unit data transmission;
[0015] S203, calculating the overhead of the operating system or the virtual machine hypervisor during the context switching process according to the time required to save and restore the task state;
[0016] S204, analyzing changes in the task execution environment after migration, predicting changes in the execution efficiency of the task after migration through simulation or historical data, and calculating the impact of interruptions and delays generated during the migration process on system performance;
[0017] S205, integrating the above evaluation results into a comprehensive evaluation model, setting weights according to system requirements and optimization goals, and developing an algorithm to calculate the comprehensive score of the migration cost.
[0018] Furthermore, in step S200, the calculation formula of the data movement cost is: C data =D×c unit, where D is the amount of data that needs to be transferred during the migration process, c unit is the unit data transmission cost, C data is the data movement cost, and the context switching overhead is calculated as: C context =(t save +t restore )×c time , where c time is the weight of time cost, t save and t restore are the time required to save and restore the task state, C context is the context switching overhead, and the performance loss is calculated as: Among them, α is the weight of performance loss, T pre is the estimated execution time before migration, T post is the actual execution time after migration, C perf It is a performance loss.
[0019] Furthermore, the step S205 sets weights according to system requirements and optimization goals, and develops an algorithm to calculate the comprehensive score of the migration cost, and the algorithm formula is: C total =w data ×C data +w context ×C context +w perf ×C perf , where w data 、w context and w perf are the weights of data movement cost, context switching overhead, and performance loss, respectively, used to adjust their relative importance in the total cost. data is the data movement cost, C context is the context switching overhead, C perf It is a performance loss.
[0020] Furthermore, the step S300 includes:
[0021] S301, preliminarily assigning tasks to each processor core according to task classification and current system status;
[0022] S302, evaluating the load of each processor core and allocating tasks through an algorithm so that the system can maintain overall load balance;
[0023] S303, under the premise of satisfying load balancing, considering the migration cost, assigning the task to the core with a lower migration cost.
[0024] Furthermore, the step S302 performs task allocation through an algorithm, specifically, determines m processor cores and n tasks to be allocated, and for each task i, calculates its estimated execution time t i , initialize the current load L of each processor core j j is zero, for each task i to be assigned, select the processor core j with the lowest current load, where j = argmin k (L k ), assign task i to the selected processor core j, and update the current load of processor core j to L j =L j +t i , repeat the allocation strategy until all tasks are assigned.
[0025] Furthermore, the step S400 includes:
[0026] S401, monitors the status of each processor core and the task execution in real time, and collects key performance indicators, including load rate, response time and throughput;
[0027] S402, triggering migration evaluation for abnormal situations such as load imbalance, task timeout, and system performance degradation, analyzing the cause of the abnormality, and determining whether the task needs to be migrated;
[0028] S403, evaluating multiple possible migration solutions according to the migration cost evaluation model, and considering the overall performance and stability of the system after the migration;
[0029] S404: According to the migration cost evaluation result, a solution with the minimum migration cost is selected to perform task migration.
[0030] Furthermore, the step S500 includes:
[0031] S501, evaluate the system performance improvement after migration, collect user feedback and system operation data, and analyze the migration effect;
[0032] S502, dynamically adjusting the task allocation and migration strategy according to the evaluation results, and optimizing the migration cost evaluation model and the task allocation algorithm;
[0033] S503, establish a long-term monitoring system to continuously monitor the operating status and task execution of the multi-core processor, and promptly discover and handle potential problems.
[0034] Furthermore, the step S502 uses an optimization algorithm to optimize the migration cost evaluation model, and the calculation formula for the optimization is: Where: θ t+1 is the updated model parameter, θ tis the current model parameter, η is the learning rate, which controls the step size of parameter update, In the current dataset D t The gradient of the loss function L with respect to the model parameter θ, λ is the weight factor, Δθ hist It is the model parameter adjustment amount calculated based on the feedback results.
[0035] Compared with the prior art, this efficient multi-core processor task allocation method has the following beneficial effects:
[0036] 1. The present invention accurately constructs a migration cost evaluation model, comprehensively considers multiple key factors such as data movement cost, context switching overhead and performance loss, and realizes accurate evaluation of task migration cost, so that in the process of task allocation and migration, the solution with the lowest migration cost can be given priority, thereby effectively reducing unnecessary resource consumption and performance loss. In addition, through real-time monitoring and dynamic adjustment of task allocation and migration strategies, the present invention can ensure that the multi-core processor always maintains a high overall performance during operation and meets complex and changing task requirements.
[0037] 2. The present invention can timely discover and handle abnormal situations such as load imbalance, task timeout and system performance degradation by monitoring the status of each processor core and task execution in real time. When making migration decisions, it comprehensively considers multiple possible migration plans and selects the plan with the lowest migration cost to execute, thereby reducing the potential impact of migration on system stability.
[0038] Other advantages, objectives and features of the present invention will be set forth in part in the following description and, in part, will be apparent to those skilled in the art based on an examination of the following or may be taught from the practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0040] Figure 1 The flowchart of an efficient multi-core processor task allocation method is shown in FIG.
[0041] Figure 2 Flowchart of the application of migration cost evaluation model for an efficient multi-core processor task allocation method. DETAILED DESCRIPTION
[0042] The technical solutions in the embodiments of the present invention are described clearly and completely below. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0043] Example 1
[0044] This embodiment describes in detail the specific application process of an efficient multi-core processor task allocation method. By constructing a migration cost evaluation model and comprehensively considering multiple factors, an accurate evaluation of the migration cost is achieved, and a more reasonable task allocation and migration strategy is formulated accordingly.
[0045] In the task analysis and classification step (S100), the real-time data stream tasks to be processed are analyzed. These tasks may include user behavior analysis, log processing, real-time recommendation algorithms, etc. According to the computing requirements of the tasks (CPU intensive, memory intensive, I / O intensive, etc.), data dependencies (such as whether pre-data processing results are required) and the current state of the system (such as processor core load, memory usage, network bandwidth, etc.), the tasks are divided into tasks that can be executed in parallel (such as independent data processing modules), tasks that need to be executed sequentially (such as front and back dependent links in the data processing chain) and task groups with specific dependencies (such as multiple related events in complex event processing).
[0046] In the migration cost evaluation model construction stage (S200), it is clarified that the migration cost includes three aspects: data movement cost, context switching overhead and performance loss. The data movement cost is calculated based on the amount of data required for task migration and the cost of unit data transmission. For context switching overhead, the overhead of the operating system or virtual machine hypervisor in the context switching process is calculated based on the time required to save and restore the task state. For performance loss evaluation, the changes in the task execution environment after migration are analyzed, the changes in the execution efficiency of the task after migration are predicted through simulation or historical data, and the impact of interruptions and delays generated during the migration process on system performance is calculated. The above evaluation results are integrated into a comprehensive evaluation model, and weights are set according to system requirements and optimization goals (such as minimizing the overall migration cost, maximizing system throughput, etc.), and an algorithm is developed to calculate the comprehensive score of the migration cost.
[0047] In task allocation strategy formulation (S300), tasks are initially allocated to each processor core according to task classification and current system status. The idle state of the processor, the type of the allocated tasks and resource requirements are considered, the load of each processor core is evaluated, and tasks are reallocated through an algorithm so that the system can maintain overall load balance. Specifically, m processor cores and n tasks to be allocated are determined. For each task i, its estimated execution time t is calculated. i , initialize the current load L of each processor core j j is zero, for each task i to be assigned, select the processor core j with the lowest current load, where j = argmin k (L k ), assign task i to the selected processor core j, and update the current load of processor core j to L j =L j +t i ,The allocation strategy is repeated until all tasks are assigned.,Under the premise of satisfying load balancing, the migration cost is further considered, and tasks are assigned to the cores with lower migration cost, which helps reduce unnecessary ,migration overhead and improve the overall system performance.
[0048] In the dynamic migration decision stage (S400), a monitoring tool is used to monitor the status of each processor core and the execution of tasks in real time, and key performance indicators are collected, including load rate, response time, throughput, etc. For abnormal situations such as load imbalance, task timeout and system performance degradation, the migration evaluation mechanism is triggered to analyze the cause of the abnormality and determine whether it is necessary to migrate the task to relieve pressure or optimize performance. Based on the migration cost evaluation model, multiple possible migration plans are evaluated, and the overall performance and stability of the system before and after migration are considered. The plan with the lowest migration cost is selected. Based on the evaluation results, the selected migration plan is executed. During the migration process, attention is paid to minimizing the impact on running tasks to ensure a smooth transition of the system.
[0049] In the optimization and adjustment phase (S500), the system performance improvement after migration is evaluated, user feedback and system operation data are collected, and the migration effect is analyzed to see whether it has achieved the expected goals, such as reducing delays and improving throughput. According to the evaluation results, the task allocation and migration strategy are dynamically adjusted to optimize the migration cost evaluation model and task allocation algorithm. The calculation formula for optimization is: Where: θ t+1 is the updated model parameter, θ t is the current model parameter, η is the learning rate, which controls the step size of parameter update, In the current dataset D t The gradient of the loss function L with respect to the model parameter θ, λ is the weight factor, Δθ histIt is the adjustment amount of model parameters calculated based on the feedback results to improve the adaptability and accuracy of the strategy, and establish a long-term monitoring system to continuously monitor the operating status and task execution of multi-core processors, promptly discover and deal with potential problems, ensure stable system operation and continuously optimize performance.
[0050] In summary, this embodiment effectively improves the task allocation efficiency of multi-core processors in real-time data analysis by analyzing the characteristics of real-time data tasks in detail, constructing a migration cost evaluation model, formulating a task allocation strategy based on the cloud computing platform, and introducing a dynamic migration decision-making mechanism. Through real-time monitoring and adjustment, it ensures system load balancing and performance optimization, reduces unnecessary migration overhead, and ultimately improves the overall data processing capability and user experience.
[0051] Embodiment 2
[0052] Based on the first embodiment, this embodiment describes in detail a specific application of a migration cost evaluation model in an efficient multi-core processor task allocation method.
[0053] The real-time data processing tasks to be assigned are analyzed in detail, and based on the dependencies between tasks and computing requirements, the tasks are divided into task groups that can be executed in parallel, those that need to be executed sequentially, and those with specific dependencies.
[0054] Clearly, the migration cost includes data movement cost, context switching overhead, and performance loss. According to the amount of data required for task migration and the unit data transmission cost, use formula C data =D×c unit Calculate the data movement cost, where D is the amount of data that needs to be transferred during the migration process, c unit is the unit data transmission cost, C data is the data movement cost.
[0055] According to the time required to save and restore the task state, and the weight of the time cost, use formula C context =(t save +t restore )×c time Calculate the context switching cost, where c time is the weight of time cost, t save and t restore are the time required to save and restore the task state, C context is the context switching overhead.
[0056] Predict the change in execution efficiency of tasks after migration through simulation or historical data, using the formula Calculate the performance loss, where α is the weight of the performance loss, T preis the estimated execution time before migration, T post is the actual execution time after migration, C perf It is a performance loss.
[0057] The above evaluation results are integrated into the comprehensive evaluation model, using formula C total =w data ×C data +w context ×C context +w perf ×C perf , where w data 、w context and w perf are the weights of data movement cost, context switching overhead, and performance loss, respectively, used to adjust their relative importance in the total cost. data is the data movement cost, C context is the context switching overhead, C perf It is a performance loss.
[0058] Based on task classification and current system status, tasks are initially assigned to each processor core. The load of each processor core is evaluated through an algorithm, and tasks are redistributed to ensure overall system load balance. On the premise of satisfying load balance, tasks are assigned to cores with lower migration costs based on migration cost evaluation results.
[0059] Monitor the status of each processor core and task execution in real time, collect key performance indicators such as load rate, response time and throughput, and trigger the migration evaluation mechanism when abnormal conditions such as load imbalance or task timeout are detected. According to the migration cost evaluation model, evaluate multiple possible migration plans, analyze the overall performance and stability of the system after migration, select the plan with the lowest migration cost, execute the migration operation, and ensure a smooth transition of the system.
[0060] To summarize, this embodiment builds a migration cost evaluation model, comprehensively considering data movement cost, context switching overhead and performance loss, to ensure that while maintaining system load balance, the solution with the lowest migration cost is selected for task migration, thereby significantly improving the resource utilization and task processing efficiency of multi-core processors, and providing strong technical support for large-scale computing environments such as data centers.
[0061] It will be apparent to those skilled in the art that the invention is not limited to the details of the exemplary embodiments described above and that the invention can be implemented in other specific forms without departing from the spirit or essential features of the invention. Therefore, the embodiments should be considered exemplary and non-limiting in all respects, and the scope of the invention is defined by the appended claims rather than the foregoing description, and it is intended that all variations falling within the meaning and range of equivalent elements of the claims be included in the invention. Any reference numeral in a claim should not be considered as limiting the claim to which it relates.
Claims
1. An efficient multi-core processor task allocation method, characterized in that: The method comprises the following specific steps: S100, task analysis and classification: Analyze the tasks to be assigned and classify them into groups of tasks that can be executed in parallel, tasks that need to be executed sequentially, and tasks with specific dependencies according to the task characteristics and system status; S200, Migration cost evaluation model construction: Establish a migration cost evaluation model, comprehensively considering data movement cost, context switching overhead and performance loss; S300, task allocation strategy formulation: formulate a task allocation strategy based on task classification and migration cost evaluation results; S400, dynamic migration decision: monitor the status of each processor core and the task execution status in real time. When load imbalance and task demand changes are detected, the necessity and feasibility of migration are evaluated according to the migration cost evaluation model, and the solution with the lowest migration cost is selected when implementing the migration decision; S500, optimization and adjustment: Dynamically adjust and optimize task allocation and migration strategies based on actual operating results.
2. The method for efficiently allocating tasks to a multi-core processor according to claim 1, characterized in that: The step S200 includes: S201, it is clear that the migration cost includes data movement cost, context switching overhead and performance loss; S202, calculating the data movement cost according to the amount of data required to be transmitted for task migration and the cost of unit data transmission; S203, calculating the overhead of the operating system or the virtual machine hypervisor during the context switching process according to the time required to save and restore the task state; S204, analyzing changes in the task execution environment after migration, predicting changes in the execution efficiency of the task after migration through simulation or historical data, and calculating the impact of interruptions and delays generated during the migration process on system performance; S205, integrating the above evaluation results into a comprehensive evaluation model, setting weights according to system requirements and optimization goals, and developing an algorithm to calculate the comprehensive score of the migration cost.
3. The method for efficiently allocating tasks to a multi-core processor according to claim 2, characterized in that: In step S200, the calculation formula of data movement cost is: C data =D×c unit , where D is the amount of data that needs to be transferred during the migration process, c unit is the unit data transmission cost, C data is the data movement cost, and the context switching overhead is calculated as: C context =(t save +t restore )×c time , where c time is the weight of time cost, t save and t restore are the time required to save and restore the task state, C context is the context switching overhead, and the performance loss is calculated as: Among them, α is the weight of performance loss, T pre is the estimated execution time before migration, T post is the actual execution time after migration, C perf It is a performance loss.
4. The method for efficiently allocating tasks to a multi-core processor according to claim 2, characterized in that: The step S205 sets weights according to system requirements and optimization goals, and develops an algorithm to calculate the comprehensive score of the migration cost. The algorithm formula is: total =w data ×C data +w context ×C context +w perf ×C perf , where w data 、w context and w perf are the weights of data movement cost, context switching overhead, and performance loss, respectively, used to adjust their relative importance in the total cost. data is the data movement cost, C context is the context switching overhead, C perf It is a performance loss.
5. The method for efficiently allocating tasks to a multi-core processor according to claim 1, characterized in that: The step S300 includes: S301, preliminarily assigning tasks to each processor core according to task classification and current system status; S302, evaluating the load of each processor core and allocating tasks through an algorithm so that the system can maintain overall load balance; S303, under the premise of satisfying load balancing, considering the migration cost, assigning the task to the core with a lower migration cost.
6. The method for efficiently allocating tasks to a multi-core processor according to claim 5, characterized in that: The step S302 performs task allocation through an algorithm. Specifically, m processor cores and n tasks to be allocated are determined. For each task i, its estimated execution time t is calculated. i , initialize the current load L of each processor core j j is zero, for each task i to be assigned, select the processor core j with the lowest current load, where j = argmin k (L k ), assign task i to the selected processor core j, and update the current load of processor core j to L j =L j +t i , repeat the allocation strategy until all tasks are assigned.
7. The method for efficiently allocating tasks to a multi-core processor according to claim 1, characterized in that: The step S400 includes: S401, monitors the status of each processor core and the task execution in real time, and collects key performance indicators, including load rate, response time and throughput; S402, triggering migration evaluation for abnormal situations such as load imbalance, task timeout, and system performance degradation, analyzing the cause of the abnormality, and determining whether the task needs to be migrated; S403, evaluating multiple possible migration solutions according to the migration cost evaluation model, and considering the overall performance and stability of the system after the migration; S404: According to the migration cost evaluation result, a solution with the minimum migration cost is selected to perform task migration.
8. The method for efficiently allocating tasks to a multi-core processor according to claim 1, characterized in that: The step S500 includes: S501, evaluate the system performance improvement after migration, collect user feedback and system operation data, and analyze the migration effect; S502, dynamically adjusting the task allocation and migration strategy according to the evaluation results, and optimizing the migration cost evaluation model and the task allocation algorithm; S503, establish a long-term monitoring system to continuously monitor the operating status and task execution of the multi-core processor, and promptly discover and handle potential problems.
9. The method for efficiently allocating tasks to a multi-core processor according to claim 8, characterized in that: The step S502 uses an optimization algorithm to optimize the migration cost evaluation model, and the calculation formula for the optimization is: Where: θ t+1 is the updated model parameter, θ t is the current model parameter, η is the learning rate, which controls the step size of parameter update, In the current dataset D t The gradient of the loss function L with respect to the model parameter θ, λ is the weight factor, Δθ hist It is the model parameter adjustment amount calculated based on the feedback results.
Citation Information
Cited By
Process scheduling method, system and equipment based on heterogeneous multi-core processor
CN119415276A
Dynamic adjustable multi-core cooperation mechanism and power consumption optimization method and system based on RISC-V architecture
CN120066892A
Task migration method, electronic equipment, storage medium and program product
CN120929225A
Vehicle starting control system based on iris recognition technology
CN122379470A