Audio Task Scheduling for Low-Overhead Priority Processing
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Conventional digital signal processing (DSP) voice chips using FreeRTOS incur increased system overhead due to frequent task context switching, which affects timely processing of high-priority tasks.
Innovation Solution
A method that separately calls high-priority and low-priority tasks, processing cached audio data without task context switching, utilizing pre-allocated memory and loop caching, and employing round robin scheduling with timeout thresholds to manage CPU usage.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Adaptability or versatility
If FreeRTOS mechanism is used for multi-task scheduling, then task switching can be realized, but system overhead increases due to frequent task context switching
Solution Approach 1:
The patent segments tasks into high-priority and low-priority categories, allowing the high-priority task to run independently without being preempted by low-priority tasks. This segmentation eliminates the need for frequent context switching while maintaining multi-task scheduling capability, thereby reducing system overhead.
Solution Approach 2:
The patent extracts the high-priority task from the FreeRTOS scheduling mechanism, allowing it to run directly without going through the standard task switching process. This extraction removes the overhead associated with context switching for high-priority operations while preserving the ability to schedule multiple tasks.
2Adaptability or versatility
If task context switching is performed frequently, then multi-task processing is enabled, but processing timeliness of high-priority tasks deteriorates
Solution Approach 1:
By segmenting tasks into priority levels and allowing high-priority tasks to execute without preemption, the patent ensures that high-priority processing completes in a single continuous execution cycle, eliminating time loss from context switching while still supporting multiple tasks.
Solution Approach 2:
The patent performs preliminary classification of tasks into high and low priority before execution begins. This preliminary action ensures that high-priority tasks are identified and can execute immediately without waiting for context switching opportunities, thus improving processing timeliness.
3Reliability
If dump protection is performed on task context during task switching, then task safety is improved, but system overhead increases
Solution Approach 1:
The patent extracts high-priority tasks from the standard task switching mechanism that requires dump protection. By allowing high-priority tasks to run without entering the normal task switching cycle, the system eliminates the need for context dumping and protection operations for these critical tasks, reducing overhead while maintaining safety for other tasks.
Data Source
Figure 1~2
Figure 3~4
Figure 5~6
AI summary
The present disclosure provides a task processing method and apparatus, an electronic device and a storage medium, and relates to the field of artificial intelligence, such as intelligent voices, artificial intelligence chips, or the like. The method may include: for to-be-executed tasks, in at least one round of processing, performing the following operations: in response to determining that one or more high-priority tasks exist in the to-be-executed tasks, calling the one or more high-priority tasks to process audio data cached in a memory; and after execution of the one or more high-priority tasks is completed, and in response to determining that one or more low-priority task exist in the to-be-executed tasks, calling the one or more low-priority tasks to process the audio data. The application of the solution of the present disclosure may reduce system overhead, or the like.