A multi-period grouping isolated task scheduling method and system suitable for star service software
Patent Information
- Application Number
- CN202611328793.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-31
- Publication Date
- 2026-10-09
AI Technical Summary
[0008]本发明旨在克服现有星务任务调度存在的耦合度高、时序精度不足、任务无序执行、故障无法隔离以及调度状态不可观测的缺陷,通过对不同周期任务实施分组隔离调度,使各组调度资源相互独立,避免业务任务之间相互阻塞与故障扩散;实现同周期任务固定有序执行,保证任务注册顺序与运行时序一一对应,保障业务流程可复现;构建统一全局时间基准,消除长期调度带来的累积时序漂移,确保周期触发的高精度与高确定性;增设任务动态注册多层合法性校验机制,规避动态加载任务引发的参数冲突、命名异常问题;实现分组、任务两级运行状态统计能力,支持调度超时识别与在轨性能量化诊断,同时调度框架具备可扩展性,能够适配多周期、多数量星务业务任务的灵活扩展需求
(1)不同周期业务任务分配独立调度资源,实现分组隔离调度,单任务或单分组异常不会扩散至全系统调度,降低卫星在轨软件失效风险,提升在轨运行可靠性。其实现原理为:调度框架采用五层抽象架构,定时层为每个分组配置独立定时触发单元,执行层采用分组隔离执行单元监听定时事件并运行任务,各任务分组资源完全隔离,长短周期任务解耦调度,全架构依托互斥保护单元实现并发安全,从资源分配层面从根本上阻断故障跨分组传播路径。
Smart Images

