Control device for a vehicle

The control device for vehicle systems addresses data contention in multi-core microcontrollers by using redundant data storage and synchronization units, ensuring fast and consistent data access without exclusive control, suitable for high-speed applications like engine control.

DE112013001146B4Active Publication Date: 2024-09-26ASTEMO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
DE112013001146
Authority / Receiving Office
DE · DE
Patent Type
Patents
Current Assignee / Owner
Priority Date
2012-02-23
Filing Date
2013-01-28
Publication Date
2024-09-26
Estimated Expiration
2033-01-28

AI Technical Summary

Technical Problem

In vehicle systems with multi-core microcontrollers, data contention and exclusive control methods lead to waiting times that cannot be tolerated in high-speed applications like engine control, and existing methods for avoiding data conflicts increase processing delays and software development efforts.

Method used

A control device with redundant data storage in a shared memory, using data update and synchronization units to ensure data consistency without exclusive control, allowing simultaneous access by multiple computing units.

Benefits of technology

Enables fast and consistent data access without delays, reducing software development efforts and ensuring real-time performance in vehicle systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 00000000_0000_ABST
    Figure 00000000_0000_ABST
Patent Text Reader

Abstract

If exclusive control is used when an update or referencing operation is performed on a data buffer in memory shared by multiple computing units, the waiting time increases, and it is difficult to guarantee real-time capability. In a vehicle control device according to the invention, a data buffer is multiplexed, and each processing unit performs an update process and a referencing process for a different multiplexed data buffer. Furthermore, a processing unit different from the processing unit performing the data update process synchronizes a data buffer updated by a data update process with the multiplexed data buffer in a shorter time than one execution cycle of the data update process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical area

[0001] The present invention relates to a technique for updating and referencing data in a memory shared by multiple computing units. Technical background

[0002] Many vehicle systems in recent years include an ECU that operates computerized vehicle control equipment, i.e. an electronic control unit, and an on-board LAN (local area network) that enables communication between multiple ECUs.

[0003] As the amount of computation increases, ECUs equipped with multi-core microcontrollers (multi-core microcomputers) are beginning to be deployed in automotive systems. In a multi-core microcomputer, data conflict may occur when multiple CPUs access (write or read) shared data in a shared memory, such as a dual-port RAM.

[0004] Exclusive control is known as a method for avoiding data conflicts. Exclusive control is a technique for detecting the absence of concurrency in scheduling access to shared data, and a semaphore or similar technique is used. A semaphore is acquired before accessing shared data, and if the acquisition is successful, the data update (write) or reference (read) is executed. After the data update or reference is completed, the semaphore is released. The semaphore can only be released by the CPU or task that acquired the semaphore. If another CPU attempts to acquire a semaphore when a CPU acquires the semaphore, a wait state occurs until the semaphore is released. When the semaphore is released, any CPU waiting for the semaphore to be released can acquire the semaphore.The semaphore among multiple cores is implemented by hardware such that multiple CPUs cannot acquire the semaphore at the same time.

[0005] Furthermore, in vehicle system development, each time a new vehicle model is developed, a new function is added or the performance of the multi-core microcomputer installed on the ECU changes, and the allocation of CPUs executing the software may need to be changed. Since the effort required to modify the software when the CPU allocation changes, the number of processes increases to reuse development resources.

[0006] In the following PTL 1, data in a shared memory that is updated and referenced by both arithmetic units is multiplexed, and the data to be referenced and the data to be updated are switched via multiple pointers. If a new value is newly written to a free memory, the pointer indicating the data to be referenced is updated. When pointer updating or referencing is performed in this way, a data conflict occurs between the arithmetic units, and therefore exclusive control is used. When reference processing is performed, a pointer to be referenced is newly created to reference the multiplexed data. Therefore, it is possible to access the shared data without considering the executing CPU.

[0007] NPL 1 concerns a so-called “lazy release consistency” algorithm for a distributed system for implementing release consistency, which transmits changes in shared data stores to distributed processors only when necessary. Citation listPatent literature

[0008] PTL 1: JP-A-2009-110063 Non-patent literature

[0009] NPL 1: Keleher, P. et al.: Lazy Release Consistency for Software Distributed Shared Memory, ACM SIGARCH Computer Architecture News, vol. 20, 1992. pp. 13-21 Summary of the inventionTechnical problem

[0010] In the above PTL 1, an exclusive control is used to update or reference the pointer. Since all CPUs access this pointer, the exclusive control generates a wait time in the other CPUs, and there is a problem that this wait time cannot be tolerated in high-speed control, such as engine control, which requires strict real-time characteristics. In particular, if the switching of a task currently being executed (hereinafter, preemption) occurs during exclusive control and the task is temporarily suspended, the wait time of the other CPUs increases and may cause a significant delay. Although there is a method for interruption prevention so that preemption does not occur if the amount of shared data is large, increasing the interruption prevention largely affects the processing by the other CPUs.Therefore, this method cannot be used frequently.

[0011] In order to solve the above problems, it is an object of the invention to provide a technique for accessing shared data without any waiting time due to exclusive control in a multi-core microcomputer equipped with a shared memory. Problem solving

