Task scheduling methods, electronic devices, storage media and program products

By modeling and classifying tasks on industrial edge computing terminals using a five-tuple approach, and combining load balancing strategies and greedy algorithms to optimize task scheduling for multi-core processors, the problems of uneven resource allocation and delayed task response in multi-core architectures are solved, achieving efficient and stable task processing.

CN123114692APending Publication Date: 2026-11-17KONGTROLINK
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611451118.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-17
Publication Date
2026-11-17

AI Technical Summary

Technical Problem

The existing multi-core processor architecture of industrial edge computing terminals cannot accurately match the priority differences, cycle constraints and dynamic load characteristics of industrial tasks in task scheduling, resulting in unbalanced resource allocation, delayed response to critical tasks and decreased system stability.

Method used

By modeling the receiving tasks and abstracting them into a 5-tuple, the tasks are classified into three types: core real-time, near real-time, and non-real-time task structures. The tasks are allocated and scheduled based on a load balancing strategy. The kernel allocation is optimized using a greedy algorithm and a dynamic load balancing mechanism, and tasks that cannot be completed before the deadline are pruned.

Benefits of technology

It achieves efficient utilization of computing resources, improves task processing efficiency, ensures the response of high-priority tasks and system stability, and avoids problems such as uneven resource allocation and task starvation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123114692A_ABST
    Figure CN123114692A_ABST
Patent Text Reader

Abstract

This application provides a task scheduling method, an electronic device, a storage medium, and a program product. The method includes: modeling received tasks to obtain a set of task structures; classifying the task structures in the task structure set to obtain three categories of categorized task structure sets, wherein the task structures in each categorized task structure set correspond to the same priority interval; the three categories of categorized task structure sets include a core real-time set, a near-real-time set, and a non-real-time set, with the core real-time set corresponding to a high-priority interval, the near-real-time set corresponding to a medium-priority interval, and the non-real-time set corresponding to a low-priority interval; and allocating and scheduling tasks corresponding to the three categories of categorized task structure sets based on a load balancing strategy corresponding to the priority intervals of each categorized task structure set. This method aims to fully utilize computing resources and improve task processing efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of industrial edge computing, and more particularly to a task scheduling method, electronic device, storage medium, and program product. Background Technology

[0002] With the deepening of industrial digital transformation, industrial edge computing terminals, as the hub connecting physical devices and information systems, are increasingly exhibiting complex characteristics of high concurrency, heterogeneity, and strong real-time performance in their computing tasks. This necessitates meeting the dual demands of low-latency response and high-throughput processing in scenarios such as high-end equipment manufacturing and intelligent production line collaborative control.

[0003] Currently, mainstream industrial edge terminals generally adopt a multi-core processor architecture in order to simultaneously handle hard real-time tasks such as device logic control and alarm linkage, as well as non-real-time data processing tasks such as data cleaning and model inference through parallel computing capabilities.

[0004] While multi-core architectures theoretically have the potential to improve the overall computing power of a system, their actual performance is highly dependent on the scientific nature and adaptability of the underlying task scheduling strategy. If the scheduling mechanism cannot accurately match the priority differences, cycle constraints and dynamic characteristics of industrial tasks, it is very easy to cause resource allocation imbalance, delayed response of critical tasks and even a decrease in system stability. Therefore, existing technologies cannot meet the actual needs of users. Summary of the Invention

[0005] This application provides a task scheduling method, electronic device, storage medium, and program product to achieve the effect of fully utilizing computing resources and improving task processing efficiency.

[0006] In a first aspect, embodiments of this disclosure provide a task scheduling method, including:

[0007] The received tasks are modeled to obtain a set of task structures, which represents a collection of task structures. Each task structure includes a quintuple corresponding to the task, and the quintuple includes at least the task's priority. The task structures in the set are classified to obtain three categories of task structure sets, where the task structures in each category correspond to the same priority interval. The three categories of task structure sets include a core real-time set, a near-real-time set, and a non-real-time set. The core real-time set corresponds to a high-priority interval, the near-real-time set corresponds to a medium-priority interval, and the non-real-time set corresponds to a low-priority interval. Based on the load balancing strategy corresponding to the priority intervals of each category of task structure set, the tasks corresponding to the three categories of task structure sets are allocated and scheduled.

[0008] In one possible implementation, the step of modeling the received tasks to obtain a task structure set includes: placing tasks in production into a scheduling queue to obtain a task scheduling queue; and abstracting the tasks in the task scheduling queue into quintuples to obtain a task structure set.

[0009] In one possible implementation, the quintuple further includes the task cycle of the task. The step of classifying the task structures in the task structure set to obtain three categories of classified task structure sets includes: labeling the priority levels of the task structure sets to obtain a labeled structure set; associating each task in the labeled structure set with the task cycle to obtain a labeled cycle structure set; and classifying the labeled cycle structure set according to priority from high to low to obtain the three categories of classified task structure sets.

[0010] In one possible implementation, the allocation and scheduling of tasks corresponding to the three categories of task structure sets based on the load balancing strategy corresponding to the priority intervals of each of the three categories of task structure sets includes: marking the deadlines associated with the tasks corresponding to the three categories of task structure sets to obtain marked task structure sets; sorting the marked task structure sets according to a two-dimensional sorting algorithm to obtain sorted task structure sets, wherein the two-dimensional sorting algorithm includes a primary rule and a secondary rule, wherein the primary rule represents sorting based on priority from high to low, and the secondary rule represents sorting based on task cycle from long to short; using a greedy algorithm to perform kernel allocation and pruning on the sorted task structure sets to obtain pruned task structure sets, wherein pruning involves removing tasks that cannot be completed before the deadline; performing dynamic load balancing on the pruned task structure sets to obtain balanced task structure sets; verifying the deadlines on the balanced task structure sets to obtain allocated task structure sets; and scheduling the tasks in the allocated task structure sets to the corresponding kernel task queues for execution.

[0011] In one possible implementation, sorting the annotation task structure set according to a two-dimensional sorting algorithm to obtain a sorted task structure set includes: sorting the annotation task structure set by priority to obtain a priority structure set; and sorting tasks with the same priority in the priority structure set from largest to smallest according to the task cycle to obtain a sorted task structure set.

