Communication task scheduling method and device based on queue and alarm exclusivity, and medium

CN122533631APending Publication Date: 2026-08-07GUANGZHOU PANCO INTELLIGENT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
GUANGZHOU PANCO INTELLIGENT TECH CO LTD
Filing Date
2026-05-14
Publication Date
2026-08-07

AI Technical Summary

Technical Problem

[0003]为了克服现有技术的不足,本发明的目的之一在于提供基于队列与报警独占的通信任务调度方法,能够解决现有的终端的普通短信或外呼与一键报警的短信或外呼在共用一队列时,容易存在任务挤压与顺序错乱,导致报警不及时的问题

Benefits of technology

本发明通过在终端的内存中维护一全局环形队列,并对任务配置不同优先级,以区分普通任务和报警任务,进而在应急时通过报警独占和队列清空机制,让报警任务即刻获得通信资源,消除了普通任务积压导致报警任务阻塞而使得报警任务无法及时有效执行的问题。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122533631A_ABST
    Figure CN122533631A_ABST
Patent Text Reader

Abstract

The application discloses a communication task scheduling method and device based on a queue and alarm monopoly and a medium, the method is applied to a terminal, a global ring queue is maintained in the memory of the terminal and is used for storing to-be-processed tasks, the method comprises the following steps: whether an alarm process is triggered is detected, so that the global ring queue enters an alarm monopoly mode, and in the mode, a current processing task that meets the requirement of entering the queue is stored into the global ring queue and is recorded as a to-be-processed task; when a communication condition is met, a corresponding to-be-processed task is taken out from the global ring queue and is sent to a communication module for execution; and when an alarm end process is triggered, the global ring queue is exited from the alarm monopoly mode. The application can solve the problem that when an existing common task and an alarm task share a queue, the alarm task cannot be executed in time and effectively due to task backlog.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of Tiantong satellite communication, and in particular to a communication task scheduling method, apparatus and medium based on queue and alarm exclusivity. Background Technology

[0002] Currently, the terminal's regular SMS, outbound calls, and one-click alarms all share the same pending queue, which can easily lead to task backlog and disordered order, resulting in untimely alarms in the satellite link. Summary of the Invention

[0003] To overcome the shortcomings of the existing technology, one of the objectives of this invention is to provide a communication task scheduling method based on queues and dedicated alarm access. This method can solve the problem that when ordinary SMS or outbound calls and one-click alarm SMS or outbound calls of existing terminals share a queue, task congestion and disordered order can easily occur, leading to untimely alarms.

[0004] The second objective of this invention is to provide a communication task scheduling device based on queues and dedicated alarm functions, which can solve the problem that when ordinary SMS or outbound calls and one-click alarm SMS or outbound calls of existing terminals share a queue, task congestion and disordered order can easily occur, resulting in untimely alarms.

[0005] The third objective of this invention is to provide a computer-readable storage medium that can solve the problem that when ordinary SMS or outbound calls and one-click alarm SMS or outbound calls of existing terminals share a queue, task backlog and disordered order can easily occur, leading to untimely alarms.

[0006] One of the objectives of this invention is achieved through the following technical solution: A communication task scheduling method based on queues and alarm exclusivity, applied to a terminal, is characterized in that the terminal maintains a global circular queue in its memory to store tasks to be processed; the communication task scheduling method includes: Alarm exclusive step: Real-time determination of whether the alarm process is triggered. If so, set an alarm exclusive flag according to the alarm process and apply the alarm exclusive flag to the global circular queue so that the global circular queue enters the alarm exclusive mode. Enqueue control steps: When the global circular queue is in alarm exclusive mode, the current processing task is obtained and it is determined whether the current processing task meets the enqueue requirements. If yes, the current processing task is stored in the global circular queue and recorded as a task to be processed; otherwise, the current processing task is rejected from enqueueing. Dequeue control steps: When the system meets the communication conditions, the corresponding task to be processed is retrieved from the global circular queue and sent to the communication module of the terminal for execution; Alarm exclusive exit steps: In real time, determine whether the alarm end process has been triggered. If so, clear the alarm exclusive flag and exit the global circular queue from the alarm exclusive mode.

[0007] Furthermore, the alarm exclusive step of putting the global circular queue into alarm exclusive mode also includes: clearing the pending tasks in the global circular queue according to preset rules; The step of clearing pending tasks in the global circular queue according to preset rules specifically includes: obtaining task priorities according to the alarm process, and clearing pending tasks in the global circular queue according to the task priorities and the priorities of each pending task in the global circular queue; when the priority of the corresponding pending task in the global circular queue is lower than the task priority, the corresponding pending task is cleared.

[0008] Furthermore, when clearing pending tasks in the global circular queue according to preset rules, the process also includes: when a pending task carries a protection tag, retaining the corresponding pending task in the global circular queue and recording the retention time of the corresponding pending task; when the retention time of the corresponding pending task in the global circular queue exceeds the maximum retention time and the pending task has not been executed, deleting the corresponding pending task; when the number of pending tasks with protection tags in the global circular queue exceeds the maximum retention number, deleting the corresponding pending tasks according to the length of the retention time.

