Task scheduling method, task scheduling system, electronic equipment, computer readable storage medium and computer program product

By combining the eBPF program and the reinforcement learning module, fine-grained data acquisition and dynamic scheduling information generation at the kernel level are achieved, solving the problems of low resource utilization and insufficient adaptability in existing task scheduling schemes, and improving the system's resource utilization and task execution efficiency.

CN122019196AActive Publication Date: 2026-05-12CHINA MOBILE (SUZHOU) SOFTWARE TECH CO LTD +1
View PDF 5 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
CHINA MOBILE (SUZHOU) SOFTWARE TECH CO LTD
Filing Date
2026-04-14
Publication Date
2026-05-12

AI Technical Summary

Technical Problem

Existing task scheduling schemes are inadequate in terms of resource utilization, responsiveness, and adaptability, especially in terms of effective scheduling under dynamic load changes and complex and ever-changing system conditions.

Method used

The eBPF program collects fine-grained system operation data at the kernel level and generates scheduling information in conjunction with the reinforcement learning module. The eBPF MAP is then fed back to the kernel scheduler for resource allocation, thereby achieving dynamic adaptive scheduling.

Benefits of technology

It significantly reduces system overhead, improves resource utilization and task execution efficiency, reduces the subjectivity and high maintenance costs of manual rule setting, and adapts to real-time data changes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122019196A_ABST
    Figure CN122019196A_ABST
Patent Text Reader

Abstract

The invention provides a task scheduling method, a task scheduling system, electronic equipment, a computer program product and a computer readable storage medium. The method comprises the steps that an eBPF program is called, and system operation data are collected on a first system kernel layer; wherein the system operation data is fine-grained data; calling a reinforcement learning module, analyzing the system operation data, and generating scheduling information of the first task; wherein the first tasks are a plurality of to-be-operated tasks in the first system; storing the scheduling information in an eBPF MAP, so that a kernel scheduler performs resource allocation on the first task based on the scheduling information read from the eBPF MAP; according to the method and the device, dynamic self-adaptive scheduling of the tasks can be realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to computer technology, and more particularly to a task scheduling method, a task scheduling system, an electronic device, a computer-readable storage medium, and a computer program product. Background Technology

[0002] In current computing systems, task scheduling is one of the key factors affecting system performance. Related scheduling techniques mainly employ static priority scheduling schemes, rule-based heuristic scheduling schemes, supervised learning-based intelligent scheduling schemes, or cluster scheduling schemes.

[0003] However, in static priority scheduling schemes, because priorities are statically preset, the scheduler cannot perceive changes in system load during runtime. This may result in high-priority tasks occupying resources even when idle, while low-priority tasks wait for extended periods, leading to low system resource utilization and uneven response. Rule-based heuristic scheduling schemes heavily rely on the accuracy of expert knowledge and lack adaptability in the face of dynamically changing workloads. Rules may quickly become invalid, making it difficult to cope with complex and ever-changing system states. Intelligent scheduling schemes based on supervised learning have high training costs, the models are often complex and poorly interpretable, and integrating them into stable production systems is complex and carries certain performance risks. Cluster scheduling schemes have weak real-time, fine-grained perception of node resource utilization, relatively long scheduling cycles, and cannot quickly respond to load changes at the second or even millisecond level. Furthermore, they do not adequately consider the interrelationships between tasks that require close collaboration. Summary of the Invention

[0004] This application provides a task scheduling method, a task scheduling system, an electronic device, a computer-readable storage medium, and a computer program product. Through this application, dynamic adaptive scheduling of tasks can be achieved.

[0005] The technical solution of this application embodiment is implemented as follows: This application provides a task scheduling method, the task scheduling method including: The eBPF program is invoked to collect system operation data at the first system kernel level; wherein, the system operation data is fine-grained data. The reinforcement learning module is invoked to analyze the system's operational data and generate scheduling information for the first task; wherein, the first task is one of multiple tasks to be run in the first system. The scheduling information is stored in the eBPF MAP so that the kernel scheduler can allocate resources to the first task based on the scheduling information read from the eBPF MAP.

[0006] This application provides a task scheduling system, the task scheduling system comprising: The eBPF program is used to collect system runtime data at the first system kernel level; wherein the system runtime data is fine-grained data. The reinforcement learning module is used to analyze the system's operational data and generate scheduling information for a first task; wherein, the first task is one of multiple tasks to be run in the first system. The processing module is used to store the scheduling information into the eBPF MAP, so that the kernel scheduler can allocate resources to the first task based on the scheduling information read from the eBPF MAP.