[0012] In one possible implementation, the step of using a greedy algorithm to perform kernel allocation and pruning on the sorted task structure set to obtain a pruned task structure set includes: sorting the kernels from low to high load to obtain a kernel sorting set, where each kernel represents a core of a multi-core processor in a computing terminal; selecting the first kernel with the lowest load from the kernel sorting set to obtain the lowest kernel; sequentially selecting the first task from the sorted task structure set and assigning it to the lowest kernel to obtain the assigned kernel; calculating the estimated completion time of the task on the assigned kernel, verifying the estimated completion time against the deadline to obtain a Boolean verification result, where the verification result is true if the estimated completion time is earlier than the deadline, and false otherwise; if the verification result is true, confirming the kernel allocation result of the task, updating the load of the lowest kernel and synchronizing it to the kernel sorting set, and continuing to execute the allocation step of the next task; if the verification result is false, pruning and removing the task and marking it as an unassigned task; and obtaining the pruned task structure set in response to satisfying a preset condition.

[0013] In one possible implementation, the step of dynamically load balancing the pruning task structure set to obtain a balanced task structure set includes: periodically checking the load status of the pruning task structure set to obtain a review task structure set; and adjusting the load of the review task structure set to obtain a balanced task structure set.

[0014] In one possible implementation, the step of performing deadline verification on the balanced task structure set to obtain the allocated task structure set includes: periodically checking the structures in the balanced task structure set based on the deadline to obtain a checked task structure set; and removing the task structures in the checked task structure set that fail the deadline verification to obtain the allocated task structure set.

[0015] In one possible implementation, sorting the kernels from low to high according to their load size to obtain a kernel sorting set includes: reserving computing power for the kernels to obtain a reserved kernel set; using a sliding window algorithm to perform load calculation on the reserved kernel set to obtain a load kernel set; and sorting the load kernel set from low to high to obtain a kernel sorting set.

[0016] In one possible implementation, the load adjustment of the review task structure set to obtain a balanced task structure set includes: determining the wake-up of non-real-time tasks in the pruning task structure set to obtain a pruning rearrangement set; releasing the first reserved computing power reserved for the non-real-time tasks in the pruning rearrangement set, and allocating the first reserved computing power to the woken non-real-time tasks to obtain a balanced task structure set.

[0017] Secondly, embodiments of this application provide a task scheduling device, comprising:

[0018] The receiving module is used to model the received tasks and obtain a set of task structure entities;

[0019] The classification module is used to classify the task structures in the task structure set to obtain three categories of task structure sets.

[0020] The scheduling module is used to allocate and schedule tasks corresponding to the three types of task structure sets based on the load balancing strategy corresponding to the priority interval of each of the three types of task structure sets.

[0021] In one possible implementation, when the receiving module models the received tasks to obtain a task structure set, it is specifically used to: put the tasks in production into a scheduling queue to obtain a task scheduling queue; and abstract the tasks in the task scheduling queue into a quintuple to obtain a task structure set.

[0022] In one possible implementation, when the classification module classifies the task structures in the task structure set to obtain three categories of classified task structure sets, it is specifically used to: label the priority levels of the task structure sets to obtain a labeled structure set; associate each task in the labeled structure set with the task cycle to obtain a labeled cycle structure set; and classify the labeled cycle structure set according to priority from high to low to obtain the three categories of classified task structure sets.

[0023] In one possible implementation, when the scheduling module allocates and schedules tasks corresponding to the three categories of task structure sets according to the load balancing strategy corresponding to the priority intervals of each of the three categories of task structure sets, it specifically performs the following steps: Marking the deadlines associated with the tasks corresponding to the three categories of task structure sets to obtain marked task structure sets; sorting the marked task structure sets according to a two-dimensional sorting algorithm to obtain sorted task structure sets, wherein the two-dimensional sorting algorithm includes a primary rule and a secondary rule, the primary rule representing sorting based on priority from high to low, and the secondary rule representing sorting based on task cycle from long to short; using a greedy algorithm to perform kernel allocation and pruning on the sorted task structure sets to obtain pruned task structure sets, wherein pruning involves removing tasks that cannot be completed before the deadline; performing dynamic load balancing on the pruned task structure sets to obtain balanced task structure sets; verifying the deadlines on the balanced task structure sets to obtain allocated task structure sets; and scheduling the tasks in the allocated task structure sets to the corresponding kernel task queues for execution.

[0024] In one possible implementation, when the scheduling module sorts the labeled task structure set according to the two-dimensional sorting algorithm to obtain a sorted task structure set, it specifically performs the following: sorts the labeled task structure set by priority to obtain a priority structure set; and sorts the tasks with the same priority in the priority structure set from largest to smallest according to the task cycle to obtain a sorted task structure set.

[0025] In one possible implementation, when the scheduling module performs kernel allocation and pruning on the sorted task structure set using a greedy algorithm to obtain a pruned task structure set, it specifically performs the following steps: sorting the kernels from low to high load to obtain a kernel sorting set, where each kernel represents a core of a multi-core processor in a computing terminal; selecting the first kernel with the lowest load from the kernel sorting set to obtain the lowest kernel; sequentially selecting the first task from the sorted task structure set and assigning it to the lowest kernel to obtain the assigned kernel; calculating the estimated completion time of the task on the assigned kernel, verifying the estimated completion time against the deadline to obtain a Boolean verification result, where the verification result is true if the estimated completion time is earlier than the deadline, and false otherwise; if the verification result is true, confirming the kernel allocation result of the task, updating the load of the lowest kernel and synchronizing it to the kernel sorting set, and continuing to execute the allocation step of the next task; if the verification result is false, pruning and removing the task and marking it as an unassigned task; and obtaining the pruned task structure set in response to satisfying a preset condition.

[0026] In one possible implementation, when the scheduling module performs dynamic load balancing on the pruning task structure set to obtain a balanced task structure set, it is specifically used to: periodically check the load status of the pruning task structure set to obtain a review task structure set; and adjust the load on the review task structure set to obtain a balanced task structure set.

[0027] In one possible implementation, when the scheduling module obtains the allocation task structure set by verifying the deadline of the balanced task structure set, it specifically performs the following: based on the deadline, periodically checks the structures in the balanced task structure set to obtain a checked task structure set; and retrieves the task structures in the checked task structure set that fail the deadline verification to obtain the allocation task structure set.

[0028] In one possible implementation, when the scheduling module sorts the kernels from low to high according to the load size to obtain the kernel sorting set, it specifically performs the following: reserves computing power for the kernels to obtain a reserved kernel set; performs load calculation on the reserved kernel set using a sliding window algorithm to obtain a load kernel set; and sorts the load kernel set from low to high to obtain the kernel sorting set.

