Electronic control device, test device for electronic control device, and test method for electronic control device
By using communication direction transformation to generate communication request data in the test device of the ECU, the problem of the working time of the test device generation in the prior art is solved, and the generation time of the test device is shortened.
Patent Information
- Application Number
- CN202210215643.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2021-03-12
- Filing Date
- 2022-03-07
- Publication Date
- 2025-06-17
- Estimated Expiration
- 2042-03-07
AI Technical Summary
The prior art is difficult to automatically generate the test device program, resulting in a long working time for the communication test device of the ECU.
In the communication between the electronic control device and the test device, communication request data is generated by generating communication request data without changing the transmission direction and the reception direction, and changing the transmission direction to the reception direction and the reception direction to the transmission direction, the corresponding communication request data processed by the test program is generated.
The generation time of the test device is shortened, and the generation time of automatic test procedures and test processing is reduced.
Smart Images

Figure CN115079665B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to an electronic control device, a test device for an electronic control device, and a test method for an electronic control device. Background Art
[0002] In vehicles such as automobiles, an ECU is used to perform control processes such as motor drive and lighting drive of a light source, or processing control for recognizing the surrounding conditions such as driving assistance and autonomous driving. Here, the ECU generally refers to an electronic control device of an Electronic Control Unit.
[0003] Conventionally, as a means for testing the behavior expected of an ECU, the following method is used: A test device is connected to the communication line of the ECU, and while communicating with the ECU, it is confirmed whether the communication of the ECU is performed as required.
[0004] In recent years, the types and quantities of data transmitted and received by the ECU via the communication line have increased. Therefore, even if the communication of the ECU is manually confirmed to be performed as required, it often cannot be completed within the allowed time. Therefore, the following method is used: A program for automatically performing tests (hereinafter referred to as a test program) is embedded in the test device, and for each data transmitted and received by the ECU, it is sequentially tested whether it is correctly transmitted or received.
[0005] When automating such tests, for a test device for communication data whose quantity is difficult to confirm manually, it is difficult to manually generate such a test device. Therefore, the generation of the program executed by the test device also needs to be automated as much as possible.
[0006] In many cases, the communication requirements of the ECU are databaseized. For each communication frame, at least the frame name, frame identification number (hereinafter referred to as "frame ID"), communication channel for transmitting and receiving the frame, data length of the transmitting and receiving frame, timing (cycle) of the transmitting and receiving frame, position of one or more various data configured in the frame data (byte arrangement), and data length (bits) are determined.
[0007] In many cases, the control software executed by the ECU is developed following the previous design. However, the communication requirements are various, and each time the ECU is developed, the latest specifications are applied. Therefore, the communication requirements of past ECUs are rarely reused.
[0008] Therefore, almost all parts corresponding to the communication requirements are replaced each time the ECU is developed, and the same applies to the test program.
[0009] As an example of the prior art for embedding an automatic test program in a test device of an ECU and reducing the man-hours required for automatic testing, for example, techniques for generating test data, test cases, etc. based on specifications are disclosed in Patent Document 1 and Patent Document 2.
[0010] Prior Art Documents
[0011] Patent Documents
[0012] Patent Document 1: Japanese Patent Application Laid-Open No. 2011-204069
[0013] Patent Document 2: Japanese Patent Application Laid-Open No. 2015-204065 Summary of the Invention
[0014] Technical Problem to be Solved by the Invention
[0015] In the above Patent Document 1 and Patent Document 2, test data and test cases that satisfy the coverage are efficiently generated according to communication specifications, software specifications, etc., but the generation man-hours of the test device and the generation man-hours of the test process are not considered when generating test data. Therefore, there is a problem that the generation of the automatic test program and the test device that executes the automatic test program must be performed manually.
[0016] This application discloses a technology for solving the above problems, and its object is to provide an electronic control device that realizes shortening of the generation time of a test device.
[0017] In addition, an object of this application is to provide a test device for an electronic control device that realizes shortening of the generation time of a test device.
[0018] In addition, an object of this application is also to provide a test method for an electronic control device that realizes shortening of the generation time of a test device.
[0019] Technical Means for Solving the Technical Problem
[0020] The electronic control device disclosed in this application includes:
[0021] At least one CPU that executes a control program composed of at least one processing level; an auxiliary storage device that stores the control program; and a RAM that is configured to be able to store and read the control program data,
[0022] When the electronic control device is configured to perform a test of the behavior of the electronic control device by using communication with a test device that generates request data for communication corresponding to the processing of the test program to be executed by changing the transmission direction of the communication to the reception direction and changing the reception direction of the communication to the transmission direction,
[0023] Generate required data for the communication corresponding to the processing of the executed control program without change in the transmission direction and reception direction of the communication.
[0024] In addition, a test device for an electronic control device disclosed in the present application includes:
[0025] At least one CPU that executes a test program composed of at least one processing level; an auxiliary storage device that stores the test program; and a RAM configured to be able to store and read data of the test program,
[0026] When the test device for the electronic control device is configured to perform a test on the behavior of the electronic control device by using communication with an electronic control device that generates required data for the communication corresponding to the processing of the executed control program without change in the transmission direction and reception direction of the communication,
[0027] Change the transmission direction of the communication to the reception direction and change the reception direction of the communication to the transmission direction to generate the required data for the communication corresponding to the processing of the executed test program.
[0028] In addition, in a test method for an electronic control device disclosed in the present application,
[0029] Perform a test on the behavior of the electronic control device based on communication between the electronic control device and the test device,
[0030] The electronic control device includes: at least one CPU that executes a control program composed of at least one processing level; an auxiliary storage device that stores the control program; and a RAM configured to be able to store and read data of the control program,
[0031] The test device includes: at least one CPU that executes a test program composed of at least one processing level; an auxiliary storage device that stores the test program; and a RAM configured to be able to store and read data of the test program,
[0032] Generate the required data for the communication corresponding to the processing of the executed control program without change in the transmission direction and reception direction of the communication,
[0033] Change the transmission direction of the communication to the reception direction and change the reception direction of the communication to the transmission direction to generate the required data for the communication corresponding to the processing of the executed test program.
[0034] Advantages of the Invention
[0035] An electronic control device according to the present application is provided, which can shorten the generation time of a test device.
[0036] In addition, a test device for an electronic control device according to the present application is provided, which can shorten the generation time of a test device.
[0037] In addition, a test method for an electronic control device according to the present application is provided, which can shorten the generation time of a test device.
[0038] In addition, a test device and a test method according to the present application are provided, which can shorten the generation time of a test device. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] Figure 1 FIG. is a structural diagram showing an electronic control device and a test device according to Embodiment 1.
[0040] Figure 2 FIG. is an explanatory diagram showing the content of variables accessed by the communication part of a control program in an electronic control device according to Embodiment 1.
[0041] Figure 3 FIG. is an explanatory diagram showing the content of the communication part of a control program in an electronic control device according to Embodiment 1.
[0042] Figure 4 FIG. is an explanatory diagram showing main hardware abstraction data referred to by hardware abstraction processing regarding communication in an electronic control device according to Embodiment 1.
[0043] Figure 5 FIG. is a flowchart showing the steps of initialization processing related to communication of hardware abstraction processing in an electronic control device according to Embodiment 1.
[0044] Figure 6 FIG. is a flowchart showing the steps of frame reception processing of hardware abstraction processing in an electronic control device according to Embodiment 1.
[0045] Figure 7 FIG. is a flowchart showing the steps of frame transmission processing of hardware abstraction processing in an electronic control device according to Embodiment 1.
[0046] Figure 8 FIG. is a flowchart showing the steps of frame transmission completion processing of related hardware abstraction processing in an electronic control device according to Embodiment 1.
[0047] Figure 9It is a flowchart showing the steps of the periodic process of the hardware abstraction process in the electronic control device according to Embodiment 1.
[0048] Figure 10 It is an explanatory diagram showing the main communication channel abstraction data referred to in the channel abstraction process in the electronic control device according to Embodiment 1.
[0049] Figure 11 It is a flowchart showing the steps of the initialization process of the channel abstraction process in the electronic control device according to Embodiment 1.
[0050] Figure 12 It is a flowchart showing the steps of the frame reception process of the channel abstraction process in the electronic control device according to Embodiment 1.
[0051] Figure 13 It is a flowchart showing the steps of the frame transmission process of the channel abstraction process in the electronic control device according to Embodiment 1.
[0052] Figure 14 It is a flowchart showing the steps of the frame transmission completion process of the channel abstraction process in the electronic control device according to Embodiment 1.
[0053] Figure 15 It is a flowchart showing the steps of the periodic process of the channel abstraction process in the electronic control device according to Embodiment 1.
[0054] Figure 16 It is a flowchart showing the steps of the frame reception monitoring process of the channel abstraction process in the electronic control device according to Embodiment 1.
[0055] Figure 17 It is a flowchart showing the steps of the frame transmission monitoring process of the channel abstraction process in the electronic control device according to Embodiment 1.
[0056] Figure 18 It is an explanatory diagram showing the content of the data related to the communication of the control process in the electronic control device according to Embodiment 1.
[0057] Figure 19 It is a flowchart showing the steps of the initialization process of the control process in the electronic control device according to Embodiment 1.
[0058] Figure 20 It is a flowchart showing the steps of the data reception process of the control process in the electronic control device according to Embodiment 1.
[0059] Figure 21It is a flowchart showing the steps of data transmission processing in the control processing of the electronic control device according to Embodiment 1.
[0060] Figure 22 It is a flowchart showing the steps of data transmission completion processing in the control processing of the electronic control device according to Embodiment 1.
[0061] Figure 23 It is a flowchart showing the steps of data reception timeout processing in the control processing of the electronic control device according to Embodiment 1.
[0062] Figure 24 It is a flowchart showing the steps of data transmission timeout processing in the control processing of the electronic control device according to Embodiment 1.
[0063] Figure 25 It is a flowchart showing the steps of cycle processing in the control processing of the electronic control device according to Embodiment 1.
[0064] Figure 26 It is a flowchart showing the steps of control-related processing in the control processing of the electronic control device according to Embodiment 1.
[0065] Figure 27 It is an explanatory diagram showing the content of variables accessed by the communication part of the test program in the test device according to Embodiment 1.
[0066] Figure 28 It is an explanatory diagram showing the content of the communication part of the test program in the test device according to Embodiment 1.
[0067] Figure 29 It is a flowchart showing the steps of cycle processing in the test processing of the test device according to Embodiment 1.
[0068] Figure 30 It is a flowchart showing the steps of test-related processing in the test processing of the test device according to Embodiment 1.
[0069] Figure 31 It is a flowchart showing the steps of ECU transmission confirmation processing in the test processing of the test device according to Embodiment 1.
[0070] Figure 32 It is a flowchart showing the steps of test failure processing in the test processing of the test device according to Embodiment 1. Detailed implementation mode
[0071] Hereinafter, the electronic control device, the testing device for the electronic control device, and the testing method for the electronic control device according to Embodiment 1 will be described with reference to the drawings. In all the drawings, the same reference numerals are used to denote the same parts.
[0072] Implementation method 1.
[0073] Figure 1 It is a diagram showing the configuration of the electronic control device and the test device according to the first embodiment, together with the electric motor driven by the electronic control device.
[0074] Figure 1 In the embodiment, the ECU 1 as an electronic control device includes a sensor voltage and digital input circuit 11, a microcomputer 12, and a drive circuit 19. The ECU 1 is configured to control the motor 2. Furthermore, the ECU 1 is communicatively connected to a test device 4 for testing the behavior of the ECU 1 via a communication line 3.
[0075] The microcomputer 12 operates as a control unit inside the ECU 1. In addition, microcomputer is the abbreviation of microcontroller unit (MicroController Unit) or microcomputer (Microcomputer). In addition, the microcomputer 12 is configured to include a CPU 13, a RAM (Random Access Memory) 14, an auxiliary storage device 15, an IO (Input / Output) 16, a communication IF (Interface) 17, and a timer 18. In addition, if the microcomputer 12 has these functions, it can also be a larger-scale SoC (System on a chip) or PC (Personal Computer) or the like.
[0076] The CPU 13 is a control unit that controls the above-mentioned components in the ECU 1. The CPU 13 can execute the following stored in the auxiliary storage device 15. Figure 3 The control program 150 shown in FIG. 1 is a control program 150. In addition, when an interrupt occurs during the execution of the control program 150, the CPU 13 can execute processing corresponding to the interrupt. In addition, the CPU 13 can be composed of a plurality of CPUs as long as the RAM 14, the auxiliary storage device 15, the IO 16, the communication IF 17, and the timer 18 can be accessed. The RAM 14 is a storage unit that can be accessed by the CPU 13 and stores data in a rewritable state.
[0077] The test device 4 according to the first embodiment is communicably connected to the ECU 1 as the electronic control device according to the first embodiment via the communication line 3. The details of the test device 4 will be described later.
[0078] Figure 2 This is an explanatory diagram showing the contents of variables accessed by the communication section of the control program in the electronic control device according to Embodiment 1. Figure 2 The control program variable 140 shown illustrates the contents of the variables in the communication section of the control program 150 related to Embodiment 1 of the present application, that is, in the RAM 14 of the ECU 1, which is stored and updated as described later. Figure 3 The control program variable 140 consists of variables such as a transmission frame table 141, a reception frame table 142, a transmission frame monitoring table 143, a reception frame monitoring table 144, a transmission completion flag table 145, a reception notification flag table 146, a transmission timeout flag table 147, a reception timeout flag table 148, a transmission request flag table 149, a transmission partial data 14A, a reception partial data 14B, a transmission data buffer 14C, and a reception data buffer 14D. The uses of the respective variables will be described in detail together with the description of the control program 150 described later.
[0079] Figure 1 In this case, the auxiliary storage device 15 in the ECU 1 is a storage unit that stores data in a read-only state. Among them, the auxiliary storage device 15 can be a storage device such as an EPROM (Erasable Programmable Read Only Memory), a NOR-type flash memory, or a NAND-type flash memory that can rewrite data by a specific method. When the CPU 13 cannot directly execute the control program 150 stored in the auxiliary storage device 15 using a NAND-type flash memory or the like, the content of the control program 150 can be transferred from the auxiliary storage device 15 to the RAM 14, and the RAM 14 can be used to execute the control program 150. In addition, the content of the control program and data stored in the auxiliary storage device 15 will be described in detail later.
[0080] The IO 16 inputs and outputs digital signals from the sensor voltage and the digital input circuit. Specifically, the IO 16 introduces the voltage read by the sensor voltage and the digital input circuit 11 into the microcomputer 12 and outputs a control signal to the drive circuit 19.
[0081] The communication IF17 is used when communicating with other devices disposed outside the electronic control device 1. In the first embodiment, it is used to communicate with the test device 4 via the communication line 3. Therefore, communication is performed using the same communication standard as the communication IF46 of the test device 4. The communication IF17 is configured to be able to communicate with external devices based on various communication standards such as CAN (Controller Area Network), CAN FD (CAN with Flexible Data-Rate), FlexRay, or Ethernet (registered trademark). The communication IF17 includes a plurality of communication channels with the same standard communication functions. When using a plurality of communication channels, a plurality of communication lines 3 are connected in parallel from the communication IF17. In addition, the communication IF17 can communicate with external devices through wireless communication.
[0082] The timer 18 operates the CPU13 to start and stop the act of measuring time, and notifies the CPU13 of the passage of time. The time measured by the timer 18 can be obtained by the CPU13 reading a dedicated register provided in the timer 18. When a preset time is reached, the CPU13 can be notified of the arrival of the preset time through an interrupt.
[0083] The drive circuit 19 receives an instruction from the microcomputer 12 to generate a motor drive signal and supplies the motor drive signal to the motor 2. In addition, a specific example of the ECU1 driving the motor 2 is shown in the first embodiment, but the structure of the ECU1 is not limited to this specific example. For example, it can also be configured such that the control target of the drive circuit 19 is a light source such as an LED (Light Emitting Diode), and the ECU1 performs the illuminance control of the LED.
[0084] Figure 3 This is an explanatory diagram illustrating the content of the communication part of the control program in the electronic control device according to the first embodiment, and illustrates the content of the communication part of the control program 150 stored in the auxiliary storage device 15. The control program 150 is composed of a hardware abstraction process 151, hardware abstraction data 152, a channel abstraction process 153, channel abstraction data 154, a control process 155, and control data 156.
[0085] The hardware abstraction process 151 is a processing level that mainly performs the following processes: when using the various functions of the communication IF17, appropriate values are written into the setting registers provided for each function, values are read from the registers representing the status to execute the target function, it is determined whether the function is correctly executed, and the execution result is obtained if the function is correctly executed. The hardware abstraction process 151 hides and abstracts the detailed settings and reads of the registers when using the various functions of the microcomputer from the external processes.
[0086] Figure 4 It is an explanatory diagram showing the main hardware abstraction data regarding communication of the hardware abstraction process in the electronic control device according to Embodiment 1, and shows the main data regarding communication of the hardware abstraction data 152 referred to by the hardware abstraction process 151.
[0087] Figure 4 Among them, the hardware abstraction data 152 is generated according to the requirement specifications of the communication of the ECU1. In Embodiment 1, as a structural example of the hardware abstraction data 152, the hardware abstraction process 151 setting data 1521 that determines the behavior of the hardware abstraction process 151, the channel unit data 1522 that stores the required values for each communication channel, the transmission frame unit data 1523 that stores the required values for each transmission frame, and the reception frame unit data 1524 that stores the required values for each reception frame are generated.
[0088] The hardware abstraction process 151 setting data 1521 is data that determines the behavior of the hardware abstraction process 151. In Embodiment 1, it is composed of whether to use the transmission completion notification interrupt 1521A and whether to use the reception notification interrupt 1521B. Whether to use the transmission completion notification interrupt 1521A determines whether to use the interrupt that notifies the completion of frame transmission in communication, and whether to use the reception notification interrupt 1521B determines whether to use the interrupt that notifies the reception of a frame. When the values for using the above-mentioned respective interrupts are set, the communication IF17 is set so that when the hardware abstraction process 151 completes transmission or receives a frame, the communication IF17 notifies the CPU13 through an interrupt. When the values for not using the above-mentioned respective interrupts are set, the communication IF17 does not notify the CPU13 of the occurrence of these phenomena. Therefore, it is necessary to periodically confirm the occurrence of these phenomena with the communication IF17.
[0089] In addition, whether to use the transmission completion notification interrupt 1521A and whether to use the reception notification interrupt 1521B are sometimes not direct requirements of the requirement specifications of the communication of the ECU1. However, considering the total number of frames processed by the hardware abstraction process 151, the performance of the used microcomputer 12, the influence of the occurrence of interrupts on the execution timing of the control process 155, etc., it is necessary to set the transmission and reception of frames of the requirement specifications of the communication so that processing can be performed without delay as required.
[0090] Channel unit data 1522 illustrates information related to a single communication channel referred to in the hardware abstraction process 151. In Embodiment 1, a communication IF register initialization value 1522A for storing initial values of various registers included in the communication IF 17 and a used hardware channel 1522B for storing which communication channel provided by the communication IF 17 is used are generated. The channel unit data 1522 generates the number of communication channels requested according to the communication requirement specifications of the ECU 1.
[0091] Transmission frame unit data 1523 illustrates information related to a single transmission frame referred to in the hardware abstraction process 151. In Embodiment 1, a transmission frame ID 1523A for storing a value unique to each transmission frame and a transmission frame channel 1523B for storing which communication channel provided by the communication IF 17 the transmission frame uses for transmission are generated. The transmission frame unit data 1523 generates the number of transmission frames required according to the communication requirement specifications of the ECU 1.
[0092] Reception frame unit data 1524 illustrates information related to a single reception frame referred to in the hardware abstraction process 151. In Embodiment 1, a reception frame ID 1524A for defining a value unique to each reception frame and a reception frame channel 1524B for storing which communication channel provided by the communication IF 17 the reception frame uses for reception are generated. The reception frame unit data 1524 generates the number of reception frames required according to the communication requirement specifications of the ECU 1.
[0093] Figures 5 to 9 is a flowchart illustrating the main processing contents related to the communication of the hardware abstraction process 151. Hereinafter, based on each flowchart, the processing contents related to the communication of the hardware abstraction process 151 will be described in detail.
[0094] Figure 5 is a flowchart showing the steps of the initialization process related to the communication of the hardware abstraction process in the electronic control device according to Embodiment 1, showing the initialization process related to the communication of the hardware abstraction process 151. Figure 5 In this, in step S101, with reference to the communication IF 17 register initialization value 1522A and the used hardware channel 1522B, registers related to transmission and reception of the communication IF 17 are set for each communication channel so as to be in a state capable of transmitting and receiving frames. Next, in step S102, with reference to the hardware abstraction process 151 setting data 1521, settings are made such that when the transmission of a requested transmission frame is completed and when a frame is received from the outside, the communication IF 17 can notify the CPU 13 by interrupt respectively, or the completion of frame transmission and reception can be periodically confirmed without using interrupts.
[0095] Figure 6 It is a flowchart showing the steps of the frame reception process of the hardware abstraction process in the electronic control device according to Embodiment 1, showing the frame reception process of the hardware abstraction process 151. Figure 6 The frame reception process shown is executed when the communication IF17 causes the CPU13 to generate an interrupt when a communication frame is received from the outside, or is executed periodically without using an interrupt. Figure 6 In this, first, in step S201, the frame reception process refers to the register of the communication IF17 to confirm that a frame is being received. If no frame is being received (No), the process ends.
[0096] If it is confirmed in step S201 that a frame has been received (Yes), the process proceeds to step S202 to determine the communication channel number of the received frame. In step S203, the frame ID of the received frame is read from the register of the communication IF17 and stored in the RAM14. Then, in step S204, with reference to Figure 4 the received frame unit data 1524 shown, it is determined whether the frame ID received through the above communication channel is a reception target. If it is not a reception target frame (No), the process proceeds to step S208 to clear the reception state of the communication IF17 to the non-received state and end the reception process.
[0097] If it is determined in step S204 that a reception target frame has been received (Yes), the process proceeds to step S205 to read the frame data length (number of bytes) from the register of the communication IF17. In step S206, the frame data corresponding to the frame data length is read from the register of the communication IF17, and the data length and data of the received frame are stored in the RAM14.
[0098] In step S207, the communication channel number, frame ID, frame data length, and frame data of the received frame are transmitted as parameters of the reception process of the channel abstraction process 153 to the Figure 12 frame reception process shown below. Then, in step S208, the reception state of the communication IF17 is cleared without reception, and the reception process ends.
[0099] Figure 7 It is a flowchart showing the steps of the frame transmission process of the hardware abstraction process in the electronic control device according to Embodiment 1, showing the frame transmission process executed by the hardware abstraction process 151 shown above when called from the channel abstraction process 153. Figure 3 shown
[0100] Figure 7In the frame transmission process of the hardware abstraction process 151 shown, in step S301, the frame ID is written into the register of the specified communication channel of the communication IF17. In step S302, the frame data length is written into the register of the specified communication channel of the communication IF17. In step S303, the frame data is written into the register of the specified communication channel of the communication IF17. In step S304, the transmission request of the frame is written into the register of the communication IF17, and the transmission process ends.
[0101] Figure 8 is a flowchart showing the steps of the frame transmission completion process in the hardware abstraction process in the electronic control device according to Embodiment 1, showing the above Figure 3 frame transmission completion process of the hardware abstraction process 151 shown. Figure 8 The frame transmission completion process of Figure 7 is executed when the communication IF17 causes an interrupt to the CPU13 when the transmission of the frame required in the frame transmission process above is completed, or is executed periodically without using an interrupt.
[0102] Figure 8 In this process, in step S401, the register of the communication IF17 is referred to confirm the completion of frame transmission. If there is no frame whose transmission has been completed (No), the process ends. If the completion of frame transmission is confirmed (Yes), the process proceeds to step S402 to determine the communication channel number of the frame whose transmission has been completed. In step S403, the frame ID of the frame whose transmission has been completed is read from the register of the communication IF17 and stored in the RAM14. Then, in step S404, the communication channel number and frame ID of the frame whose transmission has been completed are transferred as parameters of the transmission completion process to the channel abstraction process 153. In step S405, the transmission completion status of the communication IF17 is set to not transmitted and cleared, and the transmission completion process ends.
[0103] Figure 9 is a flowchart showing the steps of the periodic process in the hardware abstraction process in the electronic control device according to Embodiment 1, showing the above Figure 3 periodic process of the hardware abstraction process 151 shown. In step S501, when interrupts are not used during frame transmission completion and reception, the frame reception process of the hardware abstraction process 151 is periodically executed. In step S502, the frame transmission completion process is executed, and the process ends. In addition, the processing cycle is generated using the timer 18, for example.
[0104] Figure 3The channel abstraction process 153 in the control program 150 shown uses the hardware abstraction process 151 and the functions of transmitting and receiving data of the communication IF 17 without performing detailed register operations on the communication IF 17. In addition, in the case of using two or more communication channels, the channel abstraction process 153 replaces the information of the communication channels with the values of unique identifiers (hereinafter referred to as "data unit IDs") for hiding and abstraction.
[0105] Figure 3 The channel abstraction data 154 shown is the data after the channel abstraction process 153 applies the communication requirements of the ECU within the required range, and is equivalent to the frame ID, the communication channel for transmitting and receiving frames, etc.
[0106] Figure 10 It is an explanatory diagram showing the main communication channel abstraction data referred to in the channel abstraction process in the electronic control device according to Embodiment 1, and illustrates the above Figure 3 main data of the channel abstraction data 154 referred to in the channel abstraction process 153 shown.
[0107] Figure 10 Among them, the channel abstraction data 154 is generated according to the communication requirement specifications of the ECU1. In Embodiment 1, as a structural example of the channel abstraction data 154, channel unit data 1541 for storing the required values for each channel, transmission frame unit data 1542 for storing the required values for each transmission frame, and reception frame unit data 1543 for storing the required values for each reception frame are generated.
[0108] The channel unit data 1541 illustrates the information related to a single communication channel referred to in the channel abstraction process 153. In Embodiment 1, a transmission frame ID conversion table 1541A for converting the group of the communication channel number and the transmission frame ID of the transmission frame into a unique ID (hereinafter referred to as "data ID") and a reception frame ID conversion table 1541B for converting the group of the communication channel number and the reception frame ID of the reception frame into the data ID are generated.
[0109] When the transmission frame ID conversion table 1541A and the reception frame ID conversion table 1541B receive a transmission completion notification or a reception notification from the hardware abstraction process 151, they aggregate the communication channel number and the frame ID into an inherent ID (hereinafter referred to as "data ID"), and notify the data ID to the program module at a higher processing level (control processing 155 in Embodiment 1). As long as the data ID is an inherent value that does not duplicate other frames, it can be generated in any way. For example, consecutive numbers can be simply assigned to each frame, or the storage width of 16 bits for each data ID can be ensured, the communication channel number can be stored in the upper 4 bits thereof, and the frame ID obtained from the register of the communication IF17 of the communication channel number can be stored in the lower 12 bits.
[0110] When receiving a transmission request from the program module at the upper processing level, the channel abstraction process 153 receives the data ID and the transmission data from the program module at the upper processing level. The above Figure 3 channel abstraction process 153 of needs to obtain the communication channel number and the frame ID corresponding to the received data ID, and transfer the communication channel number, the frame ID, and the transmission data to the hardware abstraction process 151. Therefore, the transmission frame ID conversion table 1541A not only needs to obtain the data ID from the communication channel number and the frame ID of the transmission frame, but also needs to be able to obtain the communication channel number and the transmission frame ID from the data ID. When it is difficult to perform the two-way conversion efficiently with a single table, two types of tables that can perform the conversion efficiently can be generated for each conversion direction.
[0111] In addition, the channel unit data 1541 generates the number of communication channels required according to the communication requirement specifications of the ECU1.
[0112] The transmission frame unit data 1542 illustrates information related to a single transmission frame referred to by the channel abstraction process 153. In Embodiment 1, the transmission frame data length 1542A that stores the size of the net data of the transmission frame, the transmission frame monitoring presence / absence 1542B that stores whether to monitor the transmission completion within the period of the transmission frame, the transmission frame monitoring period 1542C that stores the transmission timeout time of the transmission frame, and the transmission completion notification module ID 1542D that stores the upper program module ID that notifies the transmission completion of the transmission frame are generated. The transmission frame unit data 1542 generates the number of transmission frames required according to the communication requirement specifications of the ECU1.
[0113] The received frame unit data 1543 illustrates information related to a single received frame referred to in the channel abstraction process 153. In Embodiment 1, a received frame data length 1543A for storing the net data length of the received frame, a received frame data length confirmation presence / absence 1543B for storing whether the net data length of the received frame is confirmed, a received frame monitoring presence / absence 1543C for storing whether to monitor the reception of the received frame, a received frame monitoring period 1543D for storing the reception timeout time of the received frame, and a reception notification module ID 1543E for storing the upper program module ID that notifies the reception of the received frame are generated. The received frame unit data 1543 generates the number of received frames required according to the communication requirement specifications of the ECU1.
[0114] Figures 11 to 17 It is a flowchart showing the main processing contents of the channel abstraction process 153. Hereinafter, based on Figures 11 to 17 each of the flowcharts shown, the processing contents of the channel abstraction process 153 will be described in detail.
[0115] Figure 11 It is a flowchart showing the steps of the initialization process of the channel abstraction process in the electronic control device according to Embodiment 1, showing the initialization process of the channel abstraction process 153. Figure 11 In this, in step S601, the transmission frame table 141 and the reception frame table 142 are initialized, and in step S602, the transmission frame monitoring table 143 and the reception frame monitoring table 144 are initialized. When settings and initializations for periodically calling the Figure 14 periodic processing shown later are required, they can be implemented within the processing of Figure 11 .
[0116] Figure 12 It is a flowchart showing the steps of the frame reception process of the channel abstraction process in the electronic control device according to Embodiment 1, showing the frame reception process of the channel abstraction process 153. When a frame is received, the channel number, frame ID, frame data length, and frame data of the received frame are transmitted as parameters from Figure 7 step S207 of the reception process of the hardware abstraction process 151 and called. Figure 12 In this, in step S701, the frame reception process of the channel abstraction process 153 refers to the received frame ID conversion table 1541B and obtains the data ID from the frame number and the frame ID.
[0117] Next, in step S702, it is confirmed whether the received frame data length confirmation of 1543B is valid. If the received frame data length confirmation of 1543B is valid (Yes), proceed to step S703, and confirm whether the frame data length is the same as the received frame data length 1543A. If the result of the confirmation in step S703 is that the frame data length is not the same as the received frame data length 1543A (No), end the reception process.
[0118] If the result of the determination in step S702 is that the received frame data length confirmation of 1543B is valid (Yes), and the result of the determination in step S703 is that the frame data length is the same as the received frame data length 1543A (Yes), proceed to step S704, refer to the reception notification module ID 1543E to determine the program module at the upper processing level for notifying the reception of the frame. In step S705, the data ID and the frame data are passed as parameters to the frame reception process at the upper processing level, and the reception of the data is notified. In addition, in Embodiment 1, the program module at the upper processing level is set to control process 155, but it is not limited thereto. The control process 155 can be divided into multiple ones, or can be other types of program modules that do not directly perform control processing. Finally, in step S706, the communication channel number and the frame ID are added to the received frame table 142, and the reception process ends.
[0119] Figure 13 is a flowchart showing the steps of the frame transmission process of the channel abstraction process in the electronic control device according to Embodiment 1. It is the frame transmission process executed by the channel abstraction process 153 when it is called as the transmission process from the control process 155, and transmits the data ID and the frame data to be transmitted as parameters of the process.
[0120] Figure 13 In it, in step S801, the transmission process of the channel abstraction process 153 refers to the transmission frame ID conversion table 1541A to obtain the communication channel number and the frame ID from the data ID. Next, in step S802, the communication channel number and the frame ID are added to the transmission frame table 141. In step S803, in the transmission process of the hardware abstraction process 151, the communication channel number, the frame ID, the frame data length, and the frame data of the frame to be transmitted as parameters are transmitted and called, and the transmission process ends.
[0121] Figure 14 is a flowchart showing the steps of the frame transmission completion process of the channel abstraction process in the electronic control device according to Embodiment 1. It is the frame transmission completion process of the channel abstraction process 153. When the transmission of the frame required by the above frame transmission process is completed, the communication channel number and the frame ID of the transmitted frame are transmitted as parameters from step S405 of the frame transmission completion process of the hardware abstraction process 151 and called.
[0122] Figure 14 In this process, in step S901, for the frame transmission completion process of the channel abstraction process 153, with reference to the transmission frame ID conversion table 1541A, the data ID is obtained from the communication channel number and the frame ID. Next, in step S902, the communication channel number and the frame ID are deleted from the transmission frame table 141. In step S903, with reference to the transmission completion notification module ID 1542D, the program module at the upper processing level for notifying the frame transmission completion is determined. Then, in step S904, the data ID is passed as a parameter to the frame transmission completion process at the upper processing level to notify the completion of data transmission and end the process.
[0123] Figure 15 FIG. is a flowchart showing the steps of the periodic process of the channel abstraction process in the electronic control according to Embodiment 1, showing the periodic process of the channel abstraction process 153, which is periodically called using the scheduler of the OS (Operating System) and the timer 18, etc. The call period is determined to be neither too much nor too little with respect to the response time required for the channel abstraction process 153. Figure 15 The periodic process calls the frame reception monitoring process in step S1001 and the frame transmission monitoring process in step S1002 each time it is called.
[0124] Figure 16 FIG. shows the steps of the frame reception monitoring process of the channel abstraction process in the electronic control device according to Embodiment 1. It is the frame reception monitoring process of the channel abstraction process 153. Although it is a periodic process, it is first called from step S1001.
[0125] In step S1101, the automatic variables CHANNEL and FRAME are initialized to "0", and the process proceeds to step S1102. It is determined whether the automatic variable CHANNEL is less than the number of communication channels. If the automatic variable CHANNEL is less than the number of communication channels (Yes), the process proceeds to step S1103. It is determined whether the automatic variable FRAME is less than the number of frames of the automatic variable CHANNEL. If the automatic variable FRAME is not less than the number of frames of the automatic variable CHANNEL (No), the process proceeds to step S1104. In step S1104, "1" is added to the automatic variable CHANNEL and the process returns to step S1102.
[0126] If the result of the determination in step S1102 is that the automatic variable CHANNEL is not less than the number of communication channels (No), the process ends. Further, if the result of the determination in step S1103 is that the number of frames of the automatic variable FRAME is less than that of the automatic variable CHANNEL (Yes), the process proceeds to step S1105. Through steps S1102, S1103, and S1104, the reception monitoring process equivalent to the number of frames received from the communication channel numbers of each automatic variable CHANNEL is repeated.
[0127] In step S1105, for the frame ID of each automatic variable FRAME of the communication channel number of each automatic variable CHANNEL, it is determined whether the reception frame monitoring of the corresponding frame is valid for 1543C. In the case of invalidity (No), "1" is added to the automatic variable FRAME and the process proceeds to step S1113 to perform the reception frame monitoring process for the next frame. On the other hand, if the result of the determination in step S1105 is that the reception frame monitoring of the corresponding frame for 1543C is valid (Yes), the process proceeds to step S1106 to determine whether there is a frame of the automatic variable CHANNEL and the automatic variable FRAME in the reception frame table 142. If there is a frame of the automatic variable CHANNEL and the automatic variable FRAME in the reception frame table 142 (Yes), that is, in the case where a frame with the communication channel number of the automatic variable CHANNEL and the frame ID of the automatic variable FRAME is added to the reception frame table 142, the process proceeds to step S1108.
[0128] In step S1108, the frame is deleted from the reception frame table 142. Then, in step S1109, the counter of the corresponding reception frame monitoring table 144 is initialized to "0". If the result of the determination in step S1106 is that there is no frame of the automatic variable CHANNEL and the automatic variable FRAME in the reception frame table 142 (No), that is, in the case where a frame with the communication channel number of the automatic variable CHANNEL and the frame ID of the automatic variable FRAME is not added to the reception frame table 142, the process proceeds to step S1107 to add "1" to the counter of the corresponding reception frame monitoring table 144.
[0129] Next, in step S1110, it is determined whether the counters of the automatic variables CHANNEL and FRAME in the received frame table 142 are 1543D or more in the received frame monitoring period. When the counter in the received frame monitoring table 144 of the frame with the communication channel number of the automatic variable CHANNEL and the frame ID of the automatic variable FRAME becomes the same value or more as the corresponding received frame monitoring period 1543D (Yes), proceed to step S1111, and refer to the reception notification module ID 1543E to determine the program module at the upper processing level for notifying the reception timeout of the frame. Then, in step S1112, the data ID is passed as a parameter to the frame reception timeout processing at the upper processing level to notify the reception timeout of the data. If the determination result in step S1110 is No, proceed to step S1113.
[0130] In step S1113, after the timeout notification, or when the counter in the received frame monitoring table 144 of the frame with the communication channel number of the automatic variable CHANNEL and the frame ID of the automatic variable FRAME is less than the corresponding received frame monitoring period 1543D, "1" is added to the automatic variable FRAME and the monitoring process for the next received frame is performed.
[0131] Figure 17 It is a flowchart showing the steps of the frame transmission monitoring process of the channel abstraction process in the electronic control device according to Embodiment 1. The frame transmission monitoring process of the channel abstraction process 153 is shown. Although it is a periodic process, it is first called from step S1201.
[0132] In step S1201, similar to the frame reception monitoring process of the channel abstraction process 153 described above, the frame transmission monitoring process of the channel abstraction process 153 initializes the automatic variables CHANNEL and FRAME to "0", proceeds to step S1202, and determines whether the automatic variable CHANNEL is less than the number of communication channels. If the automatic variable CHANNEL is less than the number of communication channels (Yes), proceed to step S1203, and determine whether the automatic variable FRAME is less than the number of frames of the automatic variable CHANNEL. If the automatic variable FRAME is not less than the automatic variable CHANNEL (No), proceed to step S1204. In step S1204, "1" is added to the automatic variable CHANNEL and the process returns to step S1202.
[0133] If the result of the determination in step S1202 above is that the automatic variable CHANNEL is not less than the number of communication channels (No), the process ends. In addition, if the result of the determination in step S1203 is that the number of frames of the automatic variable FRAME is less than that of the automatic variable CHANNEL (Yes), the process proceeds to step S1205. Through steps S1202, S1203, and S1204, the transmission monitoring process equivalent to the number of frames received from the communication channel numbers of each automatic variable CHANNEL is repeated.
[0134] In step S1205, for the frame ID of each automatic variable FRAME of the communication channel number of each automatic variable CHANNEL, it is determined whether the transmission frame monitoring of the corresponding frame has 1542B valid. If it is invalid (No), the process proceeds to step S1210. If it is valid (Yes), the process proceeds to step S1206. In step S1206, it is determined whether there is a frame of the automatic variable CHANNEL and the automatic variable FRAME in the transmission frame table 141. If there is a frame of the automatic variable CHANNEL and the automatic variable FRAME in the transmission frame table 141 (Yes), the process proceeds to step S1208. If not (No), the process proceeds to step S1207.
[0135] In step S1208, the frame is deleted from the transmission frame table 141, and the process proceeds to step S1209 to initialize the counter of the corresponding transmission frame monitoring table 143 to "0". On the other hand, if the result of the determination in step S1206 is that there is no frame in the transmission frame table 141 with the frame ID of the communication channel number of the automatic variable CHANNEL and the automatic variable FRAME (No), the process proceeds to step S1207, the counter of the automatic variable CHANNEL and FRAME of the transmission frame monitoring table 143 is incremented by "1", and the process proceeds to step S1210.
[0136] In step S1210, it is determined whether the counter of the automatic variable CHANNEL and the automatic variable FRAME in the transmission frame table 141 is equal to or more than the transmission frame monitoring period 1542C. If the counter of the transmission frame monitoring table 143 for the frame with the frame ID of the communication channel number of the automatic variable CHANNEL and the automatic variable FRAME becomes equal to or more than the corresponding transmission frame monitoring period 1542C (Yes), the process proceeds to step S1211 to determine the program module at the upper processing level for notifying the transmission timeout of the frame with reference to the transmission completion notification module ID 1542D. In step S1212, the data ID is passed as a parameter to the transmission timeout processing of the frame of the automatic variable CHANNEL and the automatic variable FRAME, that is, the frame transmission timeout processing at the upper processing level, to notify the transmission timeout of the data.
[0137] On the other hand, when the result of the determination in step S1210 is that the counter of the transmission frame monitoring table 143 for the communication channel number of the automatic variable CHANNEL and the frame ID of the automatic variable FRAME is less than the corresponding transmission frame monitoring period 1542C (NO), the process proceeds to step S1213. If the process proceeds from step S1210 or step S1212 to step S1213, then in step S1213, "1" is added to the automatic variable FRAME, the process returns to step S1203, and the monitoring process for the next transmission frame is performed.
[0138] The above control process 155 uses the channel abstraction process 153 to receive the data distinguished by the data ID, performs control processing using this data as input, and when it is necessary to send the processing result to the outside, transfers the data ID and the data of the processing result to the transmission process of the channel abstraction process 153 to perform data transmission.
[0139] Figure 18 It is an explanatory diagram showing the content of data related to the communication of the control process in the electronic control device according to Embodiment 1, and shows the content related to the communication of the control data 156 referred to by the control process 155. Figure 18 In Embodiment 1, the control data 156 generates a transmission data configuration table 1561, a transmission partial data initial value 1562, a reception data configuration table 1563, and a reception partial data initial value 1564.
[0140] The transmission data configuration table 1561 is a correspondence table between the data transmitted to the transmission process of the channel abstraction process 153 and the configuration of arranging one or more various data within the data, and is generated according to the requirement specifications of the communication of the ECU1. The data transmitted to the channel abstraction process 153 is usually in the form of a byte arrangement, and in the byte arrangement, there may be configured a plurality of further subdivided transmission data "0" configurations 15610, transmission data "1" configurations 15611,..., transmission data "N" configurations 1561N. For example, the transmission data "0" configuration 15610 stores data indicating from which starting bit position in the data transmitted to the transmission process of the channel abstraction process 153 and how many bits in length it is.
[0141] The transmission partial data initial value 1562 stores the respective initial values of the plurality of transmission partial data "0" initial values 15620, transmission partial data "1" initial values 15621,..., transmission partial data "N" initial values 1562N of the transmission data configuration table 1561.
[0142] The received data configuration table 1563, like the transmitted data configuration table 1561, is a correspondence table of the data transmitted from the channel abstraction process 153 in the data reception process and each configuration of one or more received data "0" configurations 15630, received data "1" configurations 15631, …, received data "N" configurations 1563N in the data, and is generated according to the requirement specifications of the communication of the ECU1.
[0143] The reception partial data initial values 1564 store the reception partial data "0" initial value 15640, reception partial data "1" initial value 15641, …, reception partial data "N" initial value 1564N of each received data in the received data configuration table 1563.
[0144] Figures 19 to 25 It is a flowchart illustrating the main processing contents of the control process 155. Hereinafter, based on Figures 19 to 25 each of the flowcharts shown, the processing contents of the control process 155 will be described.
[0145] Figure 19 It is a flowchart illustrating the steps of the initialization process of the control process in the electronic control device according to Embodiment 1. Figure 19 In this, in step S1301, the transmission partial data initial values 1562 are respectively set to the respective transmission partial data 14A shown above Figure 2 In step S1302, the reception partial data initial values 1564 are set to Figure 2 the respective reception partial data 14B shown.
[0146] Next, in step S1303, the elements of each data ID in the transmission completion flag table 145 are initialized to TRUE (true), and in step S1304, the elements of each data ID in the reception notification flag table 146 are initialized to FALSE (false). Then, proceed to step S1305, initialize the elements of each data ID in the transmission timeout flag table 147 to FALSE, and in step S1306, initialize the reception timeout flag table 148 to FALSE. In step S1307, the elements of each data ID in the transmission request flag table 149 are initialized to FALSE. In the case where setting or initialization for periodically calling the Figure 25 periodic process shown below is required, it can be implemented within the Figure 19 process shown.
[0147] Figure 20 It is a flowchart illustrating the steps of the data reception process of the control process in the electronic control device according to Embodiment 1, and is called by transmitting the data ID and data as parameters from step S705 of the reception process of the above channel abstraction process 153. Figure 20In the data reception process of the control process 155 shown, in step S1401, the transmitted received data is transferred to the receive data buffer 14D. In step S1402, the element of the data ID in the transmission completion flag table 145 is set to TRUE. Then, it proceeds to step S1403, where the element of the data ID in the receive timeout flag table 148 is set to FALSE, and the process ends.
[0148] Figure 21 It is a flowchart showing the steps of the data transmission process of the control process in the electronic control device according to Embodiment 1. Figure 21 In it, in step S1501, the automatic variable DATA_ID is initialized to "0". In step S1502, it is determined whether the element of the automatic variable DATA_ID in the transmission request flag table 149 is TRUE. When the element of the automatic variable DATA_ID is TRUE (yes), that is, when transmission is requested, it proceeds to step S1503. In step S1503, referring to the element of the automatic variable DATA_ID in the transmission partial data 14A and the transmission data configuration table 1561, the content stored in the transmission partial data 14A corresponding to the automatic variable DATA_ID is written to the transmit data buffer 14C of the automatic variable DATA_ID for update.
[0149] Next, in step S1504, after calling the transmission process of the channel abstraction process 153 by transmitting the automatic variable DATA_ID and the content of the transmit data buffer 14C as parameters, or in the determination in step S1502, when the element of the automatic variable DATA_ID in the transmission request flag table 149 is FALSE rather than TRUE (no), that is, when transmission is not requested, in step S1505, "1" is added to the automatic variable DATA_ID, and it proceeds to step S1506. In step S1506, it is determined whether the automatic variable DATA_ID is equal to the total number of transmit data. When the automatic variable DATA_ID is less than the total number of transmit data (no), it returns to step S1502 with the next automatic variable DATA_ID. When the automatic variable DATA_ID is equal to the total number of transmit data (yes), the process ends.
[0150] Figure 22 It is a flowchart showing the steps of the data transmission completion process of the control process in the electronic control device according to Embodiment 1, which is called by transmitting the data ID as a parameter from step S904 of the transmission completion process of the channel abstraction process 153. Figure 22In the data transmission completion process of the control process 155 shown, in step S1601, the element of the data ID in the transmission completion flag table 145 is set to TRUE. Then, in step S1602, the element of the data ID in the transmission timeout flag table 147 is set to FALSE, and the process ends.
[0151] Figure 23 It is a flowchart showing the steps of the data reception timeout process of the control process in the electronic control device according to Embodiment 1. Figure 23 In the data reception timeout process of the control process 155 shown, the data ID is transmitted as a parameter and called from step S1112 of the frame reception monitoring process of the channel abstraction process 153. In step S1701, the element of the data ID in the reception timeout flag table 148 is set to TRUE, and the process ends. In addition, processing that needs to immediately respond to the occurrence of data reception timeout for a specific data ID can also be implemented within this process.
[0152] Figure 24 It is a flowchart showing the steps of the data transmission timeout process of the control process in the electronic control device according to Embodiment 1. The data ID is transmitted as a parameter and called from step S1212 of the frame transmission monitoring process of the channel abstraction process 153. Figure 24 In the data transmission timeout process of the control process 155 shown, in step S1801, the element of the data ID in the transmission timeout flag table 147 is set to TRUE, and the process ends. In addition, processing that needs to immediately respond to the occurrence of data transmission timeout for a specific data ID can also be implemented within this process.
[0153] Figure 25 It is a flowchart showing the steps of the periodic process of the control process in the electronic control device according to Embodiment 1. It is the periodic process of the control process 155, which is periodically called using the scheduler or timer 18 of the OS. The call period is determined to be neither too much nor too little with respect to the response time required by the control process 155. In the periodic process of the control process 155, each time it is called, for each newly received data ID, the content of the reception data buffer 14D is transmitted to the reception partial data 14B, the control-related process is executed based on the updated reception partial data 14B, the transmission data buffer 14C corresponding to the data ID of the updated transmission partial data 14A is updated through the execution of the control-related process, and the data transmission process is called.
[0154] More specifically, Figure 25In step S1901, the automatic variable DATA_ID is initialized to "0". In step S1902, it is determined whether the element of DATA_ID in the reception timeout flag table 148 is TRUE. When the element of DATA_ID in the reception timeout flag table 148 is TRUE (yes), that is, when a reception timeout occurs, the content of the reception data buffer 14D of DATA_ID is not transmitted to the received partial data 14B, and the process proceeds to step S1905, and "1" is added to DATA_ID.
[0155] On the other hand, if the result of the determination in step S1902 is that the element of DATA_ID in the reception timeout flag table 148 is FALSE instead of TRUE (no), that is, when no reception timeout is detected, the process proceeds to step S1903, and it is confirmed whether the element of DATA_ID in the reception notification flag table 146 is TRUE. When the result of the determination in step S1903 is that the element of DATA_ID in the reception notification flag table 146 is TRUE (yes), that is, when new data is received, the process proceeds to step S1904, and referring to the reception data configuration table 1563, the content of the reception data buffer 14D of DATA_ID is transmitted to the received partial data 14B.
[0156] After the reception data buffer 14D is transmitted to the received partial data 14B using step S1904, and if the result of the determination in step S1903 is that the element of DATA_ID in the reception notification flag table 146 is FALSE instead of TRUE (no), that is, when no new data is received, the process proceeds to step S1905, and "1" is added to DATA_ID. Then, in step S1906, it is determined whether DATA_ID is equal to the total number of received data. When DATA_ID is less than the total number of received data (no), the process returns to step S1902 for the next DATA_ID. When the result of the determination in step S1906 is that DATA_ID reaches the total number of received data (yes), the process proceeds to step S1907 to perform control association processing, and then in step S1908, data transmission processing is implemented, and then the process ends.
[0157] Figure 26 is a flowchart showing the steps of the control association processing of the control processing in the electronic control device according to Embodiment 1, and is called from step S1907 of the periodic processing of the above control processing 155. Figure 26In the control-related process of the control process 155 shown, in step S2001, a control target value is calculated based on the received part data 14B updated by the periodic process, the sensor input value read separately, etc. In step S2002, the transmission part data 14A is updated as needed. Then, it proceeds to step S2003. In order to transmit the updated content, the element of the transmission request flag table 149 corresponding to the data ID including the updated transmission part data 14A is set to TRUE, and the process ends.
[0158] Figures 2 to 26 In the above description, the description is limited to the communication function. However, in the case of processing functions other than communication, for example, when reading the sensor voltage or the value of the digital IO from the IO16, similar to Figures 2 to 26 each receiving process, it can also be composed of a hardware abstraction process, an abstraction process of the channel (that is, the A / D converter to which the sensor device is connected, the input pin of the digital IO), and a control process.
[0159] The electronic control device according to the above-described Embodiment 1 is a concretization of an electronic control device including: at least one CPU that executes a control program composed of at least one processing layer; an auxiliary storage device that stores the control program; and a RAM that is configured to be able to store and read data of the control program. In this electronic control device, when performing a test of the behavior of the electronic control device by using communication with a test device that generates request data for communication corresponding to the process of the test program to be executed by changing the transmission direction of the communication to the reception direction and changing the reception direction of the communication to the transmission direction, the request data for communication corresponding to the process of the executed control program is generated without changing the transmission direction and reception direction of the communication.
[0160] Next, Figure 1 the test device 4 shown will be described. Figure 1 In this, the test device 4 connects the terminal 5 to the IO41 as the main input and output, and is composed of a CPU 42, a RAM 43, an auxiliary storage device 44, a timer 45, and a communication IF 46. In addition, the test device 4 is communicably connected to the ECU 1 via the communication IF 46 and the communication line 3.
[0161] The test device 4 operates as a control unit that executes the test program. In addition, the test device 4 can be a microcomputer, an SoC (System on a chip), a PC (Personal Computer), etc., as long as it has the functions of the respective structural elements of the above-described test device 4.
[0162] The CPU 42 constitutes a control unit that controls each part provided inside the test device 4. The CPU 42 can execute a test program 440 described later stored in the auxiliary storage device 44. In addition, when an interruption occurs during the execution of the test program 440, the CPU 42 can execute processing corresponding to the interruption. Further, as long as it can access the IO 41, the RAM 43, the auxiliary storage device 44, the timer 45, and the communication IF 46, the CPU 42 may be composed of multiple CPUs. The RAM 43 is a storage unit that can be accessed by the CPU 42 and stores data in a rewritable state.
[0163] Figure 27 It is an explanatory diagram showing the content of variables accessed by the communication part of the test program in the test device according to Embodiment 1, and is a diagram showing the content of variables of the communication part of the test program 440 described later stored and updated in the RAM 43 in Embodiment 1. Regarding the format of each variable of the test program variable 430, it is the same as that of the control program variable 140 of Figure 2 and thus detailed description thereof is omitted.
[0164] Since the test device 4 needs to receive a communication frame sent by the ECU 1 and send the received communication frame, the transmission frame table 141, the transmission frame monitoring table 143, the transmission completion flag table 145, the transmission timeout flag table 147, the transmission request flag table 149, the transmission partial data 14A, and the transmission data buffer 14C related to the transmission of the control program variable 140 respectively correspond to the reception frame table 432, the reception frame monitoring table 434, the reception notification flag table 436, the reception timeout flag table 438, the reception partial data 43B, and the reception data buffer 43D related to the reception of the test program variable 430 of the test device 4.
[0165] In addition, the transmission frame table 431, the transmission frame monitoring table 433, the transmission completion flag table 435, the transmission timeout flag table 437, the transmission request flag table 439, the transmission partial data 43A, and the transmission data buffer 43C related to the transmission of the test program variable 430 respectively correspond to the Figure 2 reception frame table 142, the reception frame monitoring table 144, the reception notification flag table 146, the reception timeout flag table 148, the reception partial data 14B, and the reception data buffer 14D related to the reception in the control program variable 140 of the ECU 1 shown in
[0166] Figure 1The auxiliary storage device 44 shown stores data in a read-only state. Among them, the auxiliary storage device 44 can be a storage device such as an EPROM, a NOR-type flash memory, or a NAND-type flash memory that can rewrite data in a specific method. When the CPU 42 cannot directly execute the test program 440 stored in the auxiliary storage device 44 using a NAND-type flash memory or the like, the content of the test program 440 can be transferred from the auxiliary storage device 44 to the RAM 43, and the test program 440 can be executed on the RAM 43.
[0167] Figure 28 It is an explanatory diagram showing the content of the communication part of the test program in the test device according to Embodiment 1. Figure 28 In the test program 440 stored in the auxiliary storage device 44, regarding the hardware abstraction process 441, the hardware abstraction data 442, the channel abstraction process 443, the channel abstraction data 444, and the test data 446, Figure 3 The processing or data format of the hardware abstraction process 151, the hardware abstraction data 152, the channel abstraction process 153, the channel abstraction data 154, and the control data 156 of the control program 150 shown in is the same, so detailed description is omitted. Regarding Figure 28 The content of the test process 445 shown will be described in detail later regarding the parts different from the content of the control process 155 and the control data 156 shown in Figure 3 In addition, since the test device 4 needs to receive the communication frame sent by the ECU 1 and send the received communication frame, the hardware abstraction data 442, the channel abstraction data 444, and the test data 446 are generated by reversing the data transmission and reception of the hardware abstraction data 152, the channel abstraction data 154, and the control data 156 of the electronic control device 1 respectively.
[0168] The timer 45 operates through the CPU 42 to start and stop the act of timing the time, and notifies the CPU 42 of the passage of time. The time measured by the timer 45 can be obtained by the CPU 42 reading the dedicated register provided in the timer 45, and when the preset time is reached, it can be notified to the CPU 42 through an interrupt. The communication IF 46 is used when communicating with other ECUs, and is used to communicate with the ECU 1 in Embodiment 1. Therefore, communication is carried out according to the same standard as the ECU 1.
[0169] Figure 29 It is a flowchart showing the steps of the periodic process of the test process in the test device according to Embodiment 1, and is periodically called using the scheduler of the OS or the timer 45, etc. The call period is determined to be neither too much nor too little with respect to the response time required for the test process 445. As Figure 29As shown, in step S2101, during the cyclic processing of test process 445, test process 445 is called each time it is invoked.
[0170] Figure 30 It is a flowchart showing the steps of test-related processing in the test processing in the test device according to Embodiment 1, and is periodically invoked from step S2101 of the cyclic processing of test process 445. Figure 30 In Embodiment 1, the test-related processing of test process 445 calls the transmission confirmation process of ECU1 through step S2201 and confirms the transmission from ECU1. Next, in step S2202, the data value transmitted to ECU1 is written to and updated in transmission partial data 43A. In step S2203, the element of transmission request flag table 439 corresponding to the data ID including the updated transmission partial data 43A is set to TRUE and the process ends. Additionally, within the ECU1 transmission confirmation process called after the next cycle, the transmission data value from ECU1 for the data transmitted here is confirmed.
[0171] Figure 31 It is a flowchart showing the steps of the ECU transmission confirmation process in the test processing in the test device according to Embodiment 1, and is invoked from step S2201 of the test-related processing of test process 445. Figure 31 In the transmission confirmation process of ECU1 in test process 445 shown, in order to confirm the data transmitted from ECU1, the data received by test process 445 is confirmed for each data ID. In Embodiment 1, as an example of confirmation, the automatic variable DATA_ID is initialized to "0" using step S2301. In step S2302, it is determined whether the element of DATA_ID in reception timeout flag table 438 is TRUE.
[0172] If the result of the determination in step S2302 is that the element of DATA_ID in reception timeout flag table 438 is TRUE (yes), it is determined that the data has not been received within the expected time, and the process proceeds to step S2306 and calls the test failure (FAIL) process. On the other hand, if the result of the determination in step S2302 is that the element of DATA_ID in reception timeout flag table 438 is FALSE rather than TRUE (no), the process proceeds to step S2303 and it is confirmed whether the element of DATA_ID in reception notification flag table 436 is TRUE.
[0173] When the result of the determination in step S2303 is that the element of DATA_ID in the reception notification flag table 436 is TRUE (yes), it is determined that the data has been received within the expected time, and the process proceeds to step S2304. Refer to the received data configuration table to transfer the received data buffer 43D of DATA_ID to the received partial data 43B, and then proceed to step S2305. On the other hand, when the result of the determination in step S2303 is that the element of DATA_ID in the reception notification flag table 436 is FALSE rather than TRUE (no), the process proceeds to step S2307.
[0174] In step S2305, each value of the received partial data 43B is compared with the expected value. When each value of the received partial data 43B does not match the expected value (no), the process proceeds to step S2306, where the test failure process is called, and then proceeds to step S2307. In addition, the received data configuration table of the test device 4 uses the same table as Figure 18 the received data configuration table 1563 of the ECU1. If the process proceeds from step S2303 or step S2306 to step S2307, "1" is added to DATA_ID, and the process proceeds to step S2308. That is, when the element of DATA_ID in the reception notification flag table 436 is FALSE, or when each value of the received partial data 43B matches the expected value, and when DATA_ID is less than the total number of received data, the next DATA_ID is confirmed, and the process proceeds to step S2308.
[0175] In step S2308, it is determined whether DATA_ID has reached the total number of received data. When DATA_ID has not reached the total number of received data (no), the process returns to step S2302. When DATA_ID has reached the total number of received data (yes), the process ends.
[0176] In addition, the confirmation process of the ECU1 transmission is not limited to the above content. For example, when it is desired to periodically transmit the data sent from the ECU1, the cycle can also be confirmed. Conversely, when confirming whether the ECU1 has correctly received the data sent by the test process 445, the test transceiver frames and data IDs can be additionally defined for the ECU1 and the test device 4, and it can be confirmed that the data received by the ECU1 is replied with the test data ID and the test device 4 receives it through the test data ID.
[0177] In addition, in order to confirm whether the data received by the ECU 1 is correctly reflected in the received partial data 14B respectively, a test device 4 such as XCP (Universal Callibration Protocol) can establish a known communication protocol for specifying an address in advance to read each value of the received partial data 14B of the ECU 1, and read each value of the received partial data 14B of the ECU 1 via XCP communication to perform the confirmation.
[0178] Figure 32 FIG. is a flowchart showing steps of a test failure process of a test process in the test device according to Embodiment 1. In Embodiment 1, in the ECU 1 transmission confirmation process of the test process 445 shown above Figure 31 it is called when data is not received from the ECU 1 within the expected time and when the data received from the ECU 1 does not match the expected value. Figure 32 In the test failure process of the test process 445 shown above, in step S2401, when the data ID that causes this process call and the inconsistency of the received partial data 43B are detected, the received value and the expected value are output to the terminal 5, and the process ends.
[0179] The test device for the electronic control device according to Embodiment 1 described above is obtained by embodying a test device including: at least one CPU that executes a test program composed of at least one processing level; an auxiliary storage device that stores the test program; and a RAM that is configured to be able to store and read data of the test program. In this test device for the electronic control device, when testing the behavior of the electronic control device by using communication between the electronic control device and the communication request data corresponding to the process of the control program that is generated and executed without change in the transmission direction and the reception direction of the communication,
[0180] the transmission direction of the communication is changed to the reception direction and the reception direction of the communication is changed to the transmission direction to generate the communication request data corresponding to the process of the executed test program.
[0181] In addition, the electronic control device and the test device for the electronic control device according to the above-described Embodiment 1 are used for testing the electronic control device according to Embodiment 1. That is, the test method for the electronic control device according to Embodiment 1 is obtained by concretizing the following test method for an electronic control device, which tests the behavior of the electronic control device based on communication between the electronic control device and the test device. The electronic control device includes: at least one CPU that executes a control program composed of at least one processing level; an auxiliary storage device that stores the control program; and a RAM configured to be able to store and read data of the control program. The test device includes: at least one CPU that executes a test program composed of at least one processing level; an auxiliary storage device that stores the test program; and a RAM configured to be able to store and read data of the test program. In the case where there is no change in the transmission direction and the reception direction of the communication, request data for the communication corresponding to the processing of the executed control program is generated.
[0182] The transmission direction of the communication is changed to the reception direction and the reception direction of the communication is changed to the transmission direction to generate the request data for the communication corresponding to the processing of the executed test program.
[0183] As described above, according to the electronic control device and the test device according to Embodiment 1, the control program 150 of the ECU1 and the test program 440 of the test device 4 are set to the same processing and data formats. For the hardware abstraction data 152, channel abstraction data 154, and control data 156 of the ECU1, they are generated according to the communication requirement specifications of the ECU1. For the hardware abstraction data 442, channel abstraction data 444, and test data 446 of the test device 4, they are generated by exchanging the transmission and reception of the communication requirement specifications of the ECU1. Thus, the generation method of the hardware abstraction data 442, channel abstraction data 444, and test data 446 of the test device 4 can be unified with the generation method of the hardware abstraction data 152, channel abstraction data 154, and control data 156 of the ECU1. The test program 440 of the test device 4 can be generated by making the minimum necessary change of exchanging the transmission and reception of the communication requirement specifications of the ECU1. The function of the channel abstraction process 443 of the test device 4 (for example, the function of detecting reception timeout) can be reused for the determination of the test.
[0184] In addition, the closer the installation and data formats of the respective processes of the control program 150 of the ECU 1 and the test program 440 of the test device 4 are, the more reduction in man-hours for generation can be expected. In particular, when the ECU 1 and the test device 4 are of the same hardware, and the control program 150 and the test program 440 of the test device 4 are in the same language and installed in the same way, the maximum reduction in man-hours for generation can be expected. However, this application does not depend on the installation of specific hardware or programming languages. The programming language for installing the respective processes of the test program 440 can be different from the programming language for installing the respective processes of the control program 150 of the ECU 1.
[0185] In addition, in Embodiment 1 of this application, the control program 150 of the ECU 1 and the test program 440 of the test device 4 are divided into three processing levels, but the degree of division of the processing levels is not limited to this. For example, the control process 155 of the ECU 1 and the test process 445 of the test device 4 can be further divided, and a processing level for executing the generation process of the transmission data (step S1501) performed in the data transmission process and the received data segmentation process (step S1401) performed in the data reception process can be set.
[0186] In addition, in Embodiment 1 of this application, the hardware abstraction data 152, the channel abstraction data 154, the control data 156, the hardware abstraction data 442, the channel abstraction data 444, and the test data 446 are respectively stored in the auxiliary storage device 15 and the auxiliary storage device 44, but it is not necessary to be in this way. For example, in the case where the transmission frame data length 1542A, the reception frame monitoring period 1543D, etc. are determined by an external ECU for communication and a change during communication is required, the storage area during communication of the transmission frame data length 1542A and the reception frame monitoring period 1543D can be ensured in the RAM 14, and the area of the RAM 14 can be referred to during communication. In this case, for example, the initial values can be stored in the transmission frame data length 1542A and the reception frame monitoring period 1543D, and Figure 5 in the initialization process of [], the values of the transmission frame data length 1542A and the reception frame monitoring period 1543D are transmitted to the corresponding areas of the RAM, and when a change in value is notified from the external ECU, the area of the RAM 14 is updated, etc. The same applies to the test device.
[0187] In addition, an SoC, a PC, etc. can be used for the microcomputer 12 and the test device 4, and as a process of the OS, the control program 150 or the test program 440 can be executed. In this case, when the OS starts the control program 150 or the test program 440, the respective contents can be transmitted from the auxiliary storage device 15 and the auxiliary storage device 44 to the RAM 14 and the RAM 43 respectively, and the control program 150 and the test program 440 can be executed on the RAM 14 and the RAM 43.
[0188] In addition, in Embodiment 1 of the present application, the case where the ECU 1 is only connected to the test device 4 is described, but it is not limited to this form. For example, in the case where a plurality of ECUs similar to the ECU 1 are connected to the test device 4 via the communication line 3, it is also possible to prepare the hardware abstraction data 442, the channel abstraction data 444, and the test data 446 corresponding to the plurality of ECUs of the test device 4, and thus implement the test in the same manner as the method described in Embodiment 1 of the present application.
[0189] The present application describes exemplary embodiments, but the various features, modes, and functions described in the embodiments are not limited to the application of specific embodiments, and can be applied to the embodiments alone or in various combinations. Therefore, countless unillustrated variations can be envisioned within the technical scope disclosed in the present application. For example, it is assumed to include cases where at least one structural element is deformed, added, or omitted.
[0190] Reference Numeral Explanation
[0191] 1 Electronic control device
[0192] 2 Electric motor
[0193] 3 Communication line
[0194] 4 Test device
[0195] 5 Terminal
[0196] 11 Sensor unit and digital input circuit
[0197] 12 Microcomputer
[0198] 13, 42 CPU
[0199] 14, 43 RAM
[0200] 15, 44 Auxiliary storage device
[0201] 16, 41 IO
[0202] 17, 46 Communication IF
[0203] 18, 45 Timer
[0204] 19 Drive circuit
[0205] 140 Control program variable
[0206] 141, 431 Transmission frame table
[0207] 142, 432 Reception frame table
[0208] 143, 433 Transmission frame monitoring table
[0209] 144, 434 Receive Frame Monitoring Table
[0210] 145, 435 Transmission Completion Flag Table
[0211] 146, 436 Receive Notification Flag Table
[0212] 147, 437 Transmission Timeout Flag Table
[0213] 148, 438 Receive Timeout Flag Table
[0214] 149, 439 Transmission Request Flag Table
[0215] 14A, 43A Transmit Partial Data
[0216] 14B, 43B Receive Partial Data
[0217] 14C, 43C Transmit Data Buffer
[0218] 14D, 43D Receive Data Buffer
[0219] 150 Control Program
[0220] 151, 441 Hardware Abstraction Processing
[0221] 152, 442 Hardware Abstraction Data
[0222] 153, 443 Channel Abstraction Processing
[0223] 154, 444 Channel Abstraction Data
[0224] 155 Control Processing
[0225] 156 Control Data
[0226] 1521 Hardware Abstraction Processing 151 Setting Data
[0227] 1521A Whether to Use Transmission Completion Notification Interrupt
[0228] 1521B Whether to Use Receive Notification Interrupt
[0229] 1522, 1541 Channel Unit Data
[0230] 1522A Communication IF17 Register Initialization Value
[0231] 1522B Use Hardware Channel
[0232] 1523 Transmit Frame Unit Data
[0233] 1523A Transmit Frame ID
[0234] 1523B Transmission Frame Channel
[0235] 1524 Received Frame Unit Data
[0236] 1524A Received Frame ID
[0237] 1524B Received Frame Channel
[0238] 1541A Transmission Frame ID Conversion Table
[0239] 1541B Received Frame ID Conversion Table
[0240] 1542 Transmission Frame Unit Data
[0241] 1542A Transmission Frame Data Length
[0242] 1542B Transmission Frame Monitoring Presence / Absence
[0243] 1542C Transmission Frame Monitoring Period
[0244] 1542D Transmission Completion Notification Module ID
[0245] 1543 Received Frame Unit Data
[0246] 1543A Received Frame Data Length
[0247] 1543B Received Frame Data Length Confirmation Presence / Absence
[0248] 1543C Received Frame Monitoring Presence / Absence
[0249] 1543D Received Frame Monitoring Period
[0250] 1543E Receive Notification Module ID
[0251] 1561 Transmission Data Configuration Table
[0252] 15610 Transmission Data "0" Configuration
[0253] 15611 Transmission Data "1" Configuration
[0254] 1561N Transmission Data "N" Configuration
[0255] 1562 Initial Value of Transmitted Partial Data
[0256] 15620 Initial Value of Transmitted Partial Data "0"
[0257] 15621 Initial Value of Transmitted Partial Data "1"
[0258] 1562N Sending part of the data, initial value of "N"
[0259] 1563 Receiving data configuration table
[0260] 15630 Receiving data "0 rendering"
[0261] 15631 Receiving data "1" configuration
[0262] 1563N Receiving data "N" configuration
[0263] 1564 Initial value of receiving part of the data
[0264] 15640 Initial value of receiving part of the data "0 enemy step price"
[0265] 15641 Initial value of receiving part of the data "1"
[0266] 1564N Initial value of receiving part of the data "N"
[0267] 430 Test program variable
[0268] 440 Test program
[0269] 445 Test processing
[0270] 446 Test data.
Claims
1. An electronic control device, comprising: At least one CPU that executes a control program composed of at least one processing level; an auxiliary storage device that stores the control program; and a RAM configured to be able to store and read data of the control program, wherein the electronic control device is characterized in that, when performing a test of the behavior of the electronic control device by using communication with a test device that is configured to generate required data of the communication corresponding to the processing of the executed test program by changing the transmission direction of the communication to the reception direction and changing the reception direction of the communication to the transmission direction, and exchanging the transmission and reception of the communication requirement specifications of the electronic control device, required data of the communication corresponding to the processing of the executed control program is generated according to the communication requirement specifications of the electronic control device without changing the transmission direction and the reception direction of the communication.
2. The electronic control device according to claim 1, characterized in that, The control program and the test program are composed of the same processing level.
3. A test device for an electronic control device, comprising: At least one CPU that executes a test program composed of at least one processing level; an auxiliary storage device that stores the test program; and a RAM configured to be able to store and read data of the test program, wherein the test device of the electronic control device is characterized in that, when performing a test of the behavior of the electronic control device by using communication with an electronic control device that is configured to generate required data of the communication corresponding to the processing of the executed control program according to the communication requirement specifications of the electronic control device without changing the transmission direction and the reception direction of the communication, the transmission direction of the communication is changed to the reception direction and the reception direction of the communication is changed to the transmission direction, and the transmission and reception of the communication requirement specifications of the electronic control device are exchanged to generate required data of the communication corresponding to the processing of the executed test program.
4. The test device for an electronic control device according to claim 3, characterized in that, The test program and the control program are composed of the same processing level.
5. A test method for an electronic control device, testing the behavior of the electronic control device based on the communication between the electronic control device and the test device, the test method for the electronic control device being characterized in that, the electronic control device comprises: At least one CPU that executes a control program composed of at least one processing level; an auxiliary storage device that stores the control program; and a RAM configured to be able to store and read data of the control program, The test device includes: at least one CPU that executes a test program composed of at least one processing level; an auxiliary storage device that stores the test program; and a RAM configured to be able to store and read data of the test program, required data of the communication corresponding to the processing of the executed control program is generated according to the communication requirement specifications of the electronic control device without changing the transmission direction and the reception direction of the communication, the transmission direction of the communication is changed to the reception direction and the reception direction of the communication is changed to the transmission direction, and the transmission and reception of the communication requirement specifications of the electronic control device are exchanged to generate required data of the communication corresponding to the processing of the executed test program.
6. The test method for an electronic control device according to claim 5, characterized in that, The control program and the test program are composed of the same processing level.
Citation Information
Patent Citations
Testing method, and automatic test specification and test data generation apparatus
JP2011204069A
Test case generation device and test case generation method
JP2015204065A
Vehicle network data streaming system
US20190340844A1