[0012] The above problems are solved by the subject matter of the independent claims. Preferred embodiments are described in the dependent claims.

[0013] In particular, a control device for a vehicle according to the invention includes a plurality of computing units and a shared memory in which shared data, which is jointly accessed by the plurality of computing units, is redundantly stored. The shared memory includes a program area and a data area. The data area includes a plurality of data buffers in which the shared data is redundantly stored and which correspond to each of the plurality of computing units.The program area includes: a data update processing unit for one arithmetic unit among the plurality of arithmetic units, for updating a data buffer corresponding to the one arithmetic unit, storing new shared data, and reporting the update of the shared data to another control device of the plurality of arithmetic units; a data synchronization unit for the another arithmetic unit, for copying the shared data in the data buffer corresponding to the one arithmetic unit to the data buffer corresponding to the another arithmetic unit after the report; and a data reference processing unit for the another arithmetic unit, for referencing the data buffer corresponding to the another arithmetic unit. Advantageous effect of the invention

[0014] In the control device for a vehicle according to the invention, since the control device for the vehicle references and updates data for each CPU while guaranteeing the consistency of the data by synchronization processing, it is possible to access the data without delay due to the exclusive control. Brief description of the drawings [ Fig. 1] Fig. 1 is a configuration view of an engine control ECU according to Embodiment 2. [ Fig. 2] Fig. Figure 2 is an example update type table for CPU 1. [ Fig. 3] Fig. Figure 3 is an example update type table for CPU 2. [ Fig. 4] Fig. 4 is an example of an engine speed for CPU 1. [ Fig. 5] Fig. 5 is an example of an engine speed for CPU 2. [ Fig. 6] Fig. 6 is an operation flow of an engine speed calculation unit. [ Fig. 7] Fig. 7 is an operation flow of a data update processing unit according to Embodiment 1. [ Fig. 8] Fig. 8 is an operation flow of a discrimination unit for the executive core. [ Fig. 9] Fig. 9 is an operation flow of a data synchronization unit. [ Fig. 10] Fig. 10 is an operation flow of a fuel injection control unit. [ Fig. 11] Fig. 11 is an operation flow of a data referencing processing unit. [ Fig. 12] Fig. 12 is a configuration view of an engine control ECU according to Embodiment 2. [ Fig. 13] Fig. 13 is an example of a switch for the latest value for CPU 1. [ Fig. 14] Fig. 14 is an example of a switch for the latest value for CPU 2. [ Fig. 15] Fig. 15 is an example of a switch for the latest value for CPU 3. [ Fig. 16] Fig. 16 is an example of an engine speed A. [ Fig. 17] Fig. 17 is an example of an engine speed B. [ Fig. 18] Fig. 18 is an example of an error counter. [ Fig. 19] Fig. 19 is an operation flow of a data update processing unit according to Embodiment 2. [ Fig. 20] Fig. 20 is an operation flow of a data referencing processing unit according to Embodiment 2. [ Fig. 21] Fig. 21 is an operation flow of an engine speed diagnosis processing unit. Description of the embodiments

[0015] In a vehicle control device according to the invention, data accessed by both of multiple arithmetic units is multiplexed, and target data to be accessed is switched according to the CPU where an application is executed, thus preventing the occurrence of data access conflicts between applications. Furthermore, synchronization processing is performed to coincide values ​​of multiplexed data, thereby ensuring data consistency. Embodiments of the invention will be described below using the drawings. Embodiment 1

[0016] Fig. 1 is a configuration view of an engine control ECU 1 of a vehicle system according to Embodiment 1 of the invention. The engine control ECU 1 includes a computing unit 101 (CPU 1), a computing unit 102 (CPU 2), a shared memory 103, and an input / output circuit 116. The shared memory 103 may be, for example, a dual-port RAM, a high-speed access SDRAM, or the like. Furthermore, input signals from various sensors such as a crank angle sensor 117 and an air intake sensor of the engine (not shown) are input to the engine control ECU 1, which then controls an actuator of an injector 118 or the like to inject fuel into the engine.The shared memory 103 includes a program area 104 relating to the control processing of the actuator of the injector 108 or the like, and a data storage area 111 for storing data necessary for the control in a duplicated redundant manner.The program area 104 includes an engine speed calculation unit 105 for calculating the engine speed from the crank angle sensor, a fuel injection control unit 106 for calculating the period and timing of fuel injection into the engine, a data update processing unit 107 for storing engine speed data or the like into the data storage area 111, a data referencing processing unit 108 for acquiring the engine speed data or the like from the data storage area 111, a data synchronization unit 109 for synchronizing the data made redundant between a plurality of CPUs, and an executing core discrimination unit 110 for discriminating the CPU that executes data update processing or data referencing processing.The data storage area 111 stores an update type table for the CPU 1 112, which is updated with reference to . Fig. 2 described later, an update type table for the CPU 2 113 of Fig. 3, an engine speed for the CPU 1 114 of Fig. 4 and an engine speed for the CPU 2 115 of Fig. 5. Although two arithmetic units, two update type tables, and two engine speeds are used in Embodiment 1 for convenience of explanation, these are not limiting. For example, three arithmetic units, three update type tables, and three engine speeds may be used, or four arithmetic units, four update type tables, and four engine speeds may be used.