Figure CN122884641A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of real-time scheduling technology for spaceborne embedded software, and in particular to a multi-cycle grouped isolated task scheduling method and system suitable for spacecraft software. Background Technology
[0002] Satellite administration software is the core management and control software of a satellite platform, undertaking various core on-orbit services such as satellite attitude control, data acquisition, status monitoring, command response, and equipment management. Its operational stability, timing accuracy, and scheduling reliability directly determine the overall on-orbit performance of the satellite. The satellite administration software business system includes a massive number of cycle-driven business tasks, with significant differences in task execution cycles, real-time response indicators, and operational priorities across different business scenarios. Among them, tasks such as attitude control and emergency state inspections have short cycle, high real-time, and high reliability requirements, while tasks such as data storage, telemetry packaging, and log archiving are characterized by long execution times and high computational loads. Efficient, collaborative, and controllable scheduling of these diverse cycle tasks is the core key to ensuring the stable on-orbit operation of the satellite administration system.
[0003] Currently, existing satellite mission software generally adopts a universal, globally unified task scheduling scheme. This scheme manages all periodic missions through a single scheduling thread and timing resources. While this scheme is simple in architecture and highly versatile, meeting basic on-orbit mission scenarios with low load, low real-time requirements, and low timing constraints, it suffers from several inherent technical shortcomings when considering the modern demands for highly integrated, real-time, high-precision, and highly reliable satellite mission operations. These shortcomings cannot adapt to the collaborative scheduling needs of differentiated periodic missions. Specific technical drawbacks are as follows: First, the existing scheduling architecture suffers from highly coupled global scheduling resources. Traditional scheduling schemes manage all business tasks with different cycles, priorities, and durations within the same scheduling thread and timer resources. These tasks share and are interdependent, resulting in extremely high resource coupling. During actual on-orbit operation, when long-duration tasks such as data processing and file archiving continuously consume scheduling resources, they directly block the normal scheduling and execution of high-real-time, short-cycle tasks such as attitude control and status inspection, leading to severe scheduling jitter, task delays, and response timeouts. Furthermore, this architecture lacks a modular fault isolation mechanism. The scheduling links of each task are interconnected and mutually influential. When a single task experiences program anomalies, freezes, or timeouts, it directly consumes all scheduling resources, disrupts the overall scheduling logic, and ultimately causes the entire system's scheduling function to fail. This significantly increases the risk of satellite on-orbit operation and fails to meet the high fault-tolerance and high-reliability requirements of the aerospace field.
[0004] Secondly, the lack of a standardized and orderly management mechanism for tasks within the same execution cycle results in poor controllability and stability. Existing scheduling schemes lack standardized scheduling logic for business tasks with the same execution cycle, such as priority ranking, execution sequence control, and task queue management. Tasks within the same cycle are executed entirely through random scheduling, leading to a completely uncontrollable execution sequence for various source and cycle-related businesses, resulting in chaotic task execution. When anomalies occur in orbit, the lack of a fixed execution order makes it impossible to accurately reproduce the fault scenario, significantly increasing the difficulty of on-orbit fault location, problem tracing, and defect repair. Simultaneously, the existing scheduling system lacks a robust task registration legitimacy verification system. During the dynamic addition, replacement, and update of business tasks in orbit, it is impossible to verify the compliance of key information such as task names, unique identifiers, configuration parameters, and scheduling attributes. This easily leads to problems such as duplicate task names, conflicting parameter configurations, and overlapping scheduling attributes, causing stability failures such as task scheduling disorder, task overwriting, and program crashes, seriously threatening the long-term stable operation of the spacecraft software in orbit.
[0005] Secondly, traditional timed scheduling mechanisms lack sufficient timing accuracy, resulting in cumulative timing drift. Existing general scheduling schemes primarily rely on user-space delay functions for periodic task triggering and periodic iteration, without timing calibration based on hardware clocks or high-precision system clocks. User-space delay functions inherently possess timing errors, which accumulate over long-term, uninterrupted satellite operation, leading to severe timing drift. After prolonged operation, the deviation between the actual mission execution cycle and the theoretically set cycle continues to widen, failing to meet the stringent timing accuracy requirements of core services such as precise satellite attitude control, multi-device collaborative timing matching, and high-precision data sampling. This easily leads to functional problems such as abnormal satellite equipment coordination, distorted data acquisition, and attitude control deviations.
[0006] Finally, the existing scheduling system lacks observability of operational status and quantifies maintenance and early warning capabilities. Traditional scheduling frameworks only implement basic task scheduling and execution functions, failing to establish a unified system for task operational status statistics, monitoring, and analysis. This prevents the routine statistical recording of core operational data such as actual execution time, frequency, trigger accuracy, and number of anomalies for tasks in each cycle. Furthermore, the system lacks early warning mechanisms for scheduling timeouts, task freezes, and scheduling anomalies, making it impossible to identify potential scheduling anomalies in advance during on-orbit operation. When satellite maintenance software experiences issues such as performance degradation, task anomalies, or timing deviations, ground maintenance personnel lack quantifiable data to quickly conduct on-orbit performance diagnostics, anomaly investigations, and system status assessments. This hinders proactive fault prediction and maintenance, significantly reducing the on-orbit maintainability and operational safety of the satellite maintenance system.
[0007] In summary, existing general task scheduling schemes for satellite mission software suffer from multiple technical defects, including severe resource coupling, disordered timing control, insufficient timing accuracy, and unobservable operational status. These defects make it difficult to meet the on-orbit scheduling requirements of modern satellites, which demand high real-time performance, high precision, high reliability, and maintainability. Therefore, it is urgent to design a new periodic task scheduling scheme for satellite mission software to solve the problems existing in the above-mentioned technologies. Summary of the Invention
[0008] This invention aims to overcome the shortcomings of existing space mission scheduling, such as high coupling, insufficient timing accuracy, disordered task execution, inability to isolate faults, and unobservable scheduling status. It achieves this by implementing grouped and isolated scheduling for tasks with different cycles, ensuring that scheduling resources in each group are independent and preventing mutual blocking and fault propagation between tasks. It also ensures fixed and orderly execution of tasks within the same cycle, guaranteeing a one-to-one correspondence between task registration order and runtime sequence, and ensuring reproducibility of business processes. Furthermore, it constructs a unified global time benchmark to eliminate accumulated timing drift caused by long-term scheduling, ensuring high precision and high determinism in periodic triggering. A multi-layered legality verification mechanism for dynamic task registration is added to avoid parameter conflicts and naming anomalies caused by dynamically loaded tasks. The invention provides two-level operational status statistics for groups and tasks, supporting scheduling timeout identification and on-orbit performance quantitative diagnosis. Simultaneously, the scheduling framework is scalable, adaptable to the flexible expansion needs of multi-cycle and multi-quantity space missions.
[0009] This invention provides a multi-cycle grouped isolated task scheduling method suitable for space service software, comprising: The monotonically increasing clock of the acquisition system serves as a global unified time reference. It initializes the task grouping resource pool and the business task resource pool, and sets the task grouping resource pool and the business task resource pool to an idle and available state. Receive task registration requests and retrieve existing task groups based on group identifiers, including: For scenarios where no existing task group exists, create a new independent task group, use the new independent task group as the target task group, bind a dedicated execution cycle and scheduling priority to the target task group, and append the business task to the end of the group task queue of the target task group; For scenarios where existing task groups exist, the existing task group is used as the target task group. The execution cycle of the target task group is verified to be consistent with the execution cycle of the task registration request. If the execution cycles are consistent, the business task is appended to the end of the target task group's task queue. For scenarios with inconsistent execution cycles, task registration will be rejected; Iterate through all task groups and allocate independent timer resources, an independent execution queue, and an independent execution thread to each task group; and Each task group configures its timing period based on a globally unified time base, generates periodic trigger events, listens for and responds to these events, and sequentially executes all business tasks within the group's task queue according to the task registration order. The execution time of a single task and the total time of a single complete group scheduling are collected. The next timing trigger time is recalibrated based on the globally unified time base, and the periodic trigger events are listened to repeatedly. In one embodiment of the invention, the step of traversing all task groups and allocating independent timing resources, independent execution queues, and independent execution threads to each task group further includes: initiating the periodic scheduling process for all task groups.
[0010] In one embodiment of the present invention, the method further includes: generating a scheduling timeout warning based on the fact that the total time taken for a single complete scheduling of a group exceeds a preset periodic threshold.
[0011] In one embodiment of the present invention, the method further includes: calculating the total number of tasks within a single group, the cumulative number of scheduled runs of the group, the total time taken for the previous round of complete execution of the group, and the group's activation status; calculating the time taken for a single task to run; and providing corresponding scheduling statistics to external modules through a standardized query interface.
[0012] In one embodiment of the present invention, the method further includes: controlling group creation and batch startup through a global mutex lock, and controlling the addition and deletion of task queues and the traversal and execution of tasks within a group through a group-private mutex lock.
[0013] In one embodiment of the present invention, it further includes: pre-configuring to support a maximum of N different periodic task groups and a maximum of M business tasks carried by the entire system.
[0014] This invention also provides a multi-cycle grouped isolated task scheduling system suitable for space service software, comprising: The scheduling resource initialization module is used to collect the system's monotonically increasing clock as a global unified time reference, initialize the task group resource pool and the business task resource pool, and set the task group resource pool and the business task resource pool to an idle and available state. The task dynamic grouping management module is used to receive task registration requests, retrieve existing task groups based on group identifiers, create a new independent task group for scenarios where no task group exists, use the new independent task group as the target task group, bind a unique execution cycle and scheduling priority to the target task group, and append the business task to the end of the target task group's group task queue. For scenarios where an existing task group exists, use the existing task group as the target task group, verify that the execution cycle of the target task group is consistent with the execution cycle of the task registration request, append the business task to the end of the target task group's group task queue for scenarios where the execution cycles are inconsistent, and reject task registration for scenarios where the execution cycles are inconsistent. The periodic triggering module is used to configure the group timing period based on a globally unified time base and generate periodic triggering events. The group-based independent execution module is used to listen for and respond to high-precision periodic trigger events, and to sequentially execute all business tasks in the group task queue according to the task registration order. It collects the single execution time of a task and the total time of a single complete group scheduling, and recalibrates the next timed trigger time based on a globally unified time base.
[0015] In one embodiment of the present invention, it further includes: a scheduling status statistics query module, which is used to count the total number of tasks in a group, the cumulative number of scheduling runs in the group, the total time taken for the previous round of complete execution of the group, and the group's activation status in a single group dimension; to count the time taken for a single task to run in a single task dimension; and to provide corresponding scheduling statistics data to external modules through a standardized query interface.
[0016] In one embodiment of the present invention, it further includes: a multi-level concurrent mutual exclusion protection module, which is used to control group creation and batch startup through a global mutual exclusion lock, and to control the addition and deletion of task queues and the traversal and execution of tasks within a group through a group-private mutual exclusion lock.
[0017] In one embodiment of the present invention, the task dynamic grouping management module is used to perform length verification on the group identifier and task identifier in the task registration request, retrieve the task identifier in the target task group, reject task registration in the case of duplicate task identifiers, allocate idle business task resources in the case of unique task identifiers, and append the business task to the tail of the group task queue of the target task group.
[0018] The present invention has the following beneficial effects: (1) Independent scheduling resources are allocated to business tasks of different cycles to achieve group-isolated scheduling. Anomalies in a single task or group will not spread to the entire system scheduling, reducing the risk of on-orbit software failure and improving on-orbit operational reliability. The implementation principle is as follows: The scheduling framework adopts a five-layer abstract architecture. The timing layer configures an independent timing trigger unit for each group. The execution layer uses a group-isolated execution unit to listen to timing events and run tasks. The resources of each task group are completely isolated. Long and short cycle tasks are decoupled and scheduled. The entire architecture relies on mutual exclusion protection units to achieve concurrent safety, fundamentally blocking the path of fault propagation across groups from the resource allocation level.
[0019] (2) All group timing trigger times are calibrated based on a globally unified time reference to eliminate the cumulative timing drift caused by the long-term operation of traditional user-state delay functions, ensuring high precision and high determinism of periodic triggering and meeting the high-precision timing requirements of aerospace operations. The implementation principle is as follows: the globally unified time reference is solidified during the initialization phase of the scheduling framework. The framework relies on the system monotonic clock and the kernel's high-precision timing mechanism. After each group timing trigger is completed, the next trigger time is calibrated based on the global time reference. The absolute time reference replaces the relative delay accumulation, eliminating the cumulative effect of timing offset from the mechanism level.
[0020] (3) Tasks within the same cycle are managed using ordered queues. The task registration order corresponds strictly one-to-one with the runtime order. The space service business process is fixed and reproducible, facilitating on-orbit fault simulation and business logic verification. The implementation principle is as follows: Each independent task group unit maintains an ordered task queue. New tasks are uniformly added to the tail of the queue. When scheduling is triggered, tasks are executed sequentially from the head to the tail of the queue. Each group has an independent mutual exclusion protection unit to prevent concurrent modification of the queue, thereby ensuring the determinism and traceability of the task execution order within the same cycle.
[0021] (4) Dynamic task registration introduces a multi-layered legality verification mechanism, which verifies parameters such as task name, length, group period, and duplicate task names item by item. This eliminates hidden software defects such as parameter conflicts, naming anomalies, out-of-bounds errors, and overwriting caused by dynamically added tasks, ensuring the security of dynamically loaded tasks on track. The implementation principle is as follows: After the business module initiates a task registration request, the framework performs multi-layered verification of name, length, group period, and duplicate task names. If the verification passes, the task is added to the group queue in an orderly manner and the registration result is returned to the business. If the verification fails, the registration request is intercepted, forming a defensive verification barrier at the registration entry point. Attached Figure Description
[0022] Figure 1 A flowchart of a multi-cycle grouped isolated task scheduling method for space service software according to an embodiment of the present invention is shown; Figure 2 This diagram illustrates the overall hierarchical architecture of the scheduling framework in one embodiment of the present invention. Figure 3 A schematic diagram of an ordered task queue within a group is shown in one embodiment of the present invention; Figure 4 The following is a timing diagram of the task registration and verification interaction in one embodiment of the present invention. Detailed Implementation
[0023] In the following description, the invention is described with reference to various embodiments. However, those skilled in the art will recognize that the embodiments may be practiced without one or more specific details or with other alternatives and / or additional methods, materials, or components. In other instances, well-known structures, materials, or operations are not shown or described in detail so as not to obscure the inventive points of the invention. Similarly, for illustrative purposes, specific quantities, materials, and configurations are set forth to provide a comprehensive understanding of embodiments of the invention. However, the invention is not limited to these specific details.
[0024] In this invention, the various embodiments are merely intended to illustrate the solutions of the invention and should not be construed as limiting.
[0025] In this specification, references to "an embodiment" or "this embodiment" mean that a particular feature, structure, or characteristic described in connection with that embodiment is included in at least one embodiment of the invention. The phrase "in one embodiment" appearing throughout this specification does not necessarily refer to the same embodiment in all instances.
[0026] Furthermore, the numbering of the steps in the methods of the present invention does not limit the execution order of the method steps. Unless otherwise specified, the method steps may be executed in different orders.
[0027] The present invention will be further described below with reference to the accompanying drawings and specific embodiments.
[0028] Example 1: like Figure 2 As shown in the figure, in this embodiment, the present invention provides a multi-period grouped isolated task scheduling method suitable for space management software. The method is generally divided into five abstract logic modules: a scheduling resource initialization module 10, a task dynamic grouping management module 20, a periodic triggering module 30, a group independent execution module 40, and a scheduling status statistics query module 50. The overall process is as follows: Figure 1 As shown, it includes: Step 1: Initialize scheduling resources and establish a globally unified time base: When the scheduling framework is powered on and initialized, the monotonically increasing clock of the acquisition system serves as the sole unified time reference for the entire system; the task group resource pool and the business task resource pool are initialized uniformly, and all group and task resources are marked as idle and available, thus completing the initialization of concurrent mutual exclusion protection resources.
[0029] Step 2: Dynamically create task groups and register business tasks in an orderly manner: External business modules can dynamically register periodic tasks with the scheduling framework. The registration process includes multiple layers of validity checks and grouping / attaching logic. Group matching and verification: Retrieve existing groups based on group identifiers; if no group exists, create a new independent task group and bind it with a dedicated execution cycle and scheduling priority; if a group already exists, enforce consistent verification cycles and reject conflicting groups with the same identifier but different cycles. Task uniqueness verification: Retrieve task identifiers within the target group and reject registration of tasks with duplicate names; Ordered mounting: Allocate idle task resources and append tasks to the end of the group task queue to ensure the orderly scheduling rule of first-registered and first-executed; The task groups are independent scheduling units, and each group is independently configured with execution cycle, scheduling priority, timed trigger resources, and independent execution queue; all business tasks with the same cycle are stored in an ordered linked list within the group.
[0030] Step 3: Start all task groups in batches and allocate independent, isolated execution resources: During the scheduling startup phase, all created valid task groups are traversed, and each group is allocated a set of independent and isolated execution resources, with the execution processes of each group not interfering with each other; all groups start the periodic scheduling process synchronously.
[0031] Step 4: Trigger independent periods in groups and execute business tasks sequentially in an ordered manner: Each task group relies on its own independent timed resources to achieve periodic triggering. The scheduling logic within a single group is as follows: Configure group timing periods based on a globally unified time base and generate periodic trigger events; Continuously block and listen for timed events; once an event is triggered, all business tasks within the group are executed sequentially and in order. Collect the execution time of each task in a single run and the total execution time of a single complete scheduling of a group; If the total execution time of the group exceeds the preset period threshold, a scheduling timeout warning will be generated; The timing trigger time is recalibrated based on the global time base to eliminate accumulated timing deviations. It continuously listens for timed events and schedules them periodically.
[0032] Step 5: Unified statistics and external queries of scheduling status: The framework incorporates two-level scheduling data statistics logic and provides a standardized query interface to support external satellite telemetry and fault diagnosis modules for data retrieval. Single group dimension: total number of tasks within the group, cumulative number of scheduled runs for the group, total execution time of the group in the previous round, and group activation status; Single task dimension: the time taken for a single task execution; external modules can query the corresponding scheduling statistics through group identifiers / group indexes to support on-orbit performance monitoring and anomaly location.
[0033] Step 6: Multi-level concurrency mutual exclusion protection mechanism: Two layers of mutual exclusion protection logic are set up: a global mutex lock controls global resource operations such as group creation and batch startup; a group-private mutex lock controls the addition and deletion of task queues and the execution of tasks within the group, preventing queue disorder caused by concurrent modifications by multiple threads.
[0034] Figure 3 This is a partial structural diagram of the independent task grouping unit and the grouped task queue provided in an embodiment of the present invention. Figure 3 From left to right, the top section connects to an independent task group unit, task queue node 1, task queue node 2, and task queue node 3. The independent task group unit serves as an independent scheduling unit, responsible for the execution cycle, scheduling priority, independent timing resources, and independent execution thread of its group. Task queue node 1, task queue node 2, and task queue node 3 are connected end to end in the order of registration to form a grouped task queue, which is used to store business tasks of the same period in a first-in-first-out manner. Figure 3 Below, a private mutual exclusion protection unit for groups is set up and associated with the independent task grouping unit through a dotted line. This unit is used to provide mutual exclusion protection during operations involving reading and writing of the grouped task queue, such as task registration, task deletion, and task traversal execution, to avoid queue structure competition between concurrent registration and concurrent execution. Figure 3 The bottom text, "New tasks are appended to the end, and scheduling starts from the head and executes sequentially," further clarifies the mounting rules and execution direction of the grouped task queues: newly added business tasks are only appended to the tail of the queue after task queue node 3, and are not inserted before registered tasks; after the periodic trigger event arrives, the group's independent execution module starts from task queue node 1, sequentially retrieving tasks along the directions of task queue node 1, task queue node 2, and task queue node 3, and executing them serially. The diagram also uses a combination of solid lines connecting at the top and dashed lines protecting at the bottom to illustrate the subordinate relationship between the execution link and the protection mechanism. Therefore, Figure 3 The layout of independent task grouping units, task queue node chains, group private mutual exclusion protection units, and tail append instructions demonstrates the detailed coordination relationship between the orderly storage of tasks within the same cycle, the sequential execution of tasks at the head, and the concurrent protection of the queue. This allows technical personnel to intuitively understand the structural support for tasks within a group from registration and appending to periodic execution.
[0035] Figure 4 This is a sequence diagram of task registration between the space service module and the group scheduling framework provided in an embodiment of the present invention. Figure 4The space service module is located on the upper left, and the group scheduling framework is located on the upper right. The space service module and the group scheduling framework communicate via bidirectional arrows, representing registration requests, verification processes, and return results. The space service module first submits a task registration application to the group scheduling framework. This application must include at least the period, group identifier, task identifier, and task logic. Upon receiving the application, the group scheduling framework first performs identifier null value and length validity checks to intercept invalid inputs such as empty or excessively long identifiers. Next, it matches existing groups and verifies period consistency to determine if there are period conflicts under the same group identifier. Then, it verifies the uniqueness of task identifiers within the group to intercept duplicate task names within the same group. If the verification passes, the task is appended to the end of the group's ordered queue to maintain the registration order. Finally, a dashed arrow returns a registration success or failure result to the space service module. Figure 4 The central section, highlighted by a yellow rectangle, states "Multi-layered verification intercepts illegal task registration, avoiding scheduling anomalies," indicating that null value verification, length verification, periodic consistency verification, and task uniqueness verification together constitute a multi-layered secure registration mechanism. Figure 4 Below, the satellite service module and the group scheduling framework reappear, representing the subsequent scheduling operations after registration. This diagram fully presents the interaction sequence and anomaly interception points of external service modules accessing the scheduling framework through four stages: request, verification, append, and return. When any layer of verification fails, the registration process terminates prematurely and returns a registration failure result, thus preventing illegal tasks from entering the group task queue. The diagram, through the vertical temporal arrangement between the modules on the left and right sides, places registration application, verification processing, queue mounting, and result feedback in the same interaction chain, facilitating observation of the specific nodes where anomaly interception occurs.
[0036] Example 2: This embodiment provides a multi-cycle grouped isolated task scheduling method suitable for space operations software, and gives an implementation method using a multi-cycle grouped isolated task scheduling system suitable for space operations software. The system includes a scheduling resource initialization module, a task dynamic grouping management module, a cycle triggering module, and a group independent execution module. In this embodiment, the cycle triggering event is generated based on a globally unified time reference, also known as a high-precision cycle triggering event. The above modules can be deployed in an onboard embedded processor for unified scheduling of cycled tasks in space operations services such as attitude and orbit control, telemetry and remote control, and payload management.
[0037] In step S101, the scheduling resource initialization module collects the system's monotonically increasing clock as a global unified time reference, initializes the task group resource pool and the business task resource pool, and sets both to an idle and available state. Since the monotonically increasing clock is unaffected by system clock adjustments, using it as a global unified time reference provides a consistent time reference for the periodic triggering and trigger time calibration of each task group. The task group resource pool is used to pre-configure establishable task group resources, and the business task resource pool is used to pre-configure mountable business task resources. Setting both the task group resource pool and the business task resource pool to an idle and available state avoids registration failures caused by uncertain resource states after power-on.
[0038] In step S102, the task dynamic grouping management module receives the task registration request and retrieves existing task groups based on the group identifier. The task registration request includes at least the execution cycle, group identifier, task identifier, and task execution logic. When no existing task group exists, the task dynamic grouping management module creates a new independent task group and uses it as the target task group. Subsequently, the module binds a dedicated execution cycle and scheduling priority to the target task group and appends the business task to the tail of the target task group's task queue. When an existing task group exists, the module uses it as the target task group and verifies that the execution cycle of the target task group matches the execution cycle of the task registration request. If the execution cycles match, the module appends the business task to the tail of the target task group's task queue; if the execution cycles do not match, the module rejects the task registration. By using the group identifier as the basis for group matching and the execution cycle as the consistency condition for the same group, cycle conflicts between groups with the same identifier can be prevented, and tasks with the same cycle are concentrated in the same independent scheduling unit.
[0039] Step S103: After task registration is complete, traverse all task groups and allocate independent timing resources, an independent execution queue, and an independent execution thread to each task group. The independent execution queue is used to isolate the tasks to be executed within this group; the group task queue serves as an ordered storage structure for the independent execution queue, storing business tasks in the order of registration. Independent timing resources are used to generate periodic trigger events for this group, and independent execution threads are used to carry out the serial execution process of this group.
[0040] In step S104, each task group configures its timing period based on a globally unified time base, and the periodic triggering module generates periodic trigger events. The group's independent execution module listens for and responds to these periodic trigger events, and sequentially executes all business tasks within the group's task queue according to the task registration order. During execution, the group's independent execution module collects the single execution time of a task and the total time of a single complete scheduling of the group, and recalibrates the next timing trigger time based on the globally unified time base. Subsequently, the group's independent execution module continuously listens for periodic trigger events. Specifically, the group's independent execution module can accumulate the actual trigger time of the current periodic trigger event with its dedicated execution period to obtain the next timing trigger time, and correct the accumulated error based on the globally unified time base. Since each task group uses independent timing resources, an independent execution queue, and an independent execution thread, even if a group containing a long-running task times out, it will not directly occupy the execution threads of other groups, thus achieving group isolation.
[0041] In steps S102 to S104, the group task queue stores business tasks in the order of registration. During execution, tasks are retrieved sequentially starting from the head of the queue. Therefore, the actual execution order is consistent with the task registration order, which facilitates on-orbit fault reproduction and ground simulation troubleshooting.
[0042] Example 3: This embodiment, based on Embodiment 2, further illustrates the implementation methods of task registration security verification, full group startup, and scheduling timeout warning. Optionally, after receiving a task registration request, the task dynamic group management module first performs length verification on the group identifier and task identifier in the task registration request. See [link to documentation] Figure 3 When a group identifier or task identifier is empty or its length exceeds the preset range, the dynamic task grouping management module directly rejects task registration and returns a registration failure result. Once the identifier passes length verification, the module searches for the task identifier within the target task group. If the same task identifier already exists within the target task group, the module rejects task registration; if no identical task identifier exists, the module allocates idle business task resources and appends the business task to the end of the target task group's task queue. Through length verification, identifier uniqueness verification, and idle resource allocation, duplicate task names, parameter conflicts, or resource out-of-bounds errors can be avoided when dynamically adding new tasks on the satellite.
[0043] After all task groups have completed registration and resource allocation, the task dynamic group management module initiates the periodic scheduling process for all task groups. The initiation process includes writing the dedicated execution cycle of each task group into independent timed resources, setting the group task queue of each task group to an executable state, and marking the group's activation status as enabled. Once the periodic scheduling process for a particular group is initiated, that group enters a running state that continuously listens for periodic trigger events.
[0044] During the execution phase, the group-based independent execution module compares the total time taken for a single complete scheduling operation of a group with a preset periodic threshold. When the total time taken for a single complete scheduling operation of a group exceeds the preset periodic threshold, the group-based independent execution module generates a scheduling timeout warning. This scheduling timeout warning can carry the group identifier, the total time taken for a single complete scheduling operation of the group, the preset periodic threshold, and the timeout occurrence time, and can be read by the telemetry downlink module or the fault diagnosis module. By decentralizing the timeout determination to each task group, the problem of excessively long cumulative time for a single task group can be detected in a timely manner, avoiding timing overflow from affecting the triggering of subsequent cycles within the same group.
[0045] Example 4: This embodiment, based on Embodiment 2, further illustrates the implementation methods of scheduling status statistics query, multi-level concurrent mutual exclusion protection, and resource capacity configuration. Optionally, the system also includes a scheduling status statistics query module and a multi-level concurrent mutual exclusion protection module. The scheduling status statistics query module is used to count the total number of tasks within a single group, the cumulative number of scheduling runs for the group, the total execution time of the previous round of the group, and the group's activation status, and to count the single execution time of a task at the single task level. Subsequently, the scheduling status statistics query module provides the corresponding scheduling statistics data to external modules through a standardized query interface. The total execution time of the previous round of the group can be taken as the most recently collected total single scheduling time of the group; the single execution time of a task can be taken as the most recently collected single execution time of the task. External modules may include a satellite telemetry module, a fault diagnosis module, and a ground monitoring system; after reading the corresponding scheduling statistics data, the external modules can determine problems such as satellite task load, scheduling timing overflow, and abnormal group termination.
[0046] The multi-level concurrency mutual exclusion protection module manages group creation and batch startup through a global mutex lock, and manages the addition, deletion, and task traversal execution within a group through group-specific mutex locks. Specifically, when the task dynamic group management module creates a new independent task group, modifies group attributes, or performs a batch operation to start all task groups, it first acquires the global mutex lock, and then releases it after the operation is completed. When the task dynamic group management module adds or deletes business tasks to a group's task queue, or when the group's independent execution module traverses the group's task queue to execute business tasks, it acquires the group-specific mutex lock corresponding to that task group. Because the global mutex lock covers group-level operations, and the group-specific mutex lock covers queue operations within a group, data competition between concurrent registration and concurrent execution can be avoided while maintaining group isolation.
[0047] Optionally, during the initialization phase, the scheduling framework is pre-configured to support a maximum of N different periodic task groups and a maximum of M business tasks across the entire system. N and M are positive integers; N limits the number of group resources in the task group resource pool, and M limits the number of business task resources in the business task resource pool. When a task registration request causes the number of groups to reach N or the number of business tasks to reach M, the scheduling framework rejects the new registration and returns a registration failure result. By setting N and M, it is possible to ensure that the spaceborne embedded device has defined resource boundaries under resource-constrained conditions, avoiding memory overflow or uncontrolled scheduling resources caused by dynamic registration.
[0048] Preferably, the periodic triggering module uses a kernel-level event-triggered timing mechanism to generate periodic trigger events, replacing user-mode delay functions and signal interrupt timing methods. Because the kernel-level event-triggered timing mechanism can dynamically adjust the next trigger time for each group based on a globally unified time base, it can reduce context switching overhead and minimize timing drift caused by long-term operation.
[0049] Alternatively, the scheduling priority of each task group is used to determine the thread scheduling order in scenarios where resources of the same priority compete for resources. High real-time attitude and orbit control services can be configured as a higher priority group, telemetry acquisition services as a medium priority group, and payload management services as a low priority group. Alternatively, different service modules of the spacecraft can create short-cycle groups, medium-cycle groups, and long-cycle groups respectively. High real-time attitude control services can be registered to the short-cycle group, telemetry acquisition services can be registered to the medium-cycle group, and payload management services can be registered to the long-cycle group. Although each task group has an independent execution thread, the scheduling priority can still provide constraints for the operating system's thread scheduling, thereby ensuring that hard real-time tasks get processor time first.
[0050] Example 5: This embodiment is a variation. It adapts the scheduling framework to different onboard operating systems. During the adaptation process, the globally unified time base can be mapped to the operating system's monotonic clock interface, independent execution threads can be mapped to operating system threads or real-time threads, independent timing resources can be mapped to operating system timer resources, and independent execution queues can be mapped to lock-free queues, linked lists, or circular queues. Although the underlying mapping relationships change with the operating system, the calling relationships between the task dynamic grouping management module, the periodic triggering module, and the grouped independent execution module remain unchanged. Therefore, the same grouping isolation scheduling method can be ported to satellite management software of different scales while maintaining the core constraints of grouping isolation, ordered execution, and periodic calibration.
[0051] Although various embodiments of the invention have been described above, it should be understood that they are presented by way of example only and not as limitations. It will be apparent to those skilled in the art that various combinations, modifications, and alterations can be made without departing from the spirit and scope of the invention. Therefore, the breadth and scope of the invention disclosed herein should not be limited by the exemplary embodiments disclosed above, but should be defined solely by the appended claims and their equivalents.
Claims
1. A multi-cycle grouping isolation task scheduling method suitable for space service software, characterized in that, include: The monotonically increasing clock of the acquisition system serves as a global unified time reference. It initializes the task grouping resource pool and the business task resource pool, and sets the task grouping resource pool and the business task resource pool to an idle and available state. Receive task registration requests and retrieve existing task groups based on group identifiers, including: For scenarios where no existing task group exists, create a new independent task group, use the new independent task group as the target task group, bind a dedicated execution cycle and scheduling priority to the target task group, and append the business task to the end of the group task queue of the target task group; For scenarios where existing task groups exist, the existing task group is used as the target task group. The execution cycle of the target task group is verified to be consistent with the execution cycle of the task registration request. If the execution cycles are consistent, the business task is appended to the end of the target task group's task queue. For scenarios with inconsistent execution cycles, task registration will be rejected; Iterate through all task groups and allocate independent timer resources, an independent execution queue, and an independent execution thread to each task group; and Each task group configures its timing period based on a globally unified time base, generates periodic trigger events, listens for periodic trigger events, responds to periodic trigger events, and sequentially executes all business tasks in the group's task queue according to the task registration order. It collects the single execution time of a task and the total time of a single complete scheduling of a group, recalibrates the next timing trigger time based on the globally unified time base, and continuously listens for periodic trigger events.
2. The multi-cycle grouping isolation task scheduling method applicable to space management software according to claim 1, characterized in that, The step of traversing all task groups and allocating independent timed resources, independent execution queues, and independent execution threads to each task group also includes: starting the periodic scheduling process for all task groups.
3. The multi-cycle grouped isolated task scheduling method applicable to space management software according to claim 1, characterized in that, Also includes: A scheduling timeout warning is generated if the total time taken for a single complete scheduling of a group exceeds a preset periodic threshold.
4. The multi-cycle grouping isolation task scheduling method applicable to space management software according to claim 1, characterized in that, Also includes: The system calculates the total number of tasks within a single group, the cumulative number of scheduled runs for the group, the total execution time of the previous round for the group, and the group's activation status. It also calculates the single-run time of a task at the single-task level and provides corresponding scheduling statistics to external modules through a standardized query interface.
5. The multi-cycle grouped isolated task scheduling method applicable to space management software according to claim 1, characterized in that, Also includes: Global mutexes are used to control group creation and batch startup, while private mutexes within groups are used to control the addition and deletion of task queues and the traversal and execution of tasks.
6. The multi-cycle grouping isolation task scheduling method applicable to space management software according to claim 1, characterized in that, Also includes: It is pre-configured to support up to N different periodic task groups and a maximum of M business tasks across the entire system.
7. A multi-cycle grouped isolated task scheduling system suitable for space service software, characterized in that, include: The scheduling resource initialization module is used to collect the system's monotonically increasing clock as a global unified time reference, initialize the task group resource pool and the business task resource pool, and set the task group resource pool and the business task resource pool to an idle and available state. The task dynamic grouping management module is used to receive task registration requests, retrieve existing task groups based on group identifiers, create a new independent task group for scenarios where no task group exists, use the new independent task group as the target task group, bind a unique execution cycle and scheduling priority to the target task group, and append the business task to the end of the target task group's group task queue. For scenarios where an existing task group exists, use the existing task group as the target task group, verify that the execution cycle of the target task group is consistent with the execution cycle of the task registration request, append the business task to the end of the target task group's group task queue for scenarios where the execution cycles are inconsistent, and reject task registration for scenarios where the execution cycles are inconsistent. The periodic triggering module is used to configure the group timing period based on a globally unified time base and generate periodic triggering events. The group-based independent execution module is used to listen for and respond to high-precision periodic trigger events, and to sequentially execute all business tasks in the group task queue according to the task registration order. It collects the single execution time of a task and the total time of a single complete group scheduling, and recalibrates the next timed trigger time based on a globally unified time base.
8. The multi-cycle grouped isolated task scheduling system for satellite management software according to claim 7, characterized in that, Also includes: The scheduling status statistics and query module is used to calculate the total number of tasks within a single group, the cumulative number of scheduling runs within the group, the total execution time of the previous round of the group, and the group's activation status. It also calculates the single execution time of a task at the single task level and provides corresponding scheduling statistics data to external modules through a standardized query interface.
9. The multi-cycle grouped isolated task scheduling system for space service software according to claim 7, characterized in that, Also includes: The multi-level concurrency mutual exclusion protection module is used to control group creation and batch startup through a global mutex lock, and to control the addition and deletion of task queues and the traversal and execution of tasks within a group through a group-private mutex lock.
10. The multi-cycle grouped isolated task scheduling system for space service software according to claim 7, characterized in that, The task dynamic grouping management module is used to perform length verification on the group identifier and task identifier in the task registration request, retrieve the task identifier in the target task group, reject task registration in the case of duplicate task identifiers, allocate idle business task resources in the case of unique task identifiers, and append the business task to the end of the group task queue of the target task group.