Atomic task scheduling method and system based on power prediction
By using a bicyclic power prediction model and task sorting algorithm in embedded systems, ensuring that atomic tasks are performed within the power stable period, solving the task interruption problem caused by energy acquisition instability and improving system performance and energy efficiency.
Patent Information
- Application Number
- CN202411025814.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-30
- Publication Date
- 2024-11-15
AI Technical Summary
When an embedded system performs real-time atomic tasks, the instability of energy acquisition leads to task interruption and energy efficiency, which affects system performance and energy efficiency.
Using a two-period power prediction model based on a lightweight fully connected neural network, predicts the power situation of the next two sampling cycles, and sorts and schedules the tasks according to the task's deadline and key levels, so that the atomic task is complete within the power stability period. implement.
It effectively reduces the number of interrupted execution of atomic tasks and failures of non-atomic tasks, improves the performance and energy efficiency of the embedded system for energy acquisition, and improves the task completion rate and energy utilization rate.
Smart Images

Figure CN118963944A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of embedded system job scheduling, and in particular to an atomic task scheduling method and system based on power prediction. Background Art
[0002] In recent years, the Internet of Things (IoT) technology has developed rapidly, which has had a profound impact on the national economy and people's livelihood. However, the batteries used in IoT embedded devices are large in size, limited in life, and have high replacement costs, which greatly restricts the development of IoT in many fields. Energy harvesting technology is expected to solve the above limitations by collecting energy (such as solar energy, wind energy, piezoelectric energy, radio frequency energy, etc.) from the surrounding environment and converting it into electrical energy to power the equipment. It has the advantages of green economy and easy maintenance, bringing huge opportunities for the development of IoT embedded devices such as field monitoring equipment, implantable medical devices, and wearable devices.
[0003] However, while embedded systems enjoy the benefits of energy harvesting technology, they also face new problems: the risk of reduced system performance and energy efficiency. Affected by weather, environmental conditions or other factors, the energy harvested from the environment is usually unstable, which is very likely to cause the system to stop running due to insufficient energy, making it impossible to complete real-time tasks before the deadline, thereby reducing system performance.
[0004] This effect is exacerbated when embedded systems need to execute large real-time atomic tasks. Since atomic tasks are indecomposable and need to be completed all at once, if an atomic task is interrupted during execution, the time and energy previously consumed by the task will be wasted. When the system is restored to power, the task needs to be re-executed or abandoned due to missed deadlines, which greatly reduces the system's energy efficiency. In addition, multiple attempts to re-execute interrupted atomic tasks may cause a large number of real-time non-atomic tasks that could have been completed on time to miss their deadlines, further reducing system performance and energy efficiency.
[0005] For example, in a wildlife monitoring scenario, the process of detecting anomalies and capturing images can be considered a real-time atomic task. A power outage during the execution of an atomic task will result in the loss of key image information. In low light conditions, the shooting process may last longer than ordinary tasks (hundreds of milliseconds or even longer), which means a higher risk of interruption. If the power is cut off when the shooting task is about to be completed, even if the atomic task can be re-executed when the power is on, it means that a lot of precious energy is wasted, and it may result in missing the capture of the target and the failure of other tasks. In summary, it is of great significance to design a scheduling algorithm for real-time atomic tasks in energy harvesting embedded systems. Summary of the invention
[0006] The purpose of the present invention is to provide an atomic task scheduling method and system based on power prediction, which can reduce the interruption of atomic tasks and the number of non-atomic task failures caused by them, thereby improving the performance and energy efficiency of energy harvesting embedded systems.
[0007] To achieve the above object, the present invention provides the following solutions:
[0008] A method for scheduling atomic tasks based on power prediction, comprising:
[0009] Obtaining historical power acquisition information and tasks of the embedded system; the historical power acquisition information includes the power of the first three sampling periods, the power average and variance of the first four sampling periods;
[0010] The power situation of the next two cycles is obtained by predicting based on the dual-cycle power prediction model and the historical power collection information; the dual-cycle power prediction model is constructed based on a lightweight fully connected neural network, and the prediction is performed by establishing a nonlinear relationship between input features and outputs;
[0011] Sorting the tasks according to their deadlines and criticality levels to obtain an optimized task sequence;
[0012] Based on the power conditions of the next two cycles, the optimized task sequence is scheduled so that the atomic tasks in the task sequence are completely executed within the power stabilization period.
[0013] Optionally, the dual-cycle power prediction model consists of an input layer, three hidden layers, and an output layer; wherein the input layer is used to obtain the historical power collection information, the three hidden layers are used to establish a nonlinear relationship between the input features and the predicted output, and the output layer is used to output the power conditions of the next two cycles.
[0014] Optionally, the tasks are sorted according to their deadlines and criticality levels, specifically including:
[0015] The tasks are first sorted according to the earliest deadline priority principle, and then the order of the tasks is adjusted according to the atomic task preemption mechanism to obtain an optimized task sequence.
[0016] Optionally, the tasks are first sorted according to the earliest deadline priority principle, and then the order of the tasks is adjusted according to the atomic task preemption mechanism, specifically including:
[0017] Assume that the critical level of atomic tasks is Li=HI, and the critical level of non-atomic tasks is Li=LO. For any atomic task in the sequence, if the previous (HI-LO) / LO tasks are all non-atomic tasks, then move forward (HI-LO) / LO positions; if there are other atomic tasks among the previous (HI-LO) / LO tasks, then move forward at most to after the first atomic task encountered; if the number of previous tasks is less than (HI-LO) / LO, then move forward using the same principle; if the result of (HI-LO) / LO is not an integer, round it down and move forward using the same principle.
[0018] Optionally, scheduling the optimized task sequence based on the power conditions of the next two cycles specifically includes:
[0019] If the power status of the next two cycles is expressed as "11", the task sequence is executed in the order of the optimized task sequence; if the power status of the next two cycles is expressed as "10", the atomic task is skipped and the non-atomic tasks are executed in the order of the sequence; if the power status of the next two cycles is expressed as "00" or "01", capacitors are used as the power source for system backup; among them, "1" indicates that the system is powered on, and "0" indicates that the system is powered off.
[0020] Optionally, when the predicted power situation in the next two cycles is expressed as "00" or "01", but is actually "10" or "11", the capacitor used for backup of the system will not be started. At this time, it is assumed that the system has power in the next two cycles, and the tasks are scheduled sequentially according to the situation of "11".
[0021] Optionally, before performing the next scheduling update on the task sequence, the method further includes: utilizing the remaining time to execute non-atomic tasks in the sequence that meet the deadline requirement, and skipping the encountered atomic tasks.
[0022] The present invention also provides an atomic task scheduling system based on power prediction, comprising:
[0023] An initial data acquisition unit, used to acquire historical power acquisition information and tasks of the embedded system; the historical power acquisition information includes the power of the first three sampling periods, the power average and variance of the first four sampling periods;
[0024] A dual-period power prediction unit, used to predict according to the dual-period power prediction model and the historical power collection information, and obtain the power situation of the next two periods; the dual-period power prediction model is constructed based on a lightweight fully connected neural network, and the prediction is performed by establishing a nonlinear relationship between input features and outputs;
[0025] A task sorting unit, used to sort the tasks according to their deadlines and critical levels to obtain an optimized task sequence;
[0026] The task scheduling unit is used to schedule the optimized task sequence based on the power conditions of the next two cycles, so that the atomic tasks in the task can be completely executed within the power stable period.
[0027] According to the specific embodiments provided by the present invention, the present invention discloses the following technical effects:
[0028] The present invention discloses a method and system for scheduling atomic tasks based on power prediction, the method comprising first predicting the power state of the next two sampling periods using a dual-cycle power prediction model, and optimizing the sequence according to the prediction results and the deadline and critical level corresponding to the task, so that the atomic tasks in the task are fully executed within the power stable period. The present invention predicts the power of the next two sampling periods, thereby reasonably scheduling tasks, reducing the interruption of atomic tasks and the number of non-atomic task failures caused by them, so as to improve the performance and energy efficiency of energy harvesting embedded systems. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] 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 will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0030] Figure 1 It is a flow chart of the atomic task scheduling method based on power prediction of the present invention;
[0031] Figure 2 is a diagram of a fully connected neural network architecture for dual-cycle power prediction in this embodiment;
[0032] Figure 3 1 is an example diagram of optimizing the sorting of task sequences in this embodiment; wherein, part (a) is a schematic diagram of the initial task sequence; part (b) is a schematic diagram of the sequence sorted according to the earliest deadline priority principle; part (c) is a schematic diagram of the task sequence after the atomic task preemption mechanism is executed;
[0033] Figure 4 Graph showing the collected power trajectory of the TV-RF signal in this embodiment. DETAILED DESCRIPTION
[0034] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0035] The purpose of the present invention is to provide an atomic task scheduling method and system based on power prediction, which can reduce the interruption of atomic tasks and the number of non-atomic task failures caused by them, thereby improving the performance and energy efficiency of energy harvesting embedded systems.
[0036] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0037] The present invention provides an atomic task scheduling algorithm, which mainly includes the following parts:
[0038] (1) Establish a power model and then build a dual-period power prediction model, where the input of the prediction model is the historical power collection information and the output is the power situation in the next two sampling periods;
[0039] (2) Establish a task model, and then sort the released tasks according to the deadline and criticality level of the tasks to obtain an optimized task sequence;
[0040] (3) Based on the future double-cycle power forecast, the optimized task sequence is scheduled.
[0041] When establishing the power model, the threshold power of the system is set to P thr , if the collected power P ≥ P thr , indicating that the system can operate normally, and "1" is used to represent this power supply state; conversely, the system is powered off, and "0" is used to represent this power supply state.
[0042] The power prediction model is a lightweight fully connected neural network, which consists of an input layer, three hidden layers, and an output layer. The inputs are the power of the first three sampling periods, the power average and variance of the first four sampling periods. The three hidden layers are used to establish a nonlinear relationship between the input features and the predicted output, and the output layer is used to output the power situation of the next two sampling periods.
[0043] Among them, in the task model, it is assumed that a set of tasks τ={τ1,τ2,...,τ i ,...,τ n}, task τ iDescribed by a quaternion (Ri, Ei, Di, Li), where Ri, Ei, Di and Li are all non-negative integers. Ri is the task τ i The release time point of the task, Ei is the execution time of the task, Di is its deadline, and Li is the critical level. When Li = HI, it means that the task is an atomic task, and when Li = LO, it means that the task is a non-atomic task.
[0044] When sorting tasks based on their deadlines and critical levels, we first sort the tasks based on the principle of shortest deadline first, and then implement the atomic task preemption mechanism. An atomic task can be moved forward by a maximum of (HI-LO) / LO positions. If it encounters other atomic tasks in the middle, it stops moving forward.
[0045] Among them, when scheduling tasks according to the prediction, if it is predicted that there will be power in the next two cycles, the tasks will be scheduled sequentially; if it is predicted that the system status in the next two cycles is "10", the atomic tasks will be skipped and the non-atomic tasks in the sequence will be executed in sequence. In order to reduce the losses caused by prediction errors, a remedial mechanism is implemented, which requires corresponding system hardware configuration, that is, using capacitors as the power source for system backup. The remedial mechanism is: when the power supply status in the next two cycles is predicted to be "00" or "01", but it is actually "10" or "11", the capacitor used for backup in the system will not be started. At this time, it is assumed that the system will have power in the next two cycles, that is, the tasks will be scheduled sequentially according to the situation of "11". In addition, since the tasks are released dynamically, after a period of execution, it should be checked whether there are new tasks released in combination with the execution status. If so, the task sequence is updated and the above prediction, sorting and scheduling process is repeated.
[0046] Based on the above algorithm, as a specific implementation method, Figure 1 As shown, including:
[0047] Step 100: Obtain historical power acquisition information and tasks of the embedded system; the historical power acquisition information includes the power of the first three sampling periods, the power average and variance of the first four sampling periods;
[0048] Step 200: Predicting based on the dual-cycle power prediction model and the historical power collection information to obtain the power situation of the next two cycles; the dual-cycle power prediction model is constructed based on a lightweight fully connected neural network, and the prediction is performed by establishing a nonlinear relationship between input features and outputs;
[0049] Step 300: Sort the tasks according to their deadlines and criticality levels to obtain an optimized task sequence;
[0050] Step 400: Based on the power conditions of the next two cycles, the optimized task sequence is scheduled so that the atomic tasks in the task sequence are completely executed within the power stable period.
[0051] In this embodiment, the power predictor structure built for the dual-period power prediction model is as follows: Figure 2 As shown in the figure, the dual-cycle power prediction model is a lightweight fully connected neural network consisting of an input layer, three hidden layers, and an output layer. The inputs are the power of the first three sampling cycles, the average power and the variance of the first four sampling cycles. The three hidden layers contain 30, 20, and 10 neurons, respectively. There are three outputs, namely "L", "M", and "H", where "L" means that the state of the system in the next two cycles is "00" or "01", "M" means that the state of the system in the next two cycles is "10", and "H" means that the state of the system in the next two cycles is "11".
[0052] This embodiment uses the TV-RF signal as an example of the energy source for collection. This is because, on the one hand, TV-RF can provide higher power. Figure 4 As shown, TV-RF can provide 0.3-25mW of acquisition power. If multiple devices are deployed for simultaneous acquisition, the power that can be provided may be higher. On the other hand, predicting the power of the TV-RF signal in the future double cycle can meet the needs of a large number of large-scale real-time atomic tasks. For example, for atomic tasks such as capturing images, under conditions of weak light or power constraints, the shooting process can last from hundreds of milliseconds to several seconds. However, most recording processes do not last as long as a few seconds, and a prediction span of 200 milliseconds can meet the needs of most of these atomic tasks. This is exactly equal to Figure 4 The time between two sampling cycles of the TV-RF signal.
[0053] It should be noted that the power predictor is lightweight. Compared with the energy collected in each cycle, the overhead required by the predictor is very small. The predictor needs to perform about 980 multiplication and addition operations (MAC) for each prediction, that is, (5×30+30×20+20×10+10×3). Assuming that each multiplication and addition operation takes 10.7pJ of energy, a prediction requires about 10.486pJ of energy. Although there is still a computational overhead for the input data, the energy required by the predictor is still less than 1% of the collected energy. In addition, although this process also involves other overheads, such as storage overhead, these efforts are worthwhile compared to the benefits brought by the predictor.
[0054] In the sorting adjustment, the process of sorting the released tasks according to the earliest deadline first principle is as follows:
[0055] This is inspired by the Earliest Deadline First (EDF) algorithm. The EDF algorithm is a real-time scheduling algorithm that determines the critical level of task execution based on the deadline of the task. The core idea of the algorithm is to give priority to those tasks with the earliest deadline for execution. If there are multiple tasks with the same earliest deadline, different scheduling strategies can be adopted, such as the First Come First Serve (FCFS) strategy. The performance advantage of the EDF algorithm is that it can minimize the risk of tasks missing deadlines and can effectively handle tasks with different deadlines and execution times. However, the EDF algorithm does not take into account the energy supply characteristics of atomic tasks and energy harvesting embedded systems. Therefore, the algorithm of this embodiment only uses the idea that the earlier the deadline, the more likely the real-time task is to miss its deadline, and puts the task with the earliest deadline in front to improve the completion rate of the real-time task. At the same time, in order to take into account the characteristics of atomic tasks that cannot be interrupted and have a higher critical level, the task sequence is fine-tuned.
[0056] In the sorting adjustment, the atomic task preemption mechanism is used to adjust the sorted task sequence as follows:
[0057] Taking into account that there is no necessary connection between the critical level of a task and its deadline, in the scenario to which the present invention is applied, the critical level of an atomic task is higher than that of a non-atomic task. There are two main reasons for this setting. On the one hand, atomic tasks cannot be divided any further and have higher requirements for energy supply. When energy supply conditions permit, it is a safer choice to give priority to executing atomic tasks. On the other hand, such tasks are often seen in scenarios where important information is captured. If the deadline is missed, it may result in greater losses. It should be noted that the specific critical level numbers of atomic tasks and non-atomic tasks should be set according to actual application requirements.
[0058] Atomic task preemption mechanism: Assume that the critical level of atomic tasks is Li=HI, and the critical level of non-atomic tasks is Li=LO. For a certain atomic task in the sequence, if the (HI-LO) / LO tasks preceding it are all non-atomic tasks, then the atomic task can be moved forward by (HI-LO) / LO positions in the sequence. In particular, if there are other atomic tasks in the (HI-LO) / LO tasks preceding the atomic task, then it can be moved forward at most to after the first atomic task encountered. In particular, if there are less than (HI-LO) / LO tasks preceding the atomic task, the same principle should be applied to move it forward as much as possible. Among them, if the result of (HI-LO) / LO is not an integer, it is rounded down. To explain more clearly Figure 1 The steps shown in this embodiment are given by way of examples to illustrate the process of optimizing the order of the task sequence in the present invention. Figure 3 As shown. Figure 3 In , there are 5 released tasks (τ1~τ5). According to the order of release time, the initial task sequence is obtained. The conditions of each task in the sequence are shown in Table 1. Then, considering that these tasks have real-time requirements, the initial task sequence is sorted according to the earliest deadline priority principle. Figure 3 As shown in (b), the deadline of τ3 is less than τ2, so τ3 is placed in front of τ2. Then, in step S300, the atomic task preemption mechanism is implemented on the task sequence, such as Figure 3 As shown in (c), the criticality of the atomic task is 3, and the criticality of the non-atomic task is 1. According to the atomic task preemption mechanism, each atomic task can be moved forward by a maximum of (3-1) / 1 positions. Under such a setting, even if the two preempted non-atomic tasks miss their deadlines, the system still gains more than it loses.
[0059] Table 1 Task conditions
[0060]
[0061]
[0062] Finally, the ordered tasks are scheduled according to the dual-period power prediction.
[0063] In this embodiment, the sampling period of TV-RF is assumed to be Ts, Ts=10T, and T is a basic unit time. Assume that the execution time Ei of the atomic task satisfies Ts<Ei≤2Ts, because the atomic tasks to which the present invention is applicable are usually more time-consuming. Assume that the execution time of the non-atomic task is less than Ts. For non-atomic tasks with longer execution times, they can be divided into smaller subtasks. Because the system may release new tasks in every power cycle, the minimum period for checking whether the task is updated is Ts. The scheduling idea of this algorithm is: by predicting future power conditions, atomic tasks can avoid power-off points as much as possible and be replaced by non-atomic tasks that can be interrupted.
[0064] In the actual operation environment, τ is the initial task sequence released, Ppre[k] is used to store the prediction of the last two cycles of the k-1th cycle, and flag is used to indicate the system scheduling status. Assume that the system schedules a set of tasks in W sampling cycle windows, and these tasks are released dynamically over time. The system has an independent timer for timing, which is reset to zero after exceeding W sampling cycle windows. Set the initial state of flag to 0, indicating that the system does not schedule the updated task sequence before sorting. Then perform the sorting and adjustment steps to fine-tune the tasks. Then, according to the double-cycle power prediction, the sorted tasks are scheduled.
[0065] If it is predicted that there will be electricity in the next two cycles and the task sequence is not empty, the first task in the task sequence that meets the deadline will be scheduled. Among them, tasks that do not meet the deadline will be removed from the sequence before scheduling. As mentioned earlier, tasks are released dynamically, and the minimum period for checking whether there are new tasks released is Ts. If an atomic task is executed, in order to avoid interruption of atomic task execution, the check period will be dynamically adjusted to 2Ts. When a task is scheduled, the remaining idle time Tr should be used as much as possible to execute non-atomic tasks in the sequence sequentially. Here, Tr refers to the time between the completion time of the current task and the next update checkpoint. In addition, the cycle number k and the flag symbol flag are updated based on the scheduling situation. If it is predicted that there will be electricity in the next two cycles, but the task sequence is empty, only k needs to be updated.
[0066] If the prediction result is "M", skip the atomic tasks in the sequence and remove the tasks that do not meet the deadline, and execute the non-atomic tasks in order. This can avoid unnecessary scheduling of atomic tasks and save precious energy. Similarly, after a round of scheduling is completed, check and update the task sequence.
[0067] In addition, although the prediction model can achieve a high accuracy in theory, it is still very challenging to actually achieve 100% accuracy in low power consumption scenarios. To this end, the present invention proposes a remedial mechanism. This remedial mechanism mainly deals with the situation where "11" or "10" is mistakenly predicted as "00" or "01". This requires setting the corresponding system hardware configuration according to the situation, and judging whether to use capacitors as the power supply source for system backup. The remedial mechanism is: when the power supply status in the next two cycles is predicted to be "00" or "01", but it is actually "10" or "11", the capacitor used for backup in the system will not be started. At this time, it is assumed that the system has electricity in the next two cycles, that is, the tasks are scheduled sequentially according to the situation of "11". Through the matching design of hardware and software, this remedial measure can effectively improve the utilization of energy.
[0068] Therefore, the present invention has the following beneficial effects:
[0069] (1) Effectively improve the performance of the system, thanks to the fact that the present invention can effectively reduce the proportion of atomic tasks that are interrupted due to insufficient energy supply, thereby reducing the number of non-atomic tasks that are delayed and miss the deadline, and ultimately allowing more real-time tasks to be completed on time;
[0070] (2) Effectively improve the energy efficiency of the system. This is due to the use of a dual-cycle power prediction method in the present invention, which effectively reduces the energy wasted due to the interruption of atomic tasks and improves energy utilization and task completion under the same energy supply conditions.
[0071] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0072] This article uses specific examples to illustrate the principles and implementation methods of the present invention. The above examples are only used to help understand the core idea of the present invention. At the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as limiting the present invention.
Claims
1. A method for scheduling atomic tasks based on power prediction, characterized in that: include: Obtaining historical power acquisition information and tasks of the embedded system; the historical power acquisition information includes the power of the first three sampling periods, the power average and variance of the first four sampling periods; The power situation of the next two cycles is obtained by predicting based on the dual-cycle power prediction model and the historical power collection information; the dual-cycle power prediction model is constructed based on a lightweight fully connected neural network, and the prediction is performed by establishing a nonlinear relationship between input features and outputs; Sorting the tasks according to their deadlines and criticality levels to obtain an optimized task sequence; Based on the power conditions of the next two cycles, the optimized task sequence is scheduled so that the atomic tasks in the task sequence are completely executed within the power stabilization period.
2. The atomic task scheduling method based on power prediction according to claim 1 is characterized in that: The dual-cycle power prediction model consists of an input layer, three hidden layers, and an output layer; wherein the input layer is used to obtain the historical power collection information, the three hidden layers are used to establish a nonlinear relationship between the input features and the predicted output, and the output layer is used to output the power conditions of the next two cycles.
3. The atomic task scheduling method based on power prediction according to claim 1 is characterized in that: The tasks are sorted by deadline and criticality, including: The tasks are first sorted according to the earliest deadline priority principle, and then the order of the tasks is adjusted according to the atomic task preemption mechanism to obtain an optimized task sequence.
4. The atomic task scheduling method based on power prediction according to claim 3 is characterized in that: First, the tasks are sorted according to the earliest deadline first principle, and then the order of the tasks is adjusted according to the atomic task preemption mechanism, including: Assume that the critical level of atomic tasks is Li=HI, and the critical level of non-atomic tasks is Li=LO. For any atomic task in the sequence, if the previous (HI-LO) / LO tasks are all non-atomic tasks, then move forward (HI-LO) / LO positions; if there are other atomic tasks among the previous (HI-LO) / LO tasks, then move forward at most to after the first atomic task encountered; if the number of previous tasks is less than (HI-LO) / LO, then move forward using the same principle; if the result of (HI-LO) / LO is not an integer, round it down and move forward using the same principle.
5. The atomic task scheduling method based on power prediction according to claim 1 is characterized in that: Based on the power conditions of the next two cycles, the optimized task sequence is scheduled, specifically including: If the power status of the next two cycles is expressed as "11", the task sequence is executed according to the order of the optimized task sequence; if the power status of the next two cycles is expressed as "10", the atomic task is skipped and the non-atomic tasks are executed according to the order of the sequence; if the power status of the next two cycles is expressed as "00" or "01", the capacitor is used as the power source for system backup; wherein, "1" indicates that the system is powered on, and "0" indicates that the system is powered off.
6. The atomic task scheduling method based on power prediction according to claim 5 is characterized in that: When the predicted power situation in the next two cycles is expressed as "00" or "01", but the actual situation is "10" or "11", the capacitor used for backup of the system will not be started. At this time, it is assumed that the system has power in the next two cycles, and the tasks are scheduled sequentially according to the situation of "11".
7. The atomic task scheduling method based on power prediction according to claim 1 is characterized in that: Before the next scheduling update of the task sequence is performed, the method further includes: utilizing the remaining time to execute the non-atomic tasks in the sequence that meet the deadline requirements, and skipping the encountered atomic tasks.
8. An atomic task scheduling system based on power prediction, characterized in that: include: An initial data acquisition unit, used to acquire historical power acquisition information and tasks of the embedded system; the historical power acquisition information includes the power of the first three sampling periods, the power average and variance of the first four sampling periods; A dual-period power prediction unit, used to predict according to the dual-period power prediction model and the historical power collection information, and obtain the power situation of the next two periods; the dual-period power prediction model is constructed based on a lightweight fully connected neural network, and the prediction is performed by establishing a nonlinear relationship between input features and outputs; A task sorting unit, used to sort the tasks according to their deadlines and critical levels to obtain an optimized task sequence; The task scheduling unit is used to schedule the optimized task sequence based on the power conditions of the next two cycles, so that the atomic tasks in the task can be completely executed within the power stable period.