[0017] Fig. 2 is an example of the update type table for CPU 1 112. This table shows a data ID 1120 that identifies the data type, an update flag 1121 that indicates the presence / absence of data update, and a number of the CPU on which the data indicated by the data ID is updated. Although the update type table for CPU 1 is used in Embodiment 1 for convenience of explanation, this is not limiting. For example, the configuration of the table may be various, and it does not need to be implemented as a table. The update type table for CPU 1112 shows data with which the arithmetic unit 101 should be synchronized.

[0018] Fig. 3 is an example of the update type table for CPU 2 113. The entries in this table are similar to the update type table for CPU 1 112. Although the update type table for CPU 2 is used in Embodiment 1 for convenience of explanation, this is not limiting. For example, the configuration of the table may be different, and it does not need to be implemented as a table. The table does not need to coincide with the update type table for CPU 1. The update type table for CPU 2 113 shows data with which the arithmetic unit 102 should be synchronized.

[0019] Fig. 4 is an example of an engine speed variable for CPU 1 114. An engine speed for CPU 1 1140 stores the engine speed. Although the engine speed for CPU 1 1140 is used in Embodiment 1 for convenience of explanation, this is not limiting. For example, the data may be implemented as a structure that is an aggregate of multiple data, rather than a single variable.

[0020] Fig. 5 is an example of an engine speed variable for CPU 2 115. An engine speed for CPU 2 1150 stores the engine speed. Although the engine speed for CPU 1 1150 is used in Embodiment 1 for convenience of explanation, this is not limiting. For example, the data may be implemented as a structure that is an aggregate of multiple data instead of a single variable, and the implementation method may not be the same as the engine speed for CPU 1 114.

[0021] The following describes a flow in which the engine control ECU 1, which includes multiple arithmetic units, calculates the engine speed and executes fuel injection. In Embodiment 1, it is assumed that the arithmetic unit 101 (CPU 1) is always assigned to execute the engine speed calculation unit 105, the arithmetic unit 102 (CPU 2) is always assigned to execute the fuel injection control unit 106, and the data update processing unit 107, the data reference processing unit 108, the data synchronization unit 109, and the execution core discrimination unit 110 can be executed by either arithmetic unit. However, this is not limiting. Fig. 6 is an operation flow of an engine speed calculation unit 105. Hereinafter, each step in Fig. 6 described. (FIG. 6: Step 105000)

[0022] The engine speed calculation unit 105 calculates the engine speed based on the crank angle sensor 117. (FIG. 6: Step 105001)

[0023] The engine speed calculation unit 105 calls the data update processing unit 107 using the calculated engine speed as an argument and stores the engine speed in the shared memory 103.

[0024] In this way, the engine speed is calculated, and the engine speed is stored in the shared memory.

[0025] Fig. 7 is an operation flow of the data update processing unit 107. Hereinafter, each step in Fig. 7 described. (FIG. 7: Step 107000)

[0026] The data update processing unit 107 calls the executing core discrimination unit 110 and acquires the number of the CPU that executes the data update processing unit 107. (FIG. 7: Step 107001)

[0027] The data update processing unit 107 proceeds to step 107002 if the acquired CPU number is 1, and proceeds to step 107003 if the CPU number is not 1, for example, when the CPU number is 2. (FIG. 7: Step 107002)

[0028] The data update processing unit 107 stores the engine speed of the argument in the engine speed for the CPU 1 114 in the shared memory. The two arithmetic units in Embodiment 1 can update the memory processing to the engine speed for the CPU 1 114 by an instruction from the arithmetic unit 1 and therefore do not execute intra-core exclusive control. Intra-core exclusive control refers to exclusive control that prevents data conflict within the same CPU, such as OSEK OS resources defined by OSEK / VDX. Even if the instruction from the arithmetic unit 1 does not enable the update, in the case of a system in which preemption is defined not to occur during the execution of step 107002, intra-core exclusive control also does not need to be executed.Although a single variable, i.e., the engine speed for CPU 1114, is updated in Embodiment 1 for convenience of explanation, this is not limiting. For example, two or more variables may be updated. At this time, in a case where preemption is defined not to occur during the execution of step 107002, intra-core exclusive control does not need to be executed. However, if preemption does occur, intra-core exclusive control must be executed. In addition, if a multi-core OS having timing in the TDMA format is used, data update processing and data reference processing corresponding to the same data type cannot be scheduled simultaneously. Therefore, this technique can be easily applied. (FIG. 7: Step 107003)

[0029] The data update processing unit 107 stores the engine speed of the argument into the engine speed for the CPU 2 115 in the shared memory 103. The two arithmetic units in Embodiment 1 can update the memory processing into the engine speed for the CPU 2 115 by a command from the arithmetic unit 1, and therefore do not perform intra-core exclusive control. Although the single variable, that is, the engine speed for the CPU 2 115, is updated in Embodiment 1 for the convenience of explanation, this is not limiting, as in step 107002. (FIG. 7: Step 107004)

