Task scheduling method and device for multiple processes on real-time operating system

By monitoring the dependencies, operation mode and resource tension of tasks in the real-time operating system, and optimizing the scheduling solution in combination with the artificial intelligence model, the problems of complexity and low efficiency of scheduling strategies in the real-time operating system are solved, and more efficient task execution is achieved.

CN120066739AActive Publication Date: 2025-05-30GUANGZHOU JINQILI INFORMATION TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

In real-time operating systems, the prior art has the problem of high complexity and low efficiency of scheduling strategies, especially when a large number of different types of tasks are required.

Method used

A multi-process task scheduling method is proposed on a real-time operating system. By monitoring the dependencies, operation mode and resource tension of tasks, the process scheduling plan is determined, and an inter-process communication channel is established to perform tasks. This method uses artificial intelligence models, such as diffusion models, to optimize scheduling schemes.

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 CN120066739A_ABST
    Figure CN120066739A_ABST
Patent Text Reader

Abstract

The invention discloses a multi-process task scheduling method and device on a real-time operating system, and the method comprises the steps: responding to monitoring that a plurality of tasks are newly added on the real-time operating system, and determining the dependency relationship of the plurality of tasks and the operation modes of the plurality of tasks based on the information of the plurality of tasks; determining the resource tension degree of the plurality of processes based on the available resource index data of the plurality of processes on the real-time operating system; determining a process scheduling scheme based on the dependency relationship, the operation mode and the resource tension degree; establishing inter-process communication channels among the partial processes based on the process scheduling scheme; the partial processes are called to execute the first task in the multiple tasks, the at least one process is called to execute the second task, the first task is determined from the multiple tasks according to the process scheduling scheme, and the second task is the task except the first task in the multiple tasks, so that the complexity of the process scheduling strategy can be reduced, and the process scheduling efficiency can be improved.
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 method and apparatus for task scheduling of multiple processes on a real-time operating system. Background Art

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

[0003] In related technologies, generally, corresponding processes are 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 complexity of the scheduling strategy and inefficient scheduling. Summary of the Invention

[0004] To solve the above technical problems, embodiments of this application propose a method and apparatus for task scheduling of 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 method for task scheduling of multiple processes on a real-time operating system, including: 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 relationship of the multiple tasks and the corresponding running mode of each of the multiple tasks; Based on the available resource index data corresponding to each of the multiple processes on the real-time operating system, determine the resource stress level of each of the multiple processes; Based on the dependency relationship, the running mode, and the resource stress level, determine a process scheduling plan; Based on the process scheduling plan, establish an inter-process communication channel between some of the multiple processes; 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 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 some processes among the multiple processes.

[0006] Optionally, the determining a process scheduling plan based on the dependency relationship, the running mode, and the resource stress level includes: Convert the dependency relationship into a dependency relationship feature, and convert the running mode into a running mode feature; Determine an initial scheduling plan using an artificial intelligence model based at least on the dependency relationship features and the operation mode features; Adjust the initial scheduling plan based on the resource tension degree to obtain the process scheduling plan.

[0007] Optionally, the artificial intelligence model includes a diffusion model. The step of determining an initial scheduling plan using an artificial intelligence model based at least on the dependency relationship features and the operation mode features includes: Based on preset plan features, the dependency relationship features, and the operation mode features, perform 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, and the noise added in the diffusion operation is suitable for indicating a second random scheduling plan.

[0008] Optionally, 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; 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 operation 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.

[0009] Optionally, the number of groups of the added noise is N groups. The step of adding 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 includes: Add the i-th group of noise among the N groups of the added noise to the plan features output by the (i - 1)-th round of diffusion processing to obtain the i-th round of noise-added features.

[0010] Optionally, the second random scheduling plan includes q resource allocation random plans, w time window random plans, e serial-parallel strategy random plans, and r fault tolerance mechanism random plans, 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.