[0007] This application provides an electronic device, which includes: a memory for storing computer-executable instructions or computer programs; and a processor for executing the computer-executable instructions or computer programs stored in the memory to implement the task scheduling method provided in this application.

[0008] This application provides a computer-readable storage medium storing a computer program or computer-executable instructions, which, when executed by a processor, implements the task scheduling method provided in this application.

[0009] This application provides a computer program product, including a computer program or computer executable instructions. When the computer program or computer executable instructions are executed by a processor, they implement the task scheduling method provided in this application.

[0010] The embodiments of this application have the following beneficial effects: This application realizes kernel-level fine-grained data acquisition through eBPF, and automatically generates task scheduling information by combining reinforcement learning, which significantly reduces system overhead, avoids the subjectivity and high maintenance cost of manual rule setting, and solves the problems of difficulty in obtaining labeled data and long training cycle required for supervised learning; at the same time, the task scheduling method of this application has dynamic adaptive scheduling capability, that is, it can improve resource utilization and task execution efficiency based on the data collected in real time. Attached Figure Description

[0011] Figure 1 This is a flowchart illustrating the task scheduling method provided in an embodiment of this application; Figure 2 This is a flowchart of the task scheduling method provided in the embodiments of this application; Figure 3 This is a schematic diagram of the task scheduling system architecture provided in the embodiments of this application; Figure 4 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application.

[0012] It should be noted that the terms "first" and "second" mentioned above are only used to distinguish between different options and do not represent the degree of superiority or inferiority of the options or their priority in the implementation process. Detailed Implementation

[0013] To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings. The described embodiments should not be regarded as limitations on this application. All other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0014] The terms "first," "second," etc., used in this application are used to distinguish different objects, not to describe a specific order. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or apparatuses.

[0015] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.

[0016] Before explaining this application, the following description is provided regarding task scheduling schemes in related technologies: Static priority scheduling is one of the most basic scheduling strategies in operating systems. It makes decisions based on the fixed priorities that are pre-assigned to tasks, always selecting the task with the highest priority to run. Its greatest advantage is that it is simple to implement and has strong determinism.

[0017] Rule-based heuristic scheduling schemes heavily rely on the experience of system administrators. They guide scheduling by manually defining a series of "if-then" rules, such as prioritizing specific types of tasks, extrapolating from historical execution times, or reserving resources for tasks with high resource demands. Their advantage lies in the intuitiveness, ease of understanding, and rapid implementation of these rules.

[0018] Intelligent scheduling schemes based on supervised learning are a newly emerging direction in intelligent scheduling in recent years. They rely on a large amount of labeled data through supervised learning. Their potential lies in their ability to discover optimization strategies that are difficult for the human brain to design intuitively, so as to adapt to dynamic environments.

[0019] In cluster scheduling schemes, the scheduler is primarily used in containerized environments to allocate appropriate computing nodes to workloads across the cluster. Its decisions are mainly based on user-declared resource requests (such as requests and limits for Central Processing Units (CPUs) and memory). Its advantage lies in enabling automated deployment and resource management for large-scale applications.

[0020] Embodiments of this application provide a task scheduling method applied to an electronic device, with reference to... Figure 1 As shown, the method includes the following steps: Step 101: Call the eBPF program to collect system operation data at the first system kernel level.

[0021] Among them, the system operation data is fine-grained data.

[0022] In this embodiment, the Extended Berkeley PacketFilter (eBPF) program is a technology that allows user-written programs to run within the Linux kernel without modifying kernel code or loading kernel modules. Simply put, eBPF makes the Linux kernel programmable. An eBPF program is an event-driven model that provides various hook points. eBPF consists of three main parts: an instruction set for the program, memory objects for data storage and user-kernel space interaction, and helper functions for extending eBPF functionality. eBPF is event-based; in other words, the program executes when specific events occur. These events, called hooks, can be of various types, including tracepoints, kernel probes (kprobes), and perf events.

[0023] In this embodiment, the eBPF program can be a program configured in a task scheduling system; the task scheduling system is used to schedule running tasks or services in the system.

[0024] In this embodiment, the system kernel is responsible for managing key functions such as hardware resources, process scheduling, memory allocation, file system, and network communication, including the main kernel, slave kernel, and microkernel.

[0025] In this application embodiment, the first system includes, but is not limited to, Linux operating system (Ubuntu operating system, CentOS operating system), Unix operating system, Windows operating system, macOS operating system, Android operating system and iOS operating system.