[0030] The data update processing unit 107 searches for a character string equal to the data ID indicating the engine speed from the data ID in the update type table, and updates a target update flag and an update core to notify the other computing unit of the engine speed update for CPU 1 114. In Embodiment 1, CPU 1 is assigned to update the engine speed data, and CPU 2 is assigned to reference the engine speed data, and therefore, the update type table to be updated is only the update type table for CPU 2. In Embodiment 1, when the update flag is 0, it indicates that the data is not updated, and when the update flag is 1, it indicates that the data is updated. However, this is not limited to binary data and can be any variable.In addition, although the CPU number is stored in the update core in Embodiment 1, this is not restrictive as long as the computing unit can be identified. (FIG. 7: Step 107005)

[0031] The data update processing unit 107 inputs an interrupt signal to the other CPU, that is, the arithmetic unit 102 in this embodiment, and terminates the processing.

[0032] In this way, the engine speed is stored in the shared memory according to the CPU number, then the update type table is updated, and an interrupt signal is input to the other CPU. Thus, the other CPU can reference the latest value of the updated engine speed without having to wait. Note that this interrupt signal can be set as the highest priority, for example.

[0033] Fig. Fig. 8 is an operation flow of the executive core discrimination unit 110. Each step in Fig. 8 described. (FIG. 8: 110000)

[0034] The executing core discrimination unit 110 accesses a hardware register that designates the executing core, and thus determines and acquires its own CPU number. Although the CPU number is determined via the hardware register in Embodiment 1 for convenience of explanation, this is not limiting. (FIG. 8: 110001)

[0035] The executing core discrimination unit 110 returns the detected CPU number.

[0036] In this way, the CPU number of the computing unit that executes the discriminating unit for the executing core can be captured.

[0037] Fig. 9 is an operation flow of the data synchronization unit 109. Below, each step in Fig. 9 described. (FIG. 9: 109000)

[0038] The data synchronization unit 109 calls the executing core discrimination processing unit 110 and acquires the CPU number that executes the data update processing unit 107. (FIG. 9: 109001)

[0039] The data synchronization unit 109 proceeds to step 109002 if the detected CPU number is 1, and proceeds to step 109003 if the CPU number is not 1, for example, when the CPU number is 2. (FIG. 9: 109002)

[0040] The data synchronization unit 109 references the update type table for the CPU 1 112 in the shared memory 103.

[0041] In Embodiment 1, since it is triggered by the highest priority interrupt signal, data conflicts do not occur unless data update processing is executed again in a very short time. Therefore, exclusive control is not used. However, the triggering method is not limited to this. For example, in the case of a system in which the data reference processing unit is executed before the next data update processing unit is executed, and in which the data synchronization unit is called after the data update processing unit is executed and before the data referencing processing unit is executed, exclusive control also does not need to be used.Furthermore, even without the highest priority interrupt signal, exclusive control does not need to be used if the data synchronization unit can be triggered before the next update processing is executed. Note that the data update processing unit and the data referencing processing unit are executed in the same cycle, or the data update processing unit is executed in a shorter cycle than the data referencing processing unit. (FIG. 9: 109003)

[0042] The data synchronization unit 109 references the update type table for CPU 2 114 in the shared memory 103. As in step 109002, exclusive control is not used. Furthermore, the triggering method is not limited to this. (FIG. 9: 109004)

[0043] If a type having an update flag of 1 is present in the referenced update type table, that is, if a character string indicating an update is present, the data synchronization unit 109 proceeds to step 109005. If no character string indicating an update is present, the data synchronization unit 109 ends the processing. Although the update of data with an update flag is reported in Embodiment 1, this is not limiting. For example, the interrupt signal itself may be created to indicate that data is being updated, or a dedicated data synchronization unit may be implemented for all updated data. (FIG. 9: 109005)

[0044] The data synchronization unit 109 references the update core of the type having the update flag 1 in the update type table and identifies the update CPU. As a result, the data synchronization unit 109 learns the data of the latest value and copies the target data value to its own area. In Embodiment 1, since the update core is 1, as shown in Fig. 3, the value of the engine speed for CPU 1 114 is copied to the engine speed for CPU 2 115. (FIG. 9: 109006)

[0045] The data synchronization unit 109 resets the update flag in its own update type table corresponding to the copied data to 0 and proceeds to step 109004.

[0046] In this way, the data values ​​for each core can be made coincident without using exclusive control between cores.

[0047] Fig. 10 is an operation flow of the fuel injection control unit 106. Hereinafter, each step in Fig. 10 described. (FIG. 10: 106000)

[0048] The fuel injection control unit 106 calls the data referencing processing unit and records the engine speed in the shared memory. (FIG. 10: 106001)

[0049] The fuel injection control unit 106 calculates the amount of fuel injection based on the detected engine speed and causes the injection unit to inject the fuel.

[0050] In this way, the engine speed is detected from the shared memory and the injection unit is controlled.