[0011] Optionally, the information of each task among the multiple tasks includes the task description information of this task. The determining of 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, use 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, divide the multiple tasks into at least one task group; 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 relationships among the tasks included in the corresponding task group.

[0012] Optionally, the determining of the resource tension degrees 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, 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, and the target metric is included in the at least one resource metric; Based on the change trend, determine the resource tension degree of each process among the multiple processes.

[0013] Optionally, before establishing the inter-process communication channels between some of the multiple processes based on the process scheduling scheme, the method further includes: Push the process scheduling scheme to the user; 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, fault tolerance mechanism adjustment information; Update the process scheduling scheme based on the obtained feedback information.

[0014] 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: A monitoring and analysis module, configured to respond to detecting multiple new tasks on the real-time operating system, and determine the dependency relationships of the multiple tasks and the respective 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 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; A scheduling scheme generation module, configured to determine a process scheduling scheme based on the dependency relationships, the running modes, and the resource stress 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; A task execution module, configured to call the 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.

[0015] In summary, the embodiments of the present application have at least the following beneficial effects: By adopting the embodiments of the present application, in response to detecting multiple new tasks on the real-time operating system, the dependency relationships of the multiple tasks and the respective running modes of the multiple tasks are determined based on the information of each of the multiple tasks; the resource stress levels of the multiple processes are determined based on the available resource metric data corresponding to each of the multiple processes on the real-time operating system; a process scheduling scheme is determined based on the dependency relationships, the running modes, and the resource stress levels; an inter-process communication channel between some of the multiple processes is established based on the process scheduling scheme; the some of the processes for which the inter-process communication channel has been established are called to execute a first task among the multiple tasks, and at least one process is called 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, thereby being able to reduce the complexity of the process scheduling strategy and improve the process scheduling efficiency. Description of the Drawings

[0016] Figure 1 is a flowchart of a method for task scheduling of multiple processes on a real-time operating system provided by an embodiment of the present application; Figure 2It is a schematic structural diagram of a task scheduling device for multiple processes on a real-time operating system provided by an embodiment of the present application; Figure 3 It is a schematic diagram of a computer device provided by an embodiment of the present application. Specific embodiments

[0017] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying 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. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without making creative efforts belong to the scope of protection of the present application.

[0018] In the description of the present application, the terms "first", "second", "third", etc. are only used for descriptive purposes, and cannot be understood 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 the present application, unless otherwise stated, the meaning of "a plurality" is two or more. In the description of the present application, the term "including" and its variants are open-ended, that is, "including but not limited to". The term "based on" is "at least partially based on". The term "according to" is "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".

[0019] In the description of the present application, it should be noted that, unless otherwise clearly defined and limited, the terms "installed", "connected", and "connected" 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 components. For those of ordinary skill in the art, the specific meanings of the above terms in the present application can be understood according to specific situations.

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

[0021] In the first aspect, refer to Figure 1, showing a schematic flowchart of a task scheduling method for multiple processes on a real-time operating system provided by an embodiment of the present application. The method includes steps S101 - S105, specifically as follows: 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 relationship of the multiple tasks and the corresponding running mode of each of the multiple tasks.

[0022] In one example, the above dependency relationship can be used to indicate the mutual dependency characteristics between multiple tasks (such as certain tasks must start execution after the completion of their corresponding other tasks). 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 relationship 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 dependency relationship.

[0023] 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.

[0024] In one example, the running mode of each task usually depends on its characteristics and the system environment, and can 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, can also indicate the parallelism of the task), fault tolerance mechanism (the processing method after task failure, 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.).

[0025] S102, based on the available resource metric data corresponding to each of the multiple processes on the real-time operating system, determine the resource stress level of each of the multiple processes.

[0026] In one example, the resource stress level 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 each process with the corresponding metric threshold.

[0027] S103, based on the dependency relationship, the running mode, and the resource stress level, determine a process scheduling scheme.