[0009] Furthermore, determining whether the current processing task meets the queuing requirements specifically includes: Priority determination step: Determine whether the priority of the current processing task matches the task priority of the alarm process. If yes, execute the queue determination step; otherwise, refuse to let the current processing task join the queue. Queue determination steps: Determine whether the storage space of the global circular queue meets the requirements. If yes, store the current processing task in the global circular queue; otherwise, reject the current processing task from being enqueued.

[0010] Furthermore, the system meeting the communication conditions in the dequeue control step specifically includes: the system meeting the communication conditions when the terminal's communication module is started and has joined the network; during the dequeue execution of the global circular queue, at most one pending task is in the dequeue state in the global circular queue at any given time.

[0011] Furthermore, the terminal's communication module includes a first communication module and a second communication module. The first communication module is a Tiantong satellite communication module; the second communication module is a mobile communication module; the first communication module and the second communication module each maintain a local task queue. When the alarm process is triggered, the alarm exclusive flag is also applied to the local task queue of the first communication module, and the local task queue of the first communication module is cleared at the same time. The dequeue control steps specifically include: when the system meets the communication conditions, retrieving the corresponding task to be processed from the global circular queue, obtaining the priority and target module identifier of the corresponding task to be processed according to the corresponding task to be processed, and forwarding the corresponding task to be processed to the local task queue of the corresponding communication module according to the distribution rules, the target module identifier and priority of the corresponding task to be processed. The step of forwarding the corresponding task to the local task queue of the corresponding communication module according to the distribution rules, the target module identifier and priority of the corresponding task to be processed specifically includes: when the priority of the corresponding task to be processed is the alarm priority, the corresponding task to be processed is distributed to the local task queue of the first communication module. When the priority of the corresponding task to be processed is normal priority, and the target module of the corresponding task to be processed is identified as the second communication module, the corresponding task to be processed is distributed to the local task queue of the second communication module. When the priority of the corresponding task to be processed is normal priority, and the target module identifier of the corresponding task to be processed is the first communication module, the corresponding task to be processed is not distributed.

[0012] Furthermore, the dequeue control step also includes: adjusting the actual timeout threshold for task execution of pending tasks in the local task queue of the first communication module according to the current queue depth of the global circular queue.

[0013] Furthermore, it also includes a recovery step: periodically writing the metadata of the global circular queue to non-volatile storage; when the terminal is powered on again after a power outage, reading the metadata from the non-volatile storage to rebuild the global circular queue; if it is detected that the global circular queue was in alarm exclusive mode before the power outage, resetting the alarm exclusive flag and continuing to execute the alarm process.

[0014] The second objective of this invention is achieved by the following technical solution: A communication task scheduling device based on queues and alarm exclusivity includes a memory and a processor. The memory stores a communication task scheduling program that runs on the processor. The communication task scheduling program is a computer program. When the processor executes the communication task scheduling program, it implements the steps of the communication task scheduling method based on queues and alarm exclusivity as one of the objectives of this invention.

[0015] The third objective of this invention is achieved by the following technical solution: A computer-readable storage medium storing a communication task scheduler, the communication task scheduler being a computer program, wherein when executed by a processor, the communication task scheduler implements the steps of a communication task scheduling method based on queues and alarm exclusivity as one of the objectives of this invention.

[0016] Compared with the prior art, the beneficial effects of the present invention are as follows: This invention maintains a global circular queue in the terminal's memory and configures tasks with different priorities to distinguish between ordinary tasks and alarm tasks. In an emergency, alarm tasks can immediately obtain communication resources through alarm exclusive access and queue clearing mechanisms, eliminating the problem of alarm tasks being blocked due to the backlog of ordinary tasks, which prevents alarm tasks from being executed in a timely and effective manner. Attached Figure Description

[0017] Figure 1 The flowchart shows the communication task scheduling method based on queues and alarm exclusivity provided by the present invention. Detailed Implementation

[0018] The present invention will now be further described in conjunction with the accompanying drawings and specific embodiments. It should be noted that, without conflict, the various embodiments or technical features described below can be arbitrarily combined to form new embodiments. Example 1

[0019] This invention provides a communication task scheduling method based on queues and alarm exclusivity, applied to a terminal. The terminal maintains a global circular queue in its memory to store tasks to be processed. More preferably, the terminal in this invention is a Tiantong satellite terminal, equipped with a Tiantong satellite communication module. This allows the terminal to forward tasks to be processed via Tiantong satellite communication, enabling functions such as one-click alarms. Figure 1 As shown, the communication task scheduling method includes: Step S1: Determine in real time whether the alarm process has been triggered. If so, set the alarm exclusive flag according to the alarm process and apply the alarm exclusive flag to the global circular queue in the terminal so that the global circular queue enters the alarm exclusive mode.

