A task scheduling method and device for multiple processes on a real-time operating system

By monitoring task dependencies and resource tension in real-time operating systems, and using artificial intelligence models and diffusion models to optimize process scheduling, the problem of high complexity of scheduling strategies is solved and more efficient task execution is achieved.

CN120066739BActive Publication Date: 2025-07-08GUANGZHOU JINQILI INFORMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510534060.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-04-27
Publication Date
2025-07-08
Estimated Expiration
2045-04-27

AI Technical Summary

Technical Problem

In real-time operating systems, the existing technology has the problem of high complexity of process scheduling strategies and insufficient scheduling, especially when dealing with a large number of different types of tasks, it is difficult to optimize.

Method used

By monitoring the dependencies and operation modes of new tasks, combining available resource indicator data, using artificial intelligence models and diffusion models to determine process scheduling solutions, establish inter-process communication channels, and optimize process scheduling strategies.

Benefits of technology

It reduces the complexity of process scheduling strategies, improves process scheduling efficiency, and enhances the fluency of task execution and system response speed.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120066739B_ABST
    Figure CN120066739B_ABST
Patent Text Reader

Abstract

The present application discloses a task scheduling method and device for multiple processes on a real-time operating system. The method includes: in response to detecting the addition of multiple tasks on the real-time operating system, determining the dependency relationships and running modes of the multiple tasks based on the information of the multiple tasks; determining the resource stress levels of multiple processes based on the available resource metric data of the multiple processes on the real-time operating system; determining a process scheduling scheme based on the dependency relationships, running modes, and resource stress levels; establishing inter-process communication channels between some of the processes based on the process scheduling scheme; invoking some of the processes to execute a first task among the multiple tasks, and invoking at least one process to execute a second task, where the first task is determined from the multiple tasks according to the process scheduling scheme, and the second task is the task other than the first task among the multiple tasks, thereby being able to reduce the complexity of the process scheduling strategy and improve the process scheduling efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular, to a task scheduling method and apparatus for multiple processes on a real-time operating system. Background Art

[0002] A task operation management module is usually deployed in a real-time operating system. In the task operation management module, different tasks to be managed often require different operating conditions.

[0003] In the related art, corresponding processes are generally called according to the scheduling method required by the task to execute the task. However, when a large number of different types of tasks need to be executed in a real-time operating system, this method has problems of high scheduling strategy complexity and low scheduling efficiency. Summary of the Invention

[0004] To solve the above technical problems, embodiments of this application propose a task scheduling method and apparatus for multiple processes on a real-time operating system, which can reduce the complexity of the process scheduling strategy and improve the process scheduling efficiency.

[0005] In a first aspect, embodiments of this application provide a task scheduling method for multiple processes on a real-time operating system, including:

[0006] In response to detecting that multiple tasks are newly added on the real-time operating system, based on the information of each of the multiple tasks, determine the dependency relationships of the multiple tasks and the corresponding operating modes of each of the multiple tasks;

[0007] Based on the available resource metric data corresponding to each of the multiple processes on the real-time operating system, determine the resource stress levels of each of the multiple processes;

[0008] Based on the dependency relationships, the operating modes, and the resource stress levels, determine a process scheduling plan;

[0009] Based on the process scheduling plan, establish an inter-process communication channel between some of the multiple processes;

[0010] Call the part of the processes for which the inter-process communication channel has been established to execute a first task among the multiple tasks, and call at least one process to execute a second task, where the first task is determined from the multiple tasks according to the process scheduling plan, the second task is a task other than the first task among the multiple tasks, and the at least one process is at least one of the processes other than the part of the processes among the multiple processes.

[0011] Optionally, the determining a process scheduling plan based on the dependency relationships, the operating modes, and the resource stress levels includes:

[0012] Convert the dependency into a dependency feature, and convert the operation mode into an operation mode feature;

[0013] Determine an initial scheduling plan using an artificial intelligence model based at least on the dependency feature and the operation mode feature;

[0014] Adjust the initial scheduling plan based on the resource tension degree to obtain the process scheduling plan.

[0015] Optionally, the artificial intelligence model includes a diffusion model. The determining an initial scheduling plan using an artificial intelligence model based at least on the dependency feature and the operation mode feature includes:

[0016] Based on a preset plan feature, the dependency feature, and the operation mode feature, perform a diffusion operation using the diffusion model to obtain the initial scheduling plan, where the preset plan feature includes plan noise suitable for indicating a first random scheduling plan, and the noise added in the diffusion operation is suitable for indicating a second random scheduling plan.

[0017] Optionally, the diffusion operation includes N rounds of diffusion processing, N is a positive integer, and the diffusion processing includes noise addition processing and denoising processing;

[0018] In the i-th round of diffusion processing among the N rounds of diffusion processing, the noise addition processing is configured to add noise to the plan feature output by the (i - 1)-th round of diffusion processing according to the added noise to obtain the i-th round of noise-added feature, and the denoising processing is configured to denoise the i-th round of noise-added feature based on the dependency feature and the operation mode feature to obtain the plan feature output by the i-th round of diffusion processing, where 1 ≤ i ≤ N;

[0019] The initial scheduling plan is determined by the plan feature output by the N-th round of diffusion processing;

[0020] When i = 1, the plan feature output by the (i - 1)-th round of diffusion processing is the preset plan feature.

[0021] Optionally, the number of the added noises is N groups. The adding noise to the plan feature output by the (i - 1)-th round of diffusion processing according to the added noise to obtain the i-th round of noise-added feature includes:

[0022] Add the i-th group of the N groups of added noises to the plan feature output by the (i - 1)-th round of diffusion processing to obtain the i-th round of noise-added feature.

[0023] Optionally, the second random scheduling scheme includes q resource allocation random schemes, w time window random schemes, e serial-parallel strategy random schemes, and r fault tolerance mechanism random schemes, where q, w, e, and r are all positive integers, and q + w + e + r = M, M ≤ N;

[0024] Among the N groups of the added noises, q groups of adjacent noises respectively indicate the q resource allocation random schemes, w groups of adjacent noises respectively indicate the w time window random schemes, e groups of adjacent noises respectively indicate the e serial-parallel strategy random schemes, and r groups of adjacent noises respectively indicate the r fault tolerance mechanism random schemes.

