Self-recovering method of physical layer of base station and base station apparatus
A processor of a base station apparatus executes steps of: (a) executing multiple first tasks, one by one, during a time period of one of m time slots in a normal mode in a thread pool; (b) when finishing executing the first tasks, recording first statuses of the first tasks into the task status vector table; (c) when finishing recording the first statuses of the first tasks, determining whether all of second statuses of second tasks of a previous k th time slot of the m time slots recorded in the task status vector table are executed statuses; if yes, returning to the step (a); if not, executing at least one of the second tasks of the previous k th time slot having an unexecuted status within next p consecutive time slots in a load reduction mode, and then returning to step (a); m, k, and p are positive integers. The processor executes the tasks in the load reduction mode for self-recovering so that the base station apparatus can avoid crashing.
1 . A self-recovering method of a physical layer of a base station, executed by a processor of a base station apparatus, and comprising steps of:
(a) executing multiple first tasks, one by one, during a time period of one of m time slots in a normal mode in a thread pool;
(b) when finishing executing the first tasks, recording first statuses of the first tasks into a task status vector table, wherein the task status vector table further records second statuses of second tasks of the m time slots other than the one of the m time slots having the first tasks;
(c) when finishing recording the first statuses of the first tasks, determining whether all of the second statuses of the second tasks of a previous k th time slot of the m time slots recorded in the task status vector table are executed statuses;
when the second statuses of the second tasks of the previous k th time slot recorded in the task status vector table are all executed statuses, returning to the step (a); and
when any one of the second statuses of the second tasks of the previous k th time slot recorded in the task status vector table is not the executed status, executing at least one of the second tasks of the previous k th time slot having an unexecuted status within next p consecutive time slots in a load reduction mode, and returning to the step (a);
wherein the at least one of the second tasks of the previous k th time slot having the unexecuted status in the thread pool is executed in a same thread pool within the next p consecutive time slots;
wherein m, k, and p are positive integers;
wherein p+k≤m;
wherein the base station apparatus is a cell site for communicating with mobile devices;
wherein p is determined according to the statuses of the second tasks of the previous k th time slot recorded in the task status vector table; and
wherein the smaller a number of the executed statuses of the second tasks of the previous k th time slot recorded in the task status vector table is, the greater p is.
2 . The self-recovering method as claimed in claim 1 , wherein the task status vector table is stored in a memory of the base station apparatus.
3 . The self-recovering method as claimed in claim 1 , wherein when the processor is in the load reduction mode, a workload for processing subsequent tasks within the next p consecutive time slots is reduced.
4 . The self-recovering method as claimed in claim 3 , wherein when the workload of the processor is reduced, the processor executes i said subsequent tasks within each of the next p consecutive time slots in the load reduction mode;
wherein i is a positive integer, and i≤n; and
wherein n is a number of the first tasks.
5 . A base station apparatus, and comprising:
a memory, storing a task status vector table;
a processor, electrically connected to the memory, and executing steps of:
(a) executing multiple first tasks, one by one, during a time period of one of m time slots in a normal mode in a thread pool;
(b) when finishing executing the first tasks, recording first statuses of the first tasks into a task status vector table, wherein the task status vector table further records second statuses of second tasks of the m time slots other than the one of the m time slots having the first tasks;
(c) when finishing recording the first statuses of the first tasks, determining whether all of the second statuses of the second tasks of a previous k th time slot of the m time slots recorded in the task status vector table are executed statuses;
when the second statuses of the second tasks of the previous k th time slot recorded in the task status vector table are all executed statuses, returning to the step (a); and
when any one of the second statuses of the second tasks of the previous k th time slot recorded in the task status vector table is not the executed status, executing at least one of the second tasks of the previous k th time slot having an unexecuted status within next p consecutive time slots in a load reduction mode, and returning to the step (a);
wherein the at least one of the second tasks of the previous k th time slot having the unexecuted status in the thread pool is executed in a same thread pool within the next p consecutive time slots;
wherein m, k, and p are positive integers;
wherein p+k≤m;
wherein the base station apparatus is a cell site for communicating with mobile devices;
wherein p is determined according to the statuses of the second tasks of the previous k th time slot recorded in the task status vector table; and
wherein the smaller a number of the executed statuses of the second tasks of the previous k th time slot recorded in the task status vector table is, the greater p is.
6 . The base station apparatus as claimed in claim 5 , wherein when the processor is in the load reduction mode, a workload for processing subsequent tasks within the next p consecutive time slots is reduced.
7 . The base station apparatus as claimed in claim 6 , wherein when the workload of the processor is reduced, the processor executes i said subsequent tasks within each of the next p consecutive time slots in the load reduction mode;
wherein i is a positive integer, and i≤n; and
wherein n is a number of the first tasks.