[0051] Fig. 11 is an operation flow of the data referencing processing unit 108. Hereinafter, each step in Fig. 11 described. (FIG. 11: 108000)

[0052] The data reference processing unit 108 calls the executing core discrimination processing unit 110 and acquires the CPU number that executes the data update processing unit 107. (FIG. 11: 108001)

[0053] The data reference processing unit 108 proceeds to step 108002 if the detected CPU number is 1, and proceeds to step 108003 if the CPU number is not 1, for example, when the CPU number is 2. (FIG. 11: 108002)

[0054] The data referencing processing unit 108 acquires the engine speed from the engine speed for the CPU 1 114 in the shared memory 103. The two arithmetic units in Embodiment 1 can update the acquisition processing from the engine speed for the CPU 1 114 by a command from the arithmetic unit 1, and therefore do not execute in-core exclusive control. Even if the command from the arithmetic unit 1 does not enable the update, in the case of a system in which preemption is defined not to occur during the execution of step 107802, in-core exclusive control also does not need to be executed. Although the single variable, that is, the engine speed for the CPU 1 114, is updated in Embodiment 1 for the convenience of explanation, this is not limiting. For example, two or more variables may be updated.At this time, in a system where preemption is defined to not occur during the execution of step 108002, in-core exclusive control need not be executed. However, if preemption does occur, in-core exclusive control must be executed. (FIG. 11: 108003)

[0055] The data reference processing unit 108 acquires the engine speed from the engine speed for the CPU 2 115 in the shared memory 103. The two arithmetic units in Embodiment 1 can update the memory processing to the engine speed for the CPU 2 115 by a command from the arithmetic unit 1, and therefore do not perform intra-core exclusive control. Although the single variable, that is, the engine speed for the CPU 2 115, is updated in Embodiment 1 for the convenience of explanation, this is not limiting, as in step 108002. (FIG. 11: 108004)

[0056] The data referencing processing unit 108 returns the detected engine speed and ends the processing.

[0057] In this way, the engine speed can be detected from the shared memory.

[0058] Although the update type table is used to report the updated data in Embodiment 1, this is not limiting. For example, the interrupt signal itself may be designed to indicate that data is being updated, or a dedicated data synchronization unit may be implemented for all updated data.

[0059] Furthermore, although in Embodiment 1, the data synchronization unit is triggered by the interrupt signal, this is not limiting. For example, a task for triggering the data synchronization unit and the data update processing unit may be implemented in this order.

[0060] Furthermore, although the execution core discrimination unit is executed by the data update processing unit and the data reference processing unit in Embodiment 1, this is not limiting. For example, in a system where the arithmetic unit that executes the engine speed calculation unit and the fuel injection control unit is not changed during execution, only one execution is sufficient in the initial execution.

[0061] In this way, according to this Embodiment 1, since it is possible to update and reference data by using the shared memory without using exclusive control, the technique is suitable for a vehicle system in which data needs to be communicated at high speed between multiple arithmetic units such as the engine controller. For example, in the engine controller, the arithmetic operation necessary for injection control is executed synchronously with engine speed. Since the arithmetic cycle becomes shorter as the engine rotates at a higher speed, it is preferable to operate as in this Embodiment 1, which can eliminate exclusive control.

[0062] Furthermore, according to this embodiment 1, since the data synchronization unit is triggered by the highest priority interrupt signal, it is easier to trigger the data synchronization unit before the data update processing unit is executed next time, and it is possible to limit the number of development processes in development. This technique is suitable for a vehicle system in which the data update processing unit is triggered at a constant interval.

[0063] Furthermore, according to this embodiment 1, in applications such as the engine speed calculation processing unit and the fuel injection control unit, by using the data update processing unit and the data referencing processing unit, data can be updated or referenced without considering which processing unit is executing the application. Therefore, even if the executing processing unit is changed at the time of developing a new vehicle model, it is sufficient to change only a small number of sections, and therefore the number of software development processes can be reduced. Embodiment 2

[0064] Embodiment 2 is an example in which three arithmetic units are provided, and in which data not used for arithmetic operations in the control arithmetic operation of an engine speed calculation unit and the control arithmetic operation of a fuel injection control unit are synchronized by a data synchronization unit. Although an example using three arithmetic units is described in this embodiment, this embodiment can be applied as long as there are multiple arithmetic units.

[0065] Fig. 12 is a configuration view of an engine control ECU 2 of a vehicle system according to Embodiment 2 of the invention. The engine control ECU includes a computing unit 201 (CPU 1), a computing unit 202 (CPU 2), a computing unit 203 (CPU 3), a memory, an input / output circuit 223, a crank angle sensor 224, and an injection unit 225.

[0066] The memory 204 has a program area 205 and a data storage area 213. The program area 205 has an engine speed calculation unit 206, a fuel injection control unit 207, an engine speed diagnosis unit 208, a data update processing unit 209, a data referencing processing unit 210, a data synchronization unit 211, and an executive core discrimination unit 212. The data storage area 213 has a CPU 1 latest value switch 214, which is configured with reference to Fig. 13 later, a switch for the latest value for CPU 2 215 of Fig. 4, a switch for the latest value for the CPU 3 216 of Fig. 15, an update type table for the CPU 1 217 similar to Embodiment 1, an update type table for the CPU 2 218, an update type table for the CPU 2 219. an engine speed A 220 of Fig. 16, an engine speed B 221 of Fig. 17 and an error counter 222 of Fig. 18 on.

