A method and system for autonomous task scheduling based on multi-level dynamic priority
By adopting the independent task scheduling method based on multi -level dynamic priority in the digital passage of the remote sensing satellite, the traditional technologies cannot meet the problems of fast real -time observation and high -resolution observation capabilities, realizing dynamic priority adjustment and system reliable system reliability The improvement of sexuality supports the series of software productization.
Patent Information
- Application Number
- CN202211321600.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-26
- Publication Date
- 2025-01-28
- Estimated Expiration
- 2042-10-26
AI Technical Summary
The traditional interrupt-driven mechanism of the digital transmission computer software cannot meet the transformation of remote sensing satellites from test applications to service services, cannot achieve fast real-time observation and high-resolution observation capabilities, and lacks reliability and real-timeness, making it difficult to support the software product series. change.
Adopt the independent task scheduling method based on multi -level dynamic priority, refresh the constructed sub -mission priority mapping table, use a single linked list queue and priority to show dynamic priority adjustment, improve efficiency and save space, and have good available available. Transplantation and scalability.
The dynamic priority adjustment has been achieved, the task scheduling efficiency and system reliability have been improved, the rapid real -time observation and high -resolution observation needs of the remote sensing satellite are met, and the customized bottlenecks are broken and the software productization series is supported.
Smart Images