[0026] In this embodiment of the application, the system operation data includes, but is not limited to, CPU usage, latency, run queue length, input / output (I / O) wait, page fault, memory pressure, and run queue length for each task.

[0027] Here, the system operation data is related to the first task, and is the resource data occupied, called, or required by the first task in the system.

[0028] In this application embodiment, fine-grained data, also known as fine-grained operational data, refers to high-precision, multi-dimensional real-time monitoring and recording of the underlying operations and resource usage of a system, application, or service. It can delve into the level of individual requests, transactions, or events, providing detailed evidence for performance analysis, troubleshooting, and security auditing. This data transcends macro-level indicators in related technologies, instead capturing more subtle behavioral patterns, such as the response time of a single API call, the execution path of a database query, and the transmission latency of network data packets. It is a core support for achieving observability and refined operation and maintenance.

[0029] Step 102: Call the reinforcement learning module to analyze the system operation data and generate the scheduling information for the first task.

[0030] The first task consists of multiple tasks to be run in the first system.

[0031] In this embodiment of the application, the reinforcement learning module can be a module configured in the task scheduling system; the reinforcement learning module in the task scheduling system works in conjunction with the eBPF program.

[0032] In this embodiment, reinforcement learning (RL) is an important branch of machine learning. Its core lies in the agent learning the optimal decision-making strategy based on the reward signals obtained through continuous interaction with the environment, in order to maximize long-term cumulative reward. Unlike other machine learning paradigms, reinforcement learning does not require pre-labeled data but relies on trial-and-error mechanisms and delayed feedback for learning, and it needs to balance the trade-off between exploration and exploitation. The main algorithm types of reinforcement learning are as follows: Value-based approaches indirectly find the optimal policy by learning and updating a value function (such as the Q-value function Q(s,a)). Policy-based approaches: directly learn and optimize policy functions, rather than learning value functions first; The Actor-Critic approach combines value-based and policy-based methods. Actors are responsible for selecting actions based on the policy, while critics evaluate the value of the actions (e.g., the advantage function) and guide the actors' updates. Model-based approaches: Agents attempt to learn a dynamic model of the environment (state transition probabilities and reward functions), and then use this model for planning or policy optimization.

[0033] In this embodiment, the reinforcement learning module receives raw data of system information collected from eBPF without manual pre-labeling. It automatically analyzes task behavior patterns through reinforcement learning algorithms and provides a basis for scheduling decisions.

[0034] In this embodiment of the application, the scheduling information of the first task includes the label and priority score required by the first task scheduling strategy.

[0035] Step 103: Store the scheduling information in the eBPF MAP so that the kernel scheduler can allocate resources for the first task based on the scheduling information read from the eBPF MAP.

[0036] In this embodiment, the eBPF map is a general data structure that stores different types of data and provides functions such as user-mode and kernel-mode data interaction, data storage, and data sharing among multiple programs.

[0037] In this embodiment of the application, the execution subject of step 103 can be the processing module of the task scheduling system or the reinforcement learning module. That is, after the reinforcement learning module generates scheduling information, it sends, transmits or shares the scheduling information to the eBPF program.

[0038] This application provides a task scheduling method. The method includes: calling an eBPF program to collect system operation data at the kernel level of a first system; wherein the system operation data is fine-grained data; calling a reinforcement learning module to analyze the system operation data and generate scheduling information for a first task; wherein the first task is multiple tasks to be run in the first system; storing the scheduling information in an eBPF MAP so that the kernel scheduler can allocate resources to the first task based on the scheduling information read from the eBPF MAP. In other words, this application achieves kernel-level fine-grained data collection through eBPF and automatically generates task scheduling information by combining reinforcement learning, which significantly reduces system overhead, avoids the subjectivity and high maintenance costs of manual rule setting, and solves the problems of difficulty in obtaining labeled data and long training cycles required for supervised learning. At the same time, the task scheduling method of this application has dynamic adaptive scheduling capability, that is, it can improve resource utilization and task execution efficiency based on the data collected in real time.

[0039] The security verification mechanism inherent in eBPF and the adaptability of reinforcement learning in this application ensure that the solution can be deployed securely without modifying the kernel source code or restarting the system. It is also applicable to various heterogeneous environments such as cloud computing and edge computing. For example, the task scheduling method provided in this application can be applied to the virtual machine migration process. By using eBPF technology and reinforcement learning, adaptive scheduling without human intervention can be achieved, thereby introducing an intelligent closed loop of perception, analysis and decision-making into the operating system kernel and improving the efficiency and performance of the system.