[0029] In one possible implementation, when the scheduling module performs load adjustment on the review task structure set to obtain a balanced task structure set, it is specifically used to: determine the wake-up of non-real-time tasks in the pruning task structure set to obtain a pruning rearrangement set; release the first reserved computing power reserved for non-real-time tasks in the pruning rearrangement set, and allocate the first reserved computing power to the woken non-real-time tasks to obtain a balanced task structure set.

[0030] Thirdly, embodiments of this application provide an electronic device, including: a memory and a processor;

[0031] The memory stores computer-executed instructions;

[0032] The processor executes computer execution instructions stored in the memory, causing the processor to perform the first aspect and / or various possible implementations of the first aspect as described above.

[0033] Fourthly, embodiments of this application provide a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the first aspect and / or various possible implementations of the first aspect.

[0034] Fifthly, embodiments of this application provide a computer program product, including a computer program that, when executed by a processor, implements the first aspect and / or various possible implementations of the first aspect.

[0035] The task scheduling method, electronic device, storage medium, and program product provided in this application's embodiments obtain a task structure set by modeling received tasks. This task structure set represents a collection of tasks abstracted into five-tuples, each containing five task attributes: priority, task cycle, task execution time, task size, and deadline. The task structure set is then classified into three categories: a core real-time set, a near-real-time set, and a non-real-time set. The core real-time set represents high-priority task structures, the near-real-time set represents medium-priority task structures, and the non-real-time set represents low-priority task structures. Based on a load balancing strategy, these three categories of task structures are allocated and scheduled to obtain an allocated task structure set. In short, the process involves associating managed tasks with five-tuple attributes, classifying the priority attributes into three categories of task structures, and then allocating and scheduling tasks within these categories based on a load balancing strategy. This achieves the effect of fully utilizing computing resources and improving task processing efficiency. Attached Figure Description

[0036] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0037] Figure 1 A schematic diagram of a scenario for the task scheduling method provided in this embodiment of the disclosure;

[0038] Figure 2 Flowchart of the task scheduling method provided in the embodiments of this disclosure Figure 1 ;

[0039] Figure 3 for Figure 2 A flowchart illustrating the specific implementation of step S102 in the illustrated embodiment;

[0040] Figure 4 Flowchart of the task scheduling method provided in the embodiments of this disclosure Figure 2 ;

[0041] Figure 5 A flowchart illustrating the specific implementation of step S205;

[0042] Figure 6 A flowchart illustrating the specific implementation of step S205-1;

[0043] Figure 7 A schematic diagram of the task scheduling device provided in this application;

[0044] Figure 8 A schematic diagram of the structure of the electronic device provided in this application.

[0045] The accompanying drawings illustrate specific embodiments of this invention, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the present invention in any way, but rather to illustrate the concepts of this invention to those skilled in the art through reference to particular embodiments. Detailed Implementation

[0046] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this embodiment. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this embodiment as detailed in the appended claims.

[0047] This disclosure provides a task scheduling method that can be applied to applications (APPs) with task scheduling capabilities, such as industrial edge computing platforms and industrial control platforms. More specifically, it can be applied to application scenarios where an industrial edge computing platform receives and distributes tasks, such as during parallel task processing in a multi-core processing architecture. The execution entity in this embodiment can be a terminal device running the aforementioned application with an industrial edge computing platform or industrial control platform, a server deploying the server-side component corresponding to the aforementioned application, or other electronic devices performing similar functions. When the execution entity is a terminal device, the terminal device executes the method provided in this embodiment by running the aforementioned application. When the execution entity is a server, the server-side component of the aforementioned application with task scheduling capabilities can run partially or entirely on the server, executing the method provided in this embodiment on the server side, while the terminal device runs the client-side component of the application. Communication between the server and the terminal device is based on server-client communication, enabling the terminal device to obtain the execution result of the method provided in this embodiment and display it as needed.

[0048] In some embodiments, the terminal device or server can implement the task scheduling method provided in this disclosure by running various computer-executable instructions or computer programs. For example, computer-executable instructions can be program-level commands, machine instructions, or software instructions. Computer programs can be native programs or software modules in an operating system; they can be local applications, i.e., programs that need to be installed in the operating system to run, or small programs embedded in any app, i.e., programs that run in a browser environment. In summary, the aforementioned computer-executable instructions can be any form of instruction, and the aforementioned computer programs can be any form of application, module, or plugin; the specific implementation can be configured as needed. Furthermore, in implementing the task scheduling method provided in this disclosure, the terminal device can execute the method by running computer-executable instructions or computer programs set locally, or by calling computer-executable instructions or computer programs set in an external server. In some embodiments, the server may be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud storage, cloud communication, cloud database, cloud computing, cloud functions, network services, middleware services, domain name services, security services, content delivery network (CDN), and big data and artificial intelligence platforms. Among these, cloud services may be interactive processing services that can be invoked by terminal devices.

[0049] Figure 1This is a schematic diagram of a scenario for the task scheduling method provided in the embodiments of this disclosure, such as... Figure 1 As shown, in industrial production, terminal devices responsible for collecting data upload data to the server, such as video images captured by cameras, motion trajectory data of robotic arms, and signal indicator lights. The server transmits the data to the edge computing nodes based on a load balancing strategy. After receiving the data, the task scheduler deployed on the edge computing nodes generates execution tasks and sends them to the multi-core processor for execution. The task scheduler deployed on the edge computing nodes monitors the operation of the multi-core processor and performs load balancing scheduling of tasks based on the operation status.

[0050] With the deepening of industrial digital transformation, industrial edge computing terminals, as the hub connecting physical devices and information systems, are increasingly exhibiting complex characteristics of high concurrency, heterogeneity, and strong real-time requirements in their computing tasks. To meet the dual demands of low-latency response and high-throughput processing in scenarios such as high-end equipment manufacturing and intelligent production line collaborative control, current mainstream industrial edge terminals generally adopt multi-core processor architectures. This aims to leverage parallel computing capabilities to simultaneously handle hard real-time tasks such as device logic control and alarm linkage, as well as non-real-time data processing tasks such as data cleaning and model inference. While multi-core architectures theoretically possess the potential to improve the overall computing power of the system, their actual performance highly depends on the scientific nature and adaptability of the underlying task scheduling strategy. If the scheduling mechanism cannot accurately match the priority differences, periodic constraints, and dynamic characteristics of industrial tasks, it can easily lead to resource imbalance, delayed response of critical tasks, and even decreased system stability. Therefore, existing technologies cannot meet the actual needs of users. Based on the above scenarios, it is evident that existing technologies suffer from technical problems such as uneven resource allocation, slow response of priority tasks, and even system instability.