[0028] In one example, a process scheduling scheme data table can be pre-configured. Multiple standard process scheduling schemes generated / formulated from experimental data can be recorded in the process scheduling scheme data table. Each standard process scheduling scheme can be associated with corresponding experimental dependencies, experimental operation modes, and experimental resource tightness levels. Among them, the experimental dependencies, experimental operation modes, and experimental resource tightness levels are all recorded in the above-mentioned experimental data. The standard process scheduling scheme can include at least one of the following: resource allocation information, time window information, serial-parallel strategy information, and fault tolerance mechanism information.

[0029] In this way, when determining the process scheduling scheme, it is possible to perform matching in the process scheduling scheme data table according to the dependencies, the operation mode, and the resource tightness level, and use the standard process scheduling scheme with the highest matching degree as the process scheduling scheme. Among them, the standard process scheduling scheme with the highest matching degree can refer to the one with the highest comprehensive similarity. This comprehensive similarity can be obtained by weighted summation of the following similarities: the similarity between the dependencies and the experimental dependencies, the similarity between the operation mode and the experimental operation mode, and the similarity between the resource tightness level and the experimental resource tightness level.

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

[0031] 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 part of the processes. In one example, the inter-process communication channel can include multiple sub-communication channels. In this way, 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 part of the 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.

[0032] S105. Invoke the part of the 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. Among them, 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. The at least one process is at least one of the processes other than the part of the processes among the multiple processes.

[0033] 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 dependency relationships 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 an inter-process communication channel can further enhance the smoothness of task execution, reduce potential blocking points, and thus improve the process scheduling efficiency.

[0034] 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 of calling the above-mentioned part of the processes to execute the first task is approximately equal to the second total computational duration of 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.

[0035] In an alternative embodiment, determining the process scheduling scheme based on the dependency relationship, the operation mode, and the resource tension includes: Converting the dependency relationship into a dependency relationship feature, and converting the operation mode into an operation mode feature; Determining an initial scheduling scheme using an artificial intelligence model based on at least the dependency relationship feature and the operation mode feature; Adjusting the initial scheduling scheme based on the resource tension to obtain the process scheduling scheme.

[0036] In one example, the dependency can be converted into a dependency feature and the running mode can be converted into a running mode feature in an encoded manner.

[0037] 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 feature and the running mode feature as inputs and an initial scheduling plan as an output. Among them, the above sample data can include sample dependency features, sample running mode features, and labels, and the label indicates the sample scheduling plan. When training the artificial intelligence model, the sample dependency feature and the sample running mode feature can be input into the artificial intelligence model, and a general loss function can be used to calculate the loss value between the output of the artificial intelligence model and the sample scheduling plan. Finally, the loss value can be used to adjust the parameters of the artificial intelligence model to achieve the effect of model training. It should be understood that the ways of model training are diverse and general. This application only gives examples for reference here and does not specifically limit.

[0038] In one example, adjusting the initial scheduling plan based on the resource tension degree to obtain the process scheduling plan may include: adjusting the initial scheduling plan according to the resource tension degree 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.

[0039] In an alternative embodiment, the artificial intelligence model includes a diffusion model. Determining the initial scheduling plan using the artificial intelligence model based at least on the dependency feature and the running mode feature includes: Performing a diffusion operation using the diffusion model based on a preset plan feature, the dependency feature, and the running mode feature 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.

[0040] 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, so as 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.

[0041] 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; 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; The initial scheduling plan is determined by the solution features output by the N-th diffusion process; When i = 1, the solution features output by the (i - 1)-th diffusion process are the preset solution features.

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

[0043] In an alternative embodiment, the number of the added noises is N groups, and adding 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: Adding the i-th group of the N groups of the added noises to the solution features output by the (i - 1)-th diffusion process to obtain the i-th noise-added features.

[0044] In an example, each group of the N groups of the added noises can be different, and at least part of the N groups of the added noises can be randomly generated, and / or at least part of the noises 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 noises 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).

[0045] Among them, when generating noise based on the status information of the electronic device, the device hardware and system status can be monitored in real time first, and then the following dynamically adjusted noises can be generated according to the monitored device hardware and system status: resource availability perception noise, which 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, which can be used to adjust the priority of data transmission tasks according to the current network latency and / or bandwidth.