[0040] In some embodiments, the analysis of the system operation data in step 102 to generate the scheduling information for the first task can be achieved through the following steps: Step A1: Process (convert) the system running data into a state vector.

[0041] In this embodiment of the application, the state vector is a vector representation of the system state, which is a column vector composed of the system's state variables at a specific moment.

[0042] Step A2: Train the first strategy using the state vector to obtain the second strategy.

[0043] The second strategy is used to determine the scheduling information for the first task; a reward function is used to determine whether the second strategy meets a predetermined standard.

[0044] In this embodiment, the reward function can be based on reducing latency and increasing throughput as rewards, combined with fairness and starvation penalties.

[0045] In the embodiments of this application, the first strategy includes, but is not limited to, actor-critic strategy (e.g., proximal policy optimization with KL pruning (PPO)), or alternative soft actor-critic algorithm (SAC), twin-delayed deep-deterministic policy gradient (TD3), and constrained policy optimization.

[0046] Here, Actor-Critic is a commonly used framework in reinforcement learning. In this framework, the Actor is responsible for outputting the current action to be performed, and the Critic is responsible for estimating the value of the current action or the value of the current state. Typically, there is one Actor and one Critic, and the parameters of both are updated simultaneously according to the reinforcement learning algorithm used to train an excellent reinforcement learning agent.

[0047] In this embodiment of the application, the second strategy is the trained first strategy.

[0048] In this embodiment, the training process can be constrained using a security layer or a Lagrange penalty term. Training uses the same state vector (CPU, I / O, latency, run queue length, etc.), but the reward function now reflects peer fairness and cross-level suppression: Reward = -α High-priority tasks are delayed, and / or, Reward = +β Low-priority task throughput, and / or, Reward = -γ Hunger penalty, and / or, Reward = -δ Shock punishment.

[0049] Step A3: Based on the second strategy, determine the scheduling information of the first task.

[0050] In this embodiment of the application, a lightweight inference model is generated based on the second strategy; the state vector is input into the lightweight inference model to obtain the scheduling information of the first task.

[0051] In this embodiment of the application, the strategy is converted into a very small model or table through distillation technology to achieve the mapping from state to priority.

[0052] In some embodiments, the scheme to be protected by this application further includes: Determine a preset first parameter; based on the first parameter, determine the scheduling information for the first task.

[0053] In this embodiment of the application, the first parameter is a preset scheduling parameter. In some scenarios, the scheduling parameters of the first task can be determined directly based on the first parameter; or the scheduling parameters of the first task can be determined directly based on system operation data; or the scheduling parameters of the first task can be determined jointly based on the first parameter and system operation data.

[0054] In some embodiments, the eBPF program is inserted into one or more of the following: a first system kernel tracepoint; a first system kernel hook. This application inserts the eBPF program into scheduler tracepoints (such as sched_switch and sched_wakeup) and control group (cgroups) hooks to collect statistics on CPU usage, latency, run queue length, I / O wait, page faults, memory pressure, etc., for each task.

[0055] In this application, cgroups is a mechanism provided by the Linux kernel for limiting, isolating, auditing, and prioritizing the system resources (such as CPU, memory, disk input / output, I / O, network, etc.) required by a group of processes and their future child processes. Its fundamental goal is to allow administrators to group tasks (processes) running on the system and allocate and limit resources for each group. This ensures that different users, applications, or services do not interfere with each other, providing stable resource guarantees for critical applications; the control granularity can be very fine, allowing for precise statistics on the historical resource usage of each group, facilitating billing and performance analysis.

[0056] In some embodiments, the eBPF program employs a just-in-time (JIT) compiler; the eBPF virtual machine execution code in this application has been verified to ensure security, and its JIT compiler can provide near-native code execution efficiency, with the acquisition process itself having minimal impact on system performance.

[0057] In some embodiments, system runtime data is passed to user space via the kernel-shared data or performance event ring buffer of the eBPF MAP for use by the reinforcement learning module.

[0058] In some embodiments, the scheduling information of the first task includes the priority of the first task.

[0059] Here, tasks with the same priority are scheduled fairly.

[0060] Here, the first tasks with different priorities correspond to different Completely Fair Scheduler (CFS) weights, meaning that this application can dynamically adjust the CFS weights corresponding to different priorities.

[0061] Here, each priority corresponds to a separate run queue, meaning that an independent run queue is created for each priority.

