A scheduling scheme determination method and apparatus, device, and storage medium

By optimizing the scheduling scheme using a genetic algorithm, the problem of task execution time uncertainty under multi-core, high-performance system architectures in existing technologies is solved, achieving high real-time and deterministic scheduling and ensuring stable and reliable system operation.

CN122172689APending Publication Date: 2026-06-09BEIJING JINGWEI HIRAIN TECH CO INC

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
BEIJING JINGWEI HIRAIN TECH CO INC
Filing Date
2026-03-13
Publication Date
2026-06-09

AI Technical Summary

Technical Problem

In applications requiring high real-time performance and high determinism, existing technologies struggle to meet the scheduling needs of multi-core, high-performance system architectures. This leads to uncertainty in task execution time and fails to meet the timing constraints of functional safety systems.

Method used

A genetic algorithm is used to optimize the scheduling scheme. By obtaining task and system parameters, setting key control parameters of the genetic algorithm, executing the scheduling scheme optimization of the genetic algorithm, generating a conflict-free feasible scheduling scheme, and determining it as the target scheduling scheme.

Benefits of technology

It improves the accuracy and determinism of scheduling schemes, meets the timing constraints of functional safety systems, ensures that tasks are completed within a strict timing window, and avoids equipment failures and safety accidents.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122172689A_ABST
    Figure CN122172689A_ABST
Patent Text Reader

Abstract

The application provides a scheduling scheme determination method and device, equipment and a storage medium, and relates to the technical field of automobile electronics. In the method, task parameters and system parameters are first obtained, key control parameters of a genetic algorithm are then set, and the key control parameters of the genetic algorithm are set. Then, based on the task parameters, the system parameters and the key control parameters of the genetic algorithm, scheduling scheme optimization of the genetic algorithm is performed to obtain a conflict-free feasible scheduling scheme. Finally, the conflict-free feasible scheduling scheme is determined as a target scheduling scheme. In this way, the accuracy of determining the scheduling scheme is improved by first configuring the key control parameters of the genetic algorithm, then performing the genetic algorithm scheduling scheme optimization based on the task parameters, the system parameters and the algorithm parameters, and finally determining the conflict-free feasible scheduling scheme as the target scheduling scheme.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of automotive electronics technology, and in particular to a method, apparatus, device, and storage medium for determining a scheduling scheme. Background Technology

[0002] In technological fields such as automotive electronics and industrial control, where task execution demands high levels of safety and real-time performance, the time determinism of task scheduling is a core element ensuring the stable and reliable operation of the system. The correctness of system functions depends not only on the accuracy of calculation results but also on whether various tasks can be completed within a strict time window. Any deviations caused by scheduling delays or timing fluctuations can easily lead to problems such as delayed sensor data processing and timeouts in control command execution, potentially resulting in equipment failures and safety accidents. Therefore, stringent requirements are placed on the determinism, rationality, and efficiency of task scheduling schemes.

[0003] Currently, the industry mainly adopts two methods for task scheduling on multi-core processing platforms: dynamic scheduling mechanism and manual orchestration based on human experience. Although these methods can support the operation of conventional systems to a certain extent, they have exposed significant defects and shortcomings when facing application scenarios with high real-time and high determinism, and are no longer suitable for the development trend of multi-core, high-performance, and centralized system architecture.

[0004] Dynamic scheduling mechanisms, typically represented by the Completely Fair Scheduler (CFS) and real-time scheduling classes (SCHED_FIFO / SCHED_RR), are widely used in non-safety-related processing modules. This type of approach achieves multi-task concurrency by dynamically allocating CPU time slices at runtime. However, it is essentially a dynamic priority preemptive scheduling mechanism. The scheduling decision process is highly dependent on real-time changing factors such as task arrival time, system resource contention, and interrupt response timing. This can easily lead to problems such as priority inversion and scheduling delays caused by load fluctuations, making it impossible to guarantee the determinism of task execution time and thus failing to meet the timing constraints of functional safety systems.

[0005] In conclusion, accurately determining the scheduling scheme is a problem that urgently needs to be solved by those skilled in the art. Summary of the Invention

[0006] In view of this, this application provides a method, apparatus, device and storage medium for determining a scheduling scheme, with the aim of accurately determining the scheduling scheme.

[0007] Firstly, this application provides a method for determining a scheduling scheme, including: Obtain task parameters and system parameters; Set the key control parameters for the genetic algorithm; Based on the task parameters, the system parameters, and the key control parameters of the genetic algorithm, the scheduling scheme of the genetic algorithm is optimized to obtain a conflict-free feasible scheduling scheme. The conflict-free feasible scheduling scheme is determined as the target scheduling scheme.