[0046] 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; 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.

[0047] In this embodiment, since the q resource allocation random schemes are respectively indicated by q groups of adjacent noises among the N groups of the added noises, in the above N rounds of diffusion processing, it is possible to perform corresponding noise addition and then denoising for resource allocation 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 aspect and accelerating the convergence speed of the model in this aspect. Moreover, the principles for aspects such as time window, serial-parallel strategy, and fault tolerance mechanism are similar, which will not be elaborated here.

[0048] Correspondingly, if the q resource allocation random schemes are discontinuous, it will weaken the correlation between each round of diffusion processing, 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. Also, if they are discontinuous, each round of diffusion processing needs to re-evaluate the current state in terms of resource allocation, increasing unnecessary computational overhead, and easily leading to a slower convergence speed and an extended 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, thus reducing the quality of the final result.

[0049] It should be noted that the diffusion model was originally designed to solve the data generation problem. Its core idea is a process of gradually denoising. 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 process of gradually denoising 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 several seconds to dozens of seconds. However, in this embodiment, since only some metric 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.

[0050] In an alternative embodiment, 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, use 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, divide the multiple tasks into at least one task group; 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 relationships among the tasks included in the corresponding task group.

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

[0052] In an example, the above task description information can be relevant 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.

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

[0054] 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 according to the semantic information of each of multiple tasks, and each task can be assigned to 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.

[0055] In an alternative embodiment, 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: Based on the available resource metric data, determining the change trend of the target metric of each process in 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; Based on the change trend, determining the resource stress level of each process in the multiple processes.

[0056] 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 (priority of the process), preemption rate (the frequency at which the process is preempted by a higher-priority process), queue length (the number of tasks waiting to run in the ready queue).

[0057] 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.

[0058] In an alternative embodiment, before establishing an inter-process communication channel 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 feedback information from 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; Updating the process scheduling scheme based on the obtained feedback information.

[0059] 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.

[0060] 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.

[0061] 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.

[0062] See Figure 2 , which shows a schematic structural diagram of the 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: 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 respective operation modes corresponding to the multiple tasks based on the information of the multiple tasks; A resource analysis module 202, configured to determine the resource tension degree of each of the multiple processes based on the available resource index data corresponding to each of the multiple processes on the real-time operating system; A scheduling scheme generation module 203, configured to determine a process scheduling scheme based on the dependency relationship, the operation mode, and the resource tension level; A channel establishment module 204, configured to establish an inter-process communication channel between some of the multiple processes based on the process scheduling scheme; A task execution module 205, configured to call the some processes that have established the inter-process communication channel 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 processes among the multiple processes.

[0063] In an alternative embodiment, the determining a process scheduling scheme based on the dependency relationship, the operation mode, and the resource tension level includes: Converting the dependency relationship into a dependency relationship feature, and converting the operation mode into an operation mode feature; Determining an initial scheduling scheme using an artificial intelligence model based at least on the dependency relationship feature and the operation mode feature; Adjusting the initial scheduling scheme based on the resource tension level to obtain the process scheduling scheme.

[0064] In an alternative embodiment, the artificial intelligence model includes a diffusion model, and the determining an initial scheduling scheme using an artificial intelligence model based at least on the dependency relationship feature and the operation mode feature includes: Performing a diffusion operation using the diffusion model based on a preset scheme feature, the dependency relationship feature, and the operation 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 by the diffusion operation is suitable for indicating a second random scheduling scheme.

[0065] 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; 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 denoise the i-th round of noise-added feature based on the dependency relationship feature and the operation 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 solution feature output by the (i - 1)-th round of diffusion processing is the preset solution feature.

[0066] In an alternative embodiment, the number of the added noises is N groups, and adding noises to the solution feature output by the (i - 1)-th round of diffusion processing according to the added noises to obtain the i-th round of noise-added feature includes: Adding the i-th group of noises in the N groups of the added noises to the solution feature output by the (i - 1)-th round of diffusion processing to obtain the i-th round of noise-added feature.