[0067] Fig. 13 is an example of the latest value switch for CPU 1 214. If the value of the latest value switch for CPU 1 2140 is 0, it indicates that the latest value of the engine speed is stored in the engine speed A 220. If the value is 1, it indicates that the latest value is stored in the engine speed B 221. The value of the latest value switch for CPU 1 2140 is updated when the arithmetic unit 201 executes the data update processing unit or the data synchronization unit.

[0068] Fig. 14 is an example of the latest value switch for CPU 2 215. If the value of the latest value switch for CPU 2 2150 is 0, it indicates that the latest value of the engine speed is stored in the engine speed A 220. If the value is 1, it indicates that the latest value is stored in the engine speed B 221. The value of the latest value switch for CPU 2 2150 is updated when the arithmetic unit 202 executes the data update processing unit or the data synchronization unit.

[0069] Fig. 15 is an example of the latest value switch for CPU 3 216. If the value of the latest value switch for CPU 3 2160 is 0, it indicates that the latest value of the engine speed is stored in the engine speed A 220. If the value is 1, it indicates that the latest value is stored in the engine speed B 221. The value of the latest value switch for CPU 3 2160 is updated when the arithmetic unit 203 executes the data update processing unit or the data synchronization unit.

[0070] It should be noted that the latest value switch for CPU 1 214, the latest value switch for CPU 2 215, and the latest value switch for CPU 3 216 may not only be implemented in areas within the memory 204, but may also be implemented by hardware outside the memory 204.

[0071] Fig. 16 is an example of the engine speed A 220. Fig. 17 is an example of the engine speed B 221. The engine speed A 220 or the engine speed B 221 always has the latest value stored therein and is therefore a target to be referenced, while the other, in which the latest value is not stored, is the target to be updated. In the target to be updated, the latest value should be stored by the next update. That is, one of them alternately has the latest value, and the switch for the latest value specifies the latest value. However, this is not limiting. For example, a buffer for the engine speed of the latest value and a buffer for the engine speed of the next update target can be specified using pointers instead of using switches.However, since the pointers are logical values ​​that indicate the position of the memory and register, an anomaly may occur that indicates an incorrect position. In this embodiment, since switches are used instead of pointers, reliability can be improved.

[0072] Fig. 18 is an example of the error counter 222. The value of an error counter 2220 is a value that is incremented when the engine speed diagnosis unit determines that the value of the engine speed is abnormal.

[0073] Hereinafter, a procedure in which the engine control ECU 2 having a plurality of arithmetic units calculates the engine speed and executes fuel injection will be described mainly in terms of differences from Embodiment 1.

[0074] The engine speed calculation unit 206 performs an operation similar to the operation of the engine speed calculation unit 105 shown in Fig. 6. The fuel injection control unit 207 performs an operation similar to the operation of the fuel injection control unit 106 shown in Fig. 10. The data synchronization unit 211 performs an operation so that the Fig. The operation of the data synchronization unit 109 shown in Figure 9 is expanded so that it can be executed by the three CPUs. The data synchronization unit determines whether the latest value switch for each CPU is updated or not by referencing the update type table for each CPU, and copies the value of the updated latest value switch to its own latest value switch. When the arithmetic unit 201 updates the latest value switch for CPU 1 214 and inputs an interrupt signal, the data synchronization unit 211 executed by the arithmetic unit 202 copies the value of the latest value switch for CPU 1 214 to the latest value switch for CPU 2 215, and the data synchronization unit 211 executed by the arithmetic unit 203 copies the value of the latest value switch for CPU 1 214 to the latest value switch for CPU 3 216.The executive core discrimination unit 212 performs an operation similar to the operation of the executive core discrimination unit 110 shown in FIG. Fig. 8 is shown.

[0075] Fig. 19 is an operation flow of the data update processing unit 209. Hereinafter, each step in Fig. 19 described. (FIG. 19: Step 209000)

[0076] The data update processing unit 209 calls the executing core discrimination unit 212 and acquires the CPU number that the data update processing unit 209 is executing. (FIG. 19: Step 209001)

[0077] The data update processing unit 209 proceeds to step 209002 if the acquired CPU number is 1, and proceeds to step 209003 if the CPU number is not 1, for example, when the CPU number is 2 or 3. (FIG. 19: Step 209002)

[0078] The data update processing unit 209 acquires the value of the latest value switch for the CPU 1 214. (FIG. 19: Step 209003)

[0079] The data update processing unit 209 proceeds to step 209004 if the acquired CPU number is 2, and proceeds to step 209005 if the CPU number is not 2, for example, when the CPU number is 3. (FIG. 19: Step 209004)

[0080] The data update processing unit 209 acquires the value of the latest value switch for the CPU 2 214. (FIG. 19: Step 209005)