[0025] Optionally, the information of each task among the multiple tasks includes the task description information of the task. Determining the dependency relationships of the multiple tasks based on the information of the multiple tasks respectively includes:

[0026] Based on the task description information of each task among the multiple tasks, use a pre-trained large language model to generate the semantic information of each task among the multiple tasks;

[0027] Based on the semantic information of the multiple tasks respectively, divide the multiple tasks into at least one task group;

[0028] Based on the semantic information of each task included in each task group, construct a dependency graph structure corresponding to each task group, where the dependency graph structure is suitable for characterizing the dependency relationships among the tasks included in the corresponding task group.

[0029] Optionally, determining the resource tension levels of the multiple processes respectively based on the available resource metric data corresponding to the multiple processes on the real-time operating system includes:

[0030] Based on the available resource metric data, determine the change trend of the target metric of each process among the multiple processes within a preset time period, where the available resource metric data includes the data of at least one resource metric respectively, and the target metric is included in the at least one resource metric;

[0031] Based on the change trend, determine the resource tension level of each process among the multiple processes.

[0032] Optionally, before establishing the inter-process communication channels between some of the multiple processes based on the process scheduling scheme, the method further includes:

[0033] Push the process scheduling scheme to the user;

[0034] Obtain the feedback information of the user for the process scheduling scheme, where the feedback information includes at least one of the following: resource allocation adjustment information, time window adjustment information, serial-parallel strategy adjustment information, and fault tolerance mechanism adjustment information;

[0035] Update the process scheduling scheme based on the obtained feedback information.

[0036] In a second aspect, an embodiment of the present application provides a task scheduling device for multiple processes on a real-time operating system, including:

[0037] A monitoring and analysis module, configured to, in response to detecting that multiple tasks are newly added on the real-time operating system, determine the dependency relationships of the multiple tasks and the respective running modes of the multiple tasks based on the information of the multiple tasks;

[0038] A resource analysis module, configured to determine the resource tension levels of the multiple processes based on the available resource metric data corresponding to the multiple processes on the real-time operating system;

[0039] A scheduling scheme generation module, configured to determine a process scheduling scheme based on the dependency relationships, the running modes, and the resource tension levels;

[0040] A channel establishment module, configured to establish an inter-process communication channel between some of the multiple processes based on the process scheduling scheme;

[0041] A task execution module, configured to call some of the processes for which the inter-process communication channel has been established to execute a first task among the multiple tasks, and call at least one process to execute a second task, where the first task is determined from the multiple tasks according to the process scheduling scheme, the second task is a task other than the first task among the multiple tasks, and the at least one process is at least one of the processes other than the some of the processes among the multiple processes.

[0042] In summary, the embodiments of the present application at least have the following beneficial effects:

[0043] By adopting the embodiment of the present application, in response to detecting that multiple tasks are newly added on the real-time operating system, based on the information of each of the multiple tasks, the dependency relationships of the multiple tasks and the corresponding running modes of each of the multiple tasks are determined; based on the available resource metric data corresponding to each of the multiple processes on the real-time operating system, the resource stress levels of each of the multiple processes are determined; based on the dependency relationships, the running modes and the resource stress levels, a process scheduling scheme is determined; based on the process scheduling scheme, an inter-process communication channel is established between some of the multiple processes; the some of the multiple processes with the established inter-process communication channel are called to execute the first task among the multiple tasks, and at least one process is called to execute the second task, where the first task is determined from the multiple tasks according to the process scheduling scheme, the second task is the task other than the first task among the multiple tasks, and the at least one process is at least one of the processes other than the some of the multiple processes among the multiple processes, so that the complexity of the process scheduling strategy can be reduced and the process scheduling efficiency can be improved. Description of the Drawings

[0044] Figure 1 is a schematic flowchart of a method for task scheduling of multiple processes on a real-time operating system provided by an embodiment of the present application;

[0045] Figure 2 is a schematic structural diagram of a device for task scheduling of multiple processes on a real-time operating system provided by an embodiment of the present application;

[0046] Figure 3 is a schematic diagram of a computer device provided by an embodiment of the present application. Detailed Embodiments

[0047] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present application without creative efforts shall fall within the protection scope of the present application.

[0048] In the description of this application, the terms "first", "second", "third", etc. are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the quantity of the indicated technical features. Thus, features defined with "first", "second", "third", etc. may explicitly or implicitly include one or more of such features. In the description of this application, unless otherwise stated, the meaning of "a plurality" is two or more. In the description of this application, the term "comprising" and its variants are open-ended, that is, "including but not limited to". The term "based on" means "at least partially based on". The term "according to" means "at least partially according to". The term "an embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments".

[0049] In the description of this application, it should be noted that, unless otherwise clearly defined and limited, the terms "installed", "connected", and "coupled" should be understood in a broad sense. For example, it may be a fixed connection, a detachable connection, or an integral connection; it may be a mechanical connection or an electrical connection; it may be directly connected or indirectly connected through an intermediate medium, and it may be the communication inside two elements. For those of ordinary skill in the art, the specific meanings of the above terms in this application can be understood according to specific situations.

[0050] In the description of this application, it should be noted that, unless otherwise defined, all the technical and scientific terms used in this application have the same meanings as those commonly understood by those skilled in the technical field to which this application belongs. The terms used in the specification of this application are only for the purpose of describing specific embodiments and are not intended to limit this application. For those of ordinary skill in the art, the specific meanings of the above terms in this application can be understood according to specific situations.

[0051] In a first aspect, referring to Figure 1 , a schematic flowchart of a task scheduling method for multiple processes on a real-time operating system provided by an embodiment of this application is shown. The method includes steps S101 - S105, which are specifically as follows:

[0052] S101, in response to detecting that multiple tasks are newly added on the real-time operating system, based on the information of each of the multiple tasks, determine the dependency relationships of the multiple tasks and the corresponding running modes of each of the multiple tasks.