[0051] The task scheduling method provided in this embodiment solves the technical problems of high-priority task response delay, large load differences between multiple cores, and low-priority task starvation by deeply integrating multi-core scheduling mechanisms that integrate task priority semantics, dynamic core load status, and task deadline constraints.

[0052] The technical solution of this embodiment and how the technical solution of this embodiment solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this embodiment will be described below with reference to the accompanying drawings.

[0053] Figure 2 Flowchart of the task scheduling method provided in the embodiments of this disclosure Figure 1 ,like Figure 2 As shown, the method includes:

[0054] Step S101: Model the received task to obtain a task structure set. The task structure set represents a collection of task structures. Each task structure includes a quintuple corresponding to the task, and the quintuple includes at least the task priority.

[0055] For example, the target application receives an instruction to execute a task, puts the task into a scheduling queue, and then abstracts the tasks in the scheduling queue into a structure type data that includes a five-tuple of attributes. This structure type data is then uniformly referred to as a task structure. The attributes of the five-tuple include five attributes describing the task: priority, task period, task job time, job size, and deadline. In addition to these five task attributes, the task structure also includes at least the thread that executes the task. At this point, all the tasks in the scheduling queue have been abstracted into task structures, and the collection of task structures obtained after abstraction is the task structure set.

[0056] Step S102: Classify the task structures in the task structure set to obtain three categories of task structure sets. The task structures in the category task structure sets correspond to the same priority interval. The three categories of task structure sets include the core real-time set, the near real-time set, and the non-real-time set. The core real-time set corresponds to the high priority interval, the near real-time set corresponds to the medium priority interval, and the non-real-time set corresponds to the low priority interval.

[0057] For example, the task structures in the task structure set are iterated through, and their priority levels are matched. They are then classified into three categories according to their priority levels: task structures with priority levels between 1 and 3 are classified into the core real-time set; task structures with priority levels between 4 and 6 are classified into the quasi-real-time set; and task structures with priority levels between 7 and 10 are classified into the non-real-time set. The highest priority level is 1, and the lowest priority level is 10. At the same time, the task cycle of the task structures classified into the core real-time set and the quasi-real-time set is assigned. The result is obtained after the loop is completed.

[0058] Step S103: Based on the load balancing strategy corresponding to the priority interval of each category task structure set, allocate and schedule the tasks corresponding to the three categories of task structure sets.

[0059] The system allocates and schedules three categories of task structures based on a preset dynamic load balancing strategy. This strategy is a method to optimize computing power allocation. It determines task allocation and scheduling based on three indicators: the priority of the task structure, the load of the cores in the multi-core processor, and whether the task can be completed before the deadline. First, the task time is obtained by dividing the job size of the task structure by the running speed of the core. Then, the task structures are sorted in ascending order according to priority. When the priorities are the same, they are sorted in descending order according to the job time. The tasks corresponding to the sorted task structures are then assigned to the cores with the lowest load. After allocation, the deadline is checked. For example, if thread 1 is assigned to core 1 to execute this task, the job time of thread 1 is 3 milliseconds. However, task 2, which is assigned to thread 1, also takes 3 milliseconds, but will time out in 4 milliseconds. At this time, the cores need to be reallocated to find the cores with low load that can complete the task within 4 milliseconds and then assign the task to them.

[0060] Furthermore, in one possible implementation, exemplarily, step S101 is specifically implemented in the following ways:

[0061] Step S101-1: Add tasks in production to the scheduling queue to obtain the task scheduling queue.

[0062] Step S101-2: Abstract the tasks in the task scheduling queue into quintuples to obtain a set of task structures.

[0063] For example, firstly, the tasks to be executed are placed into the scheduling queue in order to obtain the task scheduling queue. Then, task structures are created for the tasks in the task scheduling queue in order. The task structure includes at least the attributes describing the task in the five-tuple. At the same time, the thread to execute the task is also created. After the task structures are created for the tasks in the queue, a set of task structures is obtained.

[0064] Figure 3 for Figure 2 The flowchart illustrates a specific implementation of step S102 in the illustrated embodiment. Further, in one possible implementation, step S102 of the method includes:

[0065] Step S102-1: Label the priority levels of the task structure set to obtain the labeled structure set.

[0066] Step S102-2: Associate each task in the annotation structure set with a task cycle to obtain the annotation cycle structure set.

[0067] Step S102-3: Classify the labeling cycle structure set according to priority from high to low to obtain three types of classification task structure sets.

[0068] For example, a loop is performed on the task structures in the task structure set. In each loop, the priority of the structures is marked from high to low according to the importance of the task, resulting in a marked structure set. The marking range is between 1 and 10, where 1 is the highest priority and 10 is the lowest priority. After marking, the task structures with priority between 1 and 6 are found and their task cycles are assigned values, resulting in a marked cycle structure set. Finally, the task structures are grouped. First, the structures with priority levels 1-3 are divided into the first group. Then, the task structures with priority levels 4-6 are divided into the second group. The remaining task structures with priority levels 7-10 are divided into the third group. At this point, a three-category task structure set is obtained.

[0069] Figure 4 Flowchart of the task scheduling method provided in the embodiments of this disclosure Figure 2 In this embodiment Figure 2 Based on the illustrated embodiment, a further refinement of step S103 is added, including:

[0070] Step S201: Model the received task to obtain a task structure set. The task structure set represents a collection of task structures. Each task structure includes a quintuple corresponding to the task, and the quintuple includes at least the task priority.

[0071] Step S202: Classify the task structures in the task structure set to obtain three categories of task structure sets. The task structures in the category task structure sets correspond to the same priority interval. The three categories of task structure sets include core real-time task structure set, quasi-real-time task structure set, and non-real-time task structure set. The core real-time task structure set corresponds to the high priority interval, the quasi-real-time task structure set corresponds to the medium priority interval, and the non-real-time task structure set corresponds to the low priority interval.

[0072] Steps S201 and S202 have been explained previously and will not be repeated here.

[0073] Step S203: Label the deadlines associated with the tasks corresponding to the three categories of task structure sets to obtain labeled task structure sets.

[0074] For example, the structure of the three categories of task structure sets is traversed, and the deadline of the task structure is assigned during the traversal. After the traversal is completed, the labeled task structure set is obtained.

[0075] Step S204: Sort the labeled task structure set according to the two-dimensional sorting algorithm to obtain the sorted task structure set. The two-dimensional sorting algorithm includes a main rule and a secondary rule. The main rule represents sorting based on priority from high to low, and the secondary rule represents sorting based on task cycle from long to short.