[0008] Optionally, the task parameters include the task name, task period, task running time, and task deadline for each task. The system parameters include the number of CPU cores; The key control parameters of the genetic algorithm include the number of iterations, population size, and mutation rate.

[0009] Optionally, the step of optimizing the scheduling scheme of the genetic algorithm based on the task parameters, the system parameters, and the key control parameters of the genetic algorithm to obtain a conflict-free feasible scheduling scheme includes: Based on the task information model of the target task, the individual encoding scheme of the genetic algorithm, and the initial number of cores, a set of initial scheduling schemes is generated to form the initial population of the genetic algorithm. Calculate the fitness of each initial scheduling scheme in the initial population; Based on the fitness of each initial scheduling scheme in the initial population, selection, crossover, and mutation operations are performed on the initial population to generate the next generation population to achieve iteration; the next generation population includes multiple scheduling schemes. The population is continuously iterated until the current iteration count reaches the preset maximum iteration count; When the current iteration count reaches the preset maximum iteration count, determine whether there is a conflict-free feasible scheduling scheme. If such a conflict-free feasible scheduling scheme exists, then the conflict-free feasible scheduling scheme is determined as the target scheduling scheme.

[0010] Optionally, when the current iteration count reaches a preset maximum iteration count, after determining whether there is a conflict-free feasible scheduling scheme, the method further includes: If it does not exist, the number of CPU cores is incremented by 1, the initial population is reconstructed, and the reconstructed initial population is iterated until the number of iterations reaches the preset maximum number of iterations.

[0011] Optionally, calculating the fitness of each initial scheduling scheme in the initial population includes: The fitness of each initial scheduling scheme in the initial population is calculated using a comprehensive fitness function, which consists of evaluation metrics such as schedulability check, conflict penalty, core number optimization, and load balancing.

[0012] Optionally, before generating an initial scheduling scheme based on the task information model of the target task, the individual encoding scheme of the genetic algorithm, and the initial number of cores to form the initial population of the genetic algorithm, the method further includes: Based on the task parameters, task information modeling is performed on the target task; Based on the system parameters, an individual encoding scheme for the genetic algorithm is constructed; Set the initial number of cores.

[0013] Optionally, after determining the conflict-free feasible scheduling scheme as the target scheduling scheme, the method further includes: The target scheduling scheme is used to generate a timeline chart of the scheduling table to show the utilization of each CPU core.

[0014] Secondly, this application provides a scheduling scheme determination apparatus, comprising: The acquisition module is used to acquire task parameters and system parameters; The configuration module is used to set the key control parameters of the genetic algorithm; The optimization module is used to optimize the scheduling scheme of the genetic algorithm based on the task parameters, the system parameters and the key control parameters of the genetic algorithm, so as to obtain a conflict-free feasible scheduling scheme. The determination module is used to determine the conflict-free feasible scheduling scheme as the target scheduling scheme.

[0015] Optionally, the task parameters include the task name, task period, task running time, and task deadline for each task. The system parameters include the number of CPU cores; The key control parameters of the genetic algorithm include the number of iterations, population size, and mutation rate.

[0016] Optionally, the optimization module includes: The first generation submodule is used to generate a set of initial scheduling schemes based on the task information model of the target task, the individual encoding scheme of the genetic algorithm, and the initial number of cores, so as to form the initial population of the genetic algorithm. The computational submodule is used to calculate the fitness of each initial scheduling scheme in the initial population; The second generation submodule is used to perform selection, crossover, and mutation operations on the initial population based on the fitness of each initial scheduling scheme in the initial population to generate the next generation population to achieve iteration; the next generation population includes multiple scheduling schemes. The first iteration submodule is used to continuously iterate the population until the current iteration count reaches the preset maximum iteration count; The judgment submodule is used to determine whether there is a conflict-free feasible scheduling scheme when the current iteration count reaches the preset maximum iteration count. A determination submodule is used to determine, if it exists, the conflict-free feasible scheduling scheme as the target scheduling scheme.

[0017] Optionally, the device further includes: The second iteration submodule is used to increment the number of CPU cores by 1 if the CPU cores do not exist, reconstruct the initial population, and iterate over the reconstructed initial population until the number of iterations reaches the preset maximum number of iterations.