[0020] Specifically, a global circular queue is used to store tasks received by the terminal, and the terminal maintains the global circular queue. Normally, when a terminal receives a task, it stores the tasks in the global circular queue in the order they are received. Then, according to the first-in, first-out (FIFO) principle, each task is retrieved from the global circular queue and processed by the communication module to achieve task scheduling. However, once an alarm task enters the global circular queue, the backlog of ordinary tasks and their sequential execution may prevent the alarm task from being executed in a timely manner, thus affecting the timeliness of the alarm task. Therefore, this invention distinguishes between alarm tasks and ordinary tasks by setting corresponding alarm priorities and ordinary priorities respectively. Simultaneously, when the alarm process is triggered, an alarm exclusivity flag is set, and the global circular queue enters alarm exclusivity mode to filter tasks, ensuring that alarm tasks take priority over ordinary tasks and enter the global circular queue promptly, thereby achieving timely execution of alarm tasks and solving the problem of alarm tasks not being processed in a timely manner due to the backlog of ordinary tasks.

[0021] Step S2: When the global circular queue is in alarm exclusive mode, obtain the current processing task and determine whether the current processing task meets the enqueue requirements. If yes, execute step S3; otherwise, execute step S4.

[0022] Step S3: Store the currently processed task in a global circular queue and mark it as a task to be processed.

[0023] Step S4: Reject the currently processed task from being queued.

[0024] In other words, when the global circular queue is in alarm exclusive mode, it determines whether each received processing task meets the queuing requirements. That is, it determines whether the priority of the processing task matches the priority of the current alarm process, such as whether the priority of the processing task is the alarm priority. If so, the processing task is enqueued; otherwise, it is rejected.

[0025] In addition, to prevent task overflow, the storage space of the global circular queue needs to be checked when determining whether to enqueue a task. Specifically, when the priority of the current task meets the enqueue requirements, it is necessary to check whether the storage space of the global circular queue is sufficient. If so, the current task is stored in the global circular queue; otherwise, the task is rejected from enqueueing. In other words, tasks are only allowed to be enqueued when the storage space of the global circular queue is not full, to avoid task loss due to overflow.

[0026] Step S5: When the system meets the communication conditions, retrieve the corresponding task to be processed from the global circular queue and send the corresponding task to be processed to the communication module of the terminal for execution.

[0027] Specifically, the system meeting the communication conditions means that the terminal's communication module is ready and has joined the network. In other words, when the terminal meets the conditions for normal communication, dequeue scheduling is performed. That is, the corresponding task to be processed is taken out from the global circular queue and sent to the terminal's communication module so that the terminal's communication module can execute the corresponding task to be processed.

[0028] In addition, during the dequeueing process of the global circular queue, at most one task can be in the dequeueing state at any given time.

[0029] Step S6: Determine in real time whether the alarm termination process has been triggered. If so, proceed to step S7.

[0030] Step S7: Clear the alarm exclusive flag and exit the global circular queue from alarm exclusive mode.

[0031] When the alarm process ends, the alarm exclusive flag is cleared and the global circular queue exits the alarm exclusive mode and enters the normal working mode. At this time, the corresponding tasks can be received in sequence or according to preset rules, and alarm exclusiveness will not be performed.

[0032] More preferably, entering the alarm exclusive mode for the global circular queue further includes: clearing pending tasks in the global circular queue according to preset rules. Specifically, task priorities are obtained according to the alarm process, and pending tasks in the global circular queue are cleared according to the task priorities and the priorities of each pending task in the global circular queue. That is, when the priority of a corresponding pending task in the global circular queue is lower than the task priority, the corresponding pending task is cleared, for example, pending tasks with normal priorities are cleared from the global circular queue.

[0033] Furthermore, when clearing pending tasks in the global circular queue according to preset rules, the process also includes: when a pending task carries a protection flag, the corresponding pending task is retained in the global circular queue and the retention time of the corresponding pending task is recorded. The retention flag generally indicates that tasks that have entered the wireless protocol stack interaction stage or whose interruption would lead to inconsistencies in the network-side state are being retained in the global circular queue to avoid data loss or abnormal network-side state issues when clearing these tasks.

[0034] Furthermore, a maximum retention time and a maximum number of pending tasks are set for the global circular queue. If the retention time of a pending task exceeds the maximum retention time and the task has not yet been executed, it indicates that the task may be abnormal, and the corresponding task should be deleted. If the number of pending tasks with protected flags remaining in the global circular queue exceeds the maximum retention time, the task is considered abnormal.

[0035] When retaining a quantity, delete the corresponding pending tasks according to the retention time, for example, delete pending tasks with a longer retention time.