[0062] Here, the first priority task is configured with a weight ratio to preempt or suppress the resources of the second priority task; where the first priority is higher than the second priority, such as the high priority task preempting or suppressing the CPU time of the low priority task according to the configurable weight ratio.

[0063] This application combines eBPF technology with reinforcement learning algorithms to construct an intelligent task scheduling system. eBPF is responsible for safely, efficiently, and with low overhead collecting fine-grained data on system runtime (such as task execution characteristics and resource usage) at the kernel level, while reinforcement learning analyzes, trains, and infers from this data, automatically discovers task execution patterns, generates labels and priority scores required for scheduling strategies, and finally feeds them back to the kernel scheduler through the eBPF mechanism to achieve dynamic and adaptive resource allocation.

[0064] Its core architecture and workflow are as follows Figure 2 As shown, it illustrates the collaborative working process of the three core modules of eBPF: data acquisition, reinforcement learning training and inference, and dynamic scheduling execution. Figure 2 As shown, eBPF obtains loadinfo and system information (Sysinfo) from the kernel; the reinforcement learning agent (RL agent) is trained based on the loadinfo / Sysinfo to obtain actions; the reinforcement learning module combines the actions and the corresponding states based on the loadinfo / Sysinfo to determine the priority; this priority satisfies constraints; or it is determined based on a preset policy; the priority is applied to the kernel scheduler based on the eBPF mechanism.

[0065] Design and implementation of the eBPF data acquisition module: eBPF technology allows us to safely load custom programs into the kernel for execution without modifying the kernel source code or restarting the system. This module leverages this feature of eBPF to attach hooks to critical paths in the kernel, capturing various fine-grained metrics during task execution in real time. It collects signals from the kernel scheduler and system in real time with low overhead for use by the RL model. The design concept is as follows: 1) Data collection: Insert eBPF programs into scheduler tracepoints (such as sched_switch, sched_wakeup) and cgroups hooks to collect statistics on CPU usage, latency, run queue length, I / O wait, page faults, memory pressure, etc. for each task.

[0066] 2) Low-overhead implementation: The eBPF virtual machine executes code that has been verified to ensure security, and its Just-In-Time (JIT) compiler can provide near-native code execution efficiency. The acquisition process itself has minimal impact on system performance.

[0067] 3) Data transfer: The collected data is transferred to the user space in real time through the eBPF map (Map), a high-efficiency kernel-user space shared data or performance event (perf-event) ring buffer, for use by the analysis module.

[0068] Design and implementation of reinforcement learning algorithm training and inference: This module receives raw system information data collected from eBPF without manual pre-labeling. It automatically analyzes task behavior patterns using reinforcement learning algorithms and provides a basis for scheduling decisions. The module is designed in two parts: training and inference, as detailed below: 1) Training: First, the data collected by the eBPF data acquisition module is processed into a state vector. Train an actor-critic policy (e.g., Proximal Policy Optimization with KL pruning (PPO)), or alternatives such as Soft Actor-Critic (SAC), Twin Delayed Deep Deterministic Policy Gradient (TD3), constrained policy optimization, etc. Rewards are a combination of latency reduction, throughput improvement, fairness, jitter / starvation penalties, etc. Constraints are implemented through a safety layer or Lagrange penalty. Training uses the same state vector (CPU, I / O, latency, run queue length, etc.), but the reward function now reflects peer fairness and cross-level suppression: Reward = -α High-priority tasks are delayed, and / or, Reward = +β Low-priority task throughput, and / or, Reward = -γ Hunger penalty, and / or, Reward = -δ Shock punishment.

[0069] 2) Reasoning: Through distillation techniques, the strategy is transformed into a very small model or table to achieve the mapping from state to priority.

[0070] Regarding the synergy between eBPF and reinforcement learning: The relationship between eBPF and reinforcement learning is the core of this solution. eBPF acts as the sensory organ, responsible for continuously collecting data; the reinforcement learning model is the brain, responsible for analyzing data and making decisions; the decision results ultimately influence system behavior through the eBPF, the execution organ. The kernel scheduler reads the priority level of each task from the eBPF map and executes the rules: Same priority: Fair scheduling is performed within this group using the standard Completely Fair Scheduler (CFS).

[0071] Different priorities: High-priority tasks preempt or suppress the CPU time of low-priority tasks according to a configurable weight ratio. This can be achieved by creating an independent run queue for each priority level or by dynamically adjusting the CFS weight.