[0018] Optionally, the computing submodule is specifically used for: The fitness of each initial scheduling scheme in the initial population is calculated using a comprehensive fitness function, which consists of evaluation metrics such as schedulability check, conflict penalty, core number optimization, and load balancing.

[0019] Optionally, the device further includes: The modeling module is used to model the target task based on the task parameters; A construction module is used to construct an individual encoding scheme for the genetic algorithm based on the system parameters; The settings module is used to set the initial number of cores.

[0020] Optionally, the device further includes: The generation module is used to generate a visual timeline chart of the scheduling table for the target scheduling scheme, so as to show the utilization of each CPU core.

[0021] Thirdly, embodiments of this application provide a computer device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the scheduling scheme determination method as described in any of the embodiments of the first aspect of this application.

[0022] Fourthly, embodiments of this application provide a computer-readable storage medium storing instructions that, when executed on a terminal device, cause the terminal device to perform a scheduling scheme determination method as described in any of the embodiments of the first aspect of this application.

[0023] This application provides a method for determining a scheduling scheme. When executing the method, first, task parameters and system parameters are obtained; then, key control parameters of the genetic algorithm are set; next, based on the task parameters, system parameters, and key control parameters, the scheduling scheme is optimized using the genetic algorithm to obtain a conflict-free feasible scheduling scheme; finally, the conflict-free feasible scheduling scheme is determined as the target scheduling scheme. This design, by first configuring the key control parameters of the genetic algorithm, then performing scheduling scheme optimization based on the task parameters, system parameters, and algorithm parameters, and finally determining the conflict-free feasible scheduling scheme as the target scheduling scheme, improves the accuracy of scheduling scheme determination. Attached Figure Description

[0024] To more clearly illustrate the technical solutions in this embodiment or the prior art, the drawings used in the description of the embodiment or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0025] Figure 1 A flowchart illustrating a scheduling scheme determination method provided in this application embodiment; Figure 2 A flowchart illustrating a scheduling scheme optimization method for executing a genetic algorithm, provided in an embodiment of this application; Figure 3 A visual timeline chart provided for embodiments of this application; Figure 4 This is a schematic diagram of a scheduling scheme determination device provided in an embodiment of this application; Figure 5 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. Detailed Implementation

[0026] The technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. This application provides a scheduling scheme determination method, apparatus, device, and storage medium, applicable to the field of automotive electronics technology. The above are merely examples and do not limit the application areas of the methods and apparatuses provided in this application.

[0027] In technological fields such as automotive electronics and industrial control, where task execution demands high levels of safety and real-time performance, the time determinism of task scheduling is a core element ensuring the stable and reliable operation of the system. The correctness of system functions depends not only on the accuracy of calculation results but also on whether various tasks can be completed within a strict time window. Any deviations caused by scheduling delays or timing fluctuations can easily lead to problems such as delayed sensor data processing and timeouts in control command execution, potentially resulting in equipment failures and safety accidents. Therefore, stringent requirements are placed on the determinism, rationality, and efficiency of task scheduling schemes.

[0028] Currently, the industry mainly adopts two methods for task scheduling on multi-core processing platforms: dynamic scheduling mechanism and manual orchestration based on human experience. Although these methods can support the operation of conventional systems to a certain extent, they have exposed significant defects and shortcomings when facing application scenarios with high real-time and high determinism, and are no longer suitable for the development trend of multi-core, high-performance, and centralized system architecture.

[0029] Dynamic scheduling mechanisms, typically represented by the Completely Fair Scheduler (CFS) and real-time scheduling classes (SCHED_FIFO / SCHED_RR), are widely used in non-safety-related processing modules. This type of approach achieves multi-task concurrency by dynamically allocating CPU time slices at runtime. However, it is essentially a dynamic priority preemptive scheduling mechanism. The scheduling decision process is highly dependent on real-time changing factors such as task arrival time, system resource contention, and interrupt response timing. This can easily lead to problems such as priority inversion and scheduling delays caused by load fluctuations, making it impossible to guarantee the determinism of task execution time and thus failing to meet the timing constraints of functional safety systems.

[0030] The inventors, through research, proposed the technical solution of this application. First, task parameters and system parameters are obtained. Then, key control parameters of the genetic algorithm are set. Next, based on the task parameters, system parameters, and key control parameters, the scheduling scheme optimization of the genetic algorithm is performed to obtain a conflict-free feasible scheduling scheme. Finally, the conflict-free feasible scheduling scheme is determined as the target scheduling scheme. This design, by first configuring the key control parameters of the genetic algorithm, then performing genetic algorithm scheduling scheme optimization based on the task parameters, system parameters, and algorithm parameters, and finally determining the conflict-free feasible scheduling scheme as the target scheduling scheme, improves the accuracy of determining the scheduling scheme.