[0036] When a one-click alarm is activated, the alarm process is triggered. At this time, the terminal will generate an alarm exclusive flag and put the global circular queue into alarm exclusive mode. At the same time, the alarm exclusive flag will be applied to the global circular queue to filter out ordinary tasks with a lower priority than the alarm priority from entering the global circular queue. This will prevent the global circular queue from being overwhelmed with tasks, which could cause alarm tasks to not be processed in a timely manner and affect the alarm process.

[0037] More preferably, the alarm priority in the alarm process of this invention also includes multiple levels of alarm priority, with different priority levels for different alarm priorities. When an alarm process is triggered, the alarm priority corresponding to the alarm process is obtained, and tasks to be processed in the global circular queue are cleared accordingly based on the alarm priority. Specifically, for example, alarm priorities include a first alarm priority and a second alarm priority, with the first alarm priority being lower than the second alarm priority. When the alarm priority of the currently triggered alarm process is the first alarm priority, tasks with a priority lower than the first alarm priority in the global circular queue are cleared, that is, tasks with normal priority are cleared; similarly, when the alarm priority of the currently triggered alarm process is the second alarm priority, tasks with a priority lower than the second alarm priority in the global circular queue are cleared, that is, tasks with normal priority and tasks with the first alarm priority are cleared. In addition, when an alarm process with the first alarm priority is already triggered, and an alarm process with the second alarm priority is triggered again, tasks with the first alarm priority in the global circular queue will be cleared again. That is, in the alarm exclusive mode of the current alarm process, if a lower level of alarm priority is triggered, tasks in the global circular queue will be cleared again according to the alarm priority of the new alarm process. This invention allows for the further refinement of the priorities of different alarm tasks by setting different alarm priorities, enabling alarm tasks with stronger timeliness to be executed in a timely manner.

[0038] Preferably, the terminal's communication module includes a first communication module and a second communication module. The first communication module is a Tiantong satellite communication module, which is used for emergency and alarm communication and to perform alarm tasks.

[0039] The second communication module is a mobile communication module, optionally a 4G / 5G communication module, used for communication of ordinary tasks. That is, when a one-button alarm is activated, the alarm tasks entering the global circular queue are executed by the first communication module.

[0040] Furthermore, in this invention, each of the two communication modules maintains a local task queue. Tasks to be processed retrieved from the global circular queue are first placed into the local task queue of the corresponding communication module. Since the communication modules have different functions, when an alarm process is triggered, an alarm exclusive flag is applied to the local task queue of the first communication module, and the local task queue of the first communication module is cleared to receive tasks to be processed retrieved from the global circular queue.

[0041] In addition, since there may be some ordinary priority tasks with reserved tags in the global circular queue, when a task is retrieved from the global circular queue, it needs to be further judged, and then the distribution rules will assign the corresponding task to different communication modules. Different tasks may require different communication modules. For example, for emergency or alarm tasks, or in areas without network signal, the task communication requires the Tiantong satellite communication module to achieve data communication; conversely, normal task data communication requires a second communication module, i.e., a 4G / 5G communication module. Each task is configured with a corresponding target module identifier when it is generated. Thus, when the system meets the communication conditions, a task is retrieved from the global circular queue, its priority and target module identifier are obtained, and then the task is distributed to the local task queue of the corresponding communication module according to the distribution rules, the target module identifier, and the priority.

[0042] Specifically: when the priority of the corresponding task to be processed is the alarm priority, the corresponding task to be processed is distributed to the local task queue of the first communication module. That is, when the priority of the task to be processed is the alarm priority, it means that the task to be processed is an alarm task, and it is stored in the local task queue of the Tiantong satellite communication module for subsequent execution.

[0043] When the priority of the task to be processed is normal priority, and the target of the task to be processed is the second communication module, the task to be processed is distributed to the local task queue of the second communication module. Since the second communication module is not used for emergency and alarm communication and is not exclusively used, the task to be processed can be distributed to the local task queue of the second communication module.

[0044] When the priority of the task to be processed is normal, and the target of the task to be processed is the first communication module or the template module is not specified, the task to be processed will not be dispatched. For example, a task to be processed with a protection tag, since its priority is normal and its specified target is the first communication module or is not specified, will not be dispatched to the local task queue of the first communication module because the first communication module is exclusively used. Instead, it can be kept in the global circular queue, and then the next task to be processed will be taken for further evaluation.

[0045] This invention employs a two-tiered mechanism, involving secondary checks during task dequeueing to prevent ordinary-priority tasks from entering the exclusively controlled communication module. This ensures that even if the global circular queue is not completely cleared or ordinary-priority tasks with protection tags exist, the exclusively controlled communication module will not process any ordinary-priority tasks, thus avoiding interference with the timely execution of alarm-priority tasks. Simultaneously, ordinary-priority tasks are forwarded to a second communication module, enabling differentiated management across modules and guaranteeing the execution of ordinary-priority tasks with protection tags. In other words, this invention further ensures that the exclusively controlled communication module does not receive any ordinary tasks by performing secondary filtering during task dequeueing, determining whether to distribute the task based on the target module identifier.

