Unmanned aerial vehicle task scheduling method and device, electronic equipment, medium and product
By constructing a task table and a key event hook mechanism, the standardized registration and priority response of tasks in the UAV remote controller are realized, which solves the problem of delay in key radio frequency events and improves the reliability and real-time performance of UAV task scheduling.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-19
- Publication Date
- 2026-03-10
AI Technical Summary
When existing drone remote controllers handle multiple concurrent tasks in complex radio frequency environments, the processing delay of critical radio frequency events becomes uncontrollable, leading to data packet loss or command loss, which affects the stability and security of drone control.
By constructing a task table and entering key information such as task processing function pointers and stack space requirements, the system achieves standardized registration and unified management of tasks to be executed. Combining the system's minimum time tick and key event function hooks, it prioritizes the execution of key radio frequency events and executes ordinary tasks in an orderly manner.
It effectively reduces scheduling delays and the risk of data packet loss, and improves the reliability and real-time performance of UAV task scheduling in complex radio frequency environments.
Smart Images

Figure CN121397759B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of unmanned aerial vehicle (UAV) technology, specifically to a UAV mission scheduling method, apparatus, electronic device, medium, and product. Background Technology
[0002] Drone remote controllers need to handle multiple real-time tasks simultaneously, such as control commands, image transmission, and frequency hopping, in complex radio frequency environments. This places extremely high demands on the reliability and timeliness of task scheduling. Existing technologies typically employ a preemptive scheduling strategy based on fixed priorities. While this strategy can manage priorities among tasks, it suffers from uncontrollable delays in processing critical radio frequency events when facing scenarios with multiple concurrent tasks and varying real-time requirements. This can easily lead to data packet loss or command loss due to task preemption or scheduling delays, severely impacting the stability and security of drone control. Summary of the Invention
[0003] In view of the above problems, this application provides a method, apparatus, electronic device, medium and product for scheduling unmanned aerial vehicle (UAV) missions, which can solve the problems of untimely response to critical radio frequency events and easy data loss.
[0004] Firstly, this application provides a method for scheduling unmanned aerial vehicle (UAV) missions, including:
[0005] Obtain all pending tasks in the remote control system;
[0006] The tasks to be executed are uniformly registered in a pre-built task table; wherein, the unified scheduling entry point of the task table is a preset main scheduling function;
[0007] A new task scheduling cycle is triggered based on the system's minimum time tick.
[0008] Based on the function hooks of critical events, prioritize executing the currently triggered target critical event;
[0009] After the critical events are processed, the remaining non-core routine tasks in the task table are executed sequentially according to the main scheduling function and the scheduling frequency registered in the task table.
[0010] In the above technical solution, the method can coordinate scheduling through unified task registration and main scheduling function, and achieve priority response by combining the system minimum time tick and key event function hooks, thereby ensuring the timely processing of key radio frequency events, while orderly promoting the execution of ordinary tasks, thus effectively reducing scheduling delay and data packet loss risk, and improving the reliability and real-time performance of UAV task scheduling in complex radio frequency environments.
[0011] In some implementations, registering the tasks to be executed to a pre-built task table includes:
[0012] Construct a task table and obtain the task information of the tasks to be executed;
[0013] The tasks to be executed are registered in the task table according to the task information.
[0014] The tasks to be executed include at least radio frequency communication tasks and non-core general tasks;
[0015] The task information includes at least the task processing function pointer, the required stack space size, the native priority, and the base frequency at which the task to be executed is scheduled.
[0016] In the above technical solution, the method can achieve standardized registration and unified management of tasks to be executed by constructing a task table and entering key information such as task processing function pointers and stack space requirements, and clarify the basic scheduling parameters of radio frequency communication tasks and ordinary tasks.
[0017] In some implementations, triggering a new task scheduling cycle based on the system's minimum time tick includes:
[0018] Construct a semaphore triggering mechanism based on the system's minimum time cycle;
[0019] Based on the semaphore triggering mechanism, a unified tick source is determined to drive the execution cycle of all tasks in the task table;
[0020] The unified beat source triggers and sends a semaphore to the main scheduling function to wake up the main scheduling function and thus trigger a complete task scheduling cycle.
[0021] In the above technical solution, the method can establish a unified semaphore triggering mechanism by constructing a unified semaphore triggering mechanism through the minimum time tick of the system, establish a unified tick source for the execution cycle of all tasks, and ensure that the main scheduling function is accurately woken up.
[0022] In some implementations, the currently triggered target critical event is prioritized for execution based on the function hook triggering status of the critical event, including:
[0023] The triggering status of hook functions for multiple key events is detected in a preset order;
[0024] When it is determined that a critical event has been triggered based on the triggering status of the hook function, the target critical event that has been triggered is identified, and the processing logic corresponding to the target critical event is executed immediately.
[0025] Among them, the key events are one of the following: radio frequency reception interruption event, radio frequency transmission completion confirmation event, multi-channel radio frequency failure event, frequency hopping trigger event, and upgrade package transmission trigger event;
[0026] All of the aforementioned critical events are stored in a circular buffer queue and sorted by priority.
[0027] In the above technical solution, the method can detect the trigger status of key event hook functions in a preset order, and combine the ring buffer queue to realize the priority sorting and efficient storage of key radio frequency events, so as to ensure that core events such as radio frequency reception interruption and frequency hopping trigger are identified and executed in time, greatly reducing the response delay of key events and ensuring the reliability of UAV radio frequency communication and core control.
[0028] In some embodiments, the method further includes:
[0029] Upon receiving data to be transmitted to the drone, the data is uniformly sent to the radio frequency transmission queue; wherein, the data to be transmitted includes at least control commands, upgrade packages, and status query commands;
[0030] Within each system minimum time tick, the highest priority data is extracted from the radio frequency transmission queue and transmitted until all data in the radio frequency transmission queue has been transmitted.
[0031] In the above technical solution, this method can unify control commands, upgrade packages and other data to be sent into the radio frequency transmission queue, and extract and send data according to priority in each system minimum time tick, thereby achieving orderly scheduling and efficient transmission of data, avoiding data transmission congestion or priority confusion, ensuring the priority delivery of core control data, reducing the risk of data loss, and improving the stability of UAV command transmission and upgrade interaction.
[0032] In some implementations, the step of sequentially executing the remaining non-core general tasks in the task table according to the main scheduling function and the scheduling frequency registered in the task table includes:
[0033] The remaining non-core general tasks are obtained according to the task table; wherein, the non-core general tasks include at least the screen display information update task, the user key status parsing task, and the device matching status detection task.
[0034] The non-core ordinary tasks are executed sequentially using the main scheduling function and the scheduling frequency registered in the task table.
[0035] Specifically, during the execution of the non-core ordinary tasks, the triggering status of hook functions for multiple key events is continuously monitored. When a key event is detected, the execution of the non-core ordinary tasks is paused first, and the newly triggered key event is executed immediately.
[0036] In the above technical solution, the method can execute non-core ordinary tasks such as screen display updates and key parsing in an orderly manner by combining the scheduling frequency registered in the task table with the main scheduling function. At the same time, it continuously monitors the triggering status of key events during the execution process to ensure that ordinary tasks can be paused and responded to in a timely manner when key events are triggered. This ensures the orderly progress of ordinary tasks while avoiding the impact on the timely processing of core events.
[0037] Secondly, this application provides a drone mission scheduling device, comprising:
[0038] The acquisition unit is used to acquire all tasks to be executed in the remote control system;
[0039] A registration unit is used to uniformly register the tasks to be executed into a pre-built task table; wherein, the unified scheduling entry point of the task table is a preset main scheduling function;
[0040] The triggering unit is used to trigger a new task scheduling cycle based on the system's minimum time tick.
[0041] The first execution unit is used to prioritize the execution of the currently triggered target key event based on the function hook triggering status of the key event;
[0042] The second execution unit is used to execute the remaining non-core ordinary tasks in the task table in sequence according to the main scheduling function and the scheduling frequency registered in the task table after completing the processing of the target key event.
[0043] In the above technical solution, the device can achieve standardized registration and unified management of tasks to be executed by constructing a task table and entering key information such as task processing function pointers and stack space requirements, and clarify the basic scheduling parameters of radio frequency communication tasks and ordinary tasks.
[0044] Thirdly, this application provides an electronic device including a memory and a processor, the memory storing a computer program, and the processor running the computer program to cause the electronic device to perform the unmanned aerial vehicle (UAV) mission scheduling method described in any one of the first aspects.
[0045] Fourthly, this application provides a readable storage medium storing a computer program, which, when executed by a processor, performs the UAV mission scheduling method described in any one of the first aspects.
[0046] Fifthly, this application provides a computer program product, which includes a computer program that, when executed by a processor, performs the UAV mission scheduling method described in any one of the first aspects.
[0047] The beneficial effects of this application are: by constructing a task table and entering key information such as task processing function pointers and stack space requirements, it is possible to achieve standardized registration and unified management of tasks to be executed, and clarify the basic scheduling parameters of radio frequency communication tasks and ordinary tasks. Attached Figure Description
[0048] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments of this application will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0049] Figure 1 This is a flowchart illustrating the drone mission scheduling method in some embodiments of this application;
[0050] Figure 2 This is a schematic diagram of the structure of the unmanned aerial vehicle (UAV) mission scheduling device in some embodiments of this application;
[0051] Figure 3 This is a schematic diagram of the structure of an electronic device in some embodiments of this application. Detailed Implementation
[0052] The embodiments of the technical solution of this application will now be described in detail with reference to the accompanying drawings. These embodiments are only used to more clearly illustrate the technical solution of this application and are therefore merely examples, and should not be used to limit the scope of protection of this application.
[0053] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains; the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the application; the terms “comprising” and “having”, and any variations thereof, in the specification, claims, and foregoing description of the drawings are intended to cover non-exclusive inclusion.
[0054] In the description of the embodiments of this application, technical terms such as "first" and "second" are used only to distinguish different objects and should not be construed as indicating or implying relative importance or implicitly specifying the number, specific order, or primary and secondary relationship of the indicated technical features. In the description of the embodiments of this application, "multiple" means two or more (including two), similarly, "multiple sets" refers to two or more sets (including two sets), and "multiple pieces" refers to two or more pieces (including two pieces) unless otherwise explicitly defined.
[0055] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.
[0056] In the description of the embodiments in this application, the term "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Additionally, the character " / " in this document generally indicates that the preceding and following related objects have an "or" relationship.
[0057] Existing technologies typically employ a preemptive scheduling strategy based on fixed priorities. While this strategy can achieve priority management between tasks, it suffers from uncontrollable delays in critical radio frequency event processing when facing scenarios with multiple concurrent tasks and varying real-time requirements. This can easily lead to data packet loss or command loss due to task preemption or scheduling delays, severely impacting the stability and security of UAV control.
[0058] To address the aforementioned technical issues, this application provides a method for scheduling unmanned aerial vehicle (UAV) tasks. This method can achieve standardized registration and unified management of tasks to be executed by constructing a task table and inputting key information such as task processing function pointers and stack space requirements, and clarify the basic scheduling parameters for radio frequency communication tasks and ordinary tasks.
[0059] like Figure 1 As shown, some embodiments of this application provide a UAV mission scheduling method, which includes:
[0060] S101. Obtain all pending tasks in the remote control system;
[0061] S102. Register all tasks to be executed into a pre-built task table; the unified scheduling entry point for the task table is the preset main scheduling function.
[0062] S103. Trigger a new task scheduling cycle based on the system's minimum time tick.
[0063] S104. Based on the function hook triggering status of critical events, prioritize the execution of the currently triggered target critical event;
[0064] S105. After completing the processing of the target critical events, execute the remaining non-core ordinary tasks in the task table in sequence according to the main scheduling function and the scheduling frequency registered in the task table.
[0065] In some embodiments, the tasks to be performed refer to a set of various tasks that need to be processed during the operation of the UAV remote control system, including at least radio frequency communication tasks and non-core general tasks, covering various pending matters related to core control and auxiliary functions.
[0066] In some embodiments, a task table refers to a pre-built carrier for the unified registration and management of all tasks to be executed. It can store task information such as task processing function pointers, stack space size, native priority, and scheduling baseline frequency, providing data support for unified scheduling.
[0067] In some embodiments, the main scheduling function refers to a pre-defined unified scheduling entry point for the task table, which is used to coordinate the triggering of task scheduling cycles and execute non-core ordinary tasks according to rules. It is the core function for achieving orderly task scheduling.
[0068] In some embodiments, the minimum time tick of the system refers to the minimum time unit set in the UAV remote control system, which serves as a benchmark for the task scheduling cycle and is used to construct the semaphore triggering mechanism and drive the uniformity of the task execution cycle.
[0069] In some embodiments, the task scheduling cycle refers to the complete time cycle for completing one round of task scheduling (including critical event processing and ordinary task execution) triggered based on the system's minimum time tick.
[0070] In some embodiments, critical events refer to core events in the UAV remote control system that are crucial to operational stability and safety, including at least radio frequency reception interruption events, radio frequency transmission completion confirmation events, multi-channel radio frequency failure events, frequency hopping trigger events, and upgrade package transmission trigger events.
[0071] In some embodiments, a function hook refers to a trigger detection mechanism associated with a critical event, used to detect in real time whether the corresponding critical event has been triggered, and to provide a trigger signal for prioritizing the execution of the critical event.
[0072] In some embodiments, a target critical event refers to a critical event that has been detected by a function hook and has been triggered, and whose corresponding processing logic should be executed first.
[0073] In some embodiments, non-core general tasks refer to auxiliary function tasks in the UAV remote control system that do not directly affect core radio frequency communication and control, including at least screen display information update tasks, user button status parsing tasks, and device matching status detection tasks.
[0074] In some embodiments, the scheduling frequency refers to a baseline parameter set when a task is registered to the task table to determine the frequency of task execution. The main scheduling function executes non-core ordinary tasks based on this parameter.
[0075] For example, this method eliminates the need to deploy separate scheduling entry points for each task. Instead, it uniformly attaches all tasks to the `os_main_task()` main scheduling function for execution. Based on this, the method achieves unified management of task function reuse and scheduling logic, eliminating the potential priority conflicts inherent in distributed multi-task scheduling.
[0076] For example, this method can, after the high-priority event (i.e., critical event) has been processed, allow os_main_task() to execute non-core ordinary tasks sequentially according to the scheduling frequency registered in the TaskTable.
[0077] In the above embodiments, the method can coordinate scheduling through unified task registration and main scheduling function, and achieve priority response by combining the system minimum time tick and key event function hooks, thereby ensuring the timely processing of key radio frequency events, while orderly promoting the execution of ordinary tasks, thereby effectively reducing scheduling delay and data packet loss risk, and improving the reliability and real-time performance of UAV task scheduling in complex radio frequency environments.
[0078] In some embodiments, tasks to be executed are uniformly registered in a pre-built task table, including:
[0079] Build a task table and obtain task information for tasks to be executed;
[0080] Register all tasks to be executed into the task table based on the task information.
[0081] The tasks to be executed include at least radio frequency communication tasks and non-core general tasks;
[0082] Task information includes at least the task processing function pointer, the required stack space size, the native priority, and the base frequency at which the task to be executed is scheduled.
[0083] For example, this method can be based on the TaskTable task table driving mechanism. First, a standardized task table carrier is constructed. Then, the task information of all radio frequency / non-radio frequency tasks such as control command transmission, image transmission, and frequency hopping processing is obtained. The core parameters such as task function pointer, stack space configuration, native priority, and scheduling base frequency are uniformly entered into the task table to realize the standardized registration and centralized management of all tasks to be executed.
[0084] In the above embodiments, the method can achieve standardized registration and unified management of tasks to be executed by constructing a task table and entering key information such as task processing function pointers and stack space requirements, and clarify the basic scheduling parameters of radio frequency communication tasks and ordinary tasks.
[0085] In some embodiments, triggering a new task scheduling cycle based on the system's minimum time tick includes:
[0086] Construct a semaphore triggering mechanism based on the system's minimum time cycle;
[0087] The unified tick source for the execution cycle of all tasks in the driving task table is determined based on the semaphore triggering mechanism;
[0088] Triggered by a unified tick source, a semaphore is sent to the main scheduler function to wake it up and thus trigger a complete task scheduling cycle.
[0089] In some embodiments, the semaphore triggering mechanism described above also supports dynamically adjusting the task scheduling frequency based on the service scenario. For example, increasing the radio frequency communication task clock frequency during long-distance flight, or increasing the data transmission task frequency when the image transmission bandwidth is increased. This dynamic adjustment method, replacing traditional fixed-frequency scheduling, better adapts to the real-time requirements of various scenarios.
[0090] For example, this method can construct a system tick-level semaphore triggering mechanism (such as task_sem_post) and use it as a unified scheduling tick source for all tasks, so that the main scheduling function (os_main_task()) can complete the task scheduling cycle triggering through semaphore waiting / waking.
[0091] In the above embodiments, the method can establish a unified semaphore triggering mechanism by constructing a system minimum time tick, establish a unified tick source for the execution cycle of all tasks, and ensure that the main scheduling function is accurately woken up.
[0092] In some embodiments, the currently triggered target critical event is executed first based on the function hook triggering status of the critical event, including:
[0093] The system detects the triggering of hook functions for multiple key events in a preset order.
[0094] When it is determined that a critical event has been triggered based on the hook function triggering situation, the target critical event that has been triggered is identified, and the processing logic corresponding to the target critical event is executed immediately.
[0095] Among them, the key events are one of the following: radio frequency reception interruption event, radio frequency transmission completion confirmation event, multi-channel radio frequency failure event, frequency hopping trigger event, and upgrade package transmission trigger event;
[0096] All critical events are stored in a circular buffer queue and sorted by priority.
[0097] For example, this method can prioritize entering the super-priority event scheduling layer in the os_main_task() execution chain. Following a preset order corresponding to the priority of critical events, it sequentially detects and processes various hook function-triggered events (such as immediately processing the receive logic when the RF receive interruption hook detects a data transmission interruption, or executing module self-recovery when the multi-channel RF fault hook detects an anomaly). All critical events are stored and sorted through a circular buffer queue, and this super-priority scheduling layer has a higher priority than all native RTOS tasks, thus ensuring that core events are not lost and are responded to with priority.
[0098] For example, this method can detect and process preset hook function triggered events sequentially according to the priority of key events, specifically including:
[0099] (1) Radio frequency reception interruption hook: When a data transmission interruption of the UAV is detected, the reception event is processed immediately;
[0100] (2) RF transmission completion hook: When the Tx completion Ack signal is detected, the transmission confirmation logic is processed immediately;
[0101] (3) Multi-channel RF fault hook: When the multi_rf_irq_erro_flag exception is detected, multi_rf_init() is executed to complete the RF module self-recovery;
[0102] (4) Frequency hopping trigger hook: When an FHSS frequency hopping event is detected, the frequency switching logic is executed immediately;
[0103] (5) Upgrade package transmission hook: When an upgrade trigger signal is detected, the upgrade data is immediately processed and sent.
[0104] In the above embodiments, the method can detect the trigger status of key event hook functions in a preset order, and combine a circular buffer queue to realize the priority sorting and efficient storage of key radio frequency events, ensuring that core events such as radio frequency reception interruption and frequency hopping trigger are identified and executed in a timely manner, greatly reducing the response delay of key events and ensuring the reliability of UAV radio frequency communication and core control.
[0105] In some embodiments, the method further includes:
[0106] When receiving data to be sent to the drone, the data is sent to the radio frequency transmission queue. The data to be sent includes at least control commands, upgrade packages, and status query commands.
[0107] Within each system minimum time tick, the highest priority data is extracted from the RF transmission queue and transmitted until all data in the RF transmission queue has been transmitted.
[0108] For example, all radio frequency data (control commands, upgrade packages, status query commands, etc.) to be sent to the drone can be uniformly enqueued into the radio frequency transmission queue (rf_queue).
[0109] For example, within each system tick, after completing the processing of super-priority events, this method only extracts the single data with the highest current priority from the rf_queue and performs the transmission operation, thereby avoiding link conflicts and Ack loss caused by concurrent contention of multiple transmission requests, thus ensuring the timing determinism of radio frequency transmission.
[0110] In the above embodiments, the method can unify control commands, upgrade packages and other data to be sent into the radio frequency transmission queue, and extract and send data according to priority in each system minimum time tick, thereby achieving orderly scheduling and efficient transmission of data, avoiding data transmission congestion or priority confusion, ensuring the priority delivery of core control data, reducing the risk of data loss, and improving the stability of UAV command transmission and upgrade interaction.
[0111] In some embodiments, based on the main scheduling function and the scheduling frequency registered in the task table, the remaining non-core ordinary tasks in the task table are executed sequentially, including:
[0112] Obtain the remaining non-core general tasks from the task list; among them, non-core general tasks include at least the screen display information update task, the user key status parsing task, and the device matching status detection task.
[0113] Non-core ordinary tasks are executed sequentially using the main scheduling function and the scheduling frequency registered in the task table.
[0114] In particular, during the execution of non-core routine tasks, the system continuously monitors the triggering of hook functions for multiple critical events. When a critical event is detected, the execution of the non-core routine tasks is paused first, and the newly triggered critical event is executed immediately.
[0115] For example, after a high-priority event (i.e. a critical event) is processed, the main scheduling function (os_main_task()) can execute non-core routine tasks such as screen display updates, user key status parsing, and device matching status detection in sequence according to the scheduling frequency registered in the TaskTable, ensuring the normal operation of non-RF business logic.
[0116] For example, if a new super-priority event is detected during the execution of a normal task, the execution of the current normal task can be paused, and the newly triggered super-priority event can be responded to and processed first.
[0117] In the above embodiments, the method can execute non-core routine tasks such as screen display updates and key parsing in an orderly manner by combining the scheduling frequency registered in the task table with the main scheduling function. At the same time, it continuously monitors the triggering status of critical events during the execution process to ensure that routine tasks can be paused and responded to in a timely manner when critical events are triggered. This ensures the orderly progress of routine tasks while avoiding any impact on the timely processing of core events.
[0118] In some embodiments, the method further includes:
[0119] The task scheduling strategy is dynamically adjusted based on the real-time service status; the real-time service status includes at least image transmission bandwidth, flight distance, and radio frequency link quality.
[0120] Specifically, the dynamic adjustment of task scheduling strategy includes:
[0121] (1) Increase or decrease the scheduling frequency of core tasks as needed to reduce ineffective high-frequency scheduling;
[0122] (2) Only trigger the necessary task logic in the current business scenario to reduce CPU idle rate;
[0123] (3) Combine the radio frequency link status feedback to dynamically adjust the priority sorting rules of the radio frequency transmission queue (rf_queue).
[0124] In the above embodiments, the method can adapt to the dynamic needs of different flight scenarios. By precisely controlling the core task scheduling frequency, simplifying invalid task logic, and optimizing the priority of radio frequency data transmission, it can reduce system resource consumption and improve CPU operating efficiency while ensuring the real-time performance of core radio frequency communication and control tasks. At the same time, it can enhance the stability and adaptability of radio frequency link transmission and further optimize the overall operating performance of the UAV remote control system.
[0125] Figure 2 A schematic diagram of a drone mission scheduling device is shown. It should be understood that this device is related to... Figure 1 The method executed in the middle corresponds to the steps involved in the aforementioned method. The specific functions and effects of the device can be found in the description above. To avoid repetition, detailed descriptions are omitted here.
[0126] The drone mission scheduling device includes:
[0127] Acquisition unit 210 is used to acquire all tasks to be executed in the remote control system;
[0128] Registration unit 220 is used to uniformly register tasks to be executed into a pre-built task table; wherein, the unified scheduling entry point of the task table is a preset main scheduling function;
[0129] Triggering unit 230 is used to trigger a new task scheduling cycle based on the system's minimum time tick.
[0130] The first execution unit 240 is used to prioritize the execution of the currently triggered target key event based on the function hook triggering status of the key event;
[0131] The second execution unit 250 is used to execute the remaining non-core ordinary tasks in the task table in sequence according to the main scheduling function and the scheduling frequency registered in the task table after completing the processing of the target critical event.
[0132] In some embodiments, the registration unit 220 includes:
[0133] The first construction subunit 221 is used to construct a task table and obtain task information of the tasks to be executed;
[0134] Registration subunit 222 is used to register all tasks to be executed to the task table based on task information;
[0135] The tasks to be executed include at least radio frequency communication tasks and non-core general tasks;
[0136] Task information includes at least the task processing function pointer, the required stack space size, the native priority, and the base frequency at which the task to be executed is scheduled.
[0137] In some embodiments, the triggering unit 230 includes:
[0138] The second construction subunit 231 is used to construct a semaphore triggering mechanism based on the minimum time tick of the system.
[0139] The first determining subunit 232 is used to determine the unified clock source for the execution cycle of all tasks in the driving task table based on the semaphore triggering mechanism;
[0140] Trigger subunit 233 is used to trigger and send a semaphore to the main scheduling function according to the unified tick source, so as to wake up the main scheduling function and trigger a complete task scheduling cycle.
[0141] In some embodiments, the first execution unit 240 includes:
[0142] The detection subunit 241 is used to detect the triggering status of hook functions for multiple key events in a preset order;
[0143] The second determining subunit 242 is used to determine the target key event that has been triggered when it is determined that a key event has been triggered based on the triggering status of the hook function, and immediately execute the processing logic corresponding to the target key event.
[0144] Among them, the key events are one of the following: radio frequency reception interruption event, radio frequency transmission completion confirmation event, multi-channel radio frequency failure event, frequency hopping trigger event, and upgrade package transmission trigger event;
[0145] All critical events are stored in a circular buffer queue and sorted by priority.
[0146] In some embodiments, the drone mission scheduling device further includes:
[0147] The transmitting unit 260 is used to send the data to be transmitted to the drone into the radio frequency transmission queue when it receives the data to be transmitted to the drone; wherein the data to be transmitted includes at least control commands, upgrade packages, and status query commands.
[0148] The transmitting unit 260 is also used to extract the highest priority data from the radio frequency transmitting queue and perform the transmitting operation within each system minimum time tick until all data in the radio frequency transmitting queue has been transmitted.
[0149] In some embodiments, the second execution unit 250 includes:
[0150] The acquisition subunit 251 is used to acquire the remaining non-core general tasks according to the task table; among which, the non-core general tasks include at least the screen display information update task, the user key status parsing task, and the device matching status detection task.
[0151] Execution subunit 252 is used to execute non-core ordinary tasks sequentially according to the main scheduling function and the scheduling frequency registered in the task table;
[0152] In particular, during the execution of non-core routine tasks, the system continuously monitors the triggering of hook functions for multiple critical events. When a critical event is detected, the execution of the non-core routine tasks is paused first, and the newly triggered critical event is executed immediately.
[0153] like Figure 3 As shown, this application provides an electronic device 300, which includes a processor 301 and a memory 302. The processor 301 and the memory 302 are interconnected and communicate with each other through a communication bus 303 and / or other forms of connection mechanism (not shown). The memory 302 stores a computer program that can be executed by the processor 301. When the computing device is running, the processor 301 executes the computer program to perform the method in any of the aforementioned optional implementations.
[0154] This application provides a computer-readable storage medium storing a computer program, which, when executed by a processor, performs the method in any of the aforementioned optional implementations.
[0155] The computer-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 Red-Only Memory (PROM), Read-Only Memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.
[0156] This application provides a computer program product, which includes a computer program that, when run by a processor, executes the method in any of the aforementioned optional implementations.
[0157] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and not to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein. These modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application, and they should all be covered within the scope of the claims and specification of this application. In particular, as long as there is no conflict, the various technical features mentioned in the embodiments can be combined in any way. This application is not limited to the specific embodiments disclosed herein, but includes all technical solutions falling within the scope of the claims.
Claims
1. A method for scheduling tasks of a UAV, characterized in that, The application relates to a method for scheduling tasks in a remote control system. The method comprises the following steps: acquiring all tasks to be executed in the remote control system; registering the tasks to be executed in a pre-constructed task table; wherein the unified scheduling entry of the task table is a preset main scheduling function; triggering a new task scheduling period according to the minimum time interval of the system; prioritizing the execution of a target key event triggered currently according to the function hook triggering condition of the key event; 2.The method of claim 1, wherein, after the processing of the target key event is completed, sequentially executing the remaining non-core ordinary tasks in the task table according to the main scheduling function and the scheduling frequency registered in the task table. The registration of the tasks to be executed in the pre-constructed task table comprises the following steps: constructing a task table and acquiring the task information of the tasks to be executed; registering the tasks to be executed in the task table according to the task information; wherein the tasks to be executed at least include radio frequency communication tasks and non-core ordinary tasks; 3.The method of claim 1, wherein, the task information at least includes a task processing function pointer, a required stack space size, a native priority and a reference frequency of the tasks to be executed. The triggering of a new task scheduling period according to the minimum time interval of the system comprises the following steps: constructing a semaphore triggering mechanism according to the minimum time interval of the system; determining a unified beat source for driving the execution period of all tasks in the task table based on the semaphore triggering mechanism; 4.The method of claim 1, wherein, triggering and sending a semaphore to the main scheduling function according to the unified beat source, so as to wake up the main scheduling function and trigger a complete task scheduling period. The prioritizing of the execution of a target key event triggered currently according to the function hook triggering condition of the key event comprises the following steps: detecting the hook function triggering condition of a plurality of key events in a preset order; when it is determined that a key event is triggered according to the hook function triggering condition, determining a target key event triggered and immediately executing the processing logic corresponding to the target key event; wherein the key event is one of a radio frequency receiving interrupt event, a radio frequency sending completion confirmation event, a multi-path radio frequency fault event, a frequency hopping triggering event and an upgrade package transmission triggering event; 5. The method of claim 1, wherein, all the key events are stored and sorted according to the priority of the key events through a ring buffer queue. The method further comprises the following steps: when receiving to-be-downloaded data needed to be downloaded to a UAV, uniformly sending the to-be-downloaded data to a radio frequency sending queue; wherein the to-be-downloaded data at least includes a control instruction, an upgrade package and a state query instruction; 6.The method of claim 1, wherein, in each minimum time interval of the system, extracting a piece of data with the highest priority from the radio frequency sending queue to execute a sending operation until all the data in the radio frequency sending queue are sent completely. The sequentially executing of the remaining non-core ordinary tasks in the task table according to the main scheduling function and the scheduling frequency registered in the task table comprises the following steps: acquiring the remaining non-core ordinary tasks in the task table; wherein the non-core ordinary tasks at least include a screen display information updating task, a user key state analyzing task and a device matching state detecting task; sequentially executing the non-core ordinary tasks through the main scheduling function and the scheduling frequency registered in the task table. In the process of executing the non-core common task, the hook function triggering condition of a plurality of the critical events is continuously detected, and when a critical event triggering is detected, the execution of the non-core common task is suspended first, and the newly triggered critical event is executed immediately.
7. An unmanned aerial vehicle task scheduling apparatus characterized by comprising: The unmanned aerial vehicle task scheduling device comprises: An acquisition unit is configured to acquire all to-be-executed tasks in a remote control system; A registration unit is configured to register the to-be-executed tasks in a pre-constructed task table; wherein a unified scheduling entrance of the task table is a preset main scheduling function; A triggering unit is configured to trigger a new task scheduling period according to a system minimum time beat; A first execution unit is configured to execute a target critical event triggered currently in priority according to a function hook triggering condition of the critical event; A second execution unit is configured to execute remaining non-core common tasks in the task table in sequence after completing the processing of the target critical event according to the main scheduling function and a scheduling frequency registered in the task table.
8. An electronic device, comprising: The electronic device comprises a memory and a processor, the memory is configured to store a computer program, and the processor runs the computer program to enable the electronic device to execute the unmanned aerial vehicle task scheduling method in any one of claims 1 to 6.
9. A readable storage medium, characterized by, The readable storage medium stores a computer program, and the computer program is run by the processor to execute the unmanned aerial vehicle task scheduling method in any one of claims 1 to 6.
10. A computer program product, characterised in that, The computer program product comprises a computer program, and the computer program is run by the processor to execute the unmanned aerial vehicle task scheduling method in any one of claims 1 to 6.
Citation Information
Patent Citations
Embedded multi-core operating system scheduling method and scheduling device, electronic equipment and storage medium
CN111796921A
Unmanned aerial vehicle communication method
CN120034979A