[0072] This application allows for maintaining CFS fairness within the same level while enabling predictable dominance and suppression across levels. Through this close collaboration, the system forms a closed-loop optimization system from data acquisition, algorithm training and inference, to policy execution, which can adaptively cope with various complex load scenarios, thereby achieving efficient and intelligent task scheduling.

[0073] This application proposes an RL intelligent task scheduling method and device based on eBPF. It utilizes the high efficiency and programmability of eBPF at the kernel layer to collect task running status and resource usage data in real time. Combined with reinforcement learning intelligent scheduling strategy, it dynamically optimizes the core allocation and resource configuration of tasks. Through data acquisition module, RL algorithm training and inference module, and policy execution module, a closed-loop scheduling system is formed, which can improve system operating efficiency and resource utilization. It is suitable for scenarios such as server clusters and cloud computing platforms, and has the characteristics of being lightweight, real-time, and low-intrusion.

[0074] This application can directly reduce the hardware procurement and maintenance costs of data centers and cloud computing platforms by improving resource utilization and task execution efficiency. Increased resource utilization reduces server demand, and its automation and adaptive features reduce the need for manual intervention in the maintenance process, thus lowering labor costs. In terms of energy efficiency optimization, intelligent resource allocation helps reduce system power consumption, aligning with the trend of green computing and bringing environmental benefits and electricity savings to enterprises. Its high versatility makes it suitable for various high-value business scenarios such as financial transactions, real-time analysis, and intelligent video processing, helping enterprises enhance their market competitiveness while improving service quality, reducing latency, and increasing throughput. In addition, this application can be implemented as software, with flexible deployment and low marginal cost. It can be used by cloud computing technology providers, companies providing services using the Linux operating system, operating system development departments, kernel development departments, or provided to cloud host customers, thus having a wide range of applications.

[0075] Embodiments of this application provide a task scheduling system that can be used to implement... Figure 1 A corresponding embodiment provides a task scheduling method, referring to... Figure 3 As shown, the task scheduling system 300 includes: eBPF program 301 is used to collect system runtime data at the first system kernel level; the system runtime data is fine-grained data. The reinforcement learning module 302 is used to analyze system operation data and generate scheduling information for the first task; wherein the first task is multiple tasks to be run in the first system. Processing module 303 (or reinforcement learning module 302) is used to store scheduling information into eBPF MAP so that the kernel scheduler can allocate resources to the first task based on the scheduling information read from eBPF MAP.

[0076] In other embodiments of this application, reinforcement learning module 302 is used to process system operation data into a state vector; The reinforcement learning module 302 is used to train a first policy using a state vector to obtain a second policy; wherein the second policy is used to decide the scheduling information of the first task; and the reward function is used to determine whether the second policy meets the predetermined criteria. Reinforcement learning module 302 is used to determine the scheduling information of the first task based on the second policy.

[0077] In other embodiments of this application, reinforcement learning module 302 is used to generate a lightweight inference model based on a second strategy; The reinforcement learning module 302 is used to input the state vector into the lightweight inference model and obtain the scheduling information of the first task.

[0078] In other embodiments of this application, the processing module 303 is used to determine a preset first parameter; and based on the first parameter, to determine the scheduling information of the first task.

[0079] In other embodiments of this application, the eBPF program is inserted into one or more of the following: a first system kernel trace point; a first system kernel hook; the eBPF program employs a just-in-time compiler; system runtime data is passed to user space via the kernel-user space shared data or performance event ring buffer of the eBPF MAP for use by the reinforcement learning module.

[0080] In other embodiments of this application, the scheduling information of the first task includes the priority of the first task; fair scheduling of first tasks with the same priority; first tasks with different priorities corresponding to different completely fair scheduler weights; one priority corresponding to one running queue; the weight ratio configured for the first priority of the first task preempting or suppressing the resources of the second priority of the first task; wherein, the first priority is higher than the second priority.

[0081] The descriptions of the above device embodiments are similar to those of the above method embodiments, and have similar beneficial effects. For technical details not disclosed in the device embodiments of this application, please refer to the descriptions of the method embodiments of this application for understanding.

[0082] It should be noted that, in the embodiments of this application, if the above-described task scheduling method is implemented as a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiments of this application, or the part that contributes to the related technology, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a terminal device to execute all or part of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, mobile hard drives, read-only memory (ROM), magnetic disks, or optical disks. Thus, the embodiments of this application are not limited to any specific hardware and software combination.