[0067] 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; 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.

[0068] In an alternative embodiment, the information of each task among the multiple tasks includes the task description information of the task, and determining the dependency relationship 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 representing the dependency relationship among the tasks included in the corresponding task group.

[0069] In an alternative embodiment, determining 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 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, determine the resource tension level of each process among the multiple processes.

[0070] In an alternative embodiment, the device further includes a scheduling scheme update module, and the scheduling scheme update module is configured to: 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; Obtain 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, fault tolerance mechanism adjustment information; Update the process scheduling scheme based on the obtained feedback information.

[0071] 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.

[0072] 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.

[0073] 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. 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.

[0074] 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 scheduling program for multiple processes on a real-time operating system. When the processor 301 executes the computer program, the steps in the embodiments of the above-mentioned task scheduling methods for multiple processes on the real-time operating system are implemented, such as Figure 1 the steps S101 - S105 shown.

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

[0076] The computer device may 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, or combine certain components, or different components. For example, the computer device may further include input / output devices, network access devices, a bus, etc.

[0077] 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.

[0078] 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 by 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.

[0079] Among them, if the modules / units integrated in the computer device are implemented in the form of software functional 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-mentioned embodiment methods of the present 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-mentioned various method embodiments can be realized. Among them, the computer program includes computer program code, and the computer program code can be in the form of source code, object code, 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 telecommunication signal, and a software distribution medium, etc.

[0080] In summary, the embodiments of the present application at least have the following beneficial effects: By adopting the embodiments 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 respective running modes corresponding to 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 the multiple processes are determined; based on the dependency relationship, 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 part of the processes with the established inter-process communication channel is 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 part of the processes among the multiple processes, so as to reduce the complexity of the process scheduling strategy and improve the process scheduling efficiency.

[0081] 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 implemented entirely by hardware. Based on such an understanding, all or part of the technical solution of the present application that contributes to the background art can be embodied in the form of a software product, and this computer software product can be stored in a storage medium, such as ROM (Read-Only Memory), RAM (Random Access Memory), magnetic disk, optical disc, 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 various embodiments or some parts of the embodiments of the present application.

[0082] 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 refinements can be made, and these improvements and refinements are also regarded as the protection scope of the present application.

Claims

1. A multi-process task scheduling method on a real-time operating system, characterized in that: include: In response to monitoring that a plurality of tasks are newly added to the real-time operating system, determining dependencies among the plurality of tasks and corresponding operation modes of the plurality of tasks based on information of the plurality of tasks; Determining the resource shortage degree of each of the multiple processes based on the available resource indicator data corresponding to each of the multiple processes on the real-time operating system; Determine a process scheduling solution based on the dependency relationship, the operation mode and the resource shortage level; Based on the process scheduling scheme, establishing an inter-process communication channel between some of the multiple processes; Call the part of the processes that have established the inter-process communication channel to execute a first task among the multiple tasks, and call at least one process to execute a second task, wherein the first task is determined from the multiple tasks according to the process scheduling scheme, the second task is a task among the multiple tasks other than the first task, and the at least one process is at least one of the multiple processes other than the part of the processes.

2. The method according to claim 1, characterized in that The determining of the process scheduling scheme based on the dependency, the operation mode and the resource shortage degree includes: Converting the dependency relationship into a dependency relationship feature, and converting the operation mode into an operation mode feature; Determining an initial scheduling plan using an artificial intelligence model based at least on the dependency characteristics and the operation mode characteristics; The initial scheduling plan is adjusted based on the resource shortage level to obtain the process scheduling plan.

3. The method according to claim 2, characterized in that The artificial intelligence model includes a diffusion model, and the initial scheduling scheme is determined by using the artificial intelligence model based at least on the dependency characteristics and the operation mode characteristics, including: Based on the preset scheme characteristics, the dependency characteristics and the operating mode characteristics, the diffusion model is used to perform a diffusion operation to obtain the initial scheduling scheme, wherein the preset scheme characteristics include 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.