[0053] In one example, the above dependencies can be used to indicate the interdependent characteristics among multiple tasks (e.g., certain tasks must start after their corresponding other tasks are completed). Specifically, if a task B must start after task A is completed, it can be said that task B depends on task A. At this time, this dependency can be identified by analyzing the input / output data characteristics required by each task. In addition, an adjacency matrix or an adjacency list can be used to store the above dependencies.

[0054] In one example, the above running mode of each task can be directly determined by the running mode information included in the information of the task.

[0055] In one example, the running mode of each task usually depends on its characteristics and the system environment, and may include at least one of the following: execution mode (determining whether the task runs in the foreground or background and / or whether it needs to exclusively occupy certain resources, etc.), concurrency strategy (indicating whether the task supports parallel execution, and if so, also indicating the degree of parallelism of the task), fault tolerance mechanism (the handling method after the task fails, such as the number of retries and / or recovery strategy, etc.), scheduling strategy (used to select a suitable scheduling algorithm for the task, such as real-time scheduling, time-sharing scheduling, etc.).

[0056] S102. Determine the resource tension degree of each of the multiple processes based on the available resource metric data corresponding to each of the multiple processes on the real-time operating system.

[0057] In one example, the resource tension degree of a process under a certain metric can be determined by comparing the data value of a certain metric included in the available resource metric data corresponding to the process with the corresponding metric threshold.

[0058] S103. Determine a process scheduling plan based on the dependency, the running mode, and the resource tension degree.

[0059] In one example, a process scheduling plan data table can be pre-configured. The process scheduling plan data table can record multiple standard process scheduling plans generated / developed from experimental data. Each standard process scheduling plan can be associated with the corresponding experimental dependency, experimental running mode, and experimental resource tension degree. Among them, the experimental dependency, experimental running mode, and experimental resource tension degree are all recorded in the above experimental data. The standard process scheduling plan can include at least one of the following: resource allocation information, time window information, serial / parallel strategy information, fault tolerance mechanism information.

[0060] Thus, when determining the process scheduling scheme, based on the dependency relationship, the running mode, and the resource tension degree, a match can be made in the process scheduling scheme data table, and the standard process scheduling scheme with the highest matching degree is used as the process scheduling scheme. Among them, the standard process scheduling scheme with the highest matching degree can refer to the highest comprehensive similarity, and this comprehensive similarity can be obtained by weighted summation of the following similarities: the similarity between the dependency relationship and the experimental dependency relationship, the similarity between the running mode and the experimental running mode, and the similarity between the resource tension degree and the experimental resource tension degree.

[0061] S104. Based on the process scheduling scheme, establish an inter-process communication channel between some of the multiple processes.

[0062] In some cases, among the above-mentioned multiple tasks, not every task requires multiple processes to cooperate in processing and execution. Therefore, the process scheduling scheme can also be used to indicate the first tasks among the multiple tasks that need to be cooperatively processed and executed by multiple processes, and indicate the processes allocated for each first task. Thus, the processes allocated for all the first tasks can form the above-mentioned partial processes. In one example, the inter-process communication channel can include multiple sub-communication channels. Thus, based on the process scheduling scheme, for each first task, a sub-communication channel can be established between the processes allocated for this first task. However, it is not difficult to understand that there can also be only one first task. In this case, the above-mentioned partial processes are all allocated for this first task, and the established inter-process communication channel is also used for the execution of this first task.

[0063] S105. Invoke the partial processes for which the inter-process communication channel has been established to execute the first task among the multiple tasks, and, invoke at least one process to execute the second task, where the first task is determined from the multiple tasks according to the process scheduling scheme, the second task is the task other than the first task among the multiple tasks, and the at least one process is at least one of the processes other than the partial processes among the multiple processes.

[0064] In this embodiment, the scheduling decision can be made not only based on a single factor (such as priority) indicated by the required scheduling method of the task, but also comprehensively considering the dependencies between tasks, the operation requirements indicated by their respective operation modes, and the real-time resource status of each process in the system (characterized by available resource index data or resource tension), so that the determined process scheduling scheme can be comprehensively optimized considering the above factors, thereby reducing the complexity of the process scheduling strategy and achieving better overall performance. In addition, a dedicated communication path is established in advance between some processes that need to work together, so that these processes can efficiently exchange data and / or synchronize operations, thereby directly promoting cooperation between tasks, reducing delays caused by lack of effective communication, and improving the response speed of the overall system. In this way, the practice of establishing a communication channel between processes can further enhance the smoothness of task execution, reduce potential blocking points, and thus improve the process scheduling efficiency.

[0065] In some cases, the above-mentioned multiple tasks can be obtained by dividing the same (computationally intensive) target task, and the computational amounts corresponding to the multiple tasks may not be exactly the same. At this time, the final computational goal is to completely execute the target task to obtain the corresponding target computational result (that is, both the first task and the second task need to be executed). In this way, the process scheduling scheme can also be used to indicate that the first total computational duration for calling the above-mentioned part of the processes to execute the first task is approximately equal to the second total computational duration for calling at least one process to execute the second task (that is, the error between the first total computational duration and the second total computational duration is within the set threshold range). Here, since when determining the process scheduling scheme, the process scheduling scheme can also include the estimated first total computational duration (for example, according to the above experimental data, estimate the duration required for each first task when calling the corresponding process to execute, so as to determine the first total computational duration), and then select the appropriate number and / or type of processes (that is, the above-mentioned at least one process) according to the computational amount required by each second task, and finally call the selected processes to execute the second task, so that the first total computational duration is approximately equal to the second total computational duration.

[0066] In an alternative embodiment, determining the process scheduling scheme based on the dependency relationship, the operation mode, and the resource tension includes:

[0067] Convert the dependency relationship into a dependency relationship feature, and convert the operation mode into an operation mode feature;

[0068] Based at least on the dependency relationship feature and the operation mode feature, use an artificial intelligence model to determine an initial scheduling scheme;

[0069] Adjust the initial scheduling plan based on the resource tension level to obtain the process scheduling plan.

[0070] In one example, the dependency relationship can be converted into a dependency relationship feature and the running mode can be converted into a running mode feature by encoding.