[0031] To enable those skilled in the art to better understand the present application, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments. Obviously, the described embodiments are only a part of the embodiments of the present application, and not all of them. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present application. It should be noted that, for ease of description, only the parts related to the invention are shown in the accompanying drawings. Unless otherwise specified, the embodiments and features in the embodiments of the present application can be combined with each other.

[0032] See Figure 1 , Figure 1 A flowchart of a scheduling scheme determination method provided in this application embodiment includes: S101: Obtain task parameters and system parameters.

[0033] First, obtain the task parameters and system parameters, which are input by the user through the graphical user interface (GUI) or a configuration file. Task parameters include the task name, task period, task execution time, and task deadline for each task. System parameters include the number of CPU cores, used to limit the upper limit of processing resources used for scheduling; the period is the time interval between task executions; the execution time is the time required for each execution of the task; and the deadline is the time when the task must be completed.

[0034] S102: Set the key control parameters for the genetic algorithm.

[0035] Users can set key control parameters of the genetic algorithm through a graphical user interface (GUI) or configuration files. These key control parameters include the number of iterations, population size, and mutation rate. The number of iterations is the total number of rounds in which the genetic algorithm executes the evolutionary process. The population size is the number of candidate solutions (i.e., individuals) in each generation. Each individual represents a possible task scheduling scheme. The mutation rate is the probability that a certain gene (such as the task start time or core number) will be randomly changed during the genetic operation.

[0036] S103: Based on task parameters, system parameters, and key control parameters of the genetic algorithm, the scheduling scheme of the genetic algorithm is optimized to obtain a conflict-free feasible scheduling scheme.

[0037] S104: Determine the conflict-free feasible scheduling scheme as the target scheduling scheme.

[0038] The specific implementation methods in steps S103 and S104 are as follows: Figure 2 As shown, Figure 2 A flowchart of a scheduling scheme optimization method for executing a genetic algorithm, provided in an embodiment of this application, includes: S201: Based on the task parameters, perform task information modeling for the target task.

[0039] First, define the target task To model this, we use a quintuple for representation: ; in, This represents a unique identifier for the task. Indicates the task cycle. Indicates the execution time. Indicates the deadline. Indicates the starting offset. .

[0040] S202: Construct an individual encoding scheme for a genetic algorithm based on system parameters.

[0041] Each individual (chromosome) represents a task allocation scheme, including: Task-to-core mapping: This defines which CPU core each task is assigned to for execution, where N is the total number of tasks to be scheduled in the system and M is the total number of CPU cores.

[0042] Initial offset vector: This defines the starting offset time for each task within its cycle.

[0043] S203: Set the initial number of cores.

[0044] To minimize hardware resources, a "few to many" core initialization strategy is adopted: the initial number of CPU cores used is set to 1, and the number of cores is gradually increased and re-optimized only when the current number of cores cannot find a conflict-free feasible scheduling solution. This ensures the feasibility of the scheduling scheme while avoiding excessive waste of core resources.

[0045] S204: Based on the task information model of the target task, the individual encoding scheme of the genetic algorithm, and the number of cores, generate a set of initial scheduling schemes to form the initial population of the genetic algorithm.

[0046] A random initial scheduling scheme is generated to form an initial population. The population size is set in S102. It is the initial sample for the evolution of the genetic algorithm. When generating the population, two requirements must be met: all individuals must abide by basic boundary constraints, such as non-negative task offsets and offsets not exceeding their own period. Heuristic strategies are used to minimize initial scheduling conflicts, improve the overall quality of the initial population, and reduce the computational cost of subsequent evolution.

[0047] S205: Calculate the fitness of each scheduling scheme in the population.

[0048] The design incorporates a comprehensive fitness function to quantitatively evaluate each individual (scheduling plan) in the population. The evaluation results provide a basis for subsequent genetic operations, with higher fitness values ​​indicating better scheduling plans. This process balances hard constraint satisfaction (must be met, otherwise the plan is infeasible) with soft objective optimization (system performance improvement).