[0083] Figure 4 This is a schematic structural diagram of an electronic device provided in an embodiment of this application. The electronic device may be a task scheduling system. Figure 4 The illustrated electronic device 400 includes a processor 410, which can call and run computer programs from memory to implement the methods in the embodiments of this application.

[0084] Optionally, such as Figure 4 As shown, the electronic device 400 may further include a memory 420. The processor 410 can retrieve and run computer programs from the memory 420 to implement the methods described in the embodiments of this application.

[0085] The memory 420 can be a separate device independent of the processor 410, or it can be integrated into the processor 410.

[0086] Optionally, such as Figure 4 As shown, the electronic device 400 may also include a transceiver 430, which the processor 410 can control to communicate with other devices. Specifically, it can send information or data to other devices or receive information or data sent by other devices.

[0087] The transceiver 430 may include a transmitter and a receiver. The transceiver 430 may further include an antenna, and the number of antennas may be one or more.

[0088] Optionally, the electronic device 400 may specifically be a task scheduling system according to the embodiments of this application, and the electronic device 400 may implement the corresponding processes implemented by the task scheduling system in the various methods of the embodiments of this application. For the sake of brevity, it will not be described in detail here.

[0089] This application also provides a computer program product, including a computer program that can be executed by the processor 410 of the electronic device 400 to perform the steps described in any of the foregoing methods.

[0090] It should be understood that the processor in the embodiments of this application may be an integrated circuit chip with signal processing capabilities. In implementation, the steps of the above method embodiments can be completed by integrated logic circuits in the processor's hardware or by instructions in software form. The processor described above can be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this application can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software modules can be located in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. The storage medium is located in memory, and the processor reads information from the memory and, in conjunction with its hardware, completes the steps of the above method.

[0091] As one embodiment, the processor may include one or more general-purpose central processing units (CPUs). Each of these processors may be a single-core processor or a multi-core processor. Here, "processor" may refer to one or more devices, circuits, and / or processing cores used for processing data (e.g., executing instructions).

[0092] It is understood that the memory in the embodiments of this application can be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. The non-volatile memory can be ROM, Programmable Read-Only Memory (PROM), Erasable Programmable Read-Only Memory (EPROM), Electrically Erasable Programmable Read-Only Memory (EEPROM), or flash memory. The volatile memory can be Random Access Memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), Synchronous DRAM (SDRAM), Double Data Rate Synchronous DRAM (DDR SDRAM), Enhanced Synchronous DRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), and Direct Rambus RAM (DR RAM). It should be noted that the memory used in the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.

[0093] This application also provides a computer-readable storage medium for storing computer programs.

[0094] Optionally, the computer-readable storage medium can be applied to the task scheduling system / electronic device in the embodiments of this application, and the computer program causes the computer to execute the corresponding processes implemented by the task scheduling system / electronic device in the various methods of the embodiments of this application. For the sake of brevity, it will not be described in detail here.

[0095] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product.

[0096] A computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the flow or function according to the embodiments of this application is generated. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a server or data center that integrates one or more available media. The available media may be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., DVDs), or semiconductor media (e.g., solid-state drives (SSDs)).

[0097] The task scheduling method, task scheduling system, electronic device, computer-readable storage medium, and computer program product provided in the embodiments of 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 above embodiments are only for the purpose of helping to understand the methods and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.

[0098] It should be understood that the phrases "an embodiment," "an embodiment," "an embodiment of this application," "the foregoing embodiment," "some implementations," or "some embodiments" mentioned throughout the specification mean that a specific feature, structure, or characteristic related to the embodiment is included in at least one embodiment of this application. Therefore, the phrases "an embodiment," "an embodiment," "an embodiment of this application," "the foregoing embodiment," "some implementations," or "some embodiments" appearing throughout the specification do not necessarily refer to the same embodiment. Furthermore, these specific features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. It should be understood that in the various embodiments of this application, the sequence numbers of the above-described processes do not imply a sequential order of execution; the execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application. The sequence numbers of the above-described embodiments of this application are merely descriptive and do not represent the superiority or inferiority of the embodiments.

[0099] Unless otherwise specified, any step in the embodiments of this application performed by the task scheduling system / electronic device may be executed by the processor of the task scheduling system / electronic device. Unless otherwise specified, the embodiments of this application do not limit the order in which the task scheduling system / electronic device performs the following steps. Furthermore, the methods used to process data in different embodiments may be the same or different methods.

[0100] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods, such as: multiple units or components can be combined, or integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the various components shown or discussed can be through some interfaces, and the indirect coupling or communication connection between devices or units can be electrical, mechanical, or other forms.