[0071] In one example, the above artificial intelligence model can be pre-trained via sample data, so that the artificial intelligence model has the ability to take the dependency relationship feature and the running mode feature as inputs and the initial scheduling plan as the output. Among them, the above sample data can include sample dependency relationship features, sample running mode features, and labels, and the label indicates the sample scheduling plan. When training the artificial intelligence model, the sample dependency relationship features and the sample running mode features can be input into the artificial intelligence model, and the loss value between the output of the artificial intelligence model and the sample scheduling plan can be calculated using a general loss function. Finally, the loss value is used to adjust the parameters of the artificial intelligence model to achieve the effect of model training. It should be understood that the way of model training is diverse and general, and only an example is given in this application for reference without specific limitation.

[0072] In one example, adjusting the initial scheduling plan based on the resource tension level to obtain the process scheduling plan may include: adjusting the initial scheduling plan according to the resource tension level to ensure that tasks on the high priority or critical path can be preferentially allocated sufficient processes to obtain sufficient resources and avoid resource bottlenecks.

[0073] In an alternative implementation, the artificial intelligence model includes a diffusion model. Determining the initial scheduling plan using the artificial intelligence model based at least on the dependency relationship feature and the running mode feature includes:

[0074] Based on the preset plan feature, the dependency relationship feature, and the running mode feature, perform a diffusion operation using the diffusion model to obtain the initial scheduling plan, where the preset plan feature includes plan noise suitable for indicating a first random scheduling plan, and the noise added by the diffusion operation is suitable for indicating a second random scheduling plan.

[0075] In one example, the above first random scheduling plan may include the above multiple standard process scheduling plans. At this time, through the diffusion operation performed by the diffusion model, one or more of the above multiple standard process scheduling plans can be diffused to obtain more reasonable scheduling plans, so as to select the most suitable scheduling plan from the obtained scheduling plans as the initial scheduling plan, thereby enhancing the diversity and adaptability of the scheduling plan, and then better coping with complex and changeable task requirements and resource conditions.

[0076] In an alternative embodiment, the diffusion operation includes N rounds of diffusion processing, where N is a positive integer, and the diffusion processing includes noise addition processing and denoising processing;

[0077] In the i-th round of diffusion processing among the N rounds of diffusion processing, the noise addition processing is configured to add noise to the solution features output by the (i - 1)-th round of diffusion processing according to the added noise to obtain the i-th round of noise-added features, and the denoising processing is configured to denoise the i-th round of noise-added features based on the dependency feature and the operation mode feature to obtain the solution features output by the i-th round of diffusion processing, where 1 ≤ i ≤ N;

[0078] The initial scheduling scheme is determined by the solution features output by the N-th round of diffusion processing;

[0079] When i = 1, the solution features output by the (i - 1)-th round of diffusion processing are the preset solution features.

[0080] In this embodiment, through the constrained learning and iterative optimization of the diffusion model, a feasible scheduling scheme that meets the actual requirements (dependencies, resources, time, etc.) is finally generated, where the randomness of diffusion covers the full dimension of the scheduling problem, ensuring that the model can explore more possibilities in the solution space.

[0081] In an alternative embodiment, the number of the added noise is N groups, and the adding noise to the solution features output by the (i - 1)-th round of diffusion processing according to the added noise to obtain the i-th round of noise-added features includes:

[0082] Adding the i-th group of noise among the N groups of the added noise to the solution features output by the (i - 1)-th round of diffusion processing to obtain the i-th round of noise-added features.

[0083] In an example, each group of the N groups of the added noise can be different, and at least part of the N groups of the added noise can be randomly generated, and / or at least part of the noise can be generated based on the status information of the electronic device for running the above real-time operating system and / or the user historical behavior data corresponding to the above real-time operating system. Thus, this embodiment can make the added noise more random and / or more adapted to the actual situation of the real-time operating system (such as device status and / or user historical preferences).

[0084] Among them, when generating noise based on the status information of an electronic device, the hardware and system status of the device can be monitored in real time first, and then the following dynamically adjusted noise can be generated according to the monitored device hardware and system status: Resource availability perception noise can be generated according to the current CPU (Central Processing Unit) / GPU (Graphics Processing Unit) load, remaining memory, battery power, etc.; Network and I / O status perception noise can be used to adjust the priority of data transmission tasks according to the current network latency and / or bandwidth.

[0085] In an alternative embodiment, the second random scheduling scheme includes q resource allocation random schemes, w time window random schemes, e serial-parallel strategy random schemes, and r fault tolerance mechanism random schemes, where q, w, e, and r are all positive integers, and q + w + e + r = M, M ≤ N;

[0086] Among the N groups of the added noise, q groups of adjacent noise respectively indicate the q resource allocation random schemes, w groups of adjacent noise respectively indicate the w time window random schemes, e groups of adjacent noise respectively indicate the e serial-parallel strategy random schemes, and r groups of adjacent noise respectively indicate the r fault tolerance mechanism random schemes.

[0087] In this embodiment, since the q resource allocation random schemes are respectively indicated by q groups of adjacent noise among the N groups of the added noise, in the above N rounds of diffusion processing, corresponding noise can be added to resource allocation and then denoised in q consecutive rounds of diffusion processing, so as to ensure that the process scheduling scheme can be fully constrained, learned, and iteratively optimized at least in terms of resource allocation, thereby improving the accuracy of the generated process scheduling scheme in this regard and accelerating the convergence speed of the model in this aspect. And the principles for aspects such as time window, serial-parallel strategy, and fault tolerance mechanism are similar, which will not be elaborated here.

[0088] Correspondingly, if the q resource allocation random schemes are discontinuous, the correlation between each round of diffusion processing will be weakened, resulting in inconsistency in the learning process, because each diffusion processing may start from different starting points (starting points in terms of resource allocation), making it difficult to form an effective cumulative learning effect. And if it is discontinuous, each round of diffusion processing needs to re-evaluate the current state in terms of resource allocation, increasing unnecessary computational overhead, and also easily leading to a slower convergence speed and prolonging the time to find a satisfactory solution. In addition, discontinuous processing may also cause the model to frequently jump in and out of different local optimal regions instead of steadily moving towards the global optimal solution, thereby reducing the quality of the final result.