[0046] More preferably, the present invention also periodically writes the metadata of the global circular queue into non-volatile memory. Thus, when the terminal suddenly loses power and then regains power, the corresponding metadata is read from the non-volatile memory to rebuild the global circular queue. Simultaneously, when it is detected that the global circular queue was already in alarm exclusive mode before the power outage, an alarm exclusive flag is regenerated and applied to the global circular queue, thereby continuing the corresponding alarm exclusive mode operation. Through this power outage recovery mechanism, the system's ability to retain tasks and its emergency continuity reliability are improved in abnormal power outage scenarios.

[0047] More preferably, the present invention also sets corresponding base timeout times for different types of tasks based on experience. For example, the base timeout time for SMS tasks is 10 seconds, and the base timeout time for outbound call tasks is 30 seconds. However, during the actual execution of the task, the actual timeout time can be dynamically adjusted based on the current system status, in addition to the base timeout time. Once the execution time of a task exceeds the corresponding timeout time, the corresponding module resources need to be released to avoid the backlog of subsequent tasks.

[0048] Each task in the global circular queue, especially alarm tasks, has a time-sensitive emergency response requirement. This means that the execution time of the previous task affects the execution time of subsequent tasks. Therefore, by setting a timeout, we can ensure that the currently executing task completes as quickly as possible, allowing the next task to begin execution promptly. This prevents the current task from occupying module resources for an extended period, causing subsequent tasks to remain in a waiting state and affecting their timeliness.

[0049] Furthermore, the number of tasks in the global circular queue is also related to the timeout setting. That is, the greater the depth of the global circular queue, the more congested the queue, the more tasks, and the heavier the system load. In this case, the timeout for the currently executing task should be shortened to speed up the task scheduling rhythm and release module resources as soon as possible to eliminate the backlog of tasks. Conversely, the smaller the depth of the circular queue, the less idle the queue, the fewer tasks, and the lighter the system load. In this case, the timeout can be appropriately relaxed to reduce unnecessary timeout interruptions, thereby ensuring that each task is more likely to execute successfully. Specifically, when scheduling pending tasks, the actual timeout threshold for task execution in the local task queue of the first communication module is adjusted according to the queue depth of the global circular queue. Specifically, when the queue depth of the global circular queue is greater than the first threshold and the global circular queue is in alarm exclusive mode, the actual timeout threshold is set to the first timeout. That is, when there are many tasks in the global circular queue and the timeliness requirement is high, the task execution time is set shorter to ensure that each task is executed as quickly as possible. When the depth of the global circular queue is less than the first threshold but greater than the second threshold, the actual timeout threshold is set to the second timeout, which is greater than the first timeout. This indicates that the number of tasks in the global circular queue is moderate, and the actual timeout can be appropriately extended. When the depth of the global circular queue is less than the third threshold, the actual timeout threshold is set to the third timeout, which is greater than the second timeout. This indicates that the number of tasks in the global circular queue is small, and the execution time of each task can be appropriately extended to ensure that each task has sufficient time to complete.

[0050] In addition, when the global circular queue is in normal operating mode, it also has a first queue depth threshold and a second queue depth threshold. When the queue depth of the global circular queue is greater than the first queue depth threshold, priority tasks are rejected from being enqueued, such as rejecting tasks with normal priority, and only tasks with alarm priority are allowed to be enqueued. When the queue depth of the global circular queue is less than the second queue depth threshold, tasks with normal priority are allowed to be enqueued again. When the global circular queue is in alarm exclusive mode, the first and second queue depth thresholds are invalid, and only tasks with alarm priority are allowed to be enqueued. By adaptively and dynamically setting the timeout based on the global circular queue depth, the scheduling pace can be automatically accelerated and task waiting latency reduced under high load and alarm scenarios.

[0051] This invention maintains a global circular queue in the terminal's memory and configures tasks with different priorities to distinguish between ordinary tasks and alarm tasks. In emergencies, alarm tasks are immediately granted communication resources through alarm exclusivity and queue clearing mechanisms, eliminating the problem of alarm tasks being blocked due to the backlog of ordinary tasks and thus unable to execute effectively and promptly. Simultaneously, a local task queue is configured for each communication module. Through the cooperation of these two queues, the execution of enqueueing, distribution, and dequeueing is decoupled. Furthermore, in multi-module scenarios, alarm exclusivity can be applied only to designated modules, while unapproved modules can continue to consume ordinary tasks, avoiding a global waste of communication capacity. Example 2

