Program rewriting device and program rewriting method
The program rewriting device optimizes thread allocation by adjusting transfer queues based on data volume and reallocating threads, ensuring rapid and balanced program updates in in-vehicle network systems with multiple buses.
Patent Information
- Application Number
- JP2023002412
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Filing Date
- 2023-01-11
- Publication Date
- 2026-01-27
- Estimated Expiration
- 2043-01-11
AI Technical Summary
In in-vehicle network systems with a large number of buses, the limited resources of the program rewriting device result in insufficient threads for parallel data transfer, leading to incomplete or biased program updates across electronic control units.
A program rewriting device that adjusts the transfer order of update data by creating queues based on data volume and reallocates threads to queues with the largest remaining data, ensuring parallel transfer completion across all buses.
The device ensures balanced and rapid program updates across all electronic control units by optimizing thread allocation, reducing the time required for complete data transfer.
Smart Images

Figure 0007806712000001 
Figure 0007806712000002 
Figure 0007806712000003
Abstract
Description
[Technical Field]
[0001] The present invention relates to a program rewriting device and a program rewriting method. [Background technology]
[0002] Patent Document 1 discloses an in-vehicle network system in which a plurality of electronic control units are connected to each of a plurality of buses. In the in-vehicle network system disclosed in Patent Document 1, a gateway device transmits data received from a rewriting device to each electronic control unit. The gateway device allocates the data received from the rewriting device to each bus and transmits the data to the electronic control units connected to each bus in parallel. [Prior art documents] [Patent documents]
[0003] [Patent Document 1] Japanese Patent Application Laid-Open No. 2010-271891 Summary of the Invention [Problem to be solved by the invention]
[0004] When transferring data from a program rewriting device to an in-vehicle network system, if data can be transferred to each bus in parallel using multiple threads, the data transfer can be completed quickly. This allows the program rewriting to be completed quickly. However, the program rewriting device has limited resources. Therefore, if the in-vehicle network system has a large number of buses, the number of threads available for parallel transfer becomes insufficient. In this case, since it is not possible to transfer data to all buses in parallel, the program rewriting device must adjust the data transfer order. [Means for solving the problem]
[0005] The means for solving the above problems and their effects will be described below. A program rewriting device for solving the above problem is connected to an in-vehicle network system in which a gateway device is connected to a plurality of buses to which a plurality of electronic control units are respectively connected, and rewrites the programs of the plurality of electronic control units. This program rewriting device includes a storage device that stores update data to be transferred to the plurality of electronic control units, a processing circuit, and a plurality of threads that transfer the update data to the gateway device. In this program rewriting device, the processing circuit acquires information on the number of the multiple buses connected to the gateway device and the multiple electronic control units connected to each bus; based on the information, collects the update data to be transferred to each electronic control unit for each bus and creates a transfer queue for each bus; compares the amount of transfer data in the transfer queues and assigns the multiple threads one by one to the transfer queues in descending order of the amount of transfer data; transfers the update data in the transfer queues to which the threads are assigned in parallel to the gateway device using the multiple threads; and each time transfer of one of the update data in any of the transfer queues is completed, compares the amount of transfer data between the transfer queue to which the transfer of the update data has been completed and the transfer queue to which the thread has not been assigned and on which the transfer of the update data has been put on hold, and assigns the thread that was assigned to the transfer queue to which the transfer has been completed to the transfer queue with the largest amount of transfer data, thereby continuing the parallel transfer.
[0006] A program rewriting method for solving the above problem is executed by a program rewriting device that rewrites programs of multiple electronic control units in an in-vehicle network system in which multiple buses, each connected to a multiple electronic control units, are connected to a gateway device. The program rewriting method includes the steps of: acquiring information on the number of buses connected to the gateway device and the multiple electronic control units connected to each bus; collecting update data to be transferred to each electronic control unit for each bus based on the information, and creating a transfer queue for each bus; comparing the transfer data amounts in the transfer queues and assigning the multiple threads one by one to the transfer queues in descending order of the transfer data amount; transferring the update data in the transfer queues to which the threads are assigned to the threads in parallel to the gateway device; and, upon completion of transfer of one of the update data in any of the transfer queues, comparing the transfer data amounts between the transfer queue to which the update data transfer has been completed and the transfer queues to which the threads have not been assigned and for which the update data transfer has been suspended, and allocating the thread that was assigned to the transfer queue to the transfer queue with the largest transfer data amount, thereby continuing the parallel transfer. [Effects of the Invention]
[0007] The program rewriting device and the program rewriting method described above can adjust the order of transfer of update data so as to shorten the transfer time of the update data. The program rewriting device can complete the program update in the in-vehicle network system quickly. [Brief explanation of the drawings]
[0008] [Figure 1] FIG. 1 is a schematic diagram showing a rewriting device and an in-vehicle network system. [Figure 2] FIG. 2 is a flowchart showing the flow of a series of processes executed by the processing circuit. [Figure 3]3(a) to 3(c) are explanatory diagrams of transfer thread allocation. [Figure 4] 4(a) and 4(b) are timing charts showing transfer schedules for each bus and for each thread, respectively. [Figure 5] 5(a) to 5(c) are explanatory diagrams of transfer thread allocation in the modified example. [Figure 6] 6(a) and 6(b) are timing charts showing transfer schedules in the modified example arranged for each bus and for each thread, respectively. DETAILED DESCRIPTION OF THE INVENTION
[0009] A rewriting device 10, which is an embodiment of a program rewriting device, will be described below with reference to Figures 1 to 4. Figure 1 shows the rewriting device 10 and a vehicle 100. <Configuration of vehicle 100> The vehicle 100 includes a plurality of buses connected to the gateway device GW_ECU. The plurality of buses are CAN (registered trademark) buses. FIG. 1 shows a first bus B_1 to an n-th bus B_n, where "n" is a positive integer. FIG. 1 shows that the vehicle 100 includes n buses.
[0010] Multiple electronic control units are connected to each bus. FIG. 1 shows multiple electronic control units from electronic control unit ECU11 to electronic control unit ECU1m, where "m" is a positive integer. FIG. 1 shows that m electronic control units from electronic control unit ECU11 to electronic control unit ECU1m are connected to the first bus B_1. The first digit "n" in the symbol "ECUnm" of the electronic control unit indicates the bus number. The second digit "m" in the symbol "ECUnm" of the electronic control unit indicates the electronic control unit number. For example, "electronic control unit ECU33" indicates the third electronic control unit connected to the third bus B_3. FIG. 1 shows an example in which the same number of electronic control units are connected to each bus, but the number of electronic control units connected to each bus may be different.
[0011] As shown in FIG. 1, a vehicle 100 includes an in-vehicle network system in which a plurality of buses, each connected to a plurality of electronic control units, are connected to a gateway device GW_ECU.
[0012] Each electronic control unit realizes various functions in the vehicle 100. For example, one of the multiple electronic control units controls the engine. One of the multiple electronic control units controls the brakes. One of the multiple electronic control units controls the car navigation system and the audio system. One of the multiple electronic control units realizes advanced driving assistance. One of the multiple electronic control units controls the drive recorder. One of the multiple electronic control units detects a collision and activates an airbag. One of the multiple electronic control units makes an emergency call when the airbag is activated. One of the multiple electronic control units detects unauthorized intrusion into the vehicle 100 and activates an alarm device. The multiple electronic control units store programs for realizing their respective functions.
[0013] <Configuration of rewriting device 10> The rewriting device 10 is a program rewriting device that rewrites the programs of these multiple electronic control units. The rewriting device 10 includes a storage device 12 that stores update data to be transferred to each electronic control unit, and a processing circuit 11. The storage device 12 also stores programs executed by the processing circuit 11. The processing circuit 11 is a multi-core processor. The rewriting device 10 includes an input device 14 that is operated by an operator. For example, the input device 14 is a keyboard. The rewriting device 10 includes a display device 13. For example, the display device 13 is a liquid crystal display. The rewriting device 10 may include, as the display device 13 and the input device 14, a touch panel that combines the functions of the display device 13 and the input device 14. The rewriting device 10 includes a communication device 15.
[0014] The rewriting device 10 is communicably connected to a server 20 via a network 30 using a communication device 15. The rewriting device 10 downloads update data to be transferred to each electronic control unit from the server 20 and stores the download data in a storage device 12.
[0015] As shown in FIG. 1, a transfer bus 110 is connected to the gateway device GW_ECU. The transfer bus 110 is a bus that can transfer more data at a higher speed than CAN. For example, the transfer bus 110 is a bus that uses CAN-FD (CAN with Flexible Data Rate), a protocol that can transfer more data at a higher speed than CAN. The transfer bus 110 is provided with a connector 120. The rewriting device 10 includes a cable 16 that connects to this connector 120. By connecting the cable 16 to the connector 120, the rewriting device 10 is connected to the in-vehicle network system. While connected to the in-vehicle network system, the rewriting device 10 transfers update data to each electronic control unit and rewrites the program of each electronic control unit.
[0016] The processing circuit 11 has multiple transfer threads. The transfer threads are responsible for executing the update data transfer process. For example, the processing circuit 11 has three transfer threads: a first thread S_1, a second thread S_2, and a third thread S_3. The rewriting device 10 transfers update data to the gateway device GW_ECU in parallel using the multiple transfer threads. If the update data to each bus is transferred in parallel using multiple threads, the transfer of the update data can be completed quickly. Therefore, the rewriting of the program of each electronic control unit can be completed quickly.
[0017] However, the buses connecting the gateway device GW_ECU and each electronic control unit have a slower data transfer speed than the transfer bus 110. Therefore, if update data addressed to multiple electronic control units is transferred simultaneously to one bus, the transfer speed is insufficient and the update data cannot be transferred properly. Furthermore, the rewriting device 10 has limited resources. Therefore, if the number of buses in the in-vehicle network system is large, the number of transfer threads available for parallel transfer becomes insufficient. In this case, the rewriting device 10 cannot transfer update data to all buses in parallel. Therefore, the rewriting device 10 needs to adjust the transfer order of update data depending on the number of buses in the in-vehicle network system and the number of electronic control units connected to each bus.
[0018] <Update data transfer routine> 2, a description will be given of an update data transfer routine executed by the rewriting device 10. This routine is executed by the processing circuit 11 when the operator issues an instruction to execute the transfer routine via the input device 14 while the cable 16 of the rewriting device 10 is connected to the connector 120.
[0019] 2, when the transfer routine is started, the processing circuit 11 acquires information about the in-vehicle network system in the process of step S100. For example, the processing circuit 11 acquires information about the number of buses in the in-vehicle network system, the number of electronic control units connected to each bus, and the type of each electronic control unit from the gateway device GW_ECU.
[0020] In the next step S110, the processing circuit 11 sorts the data to be transferred to each electronic control unit based on the acquired information. Specifically, the processing circuit 11 creates a transfer queue for each bus. A queue is a data structure in which elements are sorted in the order in which they are received and elements added first are removed in the order in which they were added first. The processing circuit 11 collects the update data to be transferred to each electronic control unit for each bus and stores the transfer events for each update data in the transfer queue for each bus. The processing circuit 11 sorts the update data for each bus in descending order of data volume. The processing circuit 11 then stores the transfer events for update data with the largest data volume in the transfer queue in descending order.
[0021] FIG. 3(a) shows the order of transfer events in five transfer queues when update data is transferred to multiple electronic control units connected to five buses, from the first bus B_1 to the fifth bus B_5. In FIG. 3(a), the transfer event located on the left side is executed first. In this example, four electronic control units, from electronic control unit ECU11 to electronic control unit ECU14, are connected to the first bus B_1 as the multiple electronic control units to be updated. Three electronic control units, from electronic control unit ECU21 to electronic control unit ECU23, are connected to the second bus B_2 as the multiple electronic control units to be updated. Three electronic control units, from electronic control unit ECU31 to electronic control unit ECU33, are connected to the third bus B_3 as the multiple electronic control units to be updated. Three electronic control units, from electronic control unit ECU41 to electronic control unit ECU43, are connected to the fourth bus B_4 as the multiple electronic control units to be updated. Three electronic control units, from electronic control unit ECU51 to electronic control unit ECU53, are connected to the fifth bus B_5 as a plurality of electronic control units to be updated.
[0022] As shown in FIG. 3(a), when comparing the data amounts of the four update data transferred through the first bus B_1, the update data transferred to the electronic control unit ECU13 has the largest data amount. The update data with the second largest data amount after the update data transferred to the electronic control unit ECU13 is the update data transferred to the electronic control unit ECU12. The update data with the second largest data amount after the update data transferred to the electronic control unit ECU12 is the update data transferred to the electronic control unit ECU14. Of the four update data transferred through the first bus B_1, the update data with the smallest data amount is the update data transferred to the electronic control unit ECU11. Therefore, in the transfer queue for the first bus B_1, as shown in FIG. 3(a), transfer events addressed to the electronic control unit ECU13, the electronic control unit ECU12, the electronic control unit ECU14, and the electronic control unit ECU11 are stored in this order.
[0023] 3(a), in each of the transfer queues for the second bus B_2 to the fifth bus B_5, transfer events are similarly stored in descending order of data volume. In this way, the processing circuit 11 creates each transfer queue by rearranging the update data to be transferred in the process of step S110 in descending order of data volume.
[0024] In the next step S120, the processing circuit 11 determines whether the number of transfer threads is less than the number of destination buses to which the update data is to be transferred. For example, if the number of destination buses is five as in the example of FIG. 3 above, the processing circuit 11 determines that the number of transfer threads is less than the number of destination buses to which the update data is to be transferred.
[0025] In the process of step S120, if the processing circuit 11 determines that the number of transfer threads is less than the number of destination buses to which the update data is transferred (S120: YES), the process proceeds to step S130.
[0026] In the process of step S130, the processing circuit 11 compares the amount of transfer data in each transfer queue and assigns three transfer threads to the transfer queues. When there are five transfer destination buses as in the example of FIG. 3 above, one transfer thread is assigned to each of the three transfer queues with the largest amount of transfer data among the five transfer queues. For example, in the example shown in FIG. 3(a), the bus with the largest amount of transfer data is the second bus B_2. The bus with the second largest amount of transfer data is the third bus B_3. The bus with the third largest amount of transfer data is the first bus B_1. Therefore, the processing circuit 11 assigns one transfer thread each to the transfer queue of the second bus B_2, the transfer queue of the third bus B_3, and the transfer queue of the first bus B_1. In the example of FIG. 3(a), the processing circuit 11 assigns the first thread S_1 to the transfer queue of the first bus B_1. The processing circuit 11 assigns the second thread S_2 to the second bus B_2. The processing circuit 11 assigns the third thread S_3 to the third bus B_3. Once the processing circuit 11 has assigned the transfer threads in this manner, the process proceeds to step S140.
[0027] Depending on the configuration of the in-vehicle network system in the vehicle 100 to which the rewriting device 10 is connected, the number of transfer threads may be equal to or greater than the number of destination buses to which the update data is transferred. In this case, the processing circuit 11 can assign one transfer thread to each transfer queue of all buses. In the processing of step S120, if the processing circuit 11 determines that the number of transfer threads is equal to or greater than the number of destination buses to which the update data is transferred (S120: NO), the processing proceeds to step S140.
[0028] In the process of step S140, the processing circuit 11 starts transferring the update data in the transfer queue of the bus to which the transfer thread is assigned. The processing circuit 11 transfers the update data to the gateway device GW_ECU using the transfer thread in accordance with the order of the transfer events in the transfer queue. The processing circuit 11 has three transfer threads. Therefore, the processing circuit 11 can transfer up to three update data in parallel. The gateway device GW_ECU transfers the update data transferred from the rewriting device 10 to the destination electronic control unit via the bus to which the destination electronic control unit is connected. Then, the electronic control unit that receives the update data executes the program update.
[0029] In the next step S150, the processing circuit 11 determines whether or not the transfer of any update data has been completed. If the processing circuit 11 determines in the processing of step S150 that the transfer of any update data has not been completed (S150: NO), the processing of step S150 is repeated. On the other hand, if the processing circuit 11 determines in the processing of step S150 that the transfer of any update data has been completed (S150: YES), the processing proceeds to step S160.
[0030] FIG. 3(b) shows an example in which parallel transfers are performed by assigning one transfer thread each to the first bus B_1, the second bus B_2, and the third bus B_3. FIG. 3(b) shows the state at the time when the transfer of update data from the electronic control unit ECU13 is completed and the first transfer event in the transfer queue of the first bus B_1 is completed. The amount of update data remaining to the right of the dashed line L_1 in FIG. 3(b) represents the amount of remaining transfer data in each transfer queue. In this example, parallel transfers were performed to the first bus B_1, the second bus B_2, and the third bus B_3, to which transfer threads were assigned. Therefore, as shown in FIG. 3(b), the amount of remaining transfer data in the transfer queues of these buses decreases. On the other hand, the amount of remaining transfer data in the transfer queues of the fourth bus B_4 and the fifth bus B_5, to which transfer threads were not assigned, remains unchanged. When the transfer of the update data of the electronic control unit ECU13, which has the smallest amount of data among the update data being transferred, is completed, the processing circuit 11 determines that the transfer of any of the update data has been completed (S150: YES).
[0031] In the process of step S160, the processing circuit 11 determines whether there is a bus on which a transfer is pending. As shown in FIG. 3(b), a transfer event in a transfer queue to which a transfer thread has not been assigned is not executed. A bus on which a transfer event has not been executed because a transfer thread has not been assigned is a bus on which a transfer is pending. In the example shown in FIG. 3(b), the fourth bus B_4 and the fifth bus B_5 are buses on which a transfer is pending. In the process of step S160, if the processing circuit 11 determines that there is a bus on which a transfer is pending (S160: YES), the process proceeds to step S170.
[0032] In the process of step S170, the processing circuit 11 reviews the allocation of transfer threads and starts transfer to the bus with the largest amount of remaining transfer data. Specifically, the processing circuit 11 searches for the bus with the largest amount of remaining transfer data from among the buses on hold for transfer and the buses that have completed transfer of update data. Then, the processing circuit 11 allocates the transfer thread that was allocated to the transfer queue of the bus that has completed transfer to the transfer queue of the bus with the largest amount of remaining transfer data.
[0033] In the example shown in FIG. 3(b), among the first bus B_1, the fourth bus B_4, and the fifth bus B_5, the bus with the largest amount of remaining transfer data is the fifth bus B_5. Therefore, the processing circuit 11 assigns the first thread S_1, which was assigned to the transfer queue of the first bus B_1, to the transfer queue of the fifth bus B_5. Then, the processing circuit 11 starts transferring the update data in the transfer queue of the fifth bus B_5. After the processing of step S170 is executed, the processing returns to the processing of step S150.
[0034] In this way, the processing circuit 11 repeatedly executes the processes of steps S150 to S170 while there is a bus on which transfer is suspended. As a result, every time the transfer of any update data is completed, the transfer thread is reallocated to the transfer queue of the bus with the largest amount of remaining transfer data. Then, parallel transfer using the three threads continues.
[0035] FIG. 3(c) shows the state at the time when the transfer threads are reassigned to the fifth bus B_5 and parallel transfer is performed, the transfer of update data for the electronic control unit ECU 33 is completed, and the first transfer event in the transfer queue for the third bus B_3 is completed. The amount of update data shown to the right of the dashed line L_2 in FIG. 3(b) represents the amount of transfer data remaining in each transfer queue at this time. When the transfer of update data for the electronic control unit ECU 33 is completed, the processing circuit 11 determines that the transfer of one of the update data has been completed (S150: YES). In this example, the third thread S_3 assigned to the transfer queue for the third bus B_3 is assigned to the transfer queue for the fourth bus B_4. Then, the transfer of update data addressed to the electronic control unit ECU 42, which is the first transfer event in the transfer queue for the fourth bus B_4, begins. By repeating the processes from step S150 to step S170 in this manner, a transfer queue that has consumed all transfer events will eventually appear. Eventually, there will be no buses holding the transfer of update data.
[0036] In the process of step S160, if the processing circuit 11 determines that there is no bus on which transfer is pending (S160: NO), the process proceeds to step S180. In the process of step S180, the processing circuit 11 determines whether or not the transfer of all update data has been completed.
[0037] In the process of step S180, if the processing circuit 11 determines that the transfer of all update data has not been completed (S180: NO), the process of step S180 is repeated. That is, in this case, the transfer of update data continues without reallocating the transfer thread. On the other hand, in the process of step S180, if the processing circuit 11 determines that the transfer of all update data has been completed (S180: YES), this transfer routine ends. In this way, the transfer of update data from the rewriting device 10 to the gateway device GW_ECU is completed.
[0038] <Operation of this embodiment> If the number of buses transferring update data is greater than the number of transfer threads, only the update data in the transfer queue to which the transfer thread is assigned will be transferred. Therefore, if the transfer thread assignment is not changed midway, only the program update of the electronic control units connected to some of the buses will proceed. As a result, a large discrepancy in the progress of the program update for each bus will occur. In this case, the waiting time until the transfer of the update data in the last remaining transfer queue is completed and the program update of the electronic control unit is completed will be long. In response to this, the rewriting device 10 reallocates a transfer thread to a transfer queue with a large amount of transfer data each time the transfer of one update data is completed, and continues the parallel transfer. This allows the rewriting device 10 to prevent the progress of update data transfer from being biased toward any one transfer queue.
[0039] FIG. 4(a) shows the transfer schedule of update data on each bus until the transfer routine is completed in the example shown in FIG. 3. FIG. 4(b) is a diagram arranging this transfer schedule for each transfer thread. As shown in FIG. 4(b), each transfer thread is always transferring some update data. The amount of data transferred in each transfer thread does not differ greatly. In other words, the rewriting device 10 has a long period during which parallel transfers are performed by all transfer threads. This allows the rewriting device 10 to shorten the time until the transfer of all update data is completed.
[0040] <Effects of this embodiment> (1) The rewriting device 10 can adjust the order of transfer of update data so as to shorten the transfer time of the update data, and can quickly complete the update of the program in the in-vehicle network system.
[0041] (2) In the rewriting device 10, the processing circuit 11 sorts the update data in descending order of data volume and creates a transfer queue for each bus. As a result, when a transfer thread is assigned, the update data with the largest data volume is transferred first. As the transfer routine approaches completion, the volume of each remaining update data decreases. Therefore, as the transfer routine approaches completion, the cycle for changing the transfer thread assignment becomes shorter. Therefore, the rewriting device 10 can adjust the transfer order of the update data so as to minimize the discrepancy in the amount of data transferred in each transfer thread. The rewriting device 10 can adjust the transfer order of the update data so as to minimize the transfer time of the update data.
[0042] (3) In the rewriting device 10, when the number of buses is equal to or less than the number of threads, the processing circuit 11 assigns one thread to each transfer queue and transfers update data in parallel. When threads can be assigned to all buses, the process of comparing the amount of transfer data in each transfer queue is not executed. Therefore, the rewriting device 10 can reduce the processing load on the processing circuit 11.
[0043] (4) The rewriting device 10 is equipped with a communication device 15. In the rewriting device 10, the processing circuit 11 uses the communication device 15 to store update data downloaded from the server 20 in the storage device 12. The rewriting device 10 can download and use the latest update data from the server 20.
[0044] (5) The program rewriting method executed by the rewriting device 10 includes a step of acquiring information on the number of buses connected to the gateway device GW_ECU and the number of electronic control units connected to each bus. This program rewriting method also includes a step of creating a transfer queue for each bus by collecting update data to be transferred to each electronic control unit based on the acquired information. This program rewriting method also includes a step of comparing the transfer data amounts in the transfer queues and assigning multiple threads to the transfer queues, one by one, in descending order of the transfer data amounts. This program rewriting method also includes a step of transferring update data in the transfer queues to which threads are assigned, in parallel to the gateway device GW_ECU, when the transfer of one update data item in any of the transfer queues is completed, comparing the transfer data amounts between the transfer queue to which the update data transfer has been completed and the transfer queue to which no thread is assigned and for which the update data transfer was suspended, and assigning the thread assigned to the transfer queue to which the transfer has been completed to the transfer queue with the largest amount of transfer data, thereby continuing the parallel transfer. The program rewriting method also adjusts the transfer order of update data to shorten the transfer time of the update data. The above program rewriting method can quickly complete updating of a program in an in-vehicle network system.
[0045] <Example of change> This embodiment can be modified as follows: This embodiment and the following modifications can be combined with each other within the scope of technical compatibility.
[0046] The processing circuit 11 does not necessarily have to sort the update data in descending order of data volume and create a transfer queue for each bus. FIG. 5(a) shows an example in which a transfer queue for each bus is created without sorting the update data in descending order of data volume. The data volume of each update data is the same as in the example shown in FIG. 3(a). In this case, the transfer routine can be executed in the same manner as the rewriting device 10 of the above embodiment. As shown in FIG. 5(b), when the transfer of the update data for the electronic control unit ECU 11 is completed, a transfer thread is assigned to the transfer queue of the fifth bus B_5, which has the largest amount of remaining data to be transferred. Then, as shown in FIG. 5(c), when the transfer of the update data for the electronic control unit ECU 21 is completed, a transfer thread is again assigned to the transfer queue of the second bus B_2, which has the largest amount of remaining data to be transferred.
[0047] FIG. 6(a) shows the transfer schedule of update data on each bus until the transfer routine is completed in the example shown in FIG. 5. FIG. 6(b) is a diagram in which this transfer schedule is arranged by transfer thread. As shown in FIG. 6(b), each transfer thread is always transferring some update data. The amount of transfer data in each transfer thread differs from the example shown in FIG. 4(b), but not by a large amount. In other words, even if the process of sorting the update data in descending order of data amount is omitted, the rewriting device 10 can shorten the time until the transfer of all update data is completed.
[0048] The number of transfer threads is not limited to three. The number of transfer threads may be two, four, or more. In the above embodiment, an example was shown in which a program update is executed from an electronic control unit to which the transfer of update data has been completed. The vehicle network system may be configured such that, once the transfer of all update data is completed, all electronic control units that have received the update data start updating their programs. In any case, the more quickly the transfer of all update data is completed, the more quickly the program updates of each electronic control unit in the vehicle network system can be completed.
[0049] The rewriting device 10 does not have to include the communication device 15. A rewriting device 10 that does not include the communication device 15 can obtain the latest update data by connecting the rewriting device 10 via a wired connection to a device in which update data is recorded. [Explanation of symbols]
[0050] 10...rewriting device, 11...processing circuit, 12...storage device, 13...display device, 14...input device, 15...communication device, 16...cable, 20...server, 30...network, 100...vehicle, 110...transfer bus, 120...connector, GW_ECU...gateway device, ECUnm...electronic control unit, B_1...first bus, B_2...second bus, B_3...third bus, B_4...fourth bus, B_5...fifth bus, B_n...nth bus, S_1...first thread, S_2...second thread, S_3...third thread
Claims
1. a program rewriting device connected to an in-vehicle network system in which a gateway device is connected to a plurality of buses to which a plurality of electronic control units are respectively connected, the program rewriting device rewriting programs of the plurality of electronic control units, a storage device that stores update data to be transferred to the plurality of electronic control units; a processing circuit; and a plurality of threads that transfer the update data to the gateway device; the processing circuitry acquiring information on the number of the plurality of buses connected to the gateway device and the plurality of electronic control units connected to each bus; based on the information, the update data to be transferred to each electronic control unit is collected for each bus to create a transfer queue for each bus; comparing the amounts of transfer data in the transfer queues and allocating the plurality of threads one by one to the transfer queues in descending order of the amount of transfer data; transferring the update data in the transfer queue to which the threads are assigned to the gateway device in parallel using the plurality of threads; Each time the transfer of one of the update data in any of the transfer queues is completed, the transfer amount of the update data is compared between the transfer queue to which the transfer of the update data has been completed and the transfer queue to which the thread has not been assigned and the transfer of the update data has been put on hold, and the thread that has been assigned to the transfer queue to which the transfer has been completed is assigned to the transfer queue with the largest amount of transfer data, thereby continuing the parallel transfer. Program rewriting device.
2. The processing circuit arranges the update data in descending order of data volume to create the transfer queue.
2. The program rewriting device according to claim 1.
3. When the number of the buses is equal to or less than the number of the plurality of threads, the processing circuit assigns the plurality of threads one to each transfer queue and transfers the update data in parallel.
2. The program rewriting device according to claim 1.
4. Equipped with a communication device, The processing circuit stores the update data downloaded from the server using the communication device in the storage device.
2. The program rewriting device according to claim 1.
5. A program rewriting method executed by a program rewriting device that rewrites programs of a plurality of electronic control units in an in-vehicle network system in which a plurality of buses, each connected to a plurality of electronic control units, are connected to a gateway device, the method comprising: acquiring information on the number of the plurality of buses connected to the gateway device and the plurality of electronic control units connected to each bus; a step of collecting update data to be transferred to each electronic control unit for each bus based on the information and creating a transfer queue for each bus; comparing the amounts of transfer data in the transfer queues and allocating the plurality of threads one by one to the transfer queues in descending order of the amount of transfer data; transferring the update data in the transfer queue to which the threads are assigned to the gateway device in parallel using the plurality of threads; When the transfer of one of the update data in any of the transfer queues is completed, the transfer queue to which the transfer of the update data has been completed and the transfer queue to which the thread has not been assigned and the transfer of the update data has been put on hold are compared in terms of the amount of transfer data, and the thread that was assigned to the transfer queue to which the transfer has been completed is assigned to the transfer queue with the largest amount of transfer data, thereby continuing the parallel transfer. How to rewrite a program.
Citation Information
Patent Citations
Bus device
JP2005284578A
Gateway device and data transmission method
JP2010271891A
Relay device and external device
JP2021056804A