[0101] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units. They may be located in one place or distributed across multiple network units. Some or all of the units may be selected to achieve the purpose of this embodiment according to actual needs.

[0102] In addition, each functional unit in the various embodiments of this application can be integrated into one processing unit, or each unit can be a separate unit, or two or more units can be integrated into one unit; the integrated unit can be implemented in hardware or in the form of hardware plus software functional units.

[0103] The methods disclosed in the several method embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments.

[0104] The features disclosed in the several product embodiments provided in this application can be arbitrarily combined without conflict to obtain new product embodiments.

[0105] The features disclosed in the several method or device embodiments provided in this application can be arbitrarily combined without conflict to obtain new method or device embodiments.

[0106] Those skilled in the art will understand that all or part of the steps of the above method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer storage medium. When the program is executed, it performs the steps of the above method embodiments. The aforementioned storage medium includes various media that can store program code, such as mobile storage devices, ROMs, magnetic disks, or optical disks.

[0107] Alternatively, if the integrated units described above are implemented as software functional modules and sold or used as independent products, they can also be stored in a computer storage medium. Based on this understanding, the technical solutions of the embodiments of this application, or the parts that contribute to related technologies, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as mobile storage devices, ROMs, magnetic disks, or optical disks.

[0108] The singular forms “a,” “the,” and “the” used in this application are intended to include the plural forms as well, unless the context clearly indicates otherwise.

[0109] It should be noted that in the various embodiments involved in this application, all steps or some steps may be performed, as long as a complete technical solution can be formed.

[0110] The above description is merely an embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application.

Claims

1. A task scheduling method, characterized in that, The method includes: The eBPF program is invoked to collect system operation data at the first system kernel level; wherein, the system operation data is fine-grained data. The reinforcement learning module is invoked to analyze the system's operational data and generate scheduling information for the first task; wherein, the first task is one of multiple tasks to be run in the first system. The scheduling information is stored in the eBPF MAP so that the kernel scheduler can allocate resources to the first task based on the scheduling information read from the eBPF MAP.

2. The method according to claim 1, characterized in that, The analysis of the system's operational data to generate scheduling information for the first task includes: The system operation data is processed into a state vector; The first strategy is trained using the state vector to obtain the second strategy; wherein the second strategy is used to determine the scheduling information of the first task. The reward function is used to determine whether the second strategy meets the predetermined criteria. Based on the second strategy, the scheduling information for the first task is determined.

3. The method according to claim 2, characterized in that, The step of determining the scheduling information of the first task based on the second strategy includes: Based on the second strategy, a lightweight inference model is generated; The state vector is input into the lightweight inference model to obtain the scheduling information of the first task.

4. The method according to claim 1, characterized in that, The method further includes: Determine the preset first parameter; Based on the first parameter, the scheduling information of the first task is determined.

5. The method according to any one of claims 1 to 4, characterized in that, The eBPF program is inserted into one or more of the following: a first system kernel tracepoint; a first system kernel hook; eBPF programs use a just-in-time compiler; The system operation data is transmitted to user space through the kernel of the eBPF MAP and the user space shared data or performance event ring buffer, so that the reinforcement learning module can use it.

6. The method according to any one of claims 1 to 4, characterized in that, The scheduling information for the first task includes the priority of the first task; Fairly schedule the first task of the same priority; Different priorities for the first task correspond to different Completely Fair Scheduler weights; One priority corresponds to one execution queue; The first priority task is configured with a weight ratio that preempts or suppresses the resources of the second priority task; wherein, the first priority is higher than the second priority.

7. A task scheduling system, characterized in that, The task scheduling system includes: The eBPF program is used to collect system runtime data at the first system kernel level; wherein the system runtime data is fine-grained data. The reinforcement learning module is used to analyze the system's operational data and generate scheduling information for a first task; wherein, the first task is one of multiple tasks to be run in the first system. The processing module is used to store the scheduling information into the eBPF MAP, so that the kernel scheduler can allocate resources to the first task based on the scheduling information read from the eBPF MAP.

8. An electronic device, characterized in that, The electronic device includes: Memory is used to store executable instructions or computer programs. A processor, when executing computer-executable instructions or computer programs stored in the memory, implements the task scheduling method according to any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores one or more programs, which can be executed by one or more processors to implement the task scheduling method according to any one of claims 1 to 6.

10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the task scheduling method according to any one of claims 1 to 6.