[0052] A communication task scheduling device based on queues and alarm exclusivity includes a memory and a processor. The memory stores a communication task scheduling program that runs on the processor. The communication task scheduling program is a computer program, and when the processor executes the communication task scheduling program, it performs the following steps: Alarm exclusive step: Real-time determination of whether the alarm process is triggered. If so, set an alarm exclusive flag according to the alarm process and apply the alarm exclusive flag to the global circular queue so that the global circular queue enters the alarm exclusive mode. Enqueue control steps: When the global circular queue is in alarm exclusive mode, the current processing task is obtained and it is determined whether the current processing task meets the enqueue requirements. If yes, the current processing task is stored in the global circular queue and recorded as a task to be processed; otherwise, the current processing task is rejected from enqueueing. Dequeue control steps: When the system meets the communication conditions, the corresponding task to be processed is retrieved from the global circular queue and sent to the communication module of the terminal for execution; Alarm exclusive exit steps: In real time, determine whether the alarm end process has been triggered. If so, clear the alarm exclusive flag and exit the global circular queue from the alarm exclusive mode.

[0053] Furthermore, the alarm exclusive step of putting the global circular queue into alarm exclusive mode also includes: clearing the pending tasks in the global circular queue according to preset rules; The step of clearing pending tasks in the global circular queue according to preset rules specifically includes: obtaining task priorities according to the alarm process, and clearing pending tasks in the global circular queue according to the task priorities and the priorities of each pending task in the global circular queue; when the priority of the corresponding pending task in the global circular queue is lower than the task priority, the corresponding pending task is cleared.

[0054] Furthermore, when clearing pending tasks in the global circular queue according to preset rules, the process also includes: when a pending task carries a protection tag, retaining the corresponding pending task in the global circular queue and recording the retention time of the corresponding pending task; when the retention time of the corresponding pending task in the global circular queue exceeds the maximum retention time and the pending task has not been executed, deleting the corresponding pending task; when the number of pending tasks with protection tags in the global circular queue exceeds the maximum retention number, deleting the corresponding pending tasks according to the length of the retention time.

[0055] Furthermore, determining whether the current processing task meets the queuing requirements specifically includes: Priority determination step: Determine whether the priority of the current processing task matches the task priority of the alarm process. If yes, execute the queue determination step; otherwise, refuse to let the current processing task join the queue. Queue determination steps: Determine whether the storage space of the global circular queue meets the requirements. If yes, store the current processing task in the global circular queue; otherwise, reject the current processing task from being enqueued.

[0056] Furthermore, the system meeting the communication conditions in the dequeue control step specifically includes: the system meeting the communication conditions when the terminal's communication module is started and has joined the network; during the dequeue execution of the global circular queue, at most one pending task is in the dequeue state in the global circular queue at any given time.

[0057] Furthermore, the terminal's communication module includes a first communication module and a second communication module. The first communication module is a Tiantong satellite communication module; the second communication module is a mobile communication module; the first communication module and the second communication module each maintain a local task queue. When the alarm process is triggered, the alarm exclusive flag is also applied to the local task queue of the first communication module, and the local task queue of the first communication module is cleared at the same time. The dequeue control steps specifically include: when the system meets the communication conditions, retrieving the corresponding task to be processed from the global circular queue, obtaining the priority and target module identifier of the corresponding task to be processed according to the corresponding task to be processed, and forwarding the corresponding task to be processed to the local task queue of the corresponding communication module according to the distribution rules, the target module identifier and priority of the corresponding task to be processed. The step of forwarding the corresponding task to the local task queue of the corresponding communication module according to the distribution rules, the target module identifier of the corresponding task, and the priority specifically includes: when the priority of the corresponding task is alarm priority, the corresponding task is distributed to the local task queue of the first communication module; when the priority of the corresponding task is normal priority and the target module identifier of the corresponding task is the second communication module, the corresponding task is distributed to the local task queue of the second communication module. When the priority of the corresponding task to be processed is normal priority, and the target module identifier of the corresponding task to be processed is the first communication module, the corresponding task to be processed is not distributed.

[0058] Furthermore, the dequeue control step also includes: adjusting the actual timeout threshold for task execution of pending tasks in the local task queue of the first communication module according to the current queue depth of the global circular queue.

[0059] Furthermore, it also includes a recovery step: periodically writing the metadata of the global circular queue to non-volatile storage; when the terminal is powered on again after a power outage, reading the metadata from the non-volatile storage to rebuild the global circular queue; if it is detected that the global circular queue was in alarm exclusive mode before the power outage, resetting the alarm exclusive flag and continuing to execute the alarm process. Example 3

[0060] A computer-readable storage medium storing a communication task scheduler, the communication task scheduler being a computer program, which, when executed by a processor, performs the following steps: Alarm exclusive step: Real-time determination of whether the alarm process is triggered. If so, set an alarm exclusive flag according to the alarm process and apply the alarm exclusive flag to the global circular queue so that the global circular queue enters the alarm exclusive mode. Enqueue control steps: When the global circular queue is in alarm exclusive mode, the current processing task is obtained and it is determined whether the current processing task meets the enqueue requirements. If yes, the current processing task is stored in the global circular queue and recorded as a task to be processed; otherwise, the current processing task is rejected from enqueueing. Dequeue control steps: When the system meets the communication conditions, the corresponding task to be processed is retrieved from the global circular queue and sent to the communication module of the terminal for execution; Alarm exclusive exit steps: In real time, determine whether the alarm end process has been triggered. If so, clear the alarm exclusive flag and exit the global circular queue from the alarm exclusive mode.