[0049] Scheduleability checks include checks on single-core utilization and deadline constraints, where single-core utilization... The formula for the deadline constraint is as follows: ; ; in, Let be the total utilization of the j-th CPU core; This represents the set of all tasks assigned to the j-th core; Represents a single task The utilization rate reflects the proportion of time a task occupies on the core. The constraint on single-core utilization means that the total utilization rate of a single core must be ≤1.0 (i.e., 100%). If it exceeds this, it means that the computing load of the core is saturated, the task cannot be completed within the time frame, and the solution is not feasible.

[0050] The deadline constraint means that the actual execution time of a task must be less than or equal to its deadline. It is a core hard constraint of real-time systems. If it is not met, the task cannot be completed within the required time, which directly leads to the infeasibility of the scheduling scheme.

[0051] The formula for conflict penalty is as follows: ; ; in, This represents the total number of timing conflicts across all cores in the system. This is a conflict detection function, indicating whether tasks assigned to the same core... and If execution times overlap, return 1; otherwise, return 0. This can avoid making duplicate conflict judgments for the same pair of tasks.

[0052] The penalty term is for conflicts, and its value ranges from (0,1]. The total number of conflicts is... The larger the value, the greater the conflict penalty. The smaller the size, the lower the fitness of the corresponding individual; if there is no conflict ( ), then the conflict penalty item The penalty item takes the maximum value, and there is no penalty.

[0053] The formula for core number optimization is as follows: ; ; in, This refers to the number of CPU cores actually assigned to tasks, i.e., the number of cores effectively used. This indicates that the j-th core has been assigned at least one task; the absolute value represents the cardinality of the set, i.e., the number of elements in the set. For example, if only cores 0, 1, and 2 out of 4 cores have been assigned tasks, and core 3 is empty, then... The value is 3.

[0054] The core number fitness is defined as a value ranging from (0,1], using the core number... Lacking, core number fitness The larger the size, the higher the individual's fitness.

[0055] The formula for load balancing is as follows: ; ; ; Among them, the core utilization set This represents the total utilization rate, which includes all CPU cores. The standard deviation of utilization rate is a core indicator of load dispersion. The smaller the value, the closer the utilization of each core, and the more balanced the load. To effectively utilize the average utilization of cores, only the number of cores used is considered. Each core is assigned a task to avoid empty cores affecting the results; The square of the deviation between the utilization rate of the j-th core and the average value is used to eliminate the mutual cancellation of positive and negative deviations. For load balancing fitness, the value range is (0,1], and the utilization standard deviation is... The smaller the value (the more balanced the load), the better the load balancing fitness. The larger the core, the higher the individual fitness; if the utilization rates of each core are exactly the same ( ),but , is the optimal value.

[0056] Finally, the fitness function is integrated. The calculation method is as follows: ; S206: Based on the fitness of each initial scheduling scheme in the population, perform selection, crossover, and mutation operations on the population to generate the next generation population.

[0057] Select operation: The sampling roulette wheel selection strategy assigns a probability of selection based on an individual's fitness value. Higher fitness increases the probability of selection, ensuring that high-fitness individuals have more opportunities to participate in offspring reproduction while retaining a small number of low-fitness individuals to maintain population diversity. The probability of individual i being selected is... The formula is as follows: ; in, The sum of fitness values ​​of all individuals in the current population is N, where N is the population size (a set genetic algorithm control parameter, i.e., the total number of individuals in each generation).

[0058] Cross operation: Crossover is a process of gene recombination that involves partially exchanging the codes of two superior parent individuals to generate offspring that possess the advantages of both parents. The core steps are as follows: First, randomly select two parent individuals from the chosen high-quality individuals (scheduling scheme), and then randomly select one task. Finally, at the intersection, the tasks in the two parent generations are swapped. Based on the corresponding core allocation results and starting offset, two new offspring individuals are generated.

[0059] In this way, single-point crossover only exchanges the scheduling information of a single task, avoiding the complete loss of the superior characteristics of the parent generation due to a large number of gene exchanges, and ensuring the rationality of the crossover scheme.

[0060] Mutation operation: Mutation involves randomly and slightly modifying the encoding of an individual, introducing new genetic features to prevent the population from falling into "local optima" (i.e., the scheduling scheme found is only locally optimal, not globally optimal). In this application's embodiments, two targeted strategies are designed for the two dimensions of encoding: core allocation mutation and initial offset mutation. Moreover, the mutation operation is controlled by a preset mutation rate to prevent excessive mutation from destroying high-quality schemes.

[0061] Core allocation mutation (modifies the kernel mapping relationship of a task): First, randomly select a task to be mutated. Then calculate the number of conflicts and core utilization after moving the task to each available core. Finally, move the task... The mutation is completed by redistributing the cores to the least conflicted and least utilized cores.