[0089] It should be noted that the diffusion model was initially designed to solve the data generation problem. Its core idea is a step-by-step denoising process. Traditional diffusion models are usually more used in tasks of generating complex data distributions such as "images, audio, and videos". In this embodiment, through the special design of noise, the diffusion model can use the step-by-step denoising process to more accurately simulate a large number of scheduling situations, so as to optimize the most suitable initial scheduling plan accordingly, and can better meet some tasks that require real-time response. For example, for a medium-sized diffusion model to generate an image with a resolution of 256x256 on a standard GPU, it may usually take from a few seconds to dozens of seconds. However, in this embodiment, since only some index data and policy text information need to be processed, the data volume is actually much smaller than that of an image with a resolution of 256x256, making the time required for this embodiment much less than the time required to process the image, thus being able to better meet the real-time response speed required by some tasks.

[0090] In an alternative embodiment, the information of each task among the multiple tasks includes the task description information of the task. Determining the dependency relationship of the multiple tasks based on the information of each of the multiple tasks includes:

[0091] Based on the task description information of each task among the multiple tasks, use a pre-trained large language model to generate the semantic information of each task among the multiple tasks;

[0092] Based on the semantic information of each of the multiple tasks, divide the multiple tasks into at least one task group;

[0093] Based on the semantic information of each task included in each task group, construct a dependency graph structure corresponding to each task group, where the dependency graph structure is suitable for representing the dependency relationship between the tasks included in the corresponding task group.

[0094] In an example, the above dependency graph structure can use a directed acyclic graph to represent the dependency relationship between tasks. Among them, the nodes in the dependency graph structure represent tasks, and the edges represent the dependency direction.

[0095] In an example, the above task description information can be related information described in natural language, such as text. At this time, the user can input commands corresponding to the above multiple tasks. When inputting or before and after inputting, the user can also input the above task description information by inputting text. Both the command and the task description information are included in the information of the task.

[0096] In an example, the tasks included in the same task group can be tasks with similar semantics.

[0097] In one example, at least one clustering center (corresponding one-to-one to at least one task group) can be determined by performing clustering processing based on the semantic information of each of multiple tasks, and each task can be classified into the task group corresponding to the clustering center with the highest similarity to the task according to the similarity between each task and each clustering center.

[0098] In an alternative implementation manner, determining the resource stress levels of the multiple processes based on the available resource metric data corresponding to each of the multiple processes on the real-time operating system includes:

[0099] Based on the available resource metric data, determining the change trend of the target metric of each process among the multiple processes within a preset time period, where the available resource metric data includes data of at least one resource metric, and the target metric is included in the at least one resource metric;

[0100] Based on the change trend, determining the resource stress level of each process among the multiple processes.

[0101] In one example, the above available resource metric data may include data of at least one resource metric, where the at least one resource metric may include at least one of the following: CPU utilization rate (which can be used to measure the proportion of CPU time occupied by each process, where a high CPU utilization rate may indicate that the process is not suitable for real-time tasks because it may cause real-time tasks to miss their deadlines), memory usage (which may include at least one of the following: the amount of physical memory used, the amount of virtual memory used, the heap size allocated to the process, the stack size allocated to the process, etc.), I / O operation frequency and / or latency, number of context switches, priority (the priority of the process), preemption rate (the frequency at which the process is preempted by a process with a higher priority), queue length (the number of tasks waiting to run in the ready queue).

[0102] In one example, the above change trend can be used to indicate whether the target metric shows an increasing trend or a decreasing trend within a preset time period, and indicate the growth rate or the decreasing rate.

[0103] In an alternative implementation manner, before establishing an inter-process communication channel between some of the multiple processes based on the process scheduling scheme, the method further includes:

[0104] Pushing the process scheduling scheme to the user;

[0105] Obtaining feedback information of the user on the process scheduling scheme, where the feedback information includes at least one of the following: resource allocation adjustment information, time window adjustment information, serial-parallel strategy adjustment information, fault tolerance mechanism adjustment information;

[0106] Update the process scheduling scheme based on the obtained feedback information.

[0107] In one example, the above artificial intelligence model or diffusion model can be used to update the process scheduling scheme according to the feedback information. For example, before using the artificial intelligence model, sample feedback information (including at least one of sample resource allocation adjustment information, sample time window adjustment information, sample serial-parallel strategy adjustment information, and sample fault tolerance mechanism adjustment information) can be used to further train the trained artificial intelligence model, so that the artificial intelligence model has the ability to update the process scheduling scheme based on the feedback information. The method of training the artificial intelligence model can refer to the above related embodiments and will not be elaborated here. When using the diffusion model, corresponding feedback noise can be considered to be generated according to the feedback information, and then in the (N + 1)-th round of diffusion processing, the feedback noise is added to the initial scheduling scheme to obtain the (i + 1)-th round of noise-added features, and the (i + 1)-th round of noise-added features are denoised based on the dependency relationship features and the operation mode features to complete the update of the process scheduling scheme. It should be understood that the number of feedback noises can also be n. At this time, the update of the process scheduling scheme can be completed through the (N + 1)-th round of diffusion processing to the (N + n)-th round of diffusion processing. Each diffusion processing is similar to the above (N + 1)-th round of diffusion processing and will not be elaborated here.

[0108] In one example, a real-time operating system can run on a processor in an electronic device (the execution subject of the method described in this embodiment can also be the processor). The electronic device can be associated with a display screen. The processor can output the above process scheduling scheme to the display screen for visual display to push to the user, and can obtain the above feedback information returned by the display screen. The feedback information can be generated by the display screen according to the feedback operation of the user on the display screen for the above process scheduling scheme.

[0109] In a second aspect, correspondingly, an embodiment of the present application further provides a task scheduling device for multiple processes on a real-time operating system, which can implement all the processes of the task scheduling method for multiple processes on a real-time operating system provided in the above embodiment.

[0110] See Figure 2 , which shows a schematic structural diagram of a task scheduling device for multiple processes on a real-time operating system provided in an embodiment of the present application. The task scheduling device for multiple processes on a real-time operating system includes:

[0111] A monitoring and analysis module 201, configured to, in response to detecting that multiple tasks are newly added on the real-time operating system, determine the dependency relationship of the multiple tasks and the corresponding operation mode of each of the multiple tasks based on the information of each of the multiple tasks;

[0112] A resource analysis module 202, configured to determine the resource stress levels of multiple processes based on the available resource metric data corresponding to each of the multiple processes on the real-time operating system;

[0113] A scheduling scheme generation module 203, configured to determine a process scheduling scheme based on the dependency relationship, the running mode, and the resource stress levels;

[0114] A channel establishment module 204, configured to establish inter-process communication channels between some of the multiple processes based on the process scheduling scheme;

[0115] A task execution module 205, configured to call some of the processes for which the inter-process communication channels have been established to execute a first task among the multiple tasks, and call at least one process to execute a second task, where the first task is determined from the multiple tasks according to the process scheduling scheme, the second task is a task other than the first task among the multiple tasks, and the at least one process is at least one of the processes other than the some of the processes among the multiple processes.

[0116] In an alternative embodiment, the determining the process scheduling scheme based on the dependency relationship, the running mode, and the resource stress levels includes:

[0117] Converting the dependency relationship into a dependency relationship feature, and converting the running mode into a running mode feature;

[0118] Determining an initial scheduling scheme using an artificial intelligence model based at least on the dependency relationship feature and the running mode feature;

[0119] Adjusting the initial scheduling scheme based on the resource stress levels to obtain the process scheduling scheme.

[0120] In an alternative embodiment, the artificial intelligence model includes a diffusion model, and the determining the initial scheduling scheme using an artificial intelligence model based at least on the dependency relationship feature and the running mode feature includes:

[0121] Performing a diffusion operation using the diffusion model based on a preset scheme feature, the dependency relationship feature, and the running mode feature to obtain the initial scheduling scheme, where the preset scheme feature includes scheme noise suitable for indicating a first random scheduling scheme, and the noise added by the diffusion operation is suitable for indicating a second random scheduling scheme.

[0122] In an alternative embodiment, the diffusion operation includes N rounds of diffusion processing, N is a positive integer, and the diffusion processing includes noise addition processing and denoising processing;

[0123] In the i-th diffusion process of the N-round diffusion process, the noise addition process is configured to add noise to the solution features output by the (i - 1)-th diffusion process according to the added noise to obtain the i-th noise-added features, and the denoising process is configured to denoise the i-th noise-added features based on the dependency feature and the operation mode feature to obtain the solution features output by the i-th diffusion process, where 1 ≤ i ≤ N;

[0124] The initial scheduling solution is determined by the solution features output by the N-th diffusion process;

[0125] When i = 1, the solution features output by the (i - 1)-th diffusion process are the preset solution features.

[0126] In an alternative embodiment, the number of the added noise is N groups, and adding the noise to the solution features output by the (i - 1)-th diffusion process according to the added noise to obtain the i-th noise-added features includes:

[0127] Adding the i-th group of noise in the N groups of the added noise to the solution features output by the (i - 1)-th diffusion process to obtain the i-th noise-added features.

[0128] In an alternative embodiment, the second random scheduling solution includes q resource allocation random solutions, w time window random solutions, e serial-parallel strategy random solutions, and r fault tolerance mechanism random solutions, where q, w, e, and r are all positive integers, and q + w + e + r = M, M ≤ N;

[0129] Among the N groups of the added noise, q groups of adjacent noise respectively indicate the q resource allocation random solutions, w groups of adjacent noise respectively indicate the w time window random solutions, e groups of adjacent noise respectively indicate the e serial-parallel strategy random solutions, and r groups of adjacent noise respectively indicate the r fault tolerance mechanism random solutions.

[0130] In an alternative embodiment, the information of each task among the multiple tasks includes the task description information of the task, and determining the dependencies of the multiple tasks based on the information of the multiple tasks respectively includes:

[0131] Based on the task description information of each task among the multiple tasks, using a pre-trained large language model to generate the semantic information of each task among the multiple tasks;

[0132] Based on the semantic information of the multiple tasks respectively, dividing the multiple tasks into at least one task group;

[0133] Based on the semantic information of each task included in each task group, construct a dependency graph structure corresponding to each task group, where the dependency graph structure is suitable for characterizing the dependencies between the tasks included in the corresponding task group.

[0134] In an alternative embodiment, the determining the resource tension level of each of the multiple processes based on the available resource metric data corresponding to each of the multiple processes on the real-time operating system includes:

[0135] Based on the available resource metric data, determine the change trend of the target metric of each process among the multiple processes within a preset time period, where the available resource metric data includes data of at least one resource metric, and the target metric is included in the at least one resource metric;

[0136] Based on the change trend, determine the resource tension level of each process among the multiple processes.

[0137] In an alternative embodiment, the apparatus further includes a scheduling scheme update module, and the scheduling scheme update module is configured to:

[0138] Before establishing an inter-process communication channel between some of the multiple processes based on the process scheduling scheme, push the process scheduling scheme to the user;

[0139] Obtain feedback information of the user regarding the process scheduling scheme, where the feedback information includes at least one of the following: resource allocation adjustment information, time window adjustment information, serial-parallel strategy adjustment information, fault tolerance mechanism adjustment information;

[0140] Update the process scheduling scheme based on the obtained feedback information.

[0141] In a third aspect, an embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the task scheduling method for multiple processes on the real-time operating system described in any one of the above are implemented.

[0142] In a fourth aspect, an embodiment of the present application provides a computer program product, including computer instructions, and when the computer instructions are executed by a processor, the steps of the task scheduling method for multiple processes on the real-time operating system described in any one of the above are implemented.

[0143] In a fifth aspect, an embodiment of the present application provides a computer device, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, and when the processor executes the computer program, the steps of the task scheduling method for multiple processes on the real-time operating system described in any one of the above are implemented.