[0061] Furthermore, the alarm exclusive step of putting the global circular queue into alarm exclusive mode also includes: clearing the pending tasks in the global circular queue according to preset rules; The step of clearing pending tasks in the global circular queue according to preset rules specifically includes: obtaining task priorities according to the alarm process, and clearing pending tasks in the global circular queue according to the task priorities and the priorities of each pending task in the global circular queue; when the priority of the corresponding pending task in the global circular queue is lower than the task priority, the corresponding pending task is cleared.

[0062] Furthermore, when clearing pending tasks in the global circular queue according to preset rules, the process also includes: when a pending task carries a protection tag, retaining the corresponding pending task in the global circular queue and recording the retention time of the corresponding pending task; when the retention time of the corresponding pending task in the global circular queue exceeds the maximum retention time and the pending task has not been executed, deleting the corresponding pending task; when the number of pending tasks with protection tags in the global circular queue exceeds the maximum retention number, deleting the corresponding pending tasks according to the length of the retention time.

[0063] Furthermore, determining whether the current processing task meets the queuing requirements specifically includes: Priority determination step: Determine whether the priority of the current processing task matches the task priority of the alarm process. If yes, execute the queue determination step; otherwise, refuse to let the current processing task join the queue. Queue determination steps: Determine whether the storage space of the global circular queue meets the requirements. If yes, store the current processing task in the global circular queue; otherwise, reject the current processing task from being enqueued.

[0064] Furthermore, the system meeting the communication conditions in the dequeue control step specifically includes: the system meeting the communication conditions when the terminal's communication module is started and has joined the network; during the dequeue execution of the global circular queue, at most one pending task is in the dequeue state in the global circular queue at any given time.

[0065] Furthermore, the terminal's communication module includes a first communication module and a second communication module. The first communication module is a Tiantong satellite communication module; the second communication module is a mobile communication module; the first communication module and the second communication module each maintain a local task queue. When the alarm process is triggered, the alarm exclusive flag is also applied to the local task queue of the first communication module, and the local task queue of the first communication module is cleared at the same time. The dequeue control steps specifically include: when the system meets the communication conditions, retrieving the corresponding task to be processed from the global circular queue, obtaining the priority and target module identifier of the corresponding task to be processed according to the corresponding task to be processed, and forwarding the corresponding task to be processed to the local task queue of the corresponding communication module according to the distribution rules, the target module identifier and priority of the corresponding task to be processed. The step of forwarding the corresponding task to the local task queue of the corresponding communication module according to the distribution rules, the target module identifier and priority of the corresponding task to be processed specifically includes: when the priority of the corresponding task to be processed is the alarm priority, the corresponding task to be processed is distributed to the local task queue of the first communication module. When the priority of the corresponding task to be processed is normal priority, and the target module of the corresponding task to be processed is identified as the second communication module, the corresponding task to be processed is distributed to the local task queue of the second communication module. When the priority of the corresponding task to be processed is normal priority, and the target module identifier of the corresponding task to be processed is the first communication module, the corresponding task to be processed is not distributed.

[0066] Furthermore, the dequeue control step also includes: adjusting the actual timeout threshold for task execution of pending tasks in the local task queue of the first communication module according to the current queue depth of the global circular queue.

[0067] Furthermore, it also includes a recovery step: periodically writing the metadata of the global circular queue to non-volatile storage; when the terminal is powered on again after a power outage, reading the metadata from the non-volatile storage to rebuild the global circular queue; if it is detected that the global circular queue was in alarm exclusive mode before the power outage, resetting the alarm exclusive flag and continuing to execute the alarm process.

[0068] The above embodiments are merely preferred embodiments of the present invention and should not be construed as limiting the scope of protection of the present invention. Any non-substantial changes and substitutions made by those skilled in the art based on the present invention shall fall within the scope of protection claimed by the present invention.

Claims

1. A communication task scheduling method based on queues and alarm exclusivity, applied to a terminal, characterized in that: The terminal maintains a global circular queue in its memory to store tasks to be processed; the communication task scheduling method includes: Alarm exclusive step: Real-time determination of whether the alarm process is triggered. If so, set an alarm exclusive flag according to the alarm process and apply the alarm exclusive flag to the global circular queue so that the global circular queue enters the alarm exclusive mode. Enqueue control steps: When the global circular queue is in alarm exclusive mode, the current processing task is obtained and it is determined whether the current processing task meets the enqueue requirements. If yes, the current processing task is stored in the global circular queue and recorded as a task to be processed; otherwise, the current processing task is rejected from enqueueing. Dequeue control steps: When the system meets the communication conditions, the corresponding task to be processed is retrieved from the global circular queue and sent to the communication module of the terminal for execution; Alarm exclusive exit steps: In real time, determine whether the alarm end process has been triggered. If so, clear the alarm exclusive flag and exit the global circular queue from the alarm exclusive mode.