4. The method according to claim 3, characterized in that The diffusion operation includes N rounds of diffusion processing, where N is a positive integer, and the diffusion processing includes noise addition processing and noise removal processing; In the i-th round of diffusion processing of the N-round diffusion processing, the noise adding process is configured to add noise to the scheme feature outputted by the i-1-th round of diffusion processing according to the added noise to obtain the i-th round of noise adding feature, and the denoising process is configured to denoise the i-th round of noise adding feature based on the dependency feature and the operation mode feature to obtain the scheme feature outputted by the i-th round of diffusion processing, wherein 1≤i≤N; The initial scheduling scheme is determined by the scheme characteristics output by the Nth round of diffusion processing; When i=1, the solution feature output by the (i-1)th round of diffusion processing is the preset solution feature.

5. The method according to claim 4, characterized in that The number of the added noises is N groups, and the adding of noise to the scheme features outputted by the i-1th round of diffusion processing according to the added noises to obtain the i-th round of noise-added features includes: The i-th group of noise among the N groups of added noise is added to the scheme features output by the i-1-th round of diffusion processing to obtain the i-th round of noise-added features.

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

7. The method according to claim 1, characterized in that The information of each task in the plurality of tasks includes task description information of the task, and the determining the dependency relationship of the plurality of tasks based on the respective information of the plurality of tasks includes: Based on the task description information of each task in the multiple tasks, generate semantic information of each task in the multiple tasks using a pre-trained large language model; Based on the semantic information of each of the multiple tasks, the multiple tasks are divided into at least one task group; Based on the semantic information of each task included in each task group, a dependency graph structure corresponding to each task group is constructed, wherein the dependency graph structure is suitable for representing the dependency relationship between the tasks included in the corresponding task group.

8. The method according to claim 1, characterized in that The determining the resource shortage degree of each of the multiple processes based on the available resource indicator data corresponding to each of the multiple processes on the real-time operating system includes: Based on the available resource indicator data, determining a change trend of a target indicator of each of the multiple processes within a preset time period, wherein the available resource indicator data includes data of at least one resource indicator, and the target indicator is included in the at least one resource indicator; Based on the change trend, the resource stress level of each of the multiple processes is determined.

9. The method according to any one of claims 1 to 8, characterized in that: Before establishing an inter-process communication channel between some of the multiple processes based on the process scheduling scheme, the method further includes: Pushing the process scheduling solution to the user; Acquiring feedback information from the user regarding the process scheduling scheme, wherein the feedback information includes at least one of the following: resource allocation adjustment information, time window adjustment information, serial and parallel strategy adjustment information, and fault tolerance mechanism adjustment information; The process scheduling scheme is updated based on the acquired feedback information.

10. A multi-process task scheduling device on a real-time operating system, characterized in that: include: A monitoring and analysis module, configured to determine, in response to monitoring that a plurality of tasks are newly added to the real-time operating system, dependencies between the plurality of tasks and corresponding operation modes of the plurality of tasks based on information of the plurality of tasks; A resource analysis module, used to determine the resource shortage degree of each of the multiple processes on the real-time operating system based on the available resource indicator data corresponding to each of the multiple processes; A scheduling scheme generating module, used for determining a process scheduling scheme based on the dependency, the operation mode and the resource shortage degree; A channel establishment module, used for establishing an inter-process communication channel between some of the multiple processes based on the process scheduling scheme; A task execution module is used to call the part of the processes that have established the inter-process communication channel to execute a first task among the multiple tasks, and to call at least one process to execute a second task, wherein the first task is determined from the multiple tasks according to the process scheduling scheme, the second task is a task among the multiple tasks other than the first task, and the at least one process is at least one of the multiple processes other than the part of the processes.

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

  • Process allocation method, static scheduling device and record medium

    JP1999272623A