METHOD FOR DETECTING THE DISAPPEARANCE OF A TASK
20220058051 · 2022-02-24
Inventors
Cpc classification
G06F9/52
PHYSICS
G06F11/0739
PHYSICS
G06F9/485
PHYSICS
G06F11/3065
PHYSICS
International classification
Abstract
Disclosed is a method for detecting a disappearance of a task in an environment including at least one recurring parent task that triggers, in nominal mode, on each occurrence, at least one child task, including the following steps: evaluating a parent duration elapsed between the last occurrence and the penultimate occurrence of the parent task, evaluating a child duration elapsed between the last occurrence and the penultimate occurrence of the child task, comparing the parent duration and the child duration, it being concluded that an occurrence of the child task has disappeared if the child duration, preferably with a margin, is longer than the parent duration.
Claims
1. A method for detecting a disappearance of a task in an environment comprising at least one recurring parent task (TM) that triggers, in nominal mode, on each occurrence, at least one child task (TF), the method comprising the following steps: evaluating a parent duration (DTMi) elapsed between the last occurrence (TMi) and the penultimate occurrence (TMi−1) of the parent task (TM), evaluating a child duration (DTFi) elapsed between the last occurrence (TFi) and the penultimate occurrence (TFi−1) of the child task (TF), and comparing the parent duration (DTMi) and the child duration (DTFi), it being concluded that an occurrence of the child task (TF) has disappeared, and an alarm generated, if the child duration (DTFi) is longer than the parent duration (DTMi).
2. The method as claimed in claim 1, wherein it is concluded that an occurrence of the child task (TF) has disappeared if the child duration (DTMi) is equal to the sum of the last parent duration (DTMi) and of the penultimate parent duration (DTMi−1).
3. The method as claimed in claim 2, wherein the sum of the last parent duration (DTMi) and of the penultimate parent duration (DTMi−1) is approximated by twice the last parent duration (DTMi).
4. The method as claimed in claim 2, wherein the margin is equal to p times a triggering delay (DD), the triggering delay (DD) being equal to the duration between the trigger of a child task (TF) by a parent task (TM) and the start of execution of the child task (TF), with p an integer.
5. The method as claimed in claim 1, wherein each occurrence of a task (TM, TF) records the task's execution date (tMi, tMi−1, tMi−2, tFi, tFi−1, tFi−2) in order to prepare for the evaluation of the parent duration (DTMi) and of the child duration (DTFi), respectively.
6. The method as claimed in claim 5, wherein a parent duration (DTMi) is evaluated by an occurrence (TMi) of the parent task (TM) and/or a child duration (DTFi) is evaluated by an occurrence (TFi) of the child task (TF).
7. The method as claimed in claim 5, wherein the parent duration (DTMi) and the child duration (DTFi), respectively, are evaluated by comparing the execution date (tMi, tFi) of an occurrence (TMi, TFi), which is read from the record in memory (M) or known if the occurrence (TMi, TFi) is the occurrence that performs the computation, with the execution date (tMi−1, tFi−1) of the previous occurrence of the parent task (TM) and of the child task (TF), respectively, which is read from the record in memory (M).
8. The method as claimed in claim 1, wherein the evaluation of the parent duration (DTMi) and/or the evaluation of the child duration (DTFi) is recorded, after computation in order to prepare for the comparison.
9. The method as claimed in claim 1, wherein the step of comparing the parent duration (DTMi) and the child duration (DTFi) is carried out by an occurrence (TFi) of the child task (TF).
10. The method as claimed in claim 9, wherein, when an occurrence (TFi) of the child task (TF) concludes that an occurrence of the child task (TF) has disappeared, this disappeared occurrence is the immediately preceding occurrence (TFi−1).
11. The method as claimed in claim 1, wherein the parent task (TM) is aperiodic.
12. The method as claimed in claim 1, wherein the parent task (TM) and the child task (TF) are executed in an environment containing multiple processing units (C1, C2).
13. The method as claimed in claim 1, implemented in an engine control unit, wherein the parent task (TM) is synchronous with an event related to engine speed.
14. The method as claimed in claim 13, wherein the parent task (TM) is a task of detecting a given angular position of the crankshaft, and the child task (TF) is a task of executing processing operations following such a detection.
15. The method of claim 1, wherein the alarm is generated, if the child duration (DTFi), with a margin, is longer than the parent duration (DTMi).
16. The method of claim 2, wherein it is concluded that an occurrence of the child task (TF) has disappeared if the child duration (DTMi), with a margin, is equal to the sum of the last parent duration (DTMi) and of the penultimate parent duration (DTMi−1).
17. The method of claim 4, wherein p is equal to 2.
18. The method of claim 17, wherein the margin is equal to 1 ms.
19. The method of claim 5, wherein the execution date is stored in a shared memory.
20. The method of claim 8, wherein the evaluation of the parent duration (DTMi) and/or the evaluation of the child duration (DTFi) is recorded in a shared memory.
Description
BRIEF DESCRIPTION OF THE DRAWINGS
[0033] Other innovative advantages and features of the invention will become apparent on reading the following completely non-limiting description, which is given by way of indication, with reference to the appended drawings, in which:
[0034]
[0035]
[0036]
[0037]
DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0038] For greater clarity, identical or similar elements have been designated by identical reference signs throughout the figures.
[0039] The invention relates to a method for detecting a disappearance of a task in an environment comprising at least one recurring parent task TM. Each occurrence TMi, TMi−1, TMi−2 of this task triggers at least one child task TF. It will be noted that that this triggering occurs in nominal mode. Specifically, the deletion of a task may be caused by the parent task TM not triggering the child task TF. This case is also detected by the method of the invention.
[0040] The loss of a task may be critical in the context of engine control. Thus, for example, in the case of a task detecting a top dead center, the disappearance of a task leads to passage to detection of the next top dead center, i.e. the top dead center corresponding to the next cylinder. The computation of the cylinder number to which the combustion parameters must be applied is then incorrect. As a result, for example, the quantity of fuel injected is no longer optimal. Such a detrimental situation leads to the emission of polluting products and/or over-consumption. The objective of the method is to avoid such situations and their consequences.
[0041] The detecting method is characterized in that it comprises the following steps. In a first step, a parent duration DTMi elapsed between the last occurrence TMi and the penultimate occurrence TMi−1 of the parent task TM is evaluated. Likewise, in a second step, a child duration DTFi elapsed between the last occurrence TFi and the penultimate occurrence TFi−1 of the child task TF is evaluated. These two durations DTMi and DTFi are then compared. In a nominal situation, in which no occurrence of a task has disappeared, as illustrated in
[0042] In the case where it is concluded that a disappearance has occurred, the method further comprises generating an alarm. The form of this alarm depends on the function associated with the task. It may be a question of a record of a state in a memory of a computer, such as the engine control unit, this record more particularly being intended for maintenance personnel, or it may even be a question of a signal for the attention of the driver of the vehicle, a warning light on the instrument panel or an audible signal being triggered for example.
[0043] This technical feature allows a disappearance of an occurrence of the child task TF to be detected immediately.
[0044] In order to obtain a more robust disappearance detection, the previous condition: DTFi>DTMi+margin, may be replaced by an alternative condition: DTFi≈DTMi+DTMi−1+/−margin. In other words, it is concluded that an occurrence of the child task TF has disappeared if the child duration DTMi, preferably with a margin, is equal to the sum of the last parent duration DTMi and of the penultimate parent duration DTMi−1. Such an alternative condition advantageously makes it possible to prevent a delayed occurrence from being mistakenly considered to have disappeared. It has the drawback of not allowing a plurality of successive disappeared occurrences to be detected.
[0045] The parent task TM may be periodic. In this case, the last parent duration DTMi and the penultimate parent duration DTMi−1 are equal. The parent task TM may also be aperiodic. This is the case, for example, with a parent task TM indexed to an event related to engine speed. In this case, the last parent duration DTMi and the penultimate parent duration DTMi−1 are different. However, the difference remains small and the assumption of equality may be made, at least over a few successive pseudo-periods. Thus, in both cases (periodic or aperiodic), the sum of the last parent duration DTMi and of the penultimate parent duration DTMi−1 may be approximated by twice the last parent duration DTMi.
[0046] It will be noted that this model may be generalized to the case of detection of multiple successive missing occurrences. It is then concluded that an occurrence of the child task TF has disappeared if the child duration DTMi is substantially equal, with a margin, to one of the sums of the preceding parent durations, or, adopting the simplifying assumption, equal, with a margin, to q×DTMi, with q an integer equal to 2 or 3 . . . or n, with n the depth (i.e. the number of successive disappeared tasks) at which detection of disappearance of a task is desired.
[0047] The child task TF follows the, periodic or aperiodic, model of the parent task TM.
[0048] The margin may be any margin. Its function is to add a tolerance, so as to prevent the condition of detection from being thrown off and a delayed occurrence from mistakenly being considered to have disappeared.
[0049] According to one possible embodiment, the margin is equal to p times a triggering delay DD. The triggering delay DD is equal to the duration between the trigger of a child task TF by a parent task TM and the start of execution of the child task TF, this delay being represented by a dashed rectangle in
[0050] To compute the parent and child durations DTM, DTF, according to one possible embodiment, each occurrence TMi, TMi−1, TMi−2, TFi, TFi−1, TFi−2 of a parent or child task TM, TF records its respective execution date tMi, tMi−1, tM−i2, tFi, tFi−1, tFi−2. This record is preferably stored in a shared memory M. Thus the corresponding next occurrence may read this value and compute the duration DTM, DTF, by comparison with its own execution date. This feature advantageously applies both to the parent task TM, with respect to computation of the parent duration DTM, and to the child task TF, with respect to computation of the child duration DTF.
[0051] Thus, if reference is made to
[0052] According to one advantageous embodiment, a parent duration DTMi is evaluated by an occurrence TMi of the parent task TM. Advantageously, an occurrence TMi of the parent task TM evaluates the parent duration DTMi that separates it from the immediately preceding occurrence TMi−1 of the parent task TM. Analogously, a child duration DTFi is evaluated by an occurrence TFi of the child task TF. Advantageously, an occurrence TFi of the child task TF evaluates the child duration DTFi that separates it from the immediately preceding occurrence TFi−1 of the child task TF.
[0053] According to one embodiment, the parent duration DTMi and the child duration DTFi, respectively, are evaluated by comparing the execution date tMi, tFi of an occurrence TMi, TFi, which is read from the record or known if the occurrence TMi, TFi is the occurrence that performs the computation, with the execution date tMi−1, tFi−1 of the previous occurrence of the parent task TM and of the child task TF, respectively, which is read from the record.
[0054] Thus, if reference is made to
[0055] With reference to
[0056] With reference to
[0057] Thus each occurrence of the parent task TM and of the child task TF, respectively, computes the parent duration DTM and the child duration DTF, respectively, separating it from the previous occurrence.
[0058] According to another advantageous feature, each occurrence of the parent task TM, after having evaluated its parent duration DTM, records it, preferably in the shared memory M, so that it may be read by another occurrence. Alternatively or in addition, each occurrence of the child task TF, after having evaluated its child duration DTF, records it, preferably in the shared memory M, so that it may be read by another occurrence.
[0059] If the two parent and child durations DTM, DTF are both recorded, any entity that has access to the shared memory M may read them and perform the comparison.
[0060] According to another feature, the comparing step is advantageously carried out by an occurrence TFi of the child task TF. The occurrence TFi reads, from the memory M, the corresponding parent duration DTMi recorded beforehand by the corresponding occurrence TMi of the parent task TM. The occurrence TFi will then know the child duration DTFi, which it will have just evaluated, and the parent duration DTMi, of corresponding rank, which it will have just read, and may compare them. In this case, only the parent duration DTMi needs to be recorded and read, the child duration DTFi being known if the occurrence TFi of the child task TF computes the child duration DTFi and performs the evaluation.
[0061] Thus, with reference to
[0062] With reference to
[0063] When an occurrence that compares the parent and child durations DTM, DTF concludes that an occurrence of the child task TF has disappeared, this disappeared occurrence is the immediately preceding occurrence. Thus with reference to
[0064] Thus, a disappearance may, according to the invention, be detected very rapidly after its occurrence.
[0065] The invention is particularly advantageous when the parent task TM and the child task TF are executed in an environment containing multiple processing units C1, C2, and preferably on different processing units C1, C2. Such an environment favors the appearance of the problem of deletion of an occurrence of a task.
[0066] The invention is applicable to engine control, preferably when the parent task TM is synchronous with an event related to engine speed.
[0067] For example, the parent task TM is a task of detecting a given angular position of the crankshaft, such as the top-dead-center (TDC) position, and the child task TF is a task of executing processing operations following such a detection. A deletion of an occurrence of the child task deletes a detection of a position and the processing thereof. Thus, the data to be refreshed on the execution of the child task are not refreshed and detrimentally keep their previous value.
[0068] The invention has been described above by way of example. It will be understood that a person skilled in the art will be able to produce various variant embodiments of the invention, for example by combining the various above features, which may be implemented alone or in combination, without however departing from the scope of the invention.