[0062] Starting offset variation (modifies the timing start point of the task): First, randomly select a task to be mutated. Generate a set of candidate offsets for this task: ; That is, the task cycle Divide the data into 10 equal parts, take 9 of the division points and 0 as candidate offsets, and ensure that the offsets satisfy the following conditions: Boundary constraints are then defined. Finally, the number of task conflicts corresponding to each candidate offset is verified sequentially, and the offset with the fewest conflicts is selected as the new offset. , and complete the mutation.

[0063] S207: Has the current iteration count reached the preset maximum iteration count?

[0064] After mutation, the next generation of population can be generated. It is determined whether the current iteration number has reached the preset maximum iteration number. If it has, the implementation scheme in step S208 is executed; if it has not, the process jumps back to the implementation scheme in step S205 to achieve the iteration of the population.

[0065] S208: Is there a conflict-free feasible scheduling scheme?

[0066] Determine whether there is a conflict-free feasible scheduling scheme in the current population. If there is, execute the implementation method in step S210; if not, execute the implementation method in step S209.

[0067] S209: Increase the number of CPU cores by 1.

[0068] Increment the number of CPU cores by 1 and re-execute the implementation method in step S204 to rebuild the initial population and iterate again.

[0069] S210: Determine a conflict-free feasible scheduling scheme as the target scheduling scheme.

[0070] The conflict-free feasible scheduling scheme in S208 is determined as the target scheduling scheme.

[0071] In this embodiment, the target scheduling scheme can be used as a recommended static scheduling table. This table includes: the CPU core number bound to each task and the start offset time of each task within its cycle (relative to the start of the cycle). A visual timeline chart of the scheduling table is generated, displaying the utilization of each CPU core, and the scheduling table is saved as a JSON configuration file.

[0072] In this embodiment, task parameters and system parameters are first obtained, then key control parameters of the genetic algorithm are set. Next, based on the task parameters, system parameters, and key control parameters, the scheduling scheme optimization of the genetic algorithm is performed to obtain a conflict-free feasible scheduling scheme. Finally, the conflict-free feasible scheduling scheme is determined as the target scheduling scheme. This design, by first configuring the key control parameters of the genetic algorithm, then performing scheduling scheme optimization based on the task parameters, system parameters, and algorithm parameters, and finally determining the conflict-free feasible scheduling scheme as the target scheduling scheme, improves the accuracy of determining the scheduling scheme.

[0073] The scheduling scheme determination method provided by the embodiments of this application has been introduced above. The following is an exemplary description of the scheduling scheme determination method in combination with specific application scenarios.

[0074] First, the user inputs the task set parameters as shown in Table 1: Table 1:

[0075] The system parameter setting limits the maximum number of CPU cores to 4.

[0076] Next, set the genetic algorithm parameters. The user sets the following control parameters: number of iterations = 100, population size = 50, mutation rate = 0.1.

[0077] Perform genetic algorithm optimization: The genetic algorithm was started according to the above process: the initial number of cores was set to 1, and after multiple rounds of iteration, no conflict-free solution was found; the number of cores was automatically increased to 2, and after optimization, a small number of conflicts still existed; the number of cores was increased to 3, and a conflict-free feasible scheduling scheme was successfully obtained.

[0078] Finally, as Figure 3 As shown, Figure 3 This application provides a visualization timeline chart that clearly displays the time distribution and execution density of tasks on each core, facilitating manual review and debugging.

[0079] The results and analysis of the scheduling scheme are shown in Table 2. Meanwhile, the optimal scheduling scheme is exported as a JSON file.

[0080] Table 2:

[0081] The above are some specific implementations of the scheduling scheme determination method provided in the embodiments of this application. Based on this, this application also provides a corresponding apparatus. The apparatus provided in the embodiments of this application will be described below from the perspective of functional modularity.

[0082] See Figure 4 , Figure 4 This is a schematic diagram of a scheduling scheme determination device 400 provided in an embodiment of this application. The scheduling scheme determination device 400 includes: Module 410 is used to acquire task parameters and system parameters; Module 420 is used to set the key control parameters of the genetic algorithm; The optimization module 430 is used to optimize the scheduling scheme of the genetic algorithm based on the task parameters, the system parameters and the key control parameters of the genetic algorithm, so as to obtain a conflict-free feasible scheduling scheme. The determination module 440 is used to determine the conflict-free feasible scheduling scheme as the target scheduling scheme.