[0144] See Figure 3 , the computer device of this embodiment includes: a processor 301, a memory 302, and a computer program stored in the memory 302 and executable on the processor 301, such as a task scheduler for multi-processes on a real-time operating system. When the processor 301 executes the computer program, it implements the steps in the embodiments of the above-mentioned task scheduling method for multi-processes on a real-time operating system, such as Figure 1 the steps S101 - S105 shown

[0145] Exemplarily, the computer program can be divided into one or more modules / units. The one or more modules / units are stored in the memory 302 and executed by the processor 301 to complete this application. The one or more modules / units can be a series of computer program instruction segments capable of completing specific functions, and these instruction segments are used to describe the execution process of the computer program in the computer device

[0146] The computer device can be a computing device such as a desktop computer, a notebook, a palm computer, and a cloud server. The computer device may include, but is not limited to, a processor 301 and a memory 302. Those skilled in the art can understand that the schematic diagram is only an example of the computer device, and does not constitute a limitation on the computer device. It may include more or fewer components than shown in the figure, or combine some components, or different components. For example, the computer device may further include input / output devices, network access devices, buses, etc

[0147] The processor 301 may be a central processing unit (CPU), or may also be other general-purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor, or the processor 301 may also be any conventional processor, etc. The processor 301 is the control center of the computer device, and connects various parts of the entire computer device through various interfaces and lines

[0148] The memory 302 can be used to store the computer programs and / or modules. By running or executing the computer programs and / or modules stored in the memory 302, and invoking the data stored in the memory 302, the processor 301 realizes various functions of the computer device. The memory 302 mainly includes a program storage area and a data storage area. Among them, the program storage area can store an operating system, application programs required for at least one function (such as a sound playback function, an image playback function, etc.); the data storage area can store data created according to the use of the mobile phone (such as audio data, phone book, etc.). In addition, the memory 302 may include high-speed random access memory, and may also include non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, at least one magnetic disk storage device, a flash memory device, or other volatile solid-state storage devices.

[0149] Among them, if the modules / units integrated in the computer device are implemented in the form of software function units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on such an understanding, to implement all or part of the processes in the above embodiment methods of this application, it can also be completed by a computer program instructing relevant hardware. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by the processor 301, the steps of the above various method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in the form of source code, object code, an executable file, or some intermediate form, etc. The computer-readable medium can include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a mobile hard disk, a magnetic disk, an optical disc, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunications signal, and a software distribution medium, etc.

[0150] In summary, the embodiments of this application at least have the following beneficial effects:

[0151] By adopting the embodiment of the present application, in response to detecting that multiple tasks are newly added on the real-time operating system, based on the information of each of the multiple tasks, the dependency relationship of the multiple tasks and the corresponding running mode of each of the multiple tasks are determined; based on the available resource index data corresponding to each of the multiple processes on the real-time operating system, the resource tension degree of each of the multiple processes is determined; based on the dependency relationship, the running mode and the resource tension degree, a process scheduling scheme is determined; based on the process scheduling scheme, an inter-process communication channel is established between some of the multiple processes; the some of the multiple processes with the established inter-process communication channel are called to execute the first task among the multiple tasks, and at least one process is called to execute the second task, where the first task is determined from the multiple tasks according to the process scheduling scheme, the second task is the task other than the first task among the multiple tasks, and the at least one process is at least one of the processes other than the some of the multiple processes among the multiple processes, so that the complexity of the process scheduling strategy can be reduced and the process scheduling efficiency can be improved.

[0152] Through the description of the above embodiments, those skilled in the art can clearly understand that the present application can be implemented by means of software plus a necessary hardware platform, and of course, it can also be fully implemented by hardware. Based on such an understanding, all or part of the technical solution of the present application that contributes to the background technology can be embodied in the form of a software product, and the computer software product can be stored in a storage medium, such as ROM (Read-Only Memory), RAM (Random Access Memory), magnetic disk, optical disk, etc., including several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments of the present application.

[0153] The above is the preferred embodiment of the present application. It should be noted that for those of ordinary skill in the art, without departing from the principle of the present application, several improvements and retouches can be made, and these improvements and retouches are also regarded as the protection scope of the present application.

Claims

1. A task scheduling method for multiple processes on a real-time operating system, characterized in that, Including: In response to detecting multiple new tasks on the real-time operating system, based on the information of each of the multiple tasks, determining the dependency relationships of the multiple tasks and the corresponding running modes of each of the multiple tasks; Based on the available resource metric data corresponding to each of the multiple processes on the real-time operating system, determining the resource stress levels of each of the multiple processes; Based on the dependency relationships, the running modes, and the resource stress levels, determining a process scheduling plan; Based on the process scheduling plan, establishing an inter-process communication channel between some of the multiple processes, where the process scheduling plan is at least used to indicate a first task among the multiple tasks that needs to be collaboratively processed and executed by the some processes; Invoking the some processes that have established the inter-process communication channel to execute the first task among the multiple tasks, and invoking at least one process to execute a second task, where the first task is determined from the multiple tasks according to the process scheduling plan, the second task is the task other than the first task among the multiple tasks, and the at least one process is at least one of the processes other than the some processes among the multiple processes; Wherein, the determining the process scheduling plan based on the dependency relationships, the running modes, and the resource stress levels includes: Converting the dependency relationships into dependency relationship features, and converting the running modes into running mode features; At least based on the dependency relationship features and the running mode features, using an artificial intelligence model to determine an initial scheduling plan; Adjusting the initial scheduling plan based on the resource stress levels to obtain the process scheduling plan; Wherein, the artificial intelligence model includes a diffusion model, and the using the artificial intelligence model to determine the initial scheduling plan at least based on the dependency relationship features and the running mode features includes: Based on preset plan features, the dependency relationship features, and the running mode features, performing a diffusion operation using the diffusion model to obtain the initial scheduling plan, where the preset plan features include plan noise suitable for indicating a first random scheduling plan, the noise added by the diffusion operation is suitable for indicating a second random scheduling plan, and the first random scheduling plan includes multiple standard process scheduling plans; Wherein, The diffusion operation includes N rounds of diffusion processing, N is a positive integer, and the diffusion processing includes noise addition processing and denoising processing; In the i-th round of diffusion processing among the N rounds of diffusion processing, the noise addition processing is configured to add noise to the plan features output by the (i - 1)-th round of diffusion processing according to the added noise to obtain the i-th round of noise-added features, and the denoising processing is configured to perform denoising on the i-th round of noise-added features based on the dependency relationship features and the running mode features to obtain the plan features output by the i-th round of diffusion processing, where 1 ≤ i ≤ N; The initial scheduling plan is determined by the plan features output by the N-th round of diffusion processing; When i = 1, the plan features output by the (i - 1)-th round of diffusion processing are the preset plan features.