Figure CN115755785B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to an autonomous task scheduling method and system based on multi-level dynamic priority, belonging to the technical field of digital transmission load control, suitable for receiving and parsing bus data by digital transmission lower computer software under an interrupt drive mechanism, dynamically adjusting the priority according to the monitoring key indicators for real-time response, and can be widely used in the field of load control. Background Art
[0002] In order to realize the transformation of remote sensing satellites from experimental applications to business services, we need to develop diverse land and sea observation methods and modes, and build fast real-time observation and high-resolution observation capabilities. The traditional "interrupt drive + main loop traversal" single operation mode cannot meet the requirements of reliability and real-time performance, is not conducive to software definition and function reconstruction, and cannot support the serialization of future software products. Summary of the invention
[0003] The technical problem to be solved by the present invention is: to overcome the shortcomings of the prior art and propose an autonomous task scheduling method based on multi-level dynamic priority, aiming to refresh and reconstruct the subtask priority mapping table, and cleverly realize dynamic priority adjustment by using a single linked list queue and a priority bit map, thereby improving efficiency and saving space. In addition, the autonomous task scheduling method has the characteristics of good portability and scalability, breaking through the bottleneck of previous customization, and can be used as an architecture component.
[0004] The technical solution adopted by the present invention is:
[0005] An autonomous task scheduling method based on multi-level dynamic priorities comprises the following steps:
[0006] Step 1: Periodically monitor key indicators;
[0007] Step 2: Create an intervention subtask with the maximum priority value Max_Number;
[0008] Step 3: Execute the "queue entry" operation;
[0009] Step 4: Execute the "out of queue" operation;
[0010] Step 5: According to the abnormal level of the indicator threshold, the priority of the monitoring task in the priority mapping table is increased;
[0011] Step 6: Determine again whether the indicator threshold is healthy. If so, reduce the priority of the monitoring task in the priority mapping table and restore to normal mode; otherwise, summarize the intervention process records and report them;
[0012] Step 7: Determine whether the periodic monitoring is finished. If so, it ends; otherwise, return to step 1.
[0013] Furthermore, the step 1 periodically monitors key indicators, specifically including:
[0014] S11, determine whether periodic monitoring is enabled, if yes, monitor key indicators and proceed to the next step S12;
[0015] S12, determine whether the indicator threshold is healthy, if yes, proceed to step 7; otherwise, autonomous health management is required, enter the autonomous intervention mode, and execute step 2.
[0016] Furthermore, the execution of the "queue entry" operation specifically includes:
[0017] S31, after the hardware interrupt is triggered, the data transmission control unit receives and parses the bus data in the interrupt service program, and determines whether the task ID is valid according to the bus protocol format. If the task ID is invalid, it continues to wait in the interrupt service program. If the task ID is valid, it proceeds to the next step;
[0018] S32, if the priority of the intervention subtask in step 2 is higher than the current highest priority Current_HighestPriority, then update the current highest priority Current_HighestPriority to the priority of the subtask, otherwise keep the current highest priority Current_HighestPriority unchanged;
[0019] S33, according to the mapping relationship between the priority of the current subtask and the priority queue array, obtain the priority of the queue where the subtask is located; determine whether the subtask running in the priority queue where the current subtask is located is empty, if it is empty, update the priority bitmap, and change the element in the priority bitmap subscripted as the queue priority to a valid state; otherwise, do not update the priority bitmap;
[0020] S34, the first element of the priority queue array with subscript 0 represents the number of all subtasks in the array, and the other subscripts of the array represent the priority of the queue, starting from 1 and going up to the maximum Max_Number; according to the priority of the subtask, find the queue where the current priority is located and insert the subtask into the end of the queue to implement the "queue entry" operation;
[0021] S35. The first element of the priority queue array, that is, the number of all subtasks, is synchronously updated, and the number of all subtasks is increased by 1.
[0022] Furthermore, the priority bitmap refers to: the priority bitmap refers to a two-dimensional array, the subscript corresponds to the priority of the subtask, and the content refers to whether there is a subtask of this priority in the current state, 1 for yes, 0 for no.
[0023] Furthermore, the execution of the "out of queue" operation is specifically as follows:
[0024] S41, determine whether the first element of the queue array, that is, the number of all subtasks, is greater than or equal to 1. If so, traverse the bitmap in combination with the variable Current_HighestPriority to select the non-empty subtask queue with the highest priority; otherwise, exit "Queue" and enter step S12;
[0025] S42, obtain the ID of the first subtask of the team, delete the node task, and point the head pointer to the next successor element of the "out of team" task;
[0026] S43, determine whether the subtask queue of the priority level is empty, if so, update the current priority bitmap; and update the first element of the queue, i.e., the number of all subtasks;
[0027] S44. Finally, execute the node task according to the task ID.
[0028] Furthermore, the priority of the current subtask is obtained according to the real-time and importance of the subtask, and a subtask priority mapping table is created to divide the task priority into level 1, level 2...maximum level Max_Number; a queue array is established, the array subscript is the task priority, and the array element is a single linked list priority queue; tasks of the same priority are stored in the same linked list queue; the nodes of the linked list store valid task IDs.
[0029] Furthermore, the present invention also proposes an autonomous task scheduling system based on multi-level dynamic priorities, comprising:
[0030] Key indicator monitoring module: periodically monitor key indicators;
[0031] Subtask creation module: Create an intervention subtask with the maximum priority value Max_Number;
[0032] Enqueue and dequeue execution module: execute "enqueue" operation; execute "dequeue" operation;
[0033] Priority enhancement module: according to the abnormal level of indicator threshold, enhance the priority of monitoring tasks in the priority mapping table; judge whether the indicator threshold is healthy again, if so, lower the priority of monitoring tasks in the priority mapping table and restore to normal mode; otherwise, summarize the intervention process records and report them; judge whether the periodic monitoring is over, if so, end it, otherwise monitor the key indicators again through the key indicator monitoring module.
[0034] The advantages of the present invention compared with the prior art are:
[0035] (1) The present invention proposes an autonomous task scheduling method based on multi-level dynamic priority. Compared with the traditional "interrupt drive + main loop traversal", the method realizes dynamic adjustment of priority by refreshing and reconstructing a parameterized configurable priority mapping table. It also has good portability and scalability and can be used as an architecture component.
[0036] (2) The present invention proposes autonomous on-orbit health management based on the configuration item level. Compared with the traditional centralized satellite control, this paper periodically monitors the health management status of key indicators and autonomously performs intervention tasks for abnormal problems to avoid further expansion of faults and affect the safety of the payload, thereby improving the level of refinement of on-orbit fault isolation detection.
[0037] (3) The priority queue array involved in the specific implementation process of the autonomous task scheduling method based on multi-level dynamic priority of the present invention, the subscript of the array is the task priority, and the element of the array is a single linked list priority queue. The efficient random access of the sequential list and the low complexity of the head deletion and tail insertion of the single linked list are cleverly combined, which greatly improves the query efficiency and reduces the storage space. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Figure 1 It is a flowchart for autonomous task scheduling based on dynamic priorities;
[0039] Figure 2 Added task flow chart for joining the team;
[0040] Figure 3 Execute the task flow chart for the team. DETAILED DESCRIPTION
[0041] In order to better understand the above technical solution, the technical solution of this application is described in detail below through the accompanying drawings and specific implementations.
[0042] In order to improve the fast real-time observation and high-resolution observation capabilities, the traditional "interrupt drive + main loop traversal" solidifies the priority of subtasks through if-else if-else statement polling judgment, and cannot dynamically adjust the priority of subtasks in time. Once the interrupt timing design is not comprehensive, it is easy to cause the loss of data packets, and the reliability and real-time performance are low, and the portability is poor. In response to the above problems, the present invention proposes an autonomous task scheduling method and system based on multi-level dynamic priority, which aims to refresh and reconstruct the subtask priority mapping table, and use the single linked list queue and priority bit map to cleverly realize dynamic priority adjustment, thereby improving efficiency and saving space. In addition, the autonomous task scheduling method has the characteristics of good portability and scalability, breaking through the bottleneck of previous customization, and can be used as an architecture component.
[0043] like Figure 1As shown, the present invention proposes an autonomous task scheduling method based on multi-level dynamic priority, comprising the following steps:
[0044] Step 1: Periodically monitor key indicators;
[0045] S11, determine whether periodic monitoring is enabled, if yes, monitor key indicators and proceed to the next step S12;
[0046] S12, determine whether the indicator threshold is healthy, if yes, proceed to step 7. Otherwise, autonomous health management is required to enter the autonomous intervention mode.
[0047] Step 2: Create an intervention subtask with the maximum priority value Max_Number;
[0048] Obtain the priority of the current subtask according to the real-time nature and importance of the subtask, create a subtask priority mapping table, and divide the task priority into level 1, level 2, ... the maximum level Max_Number; establish a queue array, the array subscript is the task priority, and the array element is a single linked list priority queue; tasks of the same priority are stored in the same linked list queue; the nodes of the linked list store valid task IDs.
[0049] Step 3: Figure 2 As shown, the "enter the queue" operation is performed;
[0050] S31, after the hardware interrupt is triggered, the data transmission control unit receives and parses the bus data in the interrupt service program, and determines whether the task ID is valid according to the bus protocol format. If the task ID is invalid, it continues to wait in the interrupt service program. If the task ID is valid, it proceeds to the next step;
[0051] S32, if the priority of the intervention subtask in step 2 is higher than the current highest priority Current_HighestPriority, then update the current highest priority Current_HighestPriority to the priority of the subtask, otherwise keep the current highest priority Current_HighestPriority unchanged;
[0052] S33, according to the mapping relationship between the priority of the current subtask and the priority queue array, obtain the priority of the queue where the subtask is located; determine whether the subtask running in the priority queue where the current subtask is located is empty, if it is empty, update the priority bitmap, and change the element in the priority bitmap subscripted as the queue priority to a valid state; otherwise, do not update the priority bitmap;
[0053] S34, the first element of the priority queue array with subscript 0 represents the number of all subtasks in the array, and the other subscripts of the array represent the priority of the queue, starting from 1 and going up to the maximum Max_Number; according to the priority of the subtask, find the queue where the current priority is located and insert the subtask into the end of the queue to implement the "queue entry" operation;
[0054] S35. The first element of the priority queue array, that is, the number of all subtasks, is synchronously updated, and the number of all subtasks is increased by 1.
[0055] The priority bitmap refers to: the priority bitmap refers to a two-dimensional array, the subscript corresponds to the priority of the subtask, and the content refers to whether there is a subtask of this priority in the current state, 1 for yes, 0 for no.
[0056] Step 4: Figure 3 As shown, the "dequeue" operation is performed;
[0057] S41. Determine whether the first element of the queue array, that is, the number of all subtasks, is greater than or equal to 1. If so, traverse the bitmap in combination with the variable Current_HighestPriority to select the non-empty subtask queue with the highest priority.
[0058] S42. Get the ID of the head subtask of the team, delete the node task, and point the head pointer to the next successor element of the "out of team" task.
[0059] S43, determine whether the subtask queue of the priority level is empty, if so, update the current priority bitmap and simultaneously update the first element of the queue, i.e., the number of all subtasks.
[0060] S44. Finally, execute the node task according to the task ID.
[0061] Step 5: According to the abnormal level of the indicator threshold, the priority of the monitoring task in the priority mapping table is increased;
[0062] Step 6: Determine again whether the indicator threshold is healthy. If so, reduce the priority of the monitoring task in the priority mapping table and restore to normal mode. Otherwise, summarize the intervention process records and report them.
[0063] Step 7: Determine whether the periodic monitoring is finished. If so, finish; otherwise, proceed to step 1.
[0064] Parts of the present invention that are not described in detail belong to the well-known technologies of those skilled in the art.
Claims
1. An autonomous task scheduling method based on multi-level dynamic priority, characterized in that: The steps include: Step 1: Periodically monitor key indicators; Step 2: Create an intervention subtask with the maximum priority value Max_Number; Step 3: Execute the "queue entry" operation; The execution of the "queue entry" operation specifically includes: S31, after the hardware interrupt is triggered, the data transmission control unit receives and parses the bus data in the interrupt service program, and determines whether the task ID is valid according to the bus protocol format. If the task ID is invalid, it continues to wait in the interrupt service program. If the task ID is valid, it proceeds to the next step; S32, if the priority of the intervention subtask in step 2 is higher than the current highest priority Current_HighestPriority, then update the current highest priority Current_HighestPriority to the priority of the subtask, otherwise keep the current highest priority Current_HighestPriority unchanged; S33, according to the mapping relationship between the priority of the current subtask and the priority queue array, obtain the priority of the queue where the subtask is located; determine whether the subtask running in the priority queue where the current subtask is located is empty, if it is empty, update the priority bitmap, and change the element in the priority bitmap subscripted as the queue priority to a valid state; otherwise, do not update the priority bitmap; S34, the first element of the priority queue array with subscript 0 represents the number of all subtasks in the array, and the other subscripts of the array represent the priority of the queue, starting from 1 and going up to the maximum Max_Number; according to the priority of the subtask, find the queue where the current priority is located and insert the subtask into the end of the queue to implement the "enter the queue" operation; S35, the first element of the priority queue array, that is, the number of all subtasks, is synchronously updated, and the number of all subtasks is increased by 1; Step 4: Execute the "out of queue" operation; The execution of the "out of team" operation is specifically: S41, determine whether the first element of the queue array, that is, the number of all subtasks, is greater than or equal to 1. If so, traverse the bitmap in combination with the variable Current_HighestPriority to select the non-empty subtask queue with the highest priority; otherwise, jump out of the "out of queue" and enter step S12; S42, get the ID of the head subtask, delete the subtask, and point the head pointer to the next successor element of the "out of team" task; S43, determine whether the subtask queue of the priority level is empty, if so, update the current priority bitmap; and update the first element of the queue, i.e., the number of all subtasks; S44, finally executing the node task according to the task ID; Step 5: According to the abnormal level of the indicator threshold, the priority of the monitoring task in the priority mapping table is increased; Step 6: Determine again whether the indicator threshold is healthy. If so, reduce the priority of the monitoring task in the priority mapping table and restore to normal mode; otherwise, summarize the intervention process records and report them; Step 7: Determine whether the periodic monitoring is finished. If so, it ends; otherwise, return to step 1.
2. The autonomous task scheduling method based on multi-level dynamic priority according to claim 1 is characterized in that: The step 1 periodically monitors key indicators, specifically including: S11, determine whether periodic monitoring is enabled, if yes, monitor key indicators and proceed to the next step S12; S12, determine whether the indicator threshold is healthy, if yes, proceed to step 7; otherwise, autonomous health management is required, enter the autonomous intervention mode, and execute step 2.
3. The autonomous task scheduling method based on multi-level dynamic priority according to claim 1 is characterized in that: The priority bitmap refers to: the priority bitmap refers to a two-dimensional array, the subscript corresponds to the priority of the subtask, and the content refers to whether there is a subtask of this priority in the current state, 1 for yes, 0 for no.
4. The autonomous task scheduling method based on multi-level dynamic priority according to claim 1 is characterized in that: Obtain the priority of the current subtask according to the real-time nature and importance of the subtask, create a subtask priority mapping table, and divide the task priority into level 1, level 2, ... the maximum level Max_Number; establish a queue array, the array subscript is the task priority, and the array element is a single linked list priority queue; tasks of the same priority are stored in the same linked list queue; the nodes of the linked list store valid task IDs.
5. An autonomous task scheduling system based on multi-level dynamic priorities, characterized in that include: Key indicator monitoring module: periodically monitor key indicators; Subtask creation module: Create an intervention subtask with the maximum priority value Max_Number; Enqueue and dequeue execution module: execute "enqueue" operation; execute "dequeue" operation; Priority enhancement module: according to the abnormal level of the indicator threshold, the priority of the monitoring task in the priority mapping table is enhanced; it is judged again whether the indicator threshold is healthy, if so, the priority of the monitoring task in the priority mapping table is lowered and restored to normal mode; otherwise, the intervention process records are summarized and reported; it is judged whether the periodic monitoring is ended, if so, it is ended, otherwise the key indicators are monitored again through the key indicator monitoring module; The execution of the "queue entry" operation specifically includes: S31, after the hardware interrupt is triggered, the data transmission control unit receives and parses the bus data in the interrupt service program, and determines whether the task ID is valid according to the bus protocol format. If the task ID is invalid, it continues to wait in the interrupt service program. If the task ID is valid, it proceeds to the next step; S32, if the priority of the intervention subtask in step 2 is higher than the current highest priority Current_HighestPriority, then update the current highest priority Current_HighestPriority to the priority of the subtask, otherwise keep the current highest priority Current_HighestPriority unchanged; S33, according to the mapping relationship between the priority of the current subtask and the priority queue array, obtain the priority of the queue where the subtask is located; determine whether the subtask running in the priority queue where the current subtask is located is empty, if it is empty, update the priority bitmap, and change the element in the priority bitmap subscripted as the queue priority to a valid state; otherwise, do not update the priority bitmap; The priority bitmap refers to: The priority bitmap refers to a two-dimensional array, the subscript corresponds to the priority of the subtask, and the content refers to whether there is a subtask of this priority in the current state, 1 for yes, 0 for no; S34, the first element of the priority queue array with subscript 0 represents the number of all subtasks in the array, and the other subscripts of the array represent the priority of the queue, starting from 1 and going up to the maximum Max_Number; according to the priority of the subtask, find the queue where the current priority is located and insert the subtask into the end of the queue to implement the "enter the queue" operation; S35, the first element of the priority queue array, that is, the number of all subtasks, is synchronously updated, and the number of all subtasks is increased by 1; The execution of the "out of team" operation is specifically: S41, determine whether the first element of the queue array, that is, the number of all subtasks, is greater than or equal to 1. If so, traverse the bitmap in combination with the variable Current_HighestPriority to select the non-empty subtask queue with the highest priority; otherwise, jump out of the "out of queue" and enter step S12; S42, get the ID of the head subtask, delete the subtask, and point the head pointer to the next successor element of the "out of team" task; S43, determine whether the subtask queue of the priority level is empty, if so, update the current priority bitmap; and update the first element of the queue, i.e., the number of all subtasks; S44. Finally, execute the node task according to the task ID.
6. The autonomous task scheduling system based on multi-level dynamic priority according to claim 5, characterized in that: Periodically monitor key indicators, including: S11, determine whether periodic monitoring is enabled, if yes, monitor key indicators and proceed to the next step S12; S12. Determine whether the indicator threshold is healthy. If so, determine whether the periodic monitoring is completed; otherwise, autonomous health management is required to enter the autonomous intervention mode.
Citation Information
Patent Citations
On-line management method of checking and tracking of job schedule abnormalities
CN103136161A
Multiple-redundancy variable master-slave fire alarm monitoring system and method
CN104299350A