[0083] Optionally, the task parameters include the task name, task period, task running time, and task deadline for each task. The system parameters include the number of CPU cores; The key control parameters of the genetic algorithm include the number of iterations, population size, and mutation rate.

[0084] Optionally, the optimization module 430 includes: The first generation submodule is used to generate a set of initial scheduling schemes based on the task information model of the target task, the individual encoding scheme of the genetic algorithm, and the initial number of cores, so as to form the initial population of the genetic algorithm. The computational submodule is used to calculate the fitness of each initial scheduling scheme in the initial population; The second generation submodule is used to perform selection, crossover, and mutation operations on the initial population based on the fitness of each initial scheduling scheme in the initial population to generate the next generation population to achieve iteration; the next generation population includes multiple scheduling schemes. The first iteration submodule is used to continuously iterate the population until the current iteration count reaches the preset maximum iteration count; The judgment submodule is used to determine whether there is a conflict-free feasible scheduling scheme when the current iteration count reaches the preset maximum iteration count. A determination submodule is used to determine, if it exists, the conflict-free feasible scheduling scheme as the target scheduling scheme.

[0085] Optionally, the device 400 further includes: The second iteration submodule is used to increment the number of CPU cores by 1 if the CPU cores do not exist, reconstruct the initial population, and iterate over the reconstructed initial population until the number of iterations reaches the preset maximum number of iterations.

[0086] Optionally, the computing submodule is specifically used for: The fitness of each initial scheduling scheme in the initial population is calculated using a comprehensive fitness function, which consists of evaluation metrics such as schedulability check, conflict penalty, core number optimization, and load balancing.

[0087] Optionally, the device 400 further includes: The modeling module is used to model the target task based on the task parameters; A construction module is used to construct an individual encoding scheme for the genetic algorithm based on the system parameters; The settings module is used to set the initial number of cores.

[0088] Optionally, the device 400 further includes: The generation module is used to generate a visual timeline chart of the scheduling table for the target scheduling scheme, so as to show the utilization of each CPU core.

[0089] This application also provides corresponding devices and computer storage media for implementing the solutions provided in this application.

[0090] like Figure 5 As shown, computer device 01 is represented in the form of a general-purpose computing device. Components of computer device 01 may include, but are not limited to: one or more processors or processor units 03, system memory 08, and buses 04 connecting different system components (including system memory 08 and processor units 03).

[0091] Bus 04 represents one or more of several bus architectures, including memory buses or memory controllers, peripheral buses, graphics acceleration ports, processors, or local buses using any of the various bus architectures. Examples of these architectures include, but are not limited to, the Industry Standard Architecture (ISA) bus, the Micro Channel Architecture (MAC) bus, the Enhanced ISA bus, the Video Electronics Standards Association (VESA) local bus, and the Peripheral Component Interconnect (PCI) bus.

[0092] Computer device 01 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by computer device 01, including volatile and non-volatile media, removable and non-removable media.

[0093] System memory 08 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 09 and / or cache memory 10. Computer device 01 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, storage system 11 may be used to read and write non-removable, non-volatile magnetic media (…). Figure 5 Not shown; usually referred to as a "hard drive"). Although Figure 5 As not shown, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk") and an optical disk drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to bus 04 via one or more data media interfaces. System memory 08 may include at least one program product having a set (e.g., at least one) of program modules configured to perform the functions of the embodiments of the present invention.

[0094] A program / utility 12 having a set (at least one) of program modules 13 may be stored, for example, in system memory 08. Such program modules 13 include, but are not limited to, an operating system, one or more application programs, other program modules, and program data. Each or some combination of these examples may include an implementation of a network environment. Program modules 13 typically perform the functions and / or methods described in the embodiments of the present invention.

[0095] Computer device 01 can also communicate with one or more external devices 02 (e.g., keyboard, pointing device, display 07, etc.), and with one or more devices that enable a user to interact with the computer device 01, and / or with any device that enables the computer device 01 to communicate with one or more other computing devices (e.g., network card, modem, etc.). This communication can be performed through input / output (I / O) interface 06. Furthermore, computer device 01 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) through network adapter 05. Figure 5 As shown, network adapter 05 communicates with other modules of computer device 01 via bus 04. It should be understood that, although... Figure 5 As not shown in the diagram, it can be used in conjunction with computer device 01 with other hardware and / or software modules, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0096] The processor unit 03 executes various functional applications and data processing by running programs stored in the system memory 08, such as implementing a scheduling scheme determination method provided in the embodiments of this application.