2. The method according to claim 1, wherein The number of the added noises is N groups. Adding noises to the solution features output by the (i - 1)-th round of diffusion processing according to the added noises to obtain the i-th round of noise-added features includes: Adding the i-th group of noises among the N groups of the added noises to the solution features output by the (i - 1)-th round of diffusion processing to obtain the i-th round of noise-added features.

3. The method according to claim 2, wherein The second random scheduling scheme includes q resource allocation random schemes, w time window random schemes, e serial-parallel strategy random schemes, and r fault tolerance mechanism random schemes, where q, w, e, and r are all positive integers, and q + w + e + r = M, M ≤ N; Among the N groups of the added noises, q groups of adjacent noises respectively indicate the q resource allocation random schemes, w groups of adjacent noises respectively indicate the w time window random schemes, e groups of adjacent noises respectively indicate the e serial-parallel strategy random schemes, and r groups of adjacent noises respectively indicate the r fault tolerance mechanism random schemes.

4. The method according to claim 1, wherein The information of each task among the multiple tasks includes the task description information of the task. Determining the dependency relationships of the multiple tasks based on the information of each of the multiple tasks includes: Based on the task description information of each task among the multiple tasks, using a pre-trained large language model to generate the semantic information of each task among the multiple tasks; Based on the semantic information of each of the multiple tasks, dividing the multiple tasks into at least one task group; Based on the semantic information of each task included in each task group, constructing a dependency graph structure corresponding to each task group, where the dependency graph structure is suitable for characterizing the dependency relationships among the tasks included in the corresponding task group.

5. The method according to claim 1, wherein Determining the resource tension levels of the multiple processes based on the available resource metric data corresponding to the multiple processes on the real-time operating system includes: Based on the available resource metric data, determining the change trend of the target metric of each process among the multiple processes within a preset time period, where the available resource metric data includes the data of at least one resource metric, and the target metric is included in the at least one resource metric; Based on the change trend, determining the resource tension level of each process among the multiple processes.

6. The method according to any one of claims 1-5, characterized in that, Before establishing the inter-process communication channels between some of the multiple processes based on the process scheduling scheme, the method further includes: Pushing the process scheduling scheme to the user; Obtaining the feedback information of the user for the process scheduling scheme, where the feedback information includes at least one of the following: resource allocation adjustment information, time window adjustment information, serial-parallel strategy adjustment information, and fault tolerance mechanism adjustment information; Updating the process scheduling scheme based on the obtained feedback information.

7. A task scheduling device for multiple processes on a real-time operating system, characterized in that, Including: A monitoring and analysis module, configured to, in response to detecting that multiple tasks are newly added on the real-time operating system, determine the dependency relationships of the multiple tasks and the corresponding running modes of the multiple tasks based on the information of each of the multiple tasks; A resource analysis module, configured to determine the resource tension levels of multiple processes based on the available resource metric data corresponding to each of the multiple processes on the real-time operating system; A scheduling scheme generation module, configured to determine a process scheduling scheme based on the dependency relationship, the running mode, and the resource tension levels; A channel establishment module, configured to establish an inter-process communication channel between some of the multiple processes based on the process scheduling scheme, where the process scheduling scheme is at least used to indicate a first task that needs to be cooperatively processed and executed by the some of the multiple tasks; A task execution module, configured to call the some of the processes that have established the inter-process communication channel to execute the first task among the multiple tasks, and call at least one process to execute a second task, where the first task is determined from the multiple tasks according to the process scheduling scheme, the second task is the task other than the first task among the multiple tasks, and the at least one process is at least one of the processes other than the some of the processes among the multiple processes; Wherein, the determining the process scheduling scheme based on the dependency relationship, the running mode, and the resource tension levels includes: Converting the dependency relationship into a dependency relationship feature, and converting the running mode into a running mode feature; Determining an initial scheduling scheme using an artificial intelligence model based at least on the dependency relationship feature and the running mode feature; Adjusting the initial scheduling scheme based on the resource tension levels to obtain the process scheduling scheme; Wherein, the artificial intelligence model includes a diffusion model, and the determining the initial scheduling scheme using an artificial intelligence model based at least on the dependency relationship feature and the running mode feature includes: Performing a diffusion operation using the diffusion model based on a preset scheme feature, the dependency relationship feature, and the running mode feature to obtain the initial scheduling scheme, where the preset scheme feature includes a scheme noise suitable for indicating a first random scheduling scheme, and the noise added in the diffusion operation is suitable for indicating a second random scheduling scheme, and the first random scheduling scheme includes multiple standard process scheduling schemes; Wherein, The diffusion operation includes N rounds of diffusion processing, N is a positive integer, and the diffusion processing includes noise addition processing and denoising processing; In the i-th round of diffusion processing among the N rounds of diffusion processing, the noise addition processing is configured to add noise to the scheme feature output by the (i - 1)-th round of diffusion processing according to the added noise to obtain an i-th round of noise-added feature, and the denoising processing is configured to perform denoising on the i-th round of noise-added feature based on the dependency relationship feature and the running mode feature to obtain the scheme feature output by the i-th round of diffusion processing, where 1 ≤ i ≤ N; The initial scheduling scheme is determined by the scheme feature output by the N-th round of diffusion processing; When i = 1, the scheme feature output by the (i - 1)-th round of diffusion processing is the preset scheme feature.

Citation Information

Patent Citations

  • Resource allocation method and device, mobile terminal and computer readable storage medium

    CN109992400A

  • Container isolation resource confirmation method and device, equipment and medium

    CN118819725A