A task scheduling method for inertial platform system based on round-robin mechanism

By using a rotation mechanism in the inertial platform system to equally divide the cycle period and task queue length, the execution period of each task is ensured to be fixed, which solves the problem of unstable task execution period in the existing technology and improves the accuracy and reliability of the system.

CN114968514BActive Publication Date: 2024-08-30BEIJING INST OF AEROSPACE CONTROL DEVICES
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202210442372.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-25
Publication Date
2024-08-30
Estimated Expiration
2042-04-25

AI Technical Summary

Technical Problem

The existing task scheduling method of the inertial platform system causes the task execution cycle to be unstable, affecting the system accuracy.

Method used

Using a task scheduling method based on the rotation mechanism, the cycle period is divided into time slices consistent with the length of the task queue. A position in the task queue is read in each time slice. If there is a task, it is executed. If there is no task, it waits for the next one. Time slice ensures that the task execution cycle is fixed.

Benefits of technology

The execution cycle of each task is fixed, which improves the control accuracy of the system and the reliability of task execution.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114968514B
    Figure CN114968514B
Patent Text Reader

Abstract

The present invention discloses a task scheduling method for an inertial platform system based on a round-robin mechanism, and the steps are as follows: (1) the task instruction to be executed is transmitted to the inertial platform system through a communication interface; (2) the inertial platform system receives the transmitted task and adds it to a task queue, wherein the length of the task queue is n; (3) the cycle is divided into n time slices that are consistent with the length of the task queue, and a position in the task queue is read in each time slice: if no task is added to this position, no action is performed in this time slice until the next time slice arrives; if a task is added to this position, the task execution function of this task is executed, and after the function execution is completed, the next time slice arrives. The present invention solves the problem that the task execution cycle of the inertial platform system is not fixed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a task scheduling method for an inertial platform system, and in particular to a task scheduling method for an inertial platform system based on a round-robin mechanism, which is mainly used in the field of task scheduling for an inertial platform system. Background Art

[0002] The inertial platform system is a device that can measure information such as the rotation angle of the vehicle relative to the inertial space and linear acceleration. It is the core component of the inertial navigation system.

[0003] The task execution of the inertial platform system is executed once in each cycle, and executed multiple times until the final execution effect is achieved. The existing task scheduling method of the inertial platform system is to query the receiving identifiers of various tasks in turn in the cycle. If a task is received, the corresponding action is executed, otherwise, the task is skipped directly and the receiving identifier of the next task is queried. In this scheduling method, the tasks are executed sequentially. Since the number of tasks to be executed in each cycle is uncertain, and even for the same task, the execution time of each task is different due to the different branches entered in each cycle, the execution interval of the same task is not fixed. For some tasks that require precise execution cycles, the non-fixed execution cycle may affect the control effect of the control algorithm in the task, thereby affecting the system accuracy. Therefore, it is necessary to seek a new task scheduling method for inertial platform systems based on a round-robin mechanism to ensure that the execution cycle of each task is fixed. Summary of the invention

[0004] The technical problem solved by the present invention is to overcome the deficiencies of the prior art, provide a multi-task scheduling method for an inertial platform system based on a round-robin mechanism, and solve the problem that the task execution cycle of the inertial platform system is not fixed.

[0005] The technical solution of the present invention is: a task scheduling method for an inertial platform system based on a rotation mechanism, comprising the following steps:

[0006] (1) Transmitting the task instructions to be executed to the inertial platform system through the communication interface;

[0007] (2) The inertial platform system receives the issued task and adds it to the task queue, where the length of the task queue is n;

[0008] (3) The loop period is divided into n time slices that are the same as the length of the task queue. A position in the task queue is read in each time slice. If no task is added to this position, no action is performed in this time slice until the next time slice arrives. If a task is added to this position, the task execution function of this task is executed. After the function is executed, wait for the next time slice to arrive.

[0009] The communication interface adopts any one of RS232 serial port, RS422 serial port, RS485 serial port, 1553B communication interface, parallel bus interface, CAN interface and Ethernet interface.

[0010] The task types of the tasks sent down include frame locking, inertial data acquisition, and stable loop control.

[0011] The frame locking refers to locking the three-axis angle of the inertial platform system at a preset angle according to the three-axis angle output by the frame angle sensor; the three axes of the inertial platform system include an outer ring axis, an inner ring axis and a platform body axis.

[0012] The inertial data acquisition refers to the acquisition of inertial data generated by various components in the system; the components include gyroscopes, accelerometers, and frame angles.

[0013] The stabilization loop control refers to stabilizing the outer ring axis, inner ring axis and platform axis of the inertial platform system in the inertial space according to the collected gyro data.

[0014] The characteristic description of the task of the inertial platform system includes task ID, task initialization function, task execution function, task completion callback function, task completion flag, total task execution time, task execution times, and task timeout processing function.

[0015] Step (2) When adding a task to the task queue, ensure that there is no task of the same type in the queue. If there is, abandon the task. If not, add the task to the first empty position in the queue.