[0097] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0098] As can be seen from the above description of the embodiments, those skilled in the art can clearly understand that all or part of the steps in the methods of the above embodiments can be implemented by means of software plus a general-purpose hardware platform. Based on this understanding, the technical solution of this application can be embodied in the form of a software product. This computer software product can be stored in a storage medium, such as a read-only memory (ROM) / RAM, magnetic disk, optical disk, etc., including several instructions to cause a computer device (which may be a personal computer, a server, or a network communication device such as a router) to execute the methods described in various embodiments or some parts of the embodiments of this application.

[0099] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on its differences from other embodiments. In particular, the apparatus embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions in the method embodiments. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without creative effort.

[0100] The above description is merely an exemplary implementation of this application and is not intended to limit the scope of protection of this application.

Claims

1. A method for determining a scheduling scheme, characterized in that, include: Obtain task parameters and system parameters; Set the key control parameters for the genetic algorithm; Based on the task parameters, the system parameters, and the key control parameters of the genetic algorithm, the scheduling scheme of the genetic algorithm is optimized to obtain a conflict-free feasible scheduling scheme. The conflict-free feasible scheduling scheme is determined as the target scheduling scheme.

2. The method according to claim 1, characterized in that, The task parameters include the task name, task period, task execution time, and task deadline for each task. The system parameters include the number of CPU cores; The key control parameters of the genetic algorithm include the number of iterations, population size, and mutation rate.

3. The method according to claim 1, characterized in that, The step of optimizing the scheduling scheme using the genetic algorithm based on the task parameters, the system parameters, and the key control parameters of the genetic algorithm to obtain a conflict-free feasible scheduling scheme includes: Based on the task information model of the target task, the individual encoding scheme of the genetic algorithm, and the initial number of cores, a set of initial scheduling schemes is generated to form the initial population of the genetic algorithm. Calculate the fitness of each initial scheduling scheme in the initial population; Based on the fitness of each initial scheduling scheme in the initial population, selection, crossover, and mutation operations are performed on the initial population to generate the next generation population to achieve iteration; the next generation population includes multiple scheduling schemes. The population is continuously iterated until the current iteration count reaches the preset maximum iteration count; When the current iteration count reaches the preset maximum iteration count, determine whether there is a conflict-free feasible scheduling scheme. If such a conflict-free feasible scheduling scheme exists, then the conflict-free feasible scheduling scheme is determined as the target scheduling scheme.

4. The method according to claim 3, characterized in that, When the current iteration count reaches the preset maximum iteration count, after determining whether there is a conflict-free feasible scheduling scheme, the method further includes: If it does not exist, the number of CPU cores is incremented by 1, the initial population is reconstructed, and the reconstructed initial population is iterated until the number of iterations reaches the preset maximum number of iterations.

5. The method according to claim 3, characterized in that, The calculation of the fitness of each initial scheduling scheme in the initial population includes: The fitness of each initial scheduling scheme in the initial population is calculated using a comprehensive fitness function, which consists of evaluation metrics such as schedulability check, conflict penalty, core number optimization, and load balancing.

6. The method according to claim 3, characterized in that, Before generating an initial scheduling scheme based on the task information model of the target task, the individual encoding scheme of the genetic algorithm, and the initial number of cores to form the initial population of the genetic algorithm, the method further includes: Based on the task parameters, task information modeling is performed on the target task; Based on the system parameters, an individual encoding scheme for the genetic algorithm is constructed; Set the initial number of cores.

7. The method according to claim 1, characterized in that, After determining the conflict-free feasible scheduling scheme as the target scheduling scheme, the method further includes: The target scheduling scheme is used to generate a timeline chart of the scheduling table to show the utilization of each CPU core.

8. A scheduling scheme determination device, characterized in that, include: The acquisition module is used to acquire task parameters and system parameters; The configuration module is used to set the key control parameters of the genetic algorithm; The optimization module is used to optimize the scheduling scheme of the genetic algorithm based on the task parameters, the system parameters and the key control parameters of the genetic algorithm, so as to obtain a conflict-free feasible scheduling scheme. The determination module is used to determine the conflict-free feasible scheduling scheme as the target scheduling scheme.

9. A computer device, characterized in that, include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the computer program, implements the scheduling scheme determination method as described in any one of claims 1-7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores instructions that, when executed on a terminal device, cause the terminal device to perform the scheduling scheme determination method as described in any one of claims 1-7.