Scheduling method and device for spacecraft on-orbit control program
Through the division of the two-level scheduling method and the minimum scheduling unit, the concurrent operation of the space aircraft in orbit control program is realized, and the problem of on-orbit task operation in the existing technology is solved, and the concurrent operation of on-orbit control program is improved. Capability and efficiency.
Patent Information
- Application Number
- CN202411603053.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-11
- Publication Date
- 2025-02-18
AI Technical Summary
In the prior art, in-orbit mission operation of space vehicles relies on a large number of manual operations and the guarantee of continuous measurement and control arc segments, making it difficult to achieve autonomous control in-orbit.
Using a two-level scheduling method, the scheduling cycle points are determined through the control cycle of the satellite-based software and the scheduling cycle of the on-orbit control program, multiple on-orbit control programs that are run concurrently, and divided into multiple minimum scheduling units to realize The rotation and concurrent operation of the on-orbit control program.
Improve the concurrent operation capability of on-track control programs, so that each on-track control program is scheduled every other scheduling cycle, which is simple, fast and efficient, avoids the synchronous mutual exclusion mechanism between multiple tasks, and realizes embedded Lightweight multi-task concurrency capability in environments.
Smart Images

Figure CN119473548A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of on-orbit operation of spacecraft, and in particular to a method and device for scheduling an on-orbit control program of a spacecraft. Background Art
[0002] In related technologies, the on-orbit mission operation of spacecraft mainly relies on manual work on the ground, with status monitoring through downlink telemetry data and control through uplink remote control commands, which requires a lot of manual operation and the guarantee of continuous measurement and control arcs. How to achieve autonomous control on orbit has become a technical problem that needs to be solved urgently. Summary of the invention
[0003] The present invention provides a method and device for scheduling a spacecraft on-orbit control program. The technical solution is as follows:
[0004] In one aspect, a method for scheduling an on-orbit control program of a spacecraft is provided, the method comprising:
[0005] Determine the number of scheduling cycle points based on the control cycle of the onboard software and the scheduling cycle of the on-orbit control program, and establish a corresponding relationship between the control cycle counter and the scheduling cycle points;
[0006] Allocate corresponding scheduling cycle points for multiple on-orbit control programs that need to run concurrently;
[0007] In each control cycle, a schedulable on-orbit control program corresponding to a scheduling cycle point having a corresponding relationship with a current control cycle counter is determined, and a minimum schedulable unit currently required to be scheduled of the schedulable on-orbit control program is scheduled; each on-orbit control program is divided into a plurality of minimum schedulable units.
[0008] In another aspect, a device for scheduling an on-orbit control program of a spacecraft is provided, the device comprising:
[0009] A relationship establishing unit, used to determine the number of scheduling cycle points based on the control cycle of the onboard software and the scheduling cycle of the on-orbit control program, and to establish a corresponding relationship between the control cycle counter and the scheduling cycle points;
[0010] An allocation unit, used for allocating corresponding scheduling cycle points to multiple on-orbit control programs that need to run concurrently;
[0011] The scheduling unit is used to determine, in each control cycle, a schedulable on-orbit control program corresponding to a scheduling cycle point having a corresponding relationship with a current control cycle counter, and schedule the minimum schedulable unit currently required to be scheduled for the schedulable on-orbit control program; each on-orbit control program is divided into a plurality of minimum schedulable units.
[0012] On the other hand, a computer device is provided, which includes a memory and a processor, the memory is used to store computer programs, and the processor is used to execute the computer programs stored in the memory to implement the steps of the above-mentioned scheduling method of the spacecraft in-orbit control program.
[0013] On the other hand, a computer-readable storage medium is provided, wherein a computer program is stored in the storage medium, and when the computer program is executed by a processor, the steps of the scheduling method of the above-mentioned spacecraft on-orbit control program are implemented.
[0014] On the other hand, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the steps of the above-mentioned method for scheduling an on-orbit control program of a spacecraft.
[0015] The technical solution provided by the present invention can at least bring the following beneficial effects:
[0016] By allocating a scheduling cycle point to multiple on-orbit control programs that need to run concurrently, the on-orbit control programs within a scheduling cycle point are scheduled in each control cycle. By dividing the on-orbit control program into multiple minimum schedulable units, each on-orbit control program is scheduled once every scheduling cycle. Through this two-level scheduling, the on-orbit control program can be operated concurrently based on the minimum schedulable unit in a round-robin manner, which can improve the concurrent operation capability of the on-orbit control program. In addition, only one minimum schedulable unit is executed each time, so that the execution process for on-orbit task operations runs "step by step" according to one unit at a time, which is more in line with the manual operation process. This solution, based on the two-level scheduling method, is not only simple, fast and efficient in scheduling, but also can avoid the need for synchronization and mutual exclusion mechanisms between multiple tasks, realize lightweight multi-task concurrency in an embedded environment, and has good versatility. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0018] Figure 1 It is a flow chart of a method for scheduling an on-orbit control program of a spacecraft provided by an embodiment of the present invention;
[0019] Figure 2 It is a schematic diagram of an implementation architecture of an on-orbit autonomous operation provided by an embodiment of the present invention;
[0020] Figure 3 It is a schematic diagram of two-level scheduling provided by an embodiment of the present invention;
[0021] Figure 4 It is a schematic diagram of the conversion process of the running state and the coroutine state of the on-orbit control program provided by an embodiment of the present invention;
[0022] Figure 5 It is a structural diagram of a scheduling device for an on-orbit control program of a spacecraft provided by an embodiment of the present invention;
[0023] Figure 6 It is a hardware architecture diagram of a computer device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0024] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0025] In order to achieve on-orbit autonomous control, an on-orbit control program is formed for the status monitoring based on downlink telemetry data and the control based on uplink remote control commands performed by ground personnel, and the on-orbit control program is stored in the on-board memory. By adding an engine to the on-board software, the engine creates a coroutine in the virtual machine to run the on-orbit control program, thereby achieving on-orbit autonomous control. However, in order to improve the efficiency of on-orbit operations, it is generally required to be able to execute multiple on-orbit control programs in parallel, and in embedded operating systems, there is generally no multi-thread pool support for scripting languages. In addition, the overhead of multi-thread creation, switching, stopping, and thread synchronization primitives (such as mutex locks, semaphores, etc.) is also unacceptable for the lightweight application requirements of embedded applications, and cannot meet the resource constraints of embedded on-board computers for high scripting language execution efficiency and small memory usage.
[0026] The inventive concept of the present invention is to adopt a lightweight cooperative multi-threaded scheduling method working in user mode to avoid synchronization and mutual exclusion between multiple threads, which is a feasible method to achieve concurrent execution of on-orbit control programs. Compared with threads, coroutines are fast and efficient, meeting the needs of lightweight embedded application scenarios on board, but there is no mature and universal scheduling algorithm for concurrent scheduling of multiple coroutines, which requires developers to design their own algorithms based on their own business characteristics. The on-orbit control program is oriented to on-orbit task operations, and the business characteristic is that it requires the ability to run "step by step" according to the operating steps. Based on this business characteristic, the on-orbit control program is scheduled in the form of the smallest schedulable unit.
[0027] The specific implementation of the above concept is described below.
[0028] Please refer to Figure 1 , an embodiment of the present invention provides a method for scheduling an on-orbit control program of a spacecraft, the method comprising:
[0029] Step 100, determining the number of scheduling cycle points based on the control cycle of the onboard software and the scheduling cycle of the on-orbit control program, and establishing a corresponding relationship between the control cycle counter and the scheduling cycle points;
[0030] Step 102, determining a plurality of on-orbit control programs that need to be run concurrently, and assigning a scheduling cycle point to each on-orbit control program; each on-orbit control program is divided into a plurality of minimum schedulable units;
[0031] Step 104: in each control cycle, determine the schedulable on-orbit control program corresponding to the scheduling cycle point having a corresponding relationship with the current control cycle counter, and schedule the minimum schedulable unit currently required to be scheduled of the schedulable on-orbit control program.
[0032] In the embodiment of the present invention, a scheduling cycle point is allocated to multiple on-orbit control programs that need to run concurrently, so that the on-orbit control programs in a scheduling cycle point are scheduled in each control cycle, and the on-orbit control programs are divided into multiple minimum schedulable units, so that each on-orbit control program is scheduled once every scheduling cycle. Through this two-level scheduling, the on-orbit control programs can be operated concurrently based on the minimum schedulable units, which can improve the concurrent operation capability of the on-orbit control programs; in addition, only one minimum schedulable unit is executed each time, so that the execution process for on-orbit task operations runs "step by step" according to one unit at a time, which is more in line with the manual operation process. This solution, based on the two-level scheduling method, is not only simple, fast and efficient in scheduling, but also can avoid the need for a synchronization and mutual exclusion mechanism between multiple tasks, and realizes lightweight multi-task concurrency in an embedded environment, with good versatility. .
[0033] Described below Figure 1 How the various steps are performed.
[0034] First, for step 100, the number of scheduling cycle points is determined based on the control cycle of the onboard software and the scheduling cycle of the on-orbit control program, and a corresponding relationship between the control cycle counter and the scheduling cycle points is established.
[0035] Please refer to Figure 2, which is a schematic diagram of the implementation architecture of on-orbit autonomous operation. An on-orbit control program is formed for the status monitoring based on downlink telemetry data and the control based on uplink remote control commands performed by ground personnel. There can be multiple on-orbit control programs, and multiple on-orbit control programs are stored in the on-board memory. By adding an engine to the on-board software, the original tasks in the on-board software run normally. When on-orbit autonomous operation is required, the engine creates a virtual machine, and creates a coroutine in the virtual machine to run the on-orbit control program, thereby realizing on-orbit autonomous control.
[0036] The onboard software has a control cycle of T milliseconds for the original task, assuming it is 160ms. In each control cycle, there is an execution of the corresponding task. Therefore, if the on-orbit control program needs to be executed, it is necessary to allocate a fixed time for the engine to run the on-orbit control program in the remaining time after executing the corresponding task in each control cycle. Assuming that the allocated engine task has a fixed time of t obcp , within the fixed duration of the engine task, the on-orbit control program in the virtual machine can be managed, input data can be provided for the execution of the on-orbit control program, and output data of the on-orbit control program can be obtained.
[0037] Considering the satellite-to-ground communication delay factor and the response speed of manual operation, the scheduling period P of the on-orbit control program is taken as an integer number of seconds, such as 1 second or 2 seconds, and the control period T is in the millisecond level. Therefore, there is a multiple relationship between the scheduling period of the on-orbit control program and the control period of the on-board software, and the multiple relationship is represented by N, that is, one scheduling period includes N control periods, and each control period has a scheduling period point, at which the on-orbit control program can be scheduled. Therefore, in this step 100, the number of scheduling period points is N.
[0038] The number of scheduling cycle points is determined as follows:
[0039]
[0040] Wherein, P is the scheduling period in seconds, T is the control period in milliseconds, and the N value can be obtained by rounding up the comparison value.
[0041] Then the values of the scheduling period points can be 0, 1, 2, ..., N-1. For example, if N=5, then the 5 scheduling period points are 0, 1, 2, 3, and 4 respectively.
[0042] Since each control cycle corresponds to a scheduling cycle point, the corresponding relationship between the control cycle counter and the scheduling cycle point can be established. When the control cycle counter is kN, kN+1, ..., kN+N-1, it corresponds to the 0th, 1st, 2nd, ..., N-1th scheduling cycle points respectively. K is a positive integer. Assuming N=5, then in the first scheduling cycle, k takes the value of 0, then the 0th, 1st, 2nd, 3rd, and 4th control cycles correspond to the 0th, 1st, 2nd, 3rd, and 4th scheduling cycle points one by one. In the second scheduling cycle, k takes the value of 1, then the 5th, 6th, 7th, 8th, and 9th control cycles correspond to the 0th, 1st, 2nd, 3rd, and 4th scheduling cycle points one by one, .... In other words, the value of k increases by 1 for each additional scheduling cycle.
[0043] In this way, a corresponding relationship between the control cycle counter and the scheduling cycle point can be established, which is convenient for subsequent scheduling.
[0044] Then, for step 102, multiple on-orbit control programs that need to be run concurrently are determined, and a scheduling cycle point is allocated to each on-orbit control program.
[0045] The on-orbit control program consists of two parts: the control function code and the underlying code. The underlying code is the code that provides services to support the operation of the control function code. Therefore, in the design of the scheduling method, it is necessary to distinguish between these two parts of the code. The underlying code needs to be scheduled to run in each control cycle, while the control function code needs to be scheduled to run once in N control cycles (one scheduling cycle). In order to achieve running time balance, it is necessary to distribute the multiple on-orbit control programs that need to run concurrently to N control cycles, which is achieved by allocating a scheduling cycle point to each on-orbit control program.
[0046] In one embodiment of the present invention, corresponding scheduling period points may be allocated to multiple on-orbit control programs that need to be run concurrently in the following manner:
[0047] Whenever a new on-orbit control program is activated, the scheduling period point with the least scheduling quantity is determined as the scheduling period point allocated to the new on-orbit control program.
[0048] For example, the scheduling cycle points are 0, 1, 2, 3, and 4. When the scheduling cycle points are initially allocated, the scheduling quantity of the on-orbit control program in each scheduling cycle point is 0. At this time, the first on-orbit control program is activated, and the scheduling cycle point 0 is allocated to the on-orbit control program (an arbitrary scheduling cycle point with the least scheduling quantity can be allocated, or the scheduling cycle point with the least scheduling quantity can be allocated according to the numbering sequence of the scheduling cycle points). When the second on-orbit control program is activated, the scheduling cycle point 1 is allocated to the on-orbit control program, and so on.
[0049] During the scheduling operation, if the on-orbit control program completes the operation, the on-orbit control program will be deleted from the corresponding scheduling cycle point. Therefore, the number of scheduling cycles will be unbalanced at N scheduling cycle points. In order to ensure that the fixed duration of the engine task at the scheduling cycle point is not wasted, it is necessary to evenly allocate the scheduling cycle points. In one embodiment of the present invention, the allocation of corresponding scheduling cycle points to the multiple on-orbit control programs that need to run concurrently may further include:
[0050] A1: When there is an on-orbit control program that has completed running at a scheduling period point, the scheduling quantity of the scheduling period point is reduced by 1;
[0051] A2: Determine the scheduling cycle point with the current maximum scheduling number and the scheduling cycle point with the minimum scheduling number, and calculate the difference between the maximum scheduling number and the minimum scheduling number to determine whether the difference is not less than 2. If so, move an on-orbit control program in the scheduling cycle point with the maximum scheduling number to the scheduling cycle point with the minimum scheduling number, and continue to execute this step A2 until it is determined that the difference is less than 2.
[0052] When there is an on-orbit control program that has completed its operation during the scheduling cycle, the number of on-orbit control programs at the scheduling cycle point is reallocated, and no other adjustments are made, thereby ensuring the scheduling balance at each scheduling cycle point, so that the difference in the scheduling quantity at any two scheduling cycle points is not greater than 1.
[0053] Finally, for step 104, in each control cycle, the schedulable on-orbit control program corresponding to the scheduling cycle point having a corresponding relationship with the current control cycle counter is determined, and the minimum schedulable unit currently required to be scheduled of the schedulable on-orbit control program is scheduled.
[0054] Please refer to Figure 3 , is a two-level scheduling diagram. In each control cycle, there is an engine task with a fixed duration t obcp , within the fixed duration of the engine task, the schedulable on-orbit control program corresponding to the scheduling cycle point having a corresponding relationship with the current control cycle calculator is scheduled. Figure 3 In the example, scheduling cycle point 0 corresponds to three on-orbit control programs, scheduling cycle point 1 corresponds to three on-orbit control programs, and scheduling cycle point N-1 corresponds to two on-orbit control programs. Figure 3 The shaded box in the on-orbit control program is the minimum dispatchable unit of the dispatched point at the dispatch cycle point.
[0055] In an embodiment of the present invention, the on-orbit control program is run using the corresponding coroutine after being scheduled. The on-orbit control program corresponds to the coroutine one-to-one. Multiple on-orbit control programs are loaded one-to-one by creating multiple coroutines in the virtual machine. Multiple coroutines are managed through a coroutine linked list.
[0056] Among them, the running status of the on-orbit control program is different, and the coroutine status is also different.
[0057] The operating states of the on-orbit control program include storage state, ready state and running state, which are artificially defined states according to ground control operations. The operating states are defined as follows:
[0058] The state when the on-orbit control program is stored in the on-board memory but has not yet been loaded into the virtual machine is defined as the storage state; the state when the on-orbit control program is loaded from the on-board memory into the virtual machine but has not yet started running is defined as the ready state; the state when the on-orbit control program is activated and starts to be dynamically interpreted in the virtual machine is defined as the running state. The on-orbit control program can only be scheduled when it is in the running state.
[0059] The states of a coroutine include suspended state, running state, and dead state; the scripting language is designed for the operation of coroutines. After a coroutine is created, it is in suspended state. After it is resumed, it starts to run and enters running state. When in running state, the coroutine can suspend itself by yielding, thus converting to suspended state. After the coroutine runs, it enters dead state. Among them, when the coroutine is in suspended state, it is ready to run.
[0060] Please refer to Figure 4 , is a schematic diagram of the conversion process between the running state and the coroutine state of the on-orbit control program. The conversion process includes:
[0061] B1: In response to the program loading control command initiated by the ground control end, a coroutine is created in the virtual machine. After the coroutine is created, it is in a suspended state. The on-orbit control program is loaded into the virtual machine using the coroutine. At this time, the on-orbit control program is converted from a storage state to a ready state;
[0062] B2: In response to the program activation control command initiated by the ground control end, the on-orbit control program is activated, and the running state of the on-orbit control program is converted from the ready state to the running state. At this time, the coroutine state is still in the suspended state, and the conditions for scheduling and running are met;
[0063] B3: Select an on-orbit control program that is schedulable and runnable as a schedulable on-orbit control program, schedule it according to the corresponding scheduling cycle point, and convert the coroutine state to the running state; each time it is scheduled, the coroutine executes a minimum schedulable unit, and then actively converts the coroutine to the suspended state by yielding (YIELD);
[0064] B4: Repeat step B3 until the on-orbit control program is completed and the corresponding coroutine is converted to the dead state.
[0065] Therefore, the schedulable on-orbit control program is that the on-orbit control program is in a running state and the state of the corresponding coroutine is in a suspended state.
[0066] It can be understood that an on-track control program requires at least one scheduling cycle to run to completion, and only a part of the on-track control program is scheduled in each scheduling cycle. In order to realize the step-by-step operation of the on-track control program, the code block between two yield statements in the on-track control program can be defined as a minimum schedulable unit. That is to say, each on-track control program needs to be divided into multiple minimum schedulable units in advance, so that only one minimum schedulable unit is scheduled when the on-track control program is scheduled in each scheduling cycle.
[0067] In the embodiment of the present invention, the operation process of the minimum schedulable unit is: after the operation of the coroutine is started by resume (RESUME), the coroutine obtains the return value from the first yield (YIELD) statement of the minimum schedulable unit, and then keeps running until it runs to the second yield (YIELD) statement and suspends its own coroutine; if it is the first time to start the coroutine by resume (RESUME), it starts running from the first statement of the coroutine main function until the coroutine is suspended at the first yield (YIELD) statement; if it starts running by obtaining the return value from the last yield (YIELD) statement, the current coroutine ends after all codes are run.
[0068] In the embodiment of the present invention, the minimum schedulable unit is a code block executed each time the scheduling is performed. The principle for determining the minimum schedulable unit is the relevance of the code implementation functions, and the closely related code blocks are cut into a minimum schedulable unit. Splitting into minimum schedulable units can achieve that each time the on-orbit control program is scheduled, only one minimum schedulable unit can be run, and the running process of the on-orbit control program is run "step by step" according to one unit at a time. The splitting method of dividing the on-orbit control program into multiple minimum schedulable units may include at least one of the following:
[0069] The first method is to determine the minimum schedulable unit based on the maximum running time of the on-orbit control program at each scheduling cycle point.
[0070] Specifically, based on the fixed duration of the engine task, the number of scheduling cycle points and the number of multiple on-orbit control programs that need to run concurrently, the maximum running duration of the on-orbit control program at each scheduling cycle point can be calculated, and the on-orbit control program can be divided according to the maximum running time, so that the running duration of the smallest schedulable unit after the division is not greater than the maximum running duration.
[0071] In one implementation, the maximum running time t of the on-orbit control program at each scheduling cycle point is s Calculated by the following formula:
[0072]
[0073] Where M is the number of multiple on-orbit control programs that need to run concurrently, N is the number of scheduling cycle points, and t obcp is the fixed duration of the engine task, ceil is rounded up, t reserved The runtime of the underlying code.
[0074] The second method is to use a code block that generates an output control command as a minimum schedulable unit.
[0075] The output control command of the on-orbit control program is a remote control command generated by the on-orbit control program on-orbit and forwarded to the onboard software. The characteristics of the output control command are non-periodic, multi-batch, and non-similar control command output. Therefore, the code block that generates an output control command once can be used as a minimum schedulable unit. It should be noted that when the minimum schedulable unit is divided in this way, the running time must not exceed t s requirements.
[0076] The third method is to generate a code block with complete functions as a minimum schedulable unit.
[0077] Considering that in some cases, the code block that generates an output control command contains very complex algorithms, has a large amount of calculation, and the running time is much longer than t s In order to ensure that the engine task does not time out, in general, the running time of the minimum schedulable unit of each on-orbit control program is required to be less than t s In this case, the code block needs to be further split to take the code block that can realize complete functions as the minimum schedulable unit.
[0078] Furthermore, if the running time of the minimum schedulable unit cannot meet the maximum running time, the number of on-orbit control programs running at each scheduling cycle point is adjusted. For example, the algorithm cohesion and complexity are both high, and it is difficult to effectively split, resulting in the minimum schedulable unit after splitting using the above three splitting methods cannot meet the maximum running time t s When the requirement is met, the maximum running time t of each on-orbit control program at the scheduling cycle point is increased by reducing the number of on-orbit control programs running concurrently. s .
[0079] Specifically:
[0080] When M≤N,
[0081] t smax =t obcp -t reserved
[0082] Among them, t smax It is the maximum total running time of all on-orbit control programs at the scheduling cycle point.
[0083] For example, the fixed duration of the engine task is t obcp = 10 milliseconds, the scheduling period of the on-orbit control program is 1 second, and the control period of the onboard software is 160 milliseconds, then N = 7, the number of multiple on-orbit control programs running concurrently M ≤ 7, t reserved =3 milliseconds, then:
[0084] t smax =10-3=7 milliseconds
[0085] Obviously, controlling the number of multiple on-orbit control programs running concurrently can greatly increase the runtime allowed by the minimum schedulable unit.
[0086] Please refer to Figure 5 The embodiment of the present invention provides a scheduling device for an on-orbit control program of a spacecraft, the device comprising:
[0087] A relationship establishing unit 500 is used to determine the number of scheduling cycle points based on the control cycle of the onboard software and the scheduling cycle of the on-orbit control program, and to establish a corresponding relationship between the control cycle counter and the scheduling cycle points;
[0088] An allocating unit 502 is used to allocate corresponding scheduling cycle points to multiple on-orbit control programs that need to run concurrently;
[0089] The scheduling unit 504 is used to determine, in each control cycle, the schedulable on-orbit control program corresponding to the scheduling cycle point having a corresponding relationship with the current control cycle counter, and schedule the minimum schedulable unit currently required to be scheduled for the schedulable on-orbit control program; each on-orbit control program is divided into multiple minimum schedulable units.
[0090] In one embodiment of the present invention, the allocation unit is specifically configured to: whenever a new on-orbit control program is activated, determine the scheduling period point with the least scheduling quantity as the scheduling period point allocated to the new on-orbit control program.
[0091] In one embodiment of the present invention, the allocation unit is further used to:
[0092] When there is an on-orbit control program that has completed running at a scheduling period point, the scheduling quantity of the scheduling period point is reduced by 1;
[0093] Determine the scheduling cycle point with the current maximum scheduling number and the scheduling cycle point with the minimum scheduling number, and calculate the difference between the maximum scheduling number and the minimum scheduling number to determine whether the difference is not less than 2. If so, move an on-orbit control program in the scheduling cycle point with the maximum scheduling number to the scheduling cycle point with the minimum scheduling number, and continue to execute this step until it is determined that the difference is less than 2.
[0094] In one embodiment of the present invention, the running state of the on-track control program includes a storage state, a ready state and a running state, and after the on-track control program is scheduled, it is run using a corresponding coroutine, and the coroutine state includes a suspended state, a running state and a dead state; the on-track control program can only be scheduled when the running state is the running state, and the coroutine state is in the suspended state and has the runnable condition;
[0095] The schedulable on-orbit control program is an on-orbit control program that is in a running state and a corresponding coroutine is in a suspended state.
[0096] In one embodiment of the present invention, the device further includes: a segmentation unit, which is used to segment each on-orbit control program into a plurality of minimum schedulable units in advance; the segmentation method includes at least one of the following:
[0097] The minimum schedulable unit is determined by the maximum running time of the on-orbit control program that can be run at each scheduling cycle point;
[0098] A code block that generates an output control command once is regarded as a minimum schedulable unit;
[0099] Generate a code block with complete functions as a minimum schedulable unit;
[0100] In one embodiment of the present invention, if the running time of the minimum schedulable unit cannot meet the maximum running time, the number of on-orbit control programs running at each scheduling period point is adjusted.
[0101] It should be noted that the scheduling device for the on-orbit control program of a spacecraft provided in the above embodiment is only illustrated by the division of the above functional modules. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the scheduling device for the on-orbit control program of a spacecraft provided in the above embodiment and the scheduling method embodiment of the on-orbit control program of a spacecraft belong to the same concept. The specific implementation process is detailed in the method embodiment and will not be repeated here.
[0102] The embodiment of the present application also provides a computer device, please refer to Figure 3The computer device includes a processor and a memory, in which at least one instruction, at least one program, a code set or an instruction set is stored, and the at least one instruction, at least one program, a code set or an instruction set is loaded and executed by the processor to implement the scheduling method of the spacecraft on-orbit control program provided by the above-mentioned method embodiments.
[0103] An embodiment of the present application also provides a computer-readable storage medium, on which is stored at least one instruction, at least one program, code set or instruction set, and the at least one instruction, at least one program, code set or instruction set is loaded and executed by a processor to implement the scheduling method of the space vehicle on-orbit control program provided by the above-mentioned method embodiments.
[0104] An embodiment of the present application also provides a computer program product, which includes a computer program. A processor of a computer device reads the computer program from a computer-readable storage medium, and the processor executes the computer program, so that the computer device executes the scheduling method of the space vehicle in-orbit control program described in any of the above embodiments.
[0105] For the convenience of description, the above system or device is described by dividing it into various modules or units according to its functions. Of course, when implementing the present application, the functions of each unit can be implemented in the same or multiple software and / or hardware.
[0106] It can be known from the description of the above implementation methods that those skilled in the art can clearly understand that the present application can be implemented by means of software plus a necessary general hardware platform. Based on such an understanding, the technical solution of the present application can be essentially or partly contributed to the prior art in the form of a software product, which can be stored in a storage medium such as ROM / RAM, a magnetic disk, an optical disk, etc., and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in the various embodiments of the present application or certain parts of the embodiments.
[0107] Finally, it should be noted that, in this article, relational terms such as first, second, third and fourth are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0108] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A method for scheduling an on-orbit control program of a spacecraft, characterized in that: The method comprises: Determine the number of scheduling cycle points based on the control cycle of the onboard software and the scheduling cycle of the on-orbit control program, and establish a corresponding relationship between the control cycle counter and the scheduling cycle points; Allocate corresponding scheduling cycle points for multiple on-orbit control programs that need to run concurrently; In each control cycle, a schedulable on-orbit control program corresponding to a scheduling cycle point having a corresponding relationship with a current control cycle counter is determined, and a minimum schedulable unit currently required to be scheduled of the schedulable on-orbit control program is scheduled; each on-orbit control program is divided into a plurality of minimum schedulable units.
2. The method according to claim 1, characterized in that The step of allocating corresponding scheduling cycle points to the multiple on-orbit control programs that need to run concurrently includes: Whenever a new on-orbit control program is activated, the scheduling period point with the least scheduling quantity is determined as the scheduling period point allocated to the new on-orbit control program.
3. The method according to claim 2, characterized in that The step of allocating corresponding scheduling period points to the multiple on-orbit control programs that need to be run concurrently further includes: When there is an on-orbit control program that has completed running at a scheduling period point, the scheduling quantity of the scheduling period point is reduced by 1; Determine the scheduling cycle point with the current maximum scheduling number and the scheduling cycle point with the minimum scheduling number, and calculate the difference between the maximum scheduling number and the minimum scheduling number to determine whether the difference is not less than 2. If so, move an on-orbit control program in the scheduling cycle point with the maximum scheduling number to the scheduling cycle point with the minimum scheduling number, and continue to execute this step until it is determined that the difference is less than 2.
4. The method according to claim 1, characterized in that The running state of the on-orbit control program includes storage state, ready state and running state, and after the on-orbit control program is scheduled, it is run using the corresponding coroutine. The coroutine state includes suspended state, running state and dead state. When the running state of the on-orbit control program is running state, it can be scheduled, and when the coroutine state is suspended state, it is ready to run. The schedulable on-orbit control program is an on-orbit control program that is in a running state and a corresponding coroutine is in a suspended state.
5. The method according to claim 1, characterized in that Also includes: Each on-orbit control program is pre-divided into a plurality of minimum schedulable units; the division method includes at least one of the following: The minimum schedulable unit is determined by the maximum running time of the on-orbit control program that can be run at each scheduling cycle point; A code block that generates an output control command once is regarded as a minimum schedulable unit; Generate a code block with complete functions as a minimum schedulable unit.
6. The method according to claim 5, characterized in that If the running time of the minimum schedulable unit cannot meet the maximum running time, the number of on-orbit control programs running at each scheduling period point is adjusted.
7. A scheduling device for an on-orbit control program of a spacecraft, characterized in that: The device comprises: A relationship establishing unit, used to determine the number of scheduling cycle points based on the control cycle of the onboard software and the scheduling cycle of the on-orbit control program, and to establish a corresponding relationship between the control cycle counter and the scheduling cycle points; An allocation unit, used for allocating corresponding scheduling cycle points to multiple on-orbit control programs that need to run concurrently; The scheduling unit is used to determine, in each control cycle, a schedulable on-orbit control program corresponding to a scheduling cycle point having a corresponding relationship with a current control cycle counter, and schedule the minimum schedulable unit currently required to be scheduled for the schedulable on-orbit control program; each on-orbit control program is divided into a plurality of minimum schedulable units.
8. A computer device, characterized in that: The computer device includes a memory and a processor, the memory is used to store a computer program, and the processor is used to execute the computer program stored in the memory to implement the steps of any one of the methods described in claims 1-6.
9. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method described in any one of claims 1 to 6 are implemented.
10. A computer program product, characterized in that The method comprises a computer program, wherein when the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.