[0016] When step (3) starts executing the extracted task, it is determined whether the accumulated running time of the extracted task exceeds the preset time limit: if it exceeds, the task timeout processing function is called; if it does not exceed, the task execution function is run.

[0017] When the task execution function is finished, it is determined whether the task has been completed: if it has been completed, the task completion flag is set, and the task completion callback function is called to remove the task from the task queue, and the corresponding position of the task queue becomes vacant; if it has not been completed, the task is kept in the task queue and waits for the arrival of the same time slice in the next cycle.

[0018] The advantages of the present invention compared with the prior art are as follows: the present invention sets a task queue with a length of n for storing various received tasks, and divides the cycle period into n time slices consistent with the length of the task queue, adopts a round-robin scheduling mechanism, and reads a position in the task queue in each time slice: if no task is added to this position, no action is performed in the time slice until the next time slice arrives; if a task is added to this position, the task execution function of this task is executed, and after the function is executed, wait for the arrival of the next time slice, thereby ensuring that the execution cycle of each task is fixed. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] Figure 1 Flowchart for round-robin scheduling between tasks.

[0020] Figure 2 A flowchart of the execution process for a single task. DETAILED DESCRIPTION

[0021] The following is combined with Figure 1 , 2 The present invention is described in detail with reference to the accompanying drawings and examples.

[0022] The present invention provides a task scheduling method for an inertial platform system based on a rotation mechanism, the method comprising the following steps:

[0023] (1) The task instructions to be executed are transmitted to the inertial platform system through the communication interface. The communication interface can be any one of RS232 serial port, RS422 serial port, RS485 serial port, 1553B communication interface, parallel bus interface, CAN interface, and Ethernet interface. Task types include frame locking, inertial data acquisition, and stable loop control.

[0024] Frame locking means locking the three-axis angle of the inertial platform system at a preset angle according to the three-axis angle output by the frame angle sensor; the three axes of the inertial platform system include an outer ring axis, an inner ring axis and a platform body axis;

[0025] Inertial data acquisition refers to the acquisition of inertial data generated by various components in the system; the components include gyro data, accelerometer data, and frame angle;

[0026] Stabilization loop control refers to stabilizing the outer ring axis, inner ring axis and platform axis of the inertial platform system in the inertial space based on the collected gyro data.

[0027] (2) The inertial platform system receives the issued task and adds it to the task queue, where the length of the task queue is n.

[0028] The characteristic description of the task of the inertial platform system includes task ID, task initialization function, task execution function, task completion callback function, task completion flag, total task execution time, task execution times, and task timeout processing function.

[0029] When adding a task to a task queue, you need to ensure that there are no tasks of the same type in the queue. If so, abandon the task. If not, add the task to the first empty position in the queue.

[0030] (3) Divide the loop period into n time slices that are equal to the length of the task queue. Read a position in the task queue in each time slice. If no task is added to this position, no action is performed in this time slice until the next time slice arrives. If a task is added to this position, the task execution function of this task is executed. After the function is executed, wait for the next time slice to arrive.

[0031] (4) Execute the extraction task.

[0032] When the task execution starts, determine whether the accumulated running time of the extracted tasks exceeds the preset time limit: if it exceeds, call the task timeout processing function; if it does not exceed, run the task execution function.

[0033] When the task execution function is finished, it is determined whether the task has been completed: if it has been completed, the task completion flag is set, and the task completion callback function is called to remove the task from the task queue, and the corresponding position of the task queue becomes vacant; if it has not been completed, the task is kept in the task queue and waits for the arrival of the same time slice in the next cycle.

[0034] Example:

[0035] The present invention is described in detail below through specific examples.

[0036] (1) Connect the 1553B communication interface between the test equipment and the inertial platform system.

[0037] (2) The inertial platform system is powered on, and the test equipment transmits the task command to the inertial platform system through the communication interface. The task instructions are issued in sequence: inertial data acquisition, stable loop control, and frame locking.

[0038] (3) The inertial platform system receives the tasks issued and puts them into the task queue, setting the length of the task queue to 10. The tasks of the inertial platform system are represented by structures, which are specifically defined as follows:

[0039]

[0040]

[0041] Among them, the variable type E_IS_OK_t is defined as

[0042] typedef enum{_e_ok_=0,

[0043] _e_not_ok_=1

[0044] }E_IS_OK_t;

[0045] The program pre-sets each member of different tasks. Take the framework lock task as an example, define the framework lock task variable:

[0046] fp_sched_t frame_lock_sched;

[0047] Set each member in the task:

[0048] frame_lock_sched.task_id = 0x1A; / / Task ID

[0049] frame_lock_sched.fp_init = frame_lock_init; / / Frame lock task initialization

[0050] frame_lock_sched.fp = frame_lock_execute; / / frame lock task execution

[0051] frame_lock_sched.fp_stop = frame_lock_stop; / / Frame lock task completion callback

