Method and computer for managing data exchange between multiple tasks
By reorganizing task functions and utilizing transition modules and memory to store data copies, the issues of data reliability and consistency in the engine control computer were resolved, ensuring stable engine operation.
Patent Information
- Application Number
- CN202080067241.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2019-09-27
- Filing Date
- 2020-09-25
- Publication Date
- 2025-12-23
- Estimated Expiration
- 2040-09-25
AI Technical Summary
Existing engine control computers suffer from data reliability and consistency issues during multi-task data exchange, leading to unstable engine operation and potentially damaging the equipment.
The task functions are regrouped, with each group including data generation and consumption functions. Data copies are stored and restored through a transition module, and data values are frozen using memory to ensure that the data remains stable and consistent before consumption.
This ensures data stability and consistency, avoids competition between tasks, and guarantees reliable engine operation.
Smart Images

Figure CN114402294B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of engine control for vehicles, particularly engines of motor vehicles, and more specifically to a method for managing data exchange between multiple tasks performed by a computer, and a computer that enables the implementation of the method. Background Technology
[0002] Today, many vehicles are equipped with multiple actuators that enable engine control functions. These actuators are configured to ensure the management of engine operation. For example, an actuator could be a fuel injector, an engine ignition system, or a gas recirculation system within the engine. Each actuator is connected to the engine control computer for control.
[0003] The engine control computer can be single-core or multi-core; that is, it can include one or more cores to enable engine control functions. To this end, each of the one or more cores executes a series of tasks according to priority, each task implementing one or more functions, some of which are data producers and / or data consumers.
[0004] When a first task, which includes at least one function to generate data, and a second task, which includes at least one function to consume said data, are implemented successively but in different execution cycles, a module detransition is needed to adapt the cycle of the signal corresponding to the generated data, so that the generated data can be read by the consumption function of the second task. In this way, the detransition module enables the computer to be notified of the execution cycle change and to transmit the data generated by the generating function to the consuming function.
[0005] Ensuring data consistency between production and consumption functions is also important; in other words, protecting the data transmitted between production and consumption functions is crucial when these functions are implemented by different tasks.
[0006] Reliability is defined by the stability and consistency of data. A stability problem is reflected in the fact that the value of a data point changes between several readings; in other words, it changes between several recoveries and consumptions of the data. Thus, a function consuming the data will not consistently consume the same value: that value is considered unstable.
[0007] A consistency problem arises when a data consumption function consumes data including values that were not modified simultaneously. In this case, the consumption function consumes data with different timestamps, and all the data is considered inconsistent.
[0008] Thus, when data reliability issues exist, the consumption functions performed may use incorrect data to be consumed. Using incorrect data values in the consumption functions can cause problems with engine operation control, leading to unexpected behavior or even engine damage. In fact, in cases of reliability issues, the actual position of the actuator may differ from the position controlled by the associated computer. In this situation, the computer attempts to continuously correct this discrepancy but may never converge to the controlled position, which could, for example, cause harmful mechanical vibrations and impair vehicle operation.
[0009] In the first example, the computer is a so-called "preemptive" single-core computer, enabling the execution of so-called "preemptive" tasks. The preemptive single-core computer allows for the implementation of the first solution, partially addressing the reliability problem based on the priority of each task. In other words, when the first task in a series of tasks is executed, if another task has a higher priority, that first task will be interrupted by the operating system. However, this only ensures the stability of the data. Because consistency is not checked, a protection mechanism must be added to the system to perform this check.
[0010] Furthermore, in the case of preemptive multi-core computers, reliability issues arise due to competition among the execution tasks of each core.
[0011] In the second example, the computer is a so-called "cooperative" single-core computer, enabling the execution of so-called "cooperative" tasks. The cooperative single-core computer enables the implementation of the second solution and also partially addresses the reliability issue. In practice, the task being executed by the cooperative single-core computer is interrupted at regular intervals so that the operating system can check if there is another task with higher priority. If so, the task is stopped and the other task is allowed to execute. Similar to the previous case, unreliability issues can arise in this cooperative model because the operating system may introduce inconsistencies and instability.
[0012] The use of collaborative multi-core computers has similar drawbacks to the use of collaborative single-core computers; in other words, the use of collaborative multi-core computers only partially solves the problem of data reliability.
[0013] Thus, existing solutions can only partially address the data reliability issue. Therefore, a solution that can completely overcome these shortcomings is needed. Summary of the Invention
[0014] This invention relates to a method for managing data exchange between multiple tasks by a computer in a vehicle, particularly a computer in a motor vehicle, the computer including at least one core, each task enabling the execution of at least one function, each function being specified to generate and / or consume at least one piece of data, the method notably comprising:
[0015] a) A phase of regrouping functions, each group comprising a data production function that performs the same first task and a data consumption function that performs the same second task and consumes the data produced by the data production function, wherein the first task is different from the second task.
[0016] b) For each group of functions:
[0017] i) The first phase includes the following steps:
[0018] 1) Execute the data generation function in this group to produce so-called "generated data".
[0019] 2) Store a copy of each generated data.
[0020] ii) The second phase includes the following steps:
[0021] 1) Based on the stored copy, restore the data to be consumed by the consumption functions in this group.
[0022] 2) Execute the consumption function in the group based on the recovered pending consumption data.
[0023] Advantageously, the method according to the invention enables the stable generation of data, ensuring that it remains stable, in other words, unchanged, during consumption by one or more functions, even if its generation occurs between the start and end of the function's execution. In practice, ensuring data stability is necessary in many situations: when the same function reads the same data multiple times, or when multiple consecutive functions read the same data once or multiple times. Furthermore, the method according to the invention also solves the consistency problem. The data to be consumed by the consuming functions is generated in such a way that competition between tasks does not corrupt any part of this data to be consumed. All this data to be consumed is consistent when the consuming function is executed based on this data.
[0024] Preferably, the data generation function of the first task assigned to it is sequential.
[0025] Advantageously, the sequential execution of functions makes it possible to avoid any competition issues between tasks, thereby avoiding any data reliability issues.
[0026] Advantageously, the second task assigned to it to perform data consumption functions is sequential.
[0027] Advantageously, the sequential execution of consumption functions enables the avoidance of any competition issues between tasks, thereby avoiding any data reliability issues.
[0028] Advantageously, in the storage step, the replica is stored in a memory comprising multiple regions by assigning the value of each replica to one and only one of multiple regions.
[0029] Advantageously, the steps stored in memory make it possible to freeze the values that generate the data.
[0030] Preferably, in the recovery step, the value of each copy stored in the memory region is assigned to a data to be consumed. This recovery, performed via a memory mirror (also known as reading from write memory), enables the copying of the values of the stored data to the data to be consumed by the target function, that is, the function intended to consume that data during execution.
[0031] Advantageously, the storage and recovery steps enable the stability and consistency of the generated data, ensuring that the value of each copy of the generated data is assigned to the data to be consumed remains stable and therefore unchanged before being consumed by the consumption function.
[0032] The present invention also relates to a computer for managing data exchange between multiple tasks for a vehicle, particularly a motor vehicle, said computer including at least one core, each task enabling the execution of at least one function, each function being specified to generate and / or consume at least one piece of data, and notably, said computer being configured to:
[0033] a) Reorganize the functions into groups, each group including a data production function that performs the same first task and a data consumption function that performs the same second task and consumes the data produced by the data production function, wherein the first task is different from the second task.
[0034] b) For each group of functions:
[0035] 1) Execute the data generation function in this group to produce so-called "generated data".
[0036] 2) Store a copy of each generated data.
[0037] 3) Based on the stored copy, restore the data to be consumed by the consumption functions in this group.
[0038] 4) Execute the consumption function in the group based on the recovered pending consumption data.
[0039] Advantageously, the computer according to the invention enables the stable generation of data, which remains stable, in other words, unchanged, during the consumption of the function, even if its generation occurs between the start and end of the function's execution.
[0040] Furthermore, the computer according to the invention also solves the consistency problem. The data to be consumed by the consumption function is generated in such a way that competition between tasks does not corrupt any part of this data to be consumed. All this data to be consumed is consistent when the consumption function is executed based on this data.
[0041] Preferably, the computer sequentially executes the data generation function of the first task assigned to it.
[0042] Advantageously, the sequential execution of production functions by the computer makes it possible to avoid any competition between tasks, thereby avoiding any data reliability issues.
[0043] Preferably, the computer sequentially executes the data consumption function of the second task assigned to it.
[0044] Advantageously, the sequential execution of consumption functions by the computer makes it possible to avoid any competition issues between tasks, thereby avoiding any data reliability issues.
[0045] Advantageously, the computer is configured to store each copy of the generated data in a memory comprising multiple regions by assigning the value of each copy to one of multiple regions.
[0046] Advantageously, the computer stores the generated data in memory, making it possible to freeze the value of the generated data.
[0047] Preferably, the computer is configured to recover the data to be consumed by assigning the value of each copy stored in the memory area to a data to be consumed, respectively.
[0048] Preferably, the generated data is stored and the data to be consumed is restored within the computer's protection mechanism.
[0049] Advantageously, computers enable the assurance of the stability of the generated data, ensuring that copies of the generated data values are assigned to the data to be consumed remain stable before being consumed by the consumption task.
[0050] The present invention also relates to a vehicle comprising the computer as described above. Attached Figure Description
[0051] Other features and advantages of the invention will become more apparent from the following description. This description is purely illustrative and should be read with reference to the accompanying drawings, in which:
[0052] Figure 1 An example of a computer performing multiple tasks according to the present invention is shown.
[0053] Figure 2 The diagram illustrates the transition corresponding to a computer performing two consecutive tasks according to the present invention.
[0054] Figure 3 An embodiment of the task management method according to the present invention is shown. Detailed Implementation
[0055] computer
[0056] A computer for managing data exchange between multiple tasks will now be described. The computer is intended to be installed in a vehicle, particularly a motor vehicle, and is configured to perform tasks that enable the vehicle's engine control functions, such as ignition, fuel injection, or gas recirculation, to be implemented via actuators.
[0057] The computer includes at least one core, enabling it to perform at least one task comprising at least one function, particularly functions for calculating and / or determining data. The computer also includes protection mechanisms to prevent competition between the execution of various tasks.
[0058] nuclear
[0059] As previously mentioned, each core is specifically configured to execute a task assigned to it, multiple independent tasks, or a series of interdependent tasks through its operating system. Each task enables the execution of one or more functions and is characterized by an activation scheme, allocation scheme, and priority.
[0060] The task activation scheme defines the activation type of the task execution. Task activation can be synchronous, thus the task execution cycle is constant; or asynchronous, thus the task execution cycle is variable; or event-driven, in other words, after a system state that requires the task to be executed is detected.
[0061] The task allocation scheme defines one or more cores to which the task is assigned. In practice, a task can be executed on a single core or distributed across multiple cores.
[0062] The priority of each task depends on the activation scheme and the allocation scheme on one or more cores. For example, priority is defined based on execution cycle and is inversely proportional to the execution cycle. In other words, according to this example, the shorter the execution cycle of a task, the higher its priority. Clearly, there are other patterns for determining the priority of each task.
[0063] The operating system enables the selection of which task should be executed at any given time and in what order, based on the task's activation scheme and priority.
[0064] Each function is referred to as at least one data “generation” and / or “consumption” function. In practice, each generation function is executed and enables the determination of one or more data, referred to as “generated data”, and each consumption function is executed based on one or more data, referred to as “data to be consumed”.
[0065] In addition, each function is characterized by its activation scheme, and therefore by its execution cycle.
[0066] protection mechanism
[0067] The protection mechanism is configured to store a copy of the values of the data generated by the task, and to recover data that will be consumed by another task based on the stored copy.
[0068] In this way, the protection mechanism temporarily prevents competition between tasks, and thus temporarily halts the competition between the execution of each task during the storage of generated data and the recovery of data to be consumed.
[0069] In the current situation, the protection mechanisms include transition modules and physical memory.
[0070] a) Transition module RT
[0071] The transition module (RT) manages data transfer between competing tasks based on task priority to avoid any competition issues between task executions. Data transfer management depends on the activation scheme, priority, and allocation scheme—that is, the core to which the task is assigned.
[0072] The transition module RT is configured to aggregate data transfer from the production function to the consumption function via a function for storing data generated by the production function and a function for recovering data to be consumed by the consumption function.
[0073] The transition module RT enables the determination of a copy of the generated data through its storage function, and is implemented to store that copy.
[0074] The transition module RT enables the determination of data to be consumed based on the values of the stored copies through its recovery function. In other words, the transition module RT is implemented to recover data to be consumed.
[0075] b) Memory
[0076] The protection mechanism's physical memory includes multiple regions, enabling the storage of data generated by a single task, a series of tasks, or multiple independent tasks, and the recovery of data while ensuring consistency and stability.
[0077] According to other embodiments, the protection mechanism may consist of, for example, a signal or a queue, or a forced sequence between tasks.
[0078] Example 1
[0079] refer to Figure 1 Now, we will present the first example of the execution of multiple production and consumption functions A, B, C, and D. In this example, functions A and C are so-called "production" functions, executed by a first task 1, called the "source," with an execution cycle of 5 milliseconds, and functions B and D are so-called "consumption" functions, executed by a second task 2, called the "target," with an execution cycle of 10 milliseconds. The first task 1 and the second task 2, with execution cycles of 5 milliseconds and 10 milliseconds respectively, can be assigned to the same core or multiple different cores.
[0080] This invention does not limit the number of tasks, functions, or cores.
[0081] Therefore, functions A and C are executed sequentially by the first task 1, and functions B and D are executed sequentially by the second task 2.
[0082] A single transition module RT is configured to aggregate the transfer of data from production function A (or production function C) to consumption function B (or consumption function D) through storage and recovery functions.
[0083] Example 2
[0084] refer to Figure 2 This illustrates data transfer from the first task 1, which executes production functions A and C, to the second task 2, which executes consumption functions B and D. For simplicity, only the transfer between production function A and consumption function B will be described, where consumption function B consumes the data produced by production task A.
[0085] The transition module RT connects between the first task 1 and the second task 2. In other words, the transition module RT connects production function A to consumption function B, and production function C to consumption function D.
[0086] As described in detail in the first example, task 1 has an execution cycle of 5 milliseconds, and task 2 has an execution cycle of 10 milliseconds. Thus, task 1 has a higher priority than task 2. Therefore, production function A executes before consumption function B.
[0087] Production function A is configured to execute based on an input value, which is defined, for example, by a device or function external to multiple functions A, B, C, and D, and production function A enables the determination of production data V after execution of production function A.1A .
[0088] The transition module RT is configured to ensure that the data V generated by the production function A is secure. 1A The data is transmitted to the consumption function B. Thus, the transition module RT enables the determination of the generated data V. 1A Copy V 1A_int And store the copy V 1A_int .
[0089] The protection mechanism uses memory (MEM) for storage; in other words, it stores a copy of V. 1A_int Write to the region contained in the memory MEM.
[0090] Consumption function B is configured based on the stored copy V 1A_int Read the data to be consumed, V 2B And based on the consumption data V 2B To execute.
[0091] method
[0092] refer to Figure 3 An embodiment of the computer management method for data exchange between multiple tasks as described above will now be introduced, in which reference will be taken into account. Figure 1 The four functions described are A, B, C, and D.
[0093] The method according to the invention first includes regrouping functions into group E. T The stage. In each group E T In this context, the production function, executed by the same first task 1, and the consumption function, executed by the same second task 2, consume the data produced by the production function, are reorganized. Therefore, in the example presented here, group E... T This includes generation functions A and C, and consumption functions B and D, which consume the data generated by generation functions A and C.
[0094] Each generating function A and C can include multiple input values.
[0095] For each group E after recombination T The method includes a first phase PH1, which involves sequentially executing steps E1 to generate functions A and C. In other words, functions A and C are executed one after the other. Function A is executed, enabling the determination of generated data V. 1A Similarly, the generation function C is executed, enabling the determination of the generated data V. 2C .
[0096] Finally, the first stage PH1 includes storing the generated data V. 1A and V 1CStep E2, in other words, the transition module RT writes the generated data V. 1A (or, in other words, generating data V) 1C The transition module RT generates data V through its storage mechanism. 1A V 1C This function enables the determination of the generated data V. 1A Copy V 1A_int and generate data V 1C Copy V 1C_int And the copy V 1A_int V 1C_int It is stored in memory MEM.
[0097] The method also includes a second phase PH2 executed after the first phase PH1, which includes restoring the data V to be consumed by consumption functions B and D. 2B V 2D Step E3. In other words, the recovery function of the transition module RT enables the copy V stored in memory MEM to be transferred. 1A_int (or rather, copy V) 1C_int The value of ) is assigned to the data V to be consumed. 2B (or, in other words, the data V to be consumed) 2D The value of ).
[0098] Therefore, this recovery via memory mirroring (also known as reading from write memory) makes it possible to retrieve the value of the data stored in memory MEM (here, a copy V). 1A_int Or rather, copy V 1C_int The value) is copied to the data V to be consumed during the execution of the consuming function B (or consuming function D). 2B (or, in other words, the data V to be consumed) 2D ).
[0099] The second phase, PH2, then includes step E4, based on the recovered pending consumption data V. 2B V 2D Execute group E sequentially T The consumption functions B and D in the data. In other words, based on the data V to be consumed. 2B Execute consumption function B, and then based on the data V to be consumed. 2D Perform consumption function D.
[0100] In this way, the protection mechanism prevents the simultaneous execution of storage step E2 and recovery step E3, thereby enabling the freezing of copy V. 1A_int V 1C_int The value of V. Thus, the replica V... 1A_int V 2C_int The stability of the values is guaranteed, and these values will become the data to be consumed, V. 1B V2D .
[0101] However, the execution of generating functions A and C and consuming functions B and D can be simultaneous.
[0102] In the method described above, the second stage PH2 is performed after the first stage PH1. However, as a variation, the second stage PH2 can be executed before the first stage PH1, performing the consumption task based on data that has been stored or pre-stored in the memory MEM in the previous iteration.
[0103] This ensures both data stability and consistency. Because data V is generated... 1A and V 1C Each copy V 1A_int V 1C_int It is stored only when the execution of generating functions A and C ends, and stability is guaranteed because the restoration is performed before the execution of consuming functions B and D begins.
[0104] Because the data is processed in an aggregated manner, and grouped into E according to production functions A and C and consumption functions B and d. T The data is sorted, thus ensuring consistency. Furthermore, the method is automatic and readily implementable.
Claims
1. A method for managing data exchange between multiple tasks by a computer of a vehicle, said computer including at least one core, each task enabling the execution of at least one function (A, B, C, D), each function (A, B, C, D) being specified to generate and / or consume at least one piece of data, the method characterized in that it comprises: a) Reorganize functions (R) into groups (E) T The phase of ) each group (E T This includes data generation functions (A, C) that are assigned to the same first task (1) and data consumption functions (B, D) that are assigned to the same second task (2) that consume the data generated by the data generation functions (A, C), wherein the first task (1) is different from the second task (2). b) For each group (E) T Functions (A, B, C, D): i) The first phase includes the following steps: 1) Execute (E1) this group (E T The data generation functions (A, C) in the data generation function are used to generate so-called "generated data" (V). 1A V 1C ), 2) In the first stage, which includes the steps of performing data generation functions (A, C), store (E2) each generated data (V) 1A V 1C A copy of (V) 1A_int V 1C_int ), ii) The second phase includes the following steps: 1) Based on the stored replica (V) 1A_int V 1C_int The recovery (E3) must be performed by the group (E) T The consumption function (B, D) in the data (V) of consumption. 2B V 2D ), 2) Based on the recovered pending consumption data (V) 2B V 2D To execute (E4) the group (E) T The consumption function (B, D) in ) ).
2. The method according to claim 1, wherein, In the steps of executing (E1) production functions (A, C), the first task assigned to it (1) to execute data production functions (A, C) is sequential.
3. The method according to any one of claims 1 and 2, wherein, In the step of executing (E4) consumption function (B, D), the second task (2) assigned to it to execute data consumption function (B, D) is sequential.
4. The method according to any one of claims 1 and 2, wherein in the storage (E2) step, each copy (V) 1A_int V 1C_int The value of ) is assigned to one of multiple regions to distribute the replica (V) 1A_int V 1C_int It is stored in a memory (MEM) that includes multiple regions.
5. The method according to claim 4, wherein, During the recovery (E3) step, each copy (V) stored in the memory (MEM) region... 1A_int V 1C_int The values of ) are assigned to a data set to be consumed (V) 2B V 2D ).
6. A computer for a vehicle for managing data exchange between multiple tasks, for implementing the method according to any one of claims 1 to 5, said computer comprising at least one core, each task enabling the execution of at least one function (A, B, C, D), each function (A, B, C, D) being specified to generate and / or consume at least one piece of data, said computer characterized in that it is configured to: a) Reorganize functions (A, B, C, D) into group (E) T ), each group (E T This includes data generation functions (A, C) that are assigned to the same first task (1) and data consumption functions (B, D) that are assigned to the same second task (2) that consume the data generated by the data generation functions (A, C), wherein the first task (1) is different from the second task (2). b) For each group (E) T Functions (A, B, C, D): 1) Execute this group (E) T The data generation functions (A, C) in the data generation function are used to generate so-called "generated data" (V). 1A V 1C ), 2) Store each generated data (V) 1A V 1C A copy of (V) 1A_int V 1C_int ), 3) Based on the stored replica (V) 1A_int V 1C_int The recovery should be handled by the group (E) T The consumption function (B, D) in the data (V) of consumption. 2B V 2D ), 4) Based on the recovered pending consumption data (V) 2B V 2D To execute the group (E) T The consumption function (B, D) in ) ).
7. The computer according to claim 6 is configured to sequentially execute data generation functions (A, C) assigned to it for execution of a first task (1).
8. The computer according to any one of claims 6 and 7 is configured to sequentially execute data consumption functions (B, D) assigned to it for execution of a second task (2).
9. The computer according to any one of claims 6 and 7, configured to transmit each copy (V 1A_int V 1C_int The value of ) is assigned to one of multiple regions to distribute each generated data (V) 1A V 1C A copy of (V) 1A_int V 1C_int It is stored in a memory (MEM) that includes multiple regions.
10. A vehicle comprising a computer according to any one of claims 6 to 9.
11. The vehicle according to claim 10, wherein the vehicle is a motor vehicle.
Citation Information
Patent Citations
Method for ensuring data stability in a multi-core processor of a motor vehicle
WO2019058042A1