[0076] For example, the task structures in the annotation task structure set are sorted according to a two-dimensional sorting algorithm. The two-dimensional sorting algorithm sorts the task structures in the annotation task structure set based on two dimensions: priority and task cycle. Priority corresponds to the primary rule, and task cycle corresponds to the secondary rule. First, the task structures are sorted from low to high priority. When different task structures have the same priority, they are sorted from long to short task cycle. The sorted task structure set is then obtained.

[0077] Step S205: Use a greedy algorithm to perform kernel allocation and pruning on the sorting task structure set to obtain a pruned task structure set. Pruning involves removing tasks that cannot be completed before the deadline.

[0078] For example, the greedy algorithm refers to a locally optimal allocation algorithm adapted to the multi-core processor architecture of industrial edge computing terminals, and oriented towards industrial task scheduling scenarios with priority, task cycle, and deadline constraints. Its core is to select the locally optimal decision at each step of kernel allocation for a task, that is, to select the kernel with the lowest load, without having to consider the future task allocation requirements and kernel load changes in advance. The kernel refers to the computing core of the multi-core processor. Pruning refers to the task filtering and elimination strategy adapted to the kernel allocation logic of the greedy algorithm during the task scheduling process, which eliminates tasks that cannot be completed before the deadline and completes resource release.

[0079] The specific implementation is as follows: First, a greedy algorithm is used to allocate kernels to the sorting task structure set. The task corresponding to the first task structure in the sorting task structure set is selected first and assigned to the kernel with the lowest load. Then, by checking the deadline of this task, the task that cannot be completed is constrained to be assigned. Finally, the pruned task structure set is obtained.

[0080] Step S206: Perform dynamic load balancing on the pruning task structure set to obtain a balanced task structure set.

[0081] For example, reserved computing power refers to reserving a portion of the kernel's computing resources for later use before allocating tasks to the kernel's queue of tasks to be executed. For instance, 20% of computing resources are reserved before allocation, and the kernel utilization rate is strictly limited to no more than 80% before allocating tasks to the kernel's queue of tasks to be executed. By monitoring the load status of multi-core processors in real time, computing resources are re-scheduled for the task structures in the pruned task structure set that has undergone greedy algorithm kernel allocation and pruning, and dynamic load balancing is performed. Dynamic load balancing refers to dynamic adjustment of computing resources, such as dynamically allocating reserved computing power. The target application sets a task wake-up mechanism for non-real-time sets. When the task corresponding to the structure in the non-real-time set waits for more than 30 seconds, the priority of the task is increased. If the execution time of the task in the real-time set of the core exceeds twice the task cycle, the task is forcibly killed, and the task corresponding to the task structure in the non-real-time set is allowed to jump the queue for execution, thereby completely avoiding task starvation and making the load of each kernel tend to be balanced, resulting in a set of task structures with reasonable load distribution and stable task execution, i.e., a balanced task structure set.

[0082] Step S207: Perform deadline verification on the balanced task structure set to obtain the assigned task structure set.

[0083] For example, deadline verification of the balanced task structure set is performed by conducting a final compliance check on the deadlines of the tasks that have been allocated by the kernel in the balanced task structure set. This filters out tasks that may have timeout risks during the load adjustment process, such as time loss during task migration and computing power reallocation, and finally obtains an allocated task structure set without deadline risks that can be directly executed on the processor.

[0084] Step S208: Schedule the tasks in the assigned task structure set to the corresponding kernel task queue for execution.

[0085] For example, the tasks corresponding to the task structures in the task allocation task structure set have been verified for deadlines, and the tasks are queued in the kernel's pending task queue for execution.

[0086] Furthermore, in one possible implementation, step S204 in this embodiment specifically includes:

[0087] Step S204-1: Sort the annotation task structure set by priority to obtain the priority structure set.

[0088] Step S204-2: For tasks with the same priority in the priority structure set, sort them from largest to smallest according to their task cycle to obtain the sorted task structure set.

[0089] For example, firstly, the task structures in the annotation task structure set are sorted according to priority, that is, the task structures in the annotation task structure set are sorted from high to low priority to obtain a priority structure set; then, the task structures in the priority structure set are sorted a second time, that is, when the priority of the task structures in the priority structure set is the same, they are sorted according to the task cycle from long to short, and the sorted task structure set is obtained after completion.

[0090] Figure 5 The flowchart illustrates a specific implementation of step S205. Further, in one possible implementation, step S205 of the method includes:

[0091] Step S205-1: Sort the kernels from low to high according to their load size to obtain the kernel sort set. The kernels represent the cores of the multi-core processor of the computing terminal.

[0092] For example, the load of the kernels of the multi-core processor running the target application is collected in real time, and the kernel loads are sorted from low to high to obtain a kernel sort set. Here, the load refers to the quantified value of the real-time kernel load, such as kernel 1 load 13%, kernel 2 load 25%, kernel 3 load 60%, kernel 4 load 80%, kernel 5 load 65%, and kernel 6 load 70%. Here, kernel refers to the computing core in the multi-core processor.

[0093] Step S205-2: Select the first kernel with the lowest load from the kernel sort set to obtain the lowest load kernel.

[0094] For example, the first kernel in the kernel sort set is selected, that is, the kernel with the lowest load.

[0095] Step S205-3: Select the first task from the sorted task structure set and assign it to the lowest kernel to obtain the assigned kernel.

[0096] For example, the first task structure is selected from the sorted task structure set, and the task corresponding to the task structure is assigned to the kernel with the lowest load. The task structure records the reference address of the assigned kernel. The kernel is assigned a task, that is, the assigned kernel.

[0097] Step S205-4: Calculate the estimated completion time of the task on the kernel after allocation, and verify the estimated completion time against the deadline to obtain a Boolean value verification result. If the estimated completion time is earlier than the deadline, the verification result is true; otherwise, it is false.

[0098] For example, the estimated completion time is obtained by calculating the sum of the time spent on tasks waiting to be executed in the kernel and the time spent on tasks in this particular task. This estimated completion time is then compared with the deadline of the corresponding task structure in terms of time dimension to obtain a verification result in Boolean form. If the completion time is earlier than the deadline, it is determined that the kernel allocation meets the deadline constraint of the task and the verification result is true; otherwise, it is false.