[0081] The data update processing unit 209 acquires the value of the latest value switch for the CPU 3 216. (FIG. 19: Step 209006)

[0082] The data update processing unit 209 stores the engine speed in the engine speed buffer according to the value of the switch. For example, if the value of the switch is 0, the engine speed that is the most recent value is stored in the engine speed B 221. (FIG. 19: Step 209007)

[0083] The data update processing unit 219 updates the value of its own switch. For example, if the arithmetic unit 201 updates the engine speed B 221, the value of the switch for the latest value for CPU 1 214 is updated to 1. (FIG. 19: Step 209008)

[0084] The data update processing unit 219 updates the update flags and updates the cores of the data ID in the other update type tables. For example, if the value of the latest value switch for CPU 1 214 is updated, the update flags and update CPUs in the update type table for CPU 2 218 and the update type table for CPU 3 219 corresponding to the data ID indicating the latest value switch for CPU 1 of the engine speed are updated. (FIG. 19: Step 209009)

[0085] The data update processing unit 209 inputs an interrupt signal to the other CPUs. In Embodiment 2, the interrupt signal is input to notify the update to the other CPUs. However, this method is not limiting.

[0086] In this way, the engine speed can be updated in the shared memory.

[0087] Fig. 20 is an operation flow of the data referencing processing unit 210. Hereinafter, each step in Fig. 20 described. (FIG. 20: Step 210000)

[0088] The data reference processing unit 210 calls the executing core discrimination unit 212 and acquires the CPU number that the data reference processing unit 210 is executing. (FIG. 20: Step 210001)

[0089] The data reference processing unit 209 proceeds to step 210002 if the detected CPU number is 1, and proceeds to step 210003 if the CPU number is not 1, for example, when the CPU number is 2. (FIG. 20: Step 210002)

[0090] The data reference processing unit 210 acquires the value of the switch for the latest value for the CPU 1 214. (FIG. 20: Step 210003)

[0091] The data reference processing unit 210 proceeds to step 210004 if the detected CPU number is 2, and proceeds to step 210005 if the CPU number is not 2, for example, when the CPU number is 3. (FIG. 20: Step 210004)

[0092] The data reference processing unit 210 acquires the value of the switch for the latest value for the CPU 2 215. (FIG. 20: Step 210005)

[0093] The data reference processing unit 210 acquires the value of the switch for the latest value for the CPU 3 216. (FIG. 20: Step 210006)

[0094] The data referencing processing unit 210 reads the engine speed from the engine speed buffer according to the value of the switch. For example, if the value of the switch is 1, the engine speed, which is the most recent value, is acquired from the engine speed B 221.

[0095] In this way, the engine speed can be recorded in the shared memory.

[0096] Fig. 21 is an operation flow of the engine speed diagnosis unit 208. Below, each step in Fig. 21 described. (FIG. 21: Step 208000)

[0097] The engine speed diagnosis unit 208 calls the data referencing processing unit 210 and acquires the engine speed stored in the shared memory. (FIG. 21: Step 208001)

[0098] The engine speed diagnosis unit 208 proceeds to step 208002 if the engine speed value is outside a normal value range to determine whether the engine speed value is within a normal value range, and ends the processing if the value is within the normal value range. However, the method for determining abnormality is not limited to this. (FIG. 21: Step 208002)

[0099] The engine speed diagnostic unit 208 increments the value of the error counter 222. For example, 1 is added to the value of the error counter 222. However, this is not limiting.

[0100] In Embodiment 2, data is multiplexed. When referencing data, a value is read from the data specified by the latest value switch. When updating data, a value is written to the data not specified by the latest value switch. The CPU updating the data reports the data update to other CPUs without any delay after the data update. In response, the CPU referencing the data can reference the latest value without any delay. Note that although switches are used in this embodiment, this is not limiting. For example, a pointer indicating the latest value and a pointer indicating an update destination can be used for implementation. However, using switches instead of pointers can further improve reliability.

[0101] In this way, according to Embodiment 2, it is possible to update or reference data using shared memory without using exclusive control, even when there are three or more computing units. Therefore, the technique is suitable for a vehicle system in which data needs to be communicated at high speed between multiple computing units, such as in an engine control system. List of reference symbols 1 Engine control ECU 101, 102 arithmetic unit 103 shared memory 104 Program area 105 Engine speed calculation unit 106 Fuel injection control unit 107 Data update processing unit 108 Data referencing processing unit 109 Data synchronization unit 111 Data storage area 112 CPU 1 update type table 113 CPU 2 update type table 114 Engine speed for CPU 1 115 Engine speed for CPU 2

Claims