2. The communication task scheduling method based on queues and alarm exclusivity according to claim 1, characterized in that, The alarm exclusive step of putting the global circular queue into alarm exclusive mode also includes: clearing the pending tasks in the global circular queue according to preset rules; The step of clearing pending tasks in the global circular queue according to preset rules specifically includes: obtaining task priorities according to the alarm process, and clearing pending tasks in the global circular queue according to the task priorities and the priorities of each pending task in the global circular queue; when the priority of the corresponding pending task in the global circular queue is lower than the task priority, the corresponding pending task is cleared.

3. The communication task scheduling method based on queues and alarm exclusivity according to claim 2, characterized in that, The process of clearing pending tasks in the global circular queue according to preset rules further includes: when a pending task carries a protection tag, retaining the corresponding pending task in the global circular queue and recording the retention time of the corresponding pending task; when the retention time of the corresponding pending task in the global circular queue exceeds the maximum retention time and the pending task has not been executed, deleting the corresponding pending task; when the number of pending tasks with protection tags in the global circular queue exceeds the maximum retention number, deleting the corresponding pending tasks according to the length of the retention time.

4. The communication task scheduling method based on queues and alarm exclusivity according to claim 1, characterized in that, The determination of whether the currently processed task meets the queuing requirements specifically includes: Priority determination step: Determine whether the priority of the current processing task matches the task priority of the alarm process. If yes, execute the queue determination step; otherwise, refuse to let the current processing task join the queue. Queue determination steps: Determine whether the storage space of the global circular queue meets the requirements. If yes, store the current processing task in the global circular queue; otherwise, reject the current processing task from being enqueued.

5. The communication task scheduling method based on queues and alarm exclusivity according to claim 1, characterized in that, The system meeting the communication conditions in the dequeue control step specifically includes: the system meeting the communication conditions when the terminal's communication module is started and has joined the network; during the dequeue execution of the global circular queue, at most one pending task is in the dequeue state in the global circular queue at any given time.

6. The communication task scheduling method based on queues and alarm exclusivity according to claim 1, characterized in that, The terminal's communication module includes a first communication module and a second communication module. The first communication module is a Tiantong satellite communication module, and the second communication module is a mobile communication module. The first communication module and the second communication module each maintain a local task queue. When the alarm process is triggered, the alarm exclusive flag is also applied to the local task queue of the first communication module, and the local task queue of the first communication module is cleared at the same time. The dequeue control steps specifically include: when the system meets the communication conditions, retrieving the corresponding task to be processed from the global circular queue, obtaining the priority and target module identifier of the corresponding task to be processed according to the corresponding task to be processed, and forwarding the corresponding task to be processed to the local task queue of the corresponding communication module according to the distribution rules, the target module identifier and priority of the corresponding task to be processed. The step of forwarding the corresponding task to the local task queue of the corresponding communication module according to the distribution rules, the target module identifier and priority of the corresponding task to be processed specifically includes: when the priority of the corresponding task to be processed is the alarm priority, the corresponding task to be processed is distributed to the local task queue of the first communication module. When the priority of the corresponding task to be processed is normal priority, and the target module of the corresponding task to be processed is identified as the second communication module, the corresponding task to be processed is distributed to the local task queue of the second communication module. When the priority of the corresponding task to be processed is normal priority, and the target module identifier of the corresponding task to be processed is the first communication module, the corresponding task to be processed is not distributed.

7. The communication task scheduling method based on queues and alarm exclusivity according to claim 6, characterized in that, The dequeue control step further includes: adjusting the actual timeout threshold for task execution of pending tasks in the local task queue of the first communication module according to the current queue depth of the global circular queue.

8. The communication task scheduling method based on queues and alarm exclusivity according to claim 1, characterized in that, It also includes a recovery step: periodically writing the metadata of the global circular queue to non-volatile storage; when the terminal is powered on again after a power outage, reading the metadata from the non-volatile storage to rebuild the global circular queue; if it is detected that the global circular queue was in alarm exclusive mode before the power outage, resetting the alarm exclusive flag and continuing to execute the alarm process.

9. A communication task scheduling device based on queues and alarm exclusivity, comprising a memory and a processor, wherein the memory stores a communication task scheduling program running on the processor, characterized in that, The communication task scheduler is a computer program, and when the processor executes the communication task scheduler, it implements the steps of the communication task scheduling method based on queues and alarm exclusivity as described in any one of claims 1-8.

10. A computer-readable storage medium storing a communication task scheduler thereon, the communication task scheduler being a computer program, wherein when executed by a processor, the communication task scheduler implements the steps of the communication task scheduling method based on queues and alarm exclusivity as described in any one of claims 1-8.