[0099] Step S205-5: If the verification result is true, confirm the kernel allocation result of the task, update the load of the lowest kernel and synchronize it to the kernel sorting set, and continue to execute the allocation step of the next task; if the verification result is false, prune the task and mark it as an unallocated task.

[0100] For example, if the verification result is true, the kernel allocation result of the task is first confirmed directly, that is, the binding relationship between the task and the lowest kernel is locked. The task is officially included in the task queue to be executed of the kernel and becomes the task to be processed of the kernel. The real-time load of the lowest kernel is updated. Specifically, the resource consumption of the task is added to the quantized value of the current load of the kernel. If the quantized value reaches 70% after addition, the dynamic refresh of the single kernel load is completed to ensure that the kernel load data can truly reflect its current computing resource consumption status. If the verification result is false, it means that the task will definitely exceed the deadline when it is executed on the current lowest kernel. The kernel allocation is meaningless. At this time, a pruning operation will be performed on the task, that is, the task will be removed from the current sorted task structure to prevent it from continuing to occupy scheduling resources and participate in the subsequent kernel allocation process, thus filtering out invalid tasks from the source.

[0101] Step S205-6: In response to the satisfaction of preset conditions, obtain the pruning task structure set.

[0102] For example, by iteratively executing the entire set of operations in the first five steps, the minimum kernel is selected, the first task in the sorting task structure set is assigned to the minimum kernel, the completion time is checked to confirm whether the task can be successfully completed in the selected minimum kernel, the kernels that can be completed are finally bound, and the kernels that cannot be completed are pruned and removed. The kernel sorting set and the sorting task structure set are updated in real time until all tasks that have completed the effective kernel allocation are integrated during this greedy algorithm scheduling process, that is, the preset conditions are met, and the resulting set is the pruned task structure set.

[0103] Furthermore, in one possible implementation, step S206 in this embodiment specifically includes:

[0104] Step S206-1: Periodically check the load status of the pruning task structure set to obtain the review task structure set.

[0105] Step S206-2: Perform load adjustment on the review task structure set to obtain a balanced task structure set.

[0106] For example, for all multi-core processor kernels bound to tasks in the pruning task structure set, real-time quantitative detection and statistics of load, task execution progress, and resource usage status are performed periodically. The core detection kernel load, job time of tasks waiting to be executed in the kernel, and reserved computing power usage are key indicators. After detection, a review task structure set is obtained. After inspection, kernels with uneven load are dynamically adjusted, tasks corresponding to task structures in the non-real-time set are woken up, resources are released for tasks that have not been completed for more than twice the task cycle time, and tasks corresponding to task structures in the non-real-time set are allowed to be executed in the queue.

[0107] Furthermore, in one possible implementation, step S207 in this embodiment specifically includes:

[0108] Step S207-1: Based on the deadline, periodically check the structures in the balanced task structure set to obtain the checked task structure set.

[0109] For example, the task structures in the balanced task structure set that has been pruned are traversed and checked periodically. The load of the kernel bound to the task structure and its deadline are retrieved, the latest estimated completion time of the task is calculated, the latest estimated completion time of each task is compared with its own deadline in the time dimension, the compliance check of the task deadline is completed, and a deadline check flag is added to each task structure. If the flag is qualified or unqualified, the checked task structure set is obtained after the traversal is completed.

[0110] Step S207-2: Remove the task structures that fail the deadline check from the task structure set to obtain the assigned task structure set.

[0111] For example, for task structures marked as unqualified in the task structure set, targeted secondary scheduling is performed. At the same time, for the tasks corresponding to these task structures, a kernel with a lower load is re-matched, and the estimated completion time is recalculated until the compliance check based on the deadline is met. For the tasks corresponding to the task structures marked as qualified in the task structure set, kernel binding is performed. Kernel binding refers to the final locking operation between the task structure and the kernel, which is valid until the task is completed. However, if a task that cannot be completed within the deadline is found later, it can be unbound, and the task corresponding to the task structure is also placed in the kernel's pending task queue until the loop ends, and the assigned task structure set is obtained.

[0112] Figure 6The flowchart shows a specific implementation of step S205-1. Further, in one possible implementation, step S205-1 of the method includes:

[0113] Step S205-1-1: Reserve computing power for the kernels to obtain the reserved kernel set.

[0114] Step S205-1-2: Use the sliding window algorithm to perform load calculation on the reserved kernel set to obtain the load kernel set.

[0115] Step S205-1-3: Sort the load kernel set from low to high to obtain the kernel sorted set.

[0116] For example, the kernel load is traversed to allocate a portion of the kernel's computing resources as computing power reservation. Computing power reservation refers to allocating a fixed percentage of the kernel's computing resources for subsequent use, such as allocating 20% ​​of the computing resources as exclusive reserved computing power for tasks corresponding to the task structure in the core real-time centralized task. After traversal, a reserved kernel set is obtained. The sliding window algorithm is used to statistically analyze the load of the kernels in the reserved kernel set over a period of time. The sliding window algorithm is a technique for controlling the workload by statistically analyzing the maximum number of loads received within each time window. In this embodiment, the load received by the window needs to be calculated by kernel load, that is, the sum of the task time of the queued tasks in the kernel and the task time to be allocated is calculated. Each kernel independently initializes a sliding window, and the window duration and data sampling frequency are uniformly configured to ensure that the scale of kernel collection is consistent, thus obtaining a load kernel set. Then, the kernels in the load kernel set are sorted from low to high according to their load to obtain a kernel sorting set.

[0117] Furthermore, in one possible implementation, step S206-2 in this embodiment specifically includes:

[0118] Step S206-2-1: Perform wake-up determination on the non-real-time tasks in the pruning task structure set to obtain the pruning rearrangement set.

[0119] For example, the pruned task structure set is traversed, and the non-real-time set is precisely filtered out according to the task type. The pending execution status of the task corresponding to this type of task structure is marked, and the bound kernel identifier is marked. When the waiting time of the task corresponding to this type of task structure exceeds 30 seconds, the priority level is reduced by 1, up to a maximum of 6 levels. The priority improvement operation is implemented by the daemon thread of the target application periodically scanning. During the traversal, the wake-up judgment of the task is implemented, and the task status identifier is updated synchronously. After the traversal is completed, the pruned and rearranged set is obtained.

[0120] Step S206-2-2: Release the first reserved computing power reserved for non-real-time tasks in the pruning and rearrangement set, and allocate the first reserved computing power to the awakened non-real-time tasks to obtain a balanced task structure set.