[0052] frame_lock_sched.is_ok = _e_not_ok_; / / Frame lock task is not completed

[0053] frame_lock_sched.time_out = 600000; / / The frame lock task time limit is 10 minutes, in ms

[0054] frame_lock_sched.count = 0; / / The number of frame lock task executions is 0

[0055] rame_lock_sched.fp_time_out = frame_lock_time_out; / / Frame lock task exceeds

[0056] Time Processing

[0057] Among them, frame_lock_init, frame_lock_execute, frame_lock_stop, and frame_lock_time_out are pre-set frame lock task function functions.

[0058] When adding a task to a task queue, the task ID task_id is used to determine whether there is a task of the same type in the queue. If so, the task is abandoned. If not, the task is added to the first empty position in the queue.

[0059] After adding the task, the task initialization is completed by calling the task initialization function pointed to by the function pointer fp_init.

[0060] (3) The inertial platform system divides the 20ms cycle into 10 time slices, each of which is 2ms. In each time slice, the corresponding task queue position is read: if no task is added to this position, no action is performed in this time slice until the next time slice arrives; if a task is added to this position, the task execution function of this task is executed, and after the function is executed, the next time slice arrives.

[0061] (4) Execute the extraction task.

[0062] At the beginning of task execution, determine whether the accumulated running time (count*20ms) of the extracted tasks exceeds the preset time limit time_out: if exceeded, call the task timeout processing function pointed to by the function pointer fp_time_out; if not exceeded, run the task execution function pointed to by the function pointer fp.

[0063] When the task execution function is finished, it is determined whether the task is completed: if the execution is completed, the task completion flag is_ok is set to _e_ok_, and the task completion callback function pointed to by the function pointer fp_stop is called to remove the task from the queue; if the execution is not completed, the task is kept in the queue and waits for the arrival of the same time slice in the next cycle.

[0064] The above is a detailed introduction to the task scheduling method of an inertial platform system based on a rotation mechanism provided by the present invention. For those skilled in the art, there may be changes in the specific implementation process and application scope of the present invention. In summary, the content of this specification should not be understood as limiting the present invention.

Claims

1. A task scheduling method for an inertial platform system based on a rotation mechanism, characterized in that The steps include: The task instructions to be executed are transmitted to the inertial platform system through the communication interface; The inertial platform system receives the issued task and adds it to the task queue, where the length of the task queue is n; Divide the cycle into n time slices that are equal to the length of the task queue. Read a position in the task queue in each time slice. If no task is added to this position, no action will be performed in this time slice until the next time slice arrives. If a task is added to this position, the task execution function of this task will be executed. After the function is executed, wait for the next time slice to arrive. The task types of the tasks sent down include frame locking, inertial data acquisition and stable loop control; When adding a task to a task queue, make sure that there is no task of the same type in the queue. If so, abandon the task. If not, add the task to the first empty position in the queue. When the extracted task starts to be executed, it is determined whether the accumulated running time of the extracted task exceeds the preset time limit: if it exceeds, the task timeout processing function is called; If not, run the task execution function; When the task execution function is finished, it is determined whether the task has been completed: if it has been completed, the task completion flag is set, and the task completion callback function is called to remove the task from the task queue, and the corresponding position of the task queue becomes vacant; if it has not been completed, the task is kept in the task queue and waits for the arrival of the same time slice in the next cycle.

2. The task scheduling method of an inertial platform system based on a round-robin mechanism according to claim 1, characterized in that: The communication interface adopts any one of RS232 serial port, RS422 serial port, RS485 serial port, 1553B communication interface, parallel bus interface, CAN interface and Ethernet interface.

3. The task scheduling method of an inertial platform system based on a round-robin mechanism according to claim 2, characterized in that: The frame locking refers to locking the three-axis angle of the inertial platform system at a preset angle according to the three-axis angle output by the frame angle sensor; the three axes of the inertial platform system include an outer ring axis, an inner ring axis and a platform body axis.

4. The task scheduling method of an inertial platform system based on a round-robin mechanism according to claim 3, characterized in that: The inertial data acquisition refers to the acquisition of inertial data generated by various components in the system; the components include gyroscopes, accelerometers and frame angles.

5. The task scheduling method of an inertial platform system based on a round-robin mechanism according to claim 3, characterized in that: The stabilization loop control refers to stabilizing the outer ring axis, inner ring axis and platform body axis of the inertial platform system in the inertial space according to the collected gyro data.

6. The task scheduling method of an inertial platform system based on a round-robin mechanism according to claim 1, characterized in that: The characteristic description of the task of the inertial platform system includes task ID, task initialization function, task execution function, task completion callback function, task completion flag, total task execution time, task execution times and task timeout processing function.

Citation Information

Patent Citations

  • Method and device for carrying out task scheduling in storage system

    CN106569891A

  • Task processing method and device in multi-task queue

    CN108228240A

  • Method and system for simulating a multi-queue scheduler using a single queue on a processor

    US20090113432A1