[1] A control device for a vehicle comprising a plurality of computing units (101, 102) and a shared memory (103) in which shared data, which are jointly accessed by the plurality of computing units (101, 102), are redundantly stored, wherein the control device characterized by is that the shared memory (103) has a program area (104) and a data area (111), the data area (111) has a plurality of data buffers corresponding to the plurality of computing units (101, 102), in which the jointly used data are stored redundantly, the program area contains: a data update processing unit (107) for one arithmetic unit (101, 102) of the plurality of arithmetic units (101, 102) to update a data buffer of the one arithmetic unit (101, 102), store new shared data, and report the update of the shared data to another arithmetic unit (101, 102) among the plurality of arithmetic units (101, 102); a data synchronization unit (109) for the further computing unit (101, 102) to copy the jointly used data in the data buffer of one computing unit (101, 102) into the data buffer of the further computing unit (101, 102) according to the report; and a data referencing processing unit (108) for the further computing unit (101, 102) to reference the data buffer of the further computing unit; an engine speed calculation unit (105) that detects an engine speed (114, 115) of the vehicle as shared data based on a crank angle sensor signal, transfers the detected engine speed (114, 115) to the data update processing unit (107), which stores the detected engine speed (114, 115) in the data buffer of the computing unit (101, 102) that executes the data update processing unit (107), and reports the updated engine speed (114, 115) to the further computing unit (101, 102). [2] A control device for a vehicle comprising a plurality of computing units (101, 102) and a shared memory (103) in which shared data, which are jointly accessed by the plurality of computing units (101, 102), are redundantly stored, wherein the control device characterized by is that the shared memory (103) has a program area (104) and a data area (111), the data area (111) several data buffers in which the shared data is stored redundantly, and a plurality of latest value switches provided respectively for each of the plurality of arithmetic units (101, 102) and indicating a data buffer that is updated last among the plurality of data buffers, where the program area (104) contains: a data update processing unit (107) for one arithmetic unit (101, 102) among the plurality of arithmetic units (101, 102) to update a data buffer among the plurality of data buffers based on the latest value switch corresponding to the one arithmetic unit (101, 102), store new shared data, and report the update of the shared data to another arithmetic unit (101, 102) among the plurality of arithmetic units (101, 102); a data synchronization unit (109) for copying the value of the latest value switch corresponding to the one arithmetic unit (101, 102) into the latest value switch corresponding to the other arithmetic unit (101, 102) according to the report; a data referencing processing unit (108) for the further arithmetic unit (101, 102) to reference a data buffer among the plurality of data buffers based on the latest value switch corresponding to the further arithmetic unit (101, 102); an engine speed calculation unit (105) that detects an engine speed (114, 115) of the vehicle as shared data based on a crank angle sensor signal, transfers the detected engine speed (114, 115) to the data update processing unit (107), which stores the detected engine speed (114, 115) in the data buffer of the computing unit (101, 102) that executes the data update processing unit (107), and reports the updated engine speed (114, 115) to the further computing unit (101, 102). [3] Control device for a vehicle according to claim 1 or 2, characterized byin that the data area (111) contains information about types of the plurality of data buffers, presence / absence of change and an identifier of the changed arithmetic unit (101, 102) and has an update type table (112, 113) multiplexed into a number equal to or greater than a number of the plurality of arithmetic units (101, 102). [4] Control device for a vehicle according to claim 1 or 2, characterized by that the shared data is a control value necessary to control on-board equipment. [5] Control device for a vehicle according to claim 4, characterized by that the shared data stores information that can specify a data buffer in which a control value can be stored. [6] Control device for a vehicle according to claim 1 or 2, characterized byin that it comprises a discrimination unit (110) for a core which identifies a computing unit (101, 102) which carries out the processing and which returns an identifier of the computing unit (101, 102). [7] Control device for a vehicle according to claim 6, characterized by that the data update processing unit (107) switches the data buffer, which is a destination where data is to be updated, according to the identifier of the arithmetic unit (101, 102) obtained by the discrimination unit (110) for the core, and the data referencing processing unit (108) switches the data buffer, which is a destination where shared data is to be referenced, according to the identifier of the arithmetic unit (101, 102) obtained by the discrimination unit (110) for the core. [8] Control device for a vehicle according to claim 3, characterized bythat the data update processing unit (107) changes an update type table (112, 113) containing a type of the shared data, presence / absence of an update of shared data, and an identifier indicating the one arithmetic unit (101, 102), and thereby executes the report. [9] Control device for a vehicle according to claim 1 or 2, characterized by that the report contains an interrupt signal for the further computing unit (101, 102). [10] Control device for a vehicle according to claim 1 or 2, characterized by that the execution of the data update processing unit (107) is completed in a shorter time than a time during which the data update processing unit (107) is executed once, and the update processing unit (107) that updates the same shared data is executed next. [11] Control device for a vehicle according to claim 8, characterized by that the data synchronization unit (109) specifies the type of the updated shared data based on the type of the update type table (112, 113), determines whether copying is required or not based on the presence / absence of change in the update type table (112, 113), and specifies the data buffer to be a source for copying based on the identifier of the update type table (112, 113), and the own arithmetic unit (101, 102) copies the value of the data buffer that is specified into the data buffer. [12] Control device for a vehicle according to claim 1 or 2, characterized bythat an executing computing unit (101, 102) among the plurality of computing units (101, 102) is predetermined for the data update processing unit (107), the data synchronization unit (109) and the data referencing processing unit (108).

Citation Information

Patent Citations

  • Storage, information processor, data access method, and program

    JP2009110063A