[0121] For example, the first reserved computing power refers to the portion of the kernel's computing power reserved in advance. 20% of the kernel's computing power is reserved in advance. Previously, when allocating computing power based on the load balancing strategy, only 80% of the kernel's computing power was allocated. The pruning and rearrangement set is traversed, and tasks corresponding to high-priority task structures in the non-real-time set are selected and allocated to kernels with low load. At this time, the reserved computing power can be released. At the same time, the execution time of the tasks corresponding to the task structures in the core real-time set is checked. When the execution time exceeds twice its task cycle, the target application terminates the execution thread and releases kernel resources, removes the core real-time task bound to the kernel, and synchronously updates the kernel's reserved computing power value. The released computing power is then allocated to the awakened non-real-time low-priority tasks, and the status of the tasks and the kernel is synchronously updated to obtain a balanced task structure set.

[0122] Figure 7 A schematic diagram of the task scheduling device provided in this application is shown below. Figure 7 As shown, the task scheduling device 40 provided in this embodiment includes:

[0123] The receiving module 401 is used to model the received tasks and obtain a task structure set;

[0124] The classification module 402 is used to classify the task structures in the task structure set to obtain three categories of task structure sets.

[0125] The scheduling module 403 is used to allocate and schedule tasks corresponding to the three categories of task structure sets based on the load balancing strategy corresponding to the priority interval of each category of task structure set.

[0126] In one possible implementation, when the receiving module 401 obtains a task structure set by modeling the received tasks, it specifically performs the following: puts the tasks in production into a scheduling queue to obtain a task scheduling queue; and abstracts the tasks in the task scheduling queue into a quintuple to obtain a task structure set.

[0127] In one possible implementation, when the classification module 402 classifies the task structures in the task structure set to obtain three categories of classified task structure sets, it is specifically used to: label the priority level of the task structure set to obtain a labeled structure set; associate each task in the labeled structure set with a task cycle to obtain a labeled cycle structure set; and classify the labeled cycle structure set according to priority from high to low to obtain three categories of classified task structure sets.

[0128] In one possible implementation, when the scheduling module 403 allocates and schedules tasks corresponding to the three categories of task structure sets according to the load balancing strategy corresponding to the priority intervals of each category of task structure set, it specifically performs the following steps: Marking the deadlines associated with the tasks corresponding to the three categories of task structure sets to obtain marked task structure sets; sorting the marked task structure sets according to a two-dimensional sorting algorithm to obtain sorted task structure sets, the two-dimensional sorting algorithm including a primary rule and a secondary rule, the primary rule representing sorting based on priority from high to low, and the secondary rule representing sorting based on task duration from long to short; using a greedy algorithm to perform kernel allocation and pruning on the sorted task structure sets to obtain pruned task structure sets, pruning being the removal of tasks that cannot be completed before the deadline; performing dynamic load balancing on the pruned task structure sets to obtain balanced task structure sets; verifying the deadlines of the balanced task structure sets to obtain allocated task structure sets; and scheduling the tasks in the allocated task structure sets to the corresponding kernel task queues for execution.

[0129] In one possible implementation, when the scheduling module 403 sorts the labeled task structure set according to the two-dimensional sorting algorithm to obtain the sorted task structure set, it specifically performs the following: sorts the labeled task structure set by priority to obtain a priority structure set; and sorts the tasks with the same priority in the priority structure set from largest to smallest according to their task cycle to obtain the sorted task structure set.

[0130] In one possible implementation, when the scheduling module 403 performs kernel allocation and pruning on the sorted task structure set using a greedy algorithm to obtain a pruned task structure set, it specifically performs the following steps: sorting the kernels from low to high according to their load size to obtain a kernel sorting set, where each kernel represents the core of a multi-core processor in the computing terminal; selecting the first kernel with the lowest load from the kernel sorting set to obtain the lowest kernel; sequentially selecting the first task from the sorted task structure set and assigning it to the lowest kernel to obtain the assigned kernel; calculating the estimated completion time of the task on the assigned kernel, verifying the estimated completion time against the deadline to obtain a Boolean verification result, where the verification result is true if the estimated completion time is earlier than the deadline, and false otherwise; if the verification result is true, confirming the kernel allocation result of the task, updating the load of the lowest kernel and synchronizing it to the kernel sorting set, and continuing to execute the allocation step of the next task; if the verification result is false, pruning and removing the task and marking it as an unassigned task; and obtaining the pruned task structure set in response to the satisfaction of a preset condition.

[0131] In one possible implementation, when the scheduling module 403 obtains a balanced task structure set by dynamically load balancing the pruning task structure set, it specifically performs the following: periodically checks the load status of the pruning task structure set to obtain a review task structure set; and adjusts the load of the review task structure set to obtain a balanced task structure set.

[0132] In one possible implementation, when the scheduling module 403 obtains the allocation task structure set by verifying the deadline of the balanced task structure set, it specifically performs the following: based on the deadline, periodically checks the structures in the balanced task structure set to obtain a checked task structure set; and retrieves the task structures in the checked task structure set that fail the deadline verification to obtain the allocation task structure set.

[0133] In one possible implementation, when the scheduling module 403 sorts the kernels from low to high according to the load size to obtain the kernel sorting set, it specifically performs the following: reserves computing power for the kernels to obtain a reserved kernel set; uses a sliding window algorithm to perform load calculation on the reserved kernel set to obtain a load kernel set; and sorts the load kernel set from low to high to obtain the kernel sorting set.

[0134] In one possible implementation, when the scheduling module 403 obtains a balanced task structure set by adjusting the load of the review task structure set, it specifically performs the following: wake-up determination of non-real-time tasks in the pruning task structure set to obtain a pruning rearrangement set; release the first reserved computing power reserved for non-real-time tasks in the pruning rearrangement set, and allocate the first reserved computing power to the woken non-real-time tasks to obtain a balanced task structure set.

[0135] The task scheduling device provided in this embodiment can execute the method provided in the above method embodiment. Its implementation principle and technical effect are similar, and will not be described in detail here.

[0136] Figure 8 A schematic diagram of the structure of the electronic device provided in this application. Figure 8 As shown, the electronic device 50 provided in this embodiment includes at least one processor 501 and a memory 502. Optionally, the device 50 further includes a communication component 503. The processor 501, memory 502, and communication component 503 are connected via a bus 504.

[0137] In a specific implementation, at least one processor 501 executes computer execution instructions stored in memory 502, causing at least one processor 501 to perform the above-described method.

[0138] The specific implementation process of processor 501 can be found in the above method embodiments, and its implementation principle and technical effect are similar. It will not be repeated here.

