Real-time multiprocessor scheduling method based on boundary proportional fair optimization
By using the PD2 algorithm based on boundary proportional fairness optimization, the context switching overhead of multiprocessor systems is reduced, and the system utilization and scheduling efficiency are improved, making it suitable for industrial control scenarios.
Patent Information
- Application Number
- CN202511386428.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-26
- Publication Date
- 2026-01-06
AI Technical Summary
Existing multiprocessor systems face challenges in balancing high utilization and low latency. The PFair algorithm has high overhead, GlobalEDF utilization is limited, and Partitioned EDF faces binning issues.
The PD2 algorithm based on boundary proportional fairness optimization is adopted. By constructing pseudo-deadline time dijk, successor bit bbit and group deadline time gdl, combined with early release rules and bit-level optimization, it is integrated into the SchedCAT scheduling framework. By controlling time jitter through a balanced binary tree structure and a high-precision clock source, a dynamic scheduler is realized to optimize task migration paths.
By optimizing the PD2 algorithm, the context switching overhead was reduced, achieving a 18-22% reduction in context switching and 100% utilization on heterogeneous platforms, making it suitable for industrial control scenarios.
Smart Images

Figure CN121277692A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of real-time operating system technology, specifically for real-time task scheduling systems in multiprocessor environments (such as cloud computing servers and embedded systems), and is particularly suitable for industrial control scenarios that require high utilization and low overhead. Background Technology
[0002] While the existing PFair scheduling algorithm is theoretically optimal, it suffers from high context switching overhead and implementation complexity; GlobalEDF is limited by the Dhall effect (utilization of approximately 50%), and Partitioned EDF faces binning problems. These issues prevent multiprocessor systems from simultaneously achieving high utilization and low latency. Summary of the Invention
[0003] In view of the defects and shortcomings of the prior art, the present invention aims to provide a real-time multiprocessor scheduling method based on boundary ratio fairness optimization, so as to reduce the overhead of the PFair algorithm and improve its practicality.
[0004] A real-time multiprocessor scheduling method based on boundary proportional fairness optimization includes the following steps:
[0005] Construct the priority tuple structure for the PD2 algorithm, including the pseudo-deadline d. ijk The successor bit and the group deadline (gdl);
[0006] Reduce context switching overhead through early release rules and bit-level optimizations to generate dynamic scheduling decisions;
[0007] An optimization algorithm is integrated into the SchedCAT scheduling framework to implement a quantum scheduler.
[0008] The pseudo-cutoff time d ijk For: based on the task arrival time a ij and execution requirements u i Through formula Define the time constraints for each subtask;
[0009] The successor bit identifier is generated using a boundary detection algorithm to generate a binary status flag of 0 or 1, where 0 indicates idle and 1 indicates non-idle.
[0010] The group deadline arbitration GDL is used to resolve execution conflicts by calculating the GDL value when multiple subtask windows overlap.
[0011] The dynamic scheduling decision includes: determining whether a given number of processors can fairly execute a given task and output True or False, and controlling the switching of the task arbitration mechanism.
[0012] The switching of the task arbitration mechanism is as follows:
[0013] When bbit=1 and a window conflict is detected, initiate the group deadline GDL arbitration process to obtain the task execution strategy;
[0014] Otherwise, use a pseudo-deadline time d. ijk Sort tasks and generate task execution decisions.
[0015] The pseudo-cutoff time d is adopted ijk In the sorting task, the early release rule determines whether to execute early release, which is used to allow waiting tasks to be released and executed ahead of time.
[0016] The early release rule is based on the simultaneous fulfillment of the following three conditions:
[0017] Remaining idle time check, processor idle state detection, and priority conflict avoidance.
[0018] The integration of the optimization algorithm into the SchedCAT scheduling framework includes:
[0019] A balanced binary tree structure is used to maintain a dynamic subtask queue in logarithmic time complexity;
[0020] The task execution time is adjusted by controlling the time jitter to be less than 5 microseconds using a high-precision clock source.
[0021] Real-time monitoring of CPU cache status and dynamic optimization of task migration paths based on processor affinity.
[0022] Advantages and beneficial effects of the present invention:
[0023] 1. PD2 algorithm optimization: Introduce early release rules (such as remaining free time check) and bit-level bbit / gdl calculation to reduce priority comparison complexity.
[0024] 2. System Integration: Implement an open-source scheduler within the SchedCAT framework, supporting quantum scheduling and cache-aware task migration.
[0025] 3. Empirical Optimization: Analyze quantum size configurations through x86 / ARM platforms to balance overhead and schedulability.
[0026] 4. This invention can reduce context switching by 18-22%, achieve schedulability at 100% utilization, and is compatible with heterogeneous platforms, such as Jetson AGX Xavier with a power consumption of 18.7 mJ / task. Attached Figure Description
[0027] Figure 1 This is a schematic diagram illustrating the scheduling timing example of the PD2 algorithm.
[0028] Figure 2 A schematic diagram of a proportional fairness window.
[0029] Figure 3 This is a flowchart of the real-time task scheduling process.
[0030] Figure 4 This is the technical path of the method of the present invention. Detailed Implementation
[0031] To make the above-mentioned objects, features, and advantages of the present invention more apparent and understandable, the specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings. Many specific details are set forth in the following description to provide a thorough understanding of the present invention. However, the present invention can be implemented in many other ways different from those described herein, and those skilled in the art can make similar modifications without departing from the spirit of the invention. Therefore, the present invention is not limited to the specific embodiments disclosed below.
[0032] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains. The terminology used herein in the description of the invention is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention.
[0033] Step 1: Construct the PD2 priority tuple;
[0034] This step is the calculation stage for the core scheduling parameters:
[0035] a. Pseudo-deadline calculation: Based on the task arrival time a ij and execution requirements u i Through formula Precisely determine the time constraints for each subtask;
[0036] b. Successor identifier generation: using a boundary detection algorithm. Generate binary status flags (0 / 1);
[0037] c. Group Deadline Arbitration: When multiple subtask windows overlap, the GDL value is calculated to resolve execution conflicts;
[0038] The tuples generated in this stage (d) ijk The bbit value (bbit, gdl) provides a basis for decision-making in subsequent dynamic scheduling, where the bbit value directly affects the branch selection in step 2.
[0039] Figure 1 Showcasing PD 2 The task scheduling sequence of the algorithm demonstrates how the early release rule reduces idle time; Figure 2This demonstrates the priority arbitration mechanism of bbit and gdl parameters in window conflicts, showcasing the optimization effect of early release.
[0040] Step 2: Dynamic scheduling decision;
[0041] Intelligent scheduling is achieved based on the tuple parameters from step 1:
[0042] 2.1 Priority Arbitration Mechanism:
[0043] When bbit=1 and a window conflict is detected, initiate the group deadline (GDL) arbitration process.
[0044] By default, a pseudo deadline (d) is used directly. ijk Ranking decisions;
[0045] 2.2 Early Release Execution: Triggered when three conditions are met simultaneously, it will decisively release waiting tasks and allow them to execute ahead of schedule.
[0046] Remaining idle time > 0 (ensuring time limit safety);
[0047] There is an idle processor (resource availability verification);
[0048] No high-priority task conflicts (preventing preemption chain blocking);
[0049] In summary, the bit value acts as a "window conflict detector," directly controlling the switching of the arbitration mechanism. The decision result is output to the task queue in step 3.
[0050] Step 3: Integration with the SchedCAT framework (embedding the optimization algorithm into an industrial-grade scheduling framework):
[0051] Red-black tree management: A balanced binary tree structure is used to maintain a dynamic subtask queue in logarithmic time complexity;
[0052] Quantum scheduler implementation: Time jitter is controlled to be less than 5 microseconds through a high-precision clock source (HRT);
[0053] Cache-aware strategy: Real-time monitoring of CPU cache status and dynamic optimization of task migration paths based on processor affinity (set_cpu_affinity);
[0054] Tasks that are released early are preferentially inserted into the red-black tree queue, and the quantum scheduler executes them according to the optimized path.
[0055] Step 4: Platform verification and parameter tuning;
[0056] Configure quantum size (e.g., Q=1) on x86 / ARM platform and analyze context switching and migration frequency through experiments (Section VI.B).
[0057] Example of scheduling execution process:
[0058] When three periodic tasks (created in the code as SporadicTask(2,3), representing tasks that come every 3 time units and require 2 time units of execution) enter the system, the system calculates a tuple for each task containing information such as "latest completion time" and "urgency level label". Each task is then assigned an identifier.
[0059] The system's early release rules continuously monitor CPU core status. As long as conditions such as having idle CPU cores and not affecting high-priority tasks are met, waiting tasks will be promptly released for execution, thereby significantly reducing "CPU idle waste".
[0060] The optimized SchedCAT framework uses an efficient data structure (red-black tree) to quickly find the highest priority task and uses a quantum scheduler to control the time slice of each task, keeping the time error within 5 microseconds and ensuring that all tasks pass smoothly and on time.
[0061] Finally, the system was tested on a real x86 / ARM platform. The experimental results are as follows:
[0062] When 10 CPU cores were provided, the system successfully scheduled all three tasks, outputting True. This indicates that the CPU scheduling system functions perfectly when resources are plentiful.
[0063] When only one CPU core is provided, the system accurately determines that it cannot meet the deadline requirements of all tasks and outputs False. This proves that the system can not only schedule efficiently, but also intelligently identify extreme situations and never make incorrect judgments, which is crucial for safety-critical fields such as autonomous driving and industrial control.
[0064] like Figure 3 As shown, this invention constructs a complete system from intelligent preprocessing -> dynamic decision-making -> efficient execution -> accurate verification through four steps as described in the patent. Specifically, step 1, tuple optimization (bit-level computation), reduces priority comparison overhead, directly lowering the complexity of scheduling decisions. Step 2, the early release rule, compresses the subtask execution window by reducing idle time, thereby reducing some unnecessary context switching. Step 3, the cache-aware strategy (through processor affinity), reduces cache invalidation caused by task migration, thus indirectly reducing the actual overhead of context switching.
[0065] like Figure 4The diagram illustrates the technical path of this invention. At the top level, algorithm optimization improves scheduling decisions by refining PD2 rules and computation methods; the intermediate system integration embeds the optimization algorithm into a professional framework and manages tasks using efficient data structures; and the bottom-level platform verification ensures practical effectiveness by fine-tuning parameters on x86 / ARM hardware. These three interconnected technologies work together to achieve the goal of reducing scheduling overhead by 22% while maintaining 100% scheduling efficiency.
[0066] The above description, in conjunction with specific preferred embodiments, provides a further detailed explanation of the present invention and should not be construed as limiting the specific implementation of the invention to these embodiments. Several simple deductions or substitutions can be made without departing from the concept of the present invention, and all such modifications and substitutions should be considered within the scope of protection of the present invention.
Claims
1. A real-time multiprocessor scheduling method based on boundary proportional fair optimization, characterized in that, The method comprises the following steps: Constructing a priority tuple structure for the PD2 algorithm, including a pseudo-deadline d ijk , a successor bit bbit, and a group deadline gdl; Reducing context switch overhead by early release rule and bit level optimization, generating dynamic scheduling decision; Integrating optimization algorithm into SchedCAT scheduling framework, realizing quantum scheduler.
2. The real-time multiprocessor scheduling method based on boundary proportional fair optimization according to claim 1, characterized in that, The pseudo-cut-off time d ijk is: according to the task arrival time a ij And the execution demand u i , the timeliness constraint of each subtask is determined by the formula ; The successor bit bbit identifies generating binary state mark 0 or 1 by using boundary detection algorithm, 0 represents idle, and 1 represents non-idle; The group deadline arbitration gdl is used for solving execution conflict by calculating gdl value when multiple sub-task windows overlap.
3. The real-time multiprocessor scheduling method based on boundary proportional fair optimization of claim 1, wherein, The dynamic scheduling decision comprises: judging whether a given number of processors can execute a given task output True or False, and controlling the switching of task arbitration mechanism.
4. The real-time multiprocessor scheduling method based on boundary proportional fair optimization according to claim 3, characterized in that, The switching of the task arbitration mechanism is: When bbit=1 and window conflict is detected, starting group deadline gdl arbitration process to obtain task execution strategy; Otherwise, the pseudo deadline d is used ijk The ranking task generates the task execution decision.
5. The real-time multiprocessor scheduling method based on boundary proportional fair optimization according to claim 4, characterized in that, The pseudo cut-off time d ijk In the sorting task, according to the early release rule, it is judged whether to execute the early release execution, which is used for releasing the waiting task and executing in advance.
6. The real-time multiprocessor scheduling method based on boundary proportional fair optimization according to claim 5, characterized in that, The early release rule satisfies the following three conditions simultaneously: Residual idle time check, processor idle state detection and priority conflict avoidance.
7. The real-time multiprocessor scheduling method based on boundary proportional fair optimization of claim 1, wherein, The integration of the optimization algorithm into the SchedCAT scheduling framework comprises: Balanced binary tree structure is used to maintain dynamic sub-task queue with logarithmic time complexity; Time jitter is controlled to be less than 5 microseconds by using high-precision clock source to adjust task execution time; CPU cache state is monitored in real time, and task migration path is dynamically optimized based on processor affinity.