[0139] In the above embodiments, it should be understood that the processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), etc. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in this invention can be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules within the processor.

[0140] The memory may include random access memory (RAM) and may also include non-volatile memory (NVM), such as at least one disk storage device.

[0141] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of illustration, the buses shown in the accompanying drawings are not limited to a single bus or a single type of bus.

[0142] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the above-described method.

[0143] This application also provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the above-described method.

[0144] The aforementioned readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The readable storage medium can be any available medium accessible to a general-purpose or special-purpose computer.

[0145] An exemplary readable storage medium is coupled to a processor, enabling the processor to read information from and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can reside in an Application Specific Integrated Circuit (ASIC). Alternatively, the processor and the readable storage medium can exist as discrete components in the device.

[0146] The division of units is merely a logical functional division; in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be indirect coupling or communication connection through some interfaces, devices, or units, and may be electrical, mechanical, or other forms.

[0147] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0148] In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0149] If a function is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0150] Those skilled in the art will understand that all or part of the steps of the above-described method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above-described method embodiments; and the aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.

[0151] Finally, it should be noted that other embodiments of the invention will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This invention is intended to cover any variations, uses, or adaptations of the invention that follow the general principles of the invention and include common knowledge or customary techniques in the art not disclosed herein, and is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of the invention is limited only by the appended claims.

Claims

1. A task scheduling method, characterized in that, include: The received task is modeled to obtain a task structure set, which represents a collection of task structures. Each task structure includes a quintuple corresponding to the task, and the quintuple includes at least the priority of the task. The task structures in the task structure set are classified to obtain three categories of task structure sets, wherein the task structures in the classified task structure sets correspond to the same priority interval; the three categories of task structure sets include a core real-time set, a near-real-time set, and a non-real-time set, wherein the core real-time set corresponds to the high priority interval, the near-real-time set corresponds to the medium priority interval, and the non-real-time set corresponds to the low priority interval. Based on the load balancing strategy corresponding to the priority interval of each of the three types of task structure sets, the tasks corresponding to the three types of task structure sets are allocated and scheduled.

2. The method according to claim 1, characterized in that, The process of modeling the received tasks yields a task structure set, including: Tasks in production are placed into the scheduling queue to obtain the task scheduling queue; The tasks in the task scheduling queue are abstracted into quintuples to obtain a set of task structures.

3. The method according to claim 1, characterized in that, The quintuple also includes the task cycle of the task. The task structures in the task structure set are classified to obtain three categories of task structure sets, including: The priority levels of the task structure set are labeled to obtain the labeled structure set; Associating each task in the annotation structure set with a task cycle yields a labeling cycle structure set; The labeling cycle structure set is classified according to priority from high to low to obtain the three types of classification task structure sets.

4. The method according to claim 1, characterized in that, The quintuple also includes the deadline of the task. The allocation and scheduling of tasks corresponding to the three categories of task structure sets based on the load balancing strategy corresponding to the priority intervals of each of the categorized task structure sets includes: The deadlines associated with the tasks corresponding to the three types of task structure sets are labeled to obtain labeled task structure sets; The labeled task structure set is sorted according to a two-dimensional sorting algorithm to obtain a sorted task structure set. The two-dimensional sorting algorithm includes a main rule and a secondary rule. The main rule represents sorting based on priority from high to low, and the secondary rule represents sorting based on task cycle from long to short. A greedy algorithm is used to perform kernel allocation and pruning on the sorted task structure set to obtain a pruned task structure set. The pruning is to remove tasks that cannot be completed before the deadline. Dynamic load balancing is performed on the pruning task structure set to obtain a balanced task structure set. The deadline is verified on the balanced task structure set to obtain the assigned task structure set; The tasks in the assigned task structure are scheduled to the corresponding kernel task queues for execution.

5. The method according to claim 4, characterized in that, The sorting of the labeled task structure set according to a two-dimensional sorting algorithm yields a sorted task structure set, including: The annotation task structure set is sorted by priority to obtain a priority structure set; For tasks with the same priority in the priority structure set, sort them from largest to smallest according to the task cycle to obtain the sorted task structure set.

6. The method according to claim 4, characterized in that, The step of using a greedy algorithm to perform kernel allocation and pruning on the sorting task structure set to obtain a pruned task structure set includes: The kernels are sorted from low to high according to their workload to obtain a kernel sort set, where each kernel represents the core of the multi-core processor of the computing terminal. The lowest-loaded kernel is selected from the kernel sorting set to obtain the lowest-loaded kernel; The first task is sequentially selected from the sorted task structure set and assigned to the lowest kernel to obtain the assigned kernel; Calculate the estimated completion time of the task on the kernel after the allocation, and verify the estimated completion time with the deadline to obtain a verification result in Boolean form. If the estimated completion time is earlier than the deadline, the verification result is true; otherwise, it is false. If the verification result is true, the kernel allocation result of the task is confirmed, the load of the lowest kernel is updated and synchronized to the kernel sorting set, and the allocation step of the next task is continued; if the verification result is false, the task is pruned and marked as an unallocated task. In response to the fulfillment of preset conditions, the pruning task structure set is obtained.

7. The method according to claim 4, characterized in that, The dynamic load balancing of the pruning task structure set to obtain a balanced task structure set includes: Periodically check the load status of the pruning task structure set to obtain a review task structure set; The load is adjusted on the review task structure set to obtain a balanced task structure set; The process of load balancing the review task structure set to obtain a balanced task structure set includes: The non-real-time tasks in the pruning task structure set are awakened to obtain the pruning rearrangement set. Release the first reserved computing power reserved for non-real-time tasks in the pruning and rearrangement set, and allocate the first reserved computing power to the awakened non-real-time tasks to obtain a balanced task structure set.

8. The method according to claim 4, characterized in that, The step of performing deadline verification on the balanced task structure set to obtain the assigned task structure set includes: Based on the deadline, the structures in the balanced task structure set are checked periodically to obtain the checked task structure set. Task structures that fail the deadline verification in the task structure set are retrieved to obtain the assigned task structure set.

9. The method according to claim 6, characterized in that, The kernels are sorted from low to high according to their load size to obtain a kernel sort set, including: The computing power of the kernels is reserved to obtain a set of reserved kernels; The reserved kernel set is load-calculated using a sliding window algorithm to obtain the load kernel set. The load kernel set is sorted from low to high to obtain the kernel sort set.

10. An electronic device, characterized in that, include: Memory, processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory, causing the processor to perform the method as described in any one of claims 1-9.