The present invention relates to a vehicle-mounted control device, a program writing device, a program generating device, and a program.
In related reprogramming, a personal computer (PC), serving as a writing tool, and a vehicle-mounted control device (ECU: engine control unit) are connected via a controller area network (CAN) which operates in slow speed and a load module (a new program) is divided and transmitted to be written in a flash memory in the ECU.
Further, also in a case that a part of the new program to be updated in the older version of the program is small, the entire new program is transferred via the CAN and the entire new program is written.
Thus, there has been a problem that writing takes time. To address this problem, a concept of differential reprogramming has been proposed (PTL 1, for example). In other words, in paragraph 0020 in PTL 1, difference rewriting is described as one of rewriting method.
PTL 1: JP 2011-081604 A
In such a technology disclosed in PTL 1, a difference between an entire new program and an older version of the entire program is transmitted in general.
However, although a microcomputer in the ECU has a large FLASH memory to store a program, the size of the static random access memory (SRAM) used as a work memory is small. Thus, it has been difficult to store a difference between the entire new program and the older version of the entire program in the SRAM and restore the entire new program.
The present invention has an object to provide a vehicle-mounted control device, a program writing device, a program generating device, and a program, which are capable of quickly and easily carrying out reprogramming.
To achieve the above object, focusing on that the FLASH memory mounted in the microcomputer of the ECU is configured from a plurality of blocks, a basic concept of the present invention is to divide a new program and an older version of the program into units of blocks, transfer, to a vehicle control device, compressed difference data in which a difference between the new program of the block and the older version of the program in more than one blocks is compressed, restore the new program by using the older version of the program in more than one blocks in the FLASH memory after decompressing the compressed difference data received in the vehicle control device, and write the restored new program to the block in the FLASH memory, and the above processes are repeated for each block. With this configuration, since the difference is further compressed, the entire new program can be restored even with a small SRAM by restoring the program in units of blocks. It is noted that, when the SRAM is sufficient in size, the compressed difference data may be generated with a difference generated by using the new program in unit of more than one blocks and the program may be restored. Further, the present invention has an object to shorten the write time by using the compressed difference data in which the difference is compressed, without simply using the difference between the new program and the older version of the program.
Based on the above describe basic concept, the present invention includes a non-volatile memory (FLASH) which is configured from a plurality blocks and stores an older version of a program, a volatile memory (SRAM), a communication unit that receives a frame including block data, which includes compressed difference data obtained by dividing a new program and the older version of the program in a size of the blocks and compressing a difference between the new program in the block and the older version of the program in more than one blocks, or compressed data in which the new program in the block is compressed, a type of the block data, and an address of the block in the non-volatile memory (FLASH), and a computation unit that restores the new program in the block, in the volatile memory (SRAM), from the block data and the older version of the program in more than one blocks according the type of the block data or restores the new program in the block, in the volatile memory (SRAM), from the block data, and writes the restored new program of the block to the block corresponding to the address.
According to the present invention, reprogramming can be carried out quickly and easily. In addition to the above, other objects, configurations, and effects will be described in the following embodiment.
In the following, a configuration and operation of a system including a vehicle-mounted control device according to an embodiment of the present invention will be described with reference to the drawings.
Firstly, with reference to
The system includes a program generating device 100 and a vehicle-mounted system 3.
The program generating device 100 generates data from a new program and an older version of the program stored in a vehicle-mounted control device in the vehicle-mounted system 3 and transmits the generated data to the vehicle-mounted system 3. The details will be described later with reference to FIGS. 8 to 15.
The program generating device 100 includes a PC 1 and a server 2. The PC 1 is connected to the server 2 via a local area network (LAN) for example. Here, the PC 1 and server 2 may be directly connected by using a crossover cable.
The program generating device 100 wirelessly communicates with the vehicle-mounted system 3. The communication is performed via the Internet, a cellular network, or a wireless LAN, for example. Here, in
The vehicle-mounted system 3 receives data from the program generating device 100 and updates a program of the vehicle-mounted control device included in the vehicle-mounted system 3 based on the received data. Here, the details will be described later with reference to
Next, with reference to
The PC 1 includes a computation unit 201 such as a central processing unit (CPU), an input unit 202 such as a keyboard and a mouse, a display unit 203 such as a liquid crystal display (LCD), a communication unit 204 such as a network interface card (NIC), and a memory unit 205 such as a random access memory (RAM), a read only memory (ROM), and a hard disk drive (HDD). The computation unit 201, input unit 202, display unit 203, and communication unit 204 are connected to a bus.
The memory unit 205 stores an old version of a program which is the same program stored in a FLASH memory of the vehicle-mounted control device in the vehicle-mounted system 3 and a new program which is an update of the old version of the program.
Here, a configuration of the server 2 of
Next, with reference to
The vehicle-mounted system 3 includes a gateway 310 (a program writing device) and a plurality of ECUs 300 (3001 to 300n). The gateway 310 and ECUs 300 communicate with each other via a vehicle-mounted network CAN.
The gateway 310 relays data between an external network and an in-vehicle CAN when an authentication is succeeded.
The ECU 300 includes a microcomputer 301, various integrated circuits (ICs) 304 corresponding to usage of each ECU 300, and a communication unit 305 such as a CAN transceiver. The microcomputer 301 internally includes an SRAM 302 (a volatile memory) and a FLASH memory 303 (non-volatile memory).
Here, the configuration of the gateway 310 is also basically same as the configuration of the ECU 300 and further includes a communication unit compatible with a protocol of the vehicle external network. In other words, the gateway 310 includes a communication unit 315 such as a microcomputer 311, various ICs 314, a CAN transceiver, and the like and a communication unit 316 compatible with the protocol of the vehicle external network. The microcomputer 311 internally includes an SRAM 312 and a FLASH memory 313.
Next, with reference to
The SRAM 302 includes a first area 302a that temporarily stores data and a second area 302b that restores the data stored in the first area 302a.
According to the present embodiment, as an example, the size of the SRAM 302 is 96 kB, the size of the first area 302a is 16 kB, and the size of the second area 302b is 64 kB.
Next, with reference to
The FLASH memory 303 is configured from blocks in different sizes. According to the present embodiment, as an example, the size of the FLASH memory 303 is 2 MB. The FLASH memory 303 has two types of blocks of 8 kB and 64 kB. Here, the block is a minimum unit to delete the data. For example, when 4 kB data is to be written in a 8 kB block, the 4 kB data is written after deleting 8 kB data.
As illustrated in
Further, the FLASH memory 303 stores restoration software for restoring a new program in the second area 302b of the SRAM 302 from the data in the first area 302a and the older version of the program already existing in the FLASH memory 303 or restoring a new program by decompressing compressed data in the first area 302a, according to the type of the data temporarily stored in the first area 302a of the SRAM 302.
Next, with reference to
The computation unit 201 (the compressed difference data generating software 600) generates difference data 630 by using the input of the older version of the program 610 and new program 620. A difference generating unit 601 generates a difference between the older version of the program and the new program, and a compression unit 602 compresses the difference and generates the compressed difference data 630. In this manner, the difference compression generating software 600 compresses the data to generate compressed difference data in a smaller size, in addition to simply generating the difference.
Next, with reference to
The computation unit 201 (the compressed data generating software 700) generates compressed data 730 by using an input of the new program 620. A compression unit 701 has a function for compressing a program. In this manner, the compressed data generating software performs an operation to simply compress the input program and generate compressed data.
Next, with reference to
When the sizes of the compressed difference data of the older version of the program and the new program and the compressed data of the new program are compared, the compressed difference data is smaller in general. Here, the compressed difference data becomes smaller in size since the information of the older version of the program can be used. However, in a case that the older version of the program and the new program are very different from each other, the compressed data may become smaller since there are so many different parts. Further, when the older version of the program is not stored in the FLASH memory in the ECU 300 (in a case of first writing), compressed difference data cannot be generated.
A configuration and an operation of the selection-function-included compressed difference data generating software 800 illustrated in
When the size of the compressed difference data 841 is equal to or smaller than a reference value (a threshold value) in a determination 842 (842: YES), the selection unit 840 outputs the compressed difference data 841 as output data 850. When the compressed difference data 841 is larger than the reference value (842: NO), the selection unit 840 instructs the compression unit 820 via 815 to compress the new program 620. The compression unit 820 generates compressed data 843 and temporarily stores the compressed data 843 in selection unit 840. The selection unit 840 selects, by a selection means 844, smaller data of the compressed difference data 841 and compressed data 843 and outputs the selected data as the output data 850.
As a result, compressed difference data or compressed data which is smaller in size can be obtained. On the other hand, when the determination 831 made by the input determination unit 830 is NO, the new program 620 is transmitted to the compression unit 820 via 815 and compressed data 843 is generated. The selection unit 840 selects, by the selection means 844, the compressed data 843 and outputs the compressed data 843 as the output data 850.
As described above, the selection-function-included compressed difference data generating software 800 can generate output data in a smaller size, compared to the compressed difference data generating software 600. Further, even when there is no older version of the program, the new program can be compressed and output. Here, a further simplified configuration may be considered. For example, when the compressed data 843 is generated, the compressed data 843 may be output as the output data 850 without comparing the sizes by the selection means 844. This is because that the selection means 844 may not be needed since it is determined that the size of the compressed difference data is equal to or larger than the reference value in the determination 842. Further, the new program as an input may be a new program of one block among a plurality of divided blocks, and the older version of the program may be an older version of the program in some blocks among the plurality of divided blocks.
Next, with reference to
Firstly, necessity of the restriction function will be explained. The compressed difference data and compressed data are transmitted to the ECU 300 and received in the first area 302a of the ECU 300. However, in a case that the compressed difference data or compressed data is larger than the first area 302a, the whole data cannot be received or restored as a result. This is the necessity of the restriction.
Thus, the restriction-function-included compressed difference data generating software 900 has a configuration including a restriction unit 980 in addition to an input determination unit 910, a difference generating unit 950, a compression unit 960, and a selection unit 970. In the following, a process operation will be explained. As an input, there is a first area size 1S (925) of the ECU 300, which is information used in the restriction unit 980.
Firstly, the input determination unit 910 determines, in a determination 911, whether the input includes an older version of the program 610 and a new program 620 or only new program 620. When there are the older version of the program 610 and new program 620 (911: YES), the difference generating unit 950 generates a difference and the compression unit 960 generates compressed difference data 971 which is a compressed difference. When the size of the compressed difference data is equal to or smaller than the reference value in the determination 972, the selection unit 970 transmits the compressed difference data 971 to the restriction unit 980 as selected data 981.
When the size of the compressed difference data 971 is larger than the reference value (972: NO), an instruction to compress the new program 620 is sent to the compression unit 960 via 915. The compression unit 960 compresses the new program 620 and generates compressed data 973. The selection means 974 of the selection unit 970 transmits smaller data of the compressed difference data 971 and compressed data 973 to the restriction unit 980 as selected data 981.
The restriction unit 980 compares, in a restriction means 982, the size (SS) of the selected data 981 with the first area size (1S) and outputs the selected data 981 as output data 930 when the selected data 981 is smaller (SS 1S). Here, the selected data 981 is one of the compressed difference data 971 and compressed data 973. On the other hand, the size of the size (SS) of the selected data 981 is larger than the first area size (1S) (SS>1S), the new program is output as it is as the output data 930.
In a case that the new program is output, the new program may be divided and transmitted to the first area and written in the plurality of blocks in the FLASH memory after data in those blocks is deleted.
Next, a flowchart that the PC 1 generates compressed difference data or compressed data by using the selection-function-included compressed difference data generating software 800 of
A basic concept is not that compressed difference data or compressed data is generated for all the entire older version of the program and new program, but that the old version of the program and new program are divided into a plurality of blocks and compressed difference data or compressed data is generated for the new program placed in one of the blocks and the older version of the program placed in one or more of the blocks in the FLASH memory 303 of the ECU 300.
The computation unit 201 of the PC 1 firstly checks whether or not the older version of the program exists in step S10. When there is no older version of the program (S10: NO), the new program is divided into sizes of blocks B(J) (J=1, 2, . . . , N) in the FLASH memory 303 of the ECU 300 in step S40. In step S45, block B(J) is selected and the process is repeated until J becomes equal to N in step S60. In step S50, by using the selection-function-included compressed difference data generating software 800, compressed data is generated by compressing the new program in selected block B(J). Further, the size of the compressed data is also stored.
Next, in step S55, the compressed data in B(J) is transmitted to the server 2. In step S60, it is checked whether or not the processes for all the blocks are completed and, when it is J=N (S60: YES), the process ends. When it is J≠N, it is set as J=J+1, the process returns to step S45 and the processes are repeated.
In step S10, when there is the older version of the program (S10: YES), the new program and older version of the program are divided into sizes of the blocks B(I) (I=1, 2, . . . , N) in the FLASH memory 303 of the ECU 300 in step S15. Here, the memory unit 205 of the PC 1 stores sizes of the respective blocks B(I) in the FLASH memory 303 of the ECU 300, addresses of the blocks B(I), and an ID (identifier) of the ECU 300.
The computation unit 201 of the PC 1 performs a loop initialization (I=1) related to the blocks B(I) (step S20). In step S25, the computation unit 201 of the PC 1 inputs the new program in the block B(I) and the older version of the program in the I number of blocks B(I), B(I-1), B(I-2) . . . , B(1), and executes the selection-function-included compressed difference data generating software 800. As a result, compressed difference data or compressed data of the block B(I) is generated. The size thereof is also stored. Then, in step S30, the compressed difference data or compressed data in the block B(I) is transmitted to the server 2. Next, in step S35, it is checked whether or not all the blocks are processed and, when it is I=N, the process ends. When it is I≠N, it is set as I=I+1 and the process returns to step S20 to repeat the processes.
With the above configuration, for each block size in the FLASH memory 303 of the ECU 300, compressed difference data or compressed data, the data size thereof, the block size, and a block address can be transmitted to the server 2.
Next, as another example of the invention, a flowchart will be described with reference to
In step S70, the computation unit 201 of the PC 1 checks whether or not there is an older version of the program. When there is no older version of the program (S70: NO), the new program is divided into blocks and compressed data or the new program, as it is, is transmitted to the server 2 in step S100 and following steps.
Firstly, in step S100, the new program is divided into sizes of blocks B(J) (J=1, 2, . . . , N) in the FLASH memory 303 of the ECU 300. In step S105, block B(J) is selected and the process is repeated until J becomes equal to N in step S120. In step S110, the new program in selected block B(J) and the first area size 1S (925 in
As a result, the compressed data or new program as it is of block B(J) is output. Further, the data size thereof is also stored. In next step S115, the compressed data or new program as it is of B(J) is transmitted to the server 2. In step S120, it is checked whether or not the processes for all the blocks are completed and, when J is equal to N (J=N) (S120: YES), the process ends. When it is J≠N, it is set as J=J+1, and the process returns to step S105 to repeat the process.
When there is an older version of the program in step S70 (S70: YES), the new program and older version of the program are divided into the sizes of blocks B(I) (I=1, 2, . . . , N) in the FLASH memory 303 of the ECU 300 in step S75. Here, the memory unit 205 of the PC 1 stores each size of block B(I) in the FLASH memory 303 of the ECU 300, an address of block B(I), and an identifier (ID) of the ECU 300. The computation unit 101 of the PC 1 performs loop initialization (I=1) related to block B(I) (step S80).
In step S85, the computation unit 201 of the PC 1 inputs the new program placed in block B(I), the older versions of the program placed in the I number of blocks B(I), B(I-1), B(I-2), . . . , and B(1), and the first area size 1S (925 in
With the above configuration, for each block size in the FLASH memory 303 of the ECU 300, compressed difference data, compressed data, or new program as it is, a data size thereof, a block size, a block address can be transmitted to the server 2.
In the above described process flows of the PC 1 in
OL10 in
On the other hand, R10, R20, and R30 represent microcomputer instruction sequences in which reference address of a variable number in V10 is changed according to the addition or change in V10. In other words, since the address of the variable number is changed due to the addition or change in V10 and the current address of the variable number is changed accordingly, the reference addresses in R10 to R30 are also changed at the same time. Thus, in the new program N10, there is the addition or modification in V10 in block B(3), modifications are made in R10 and R20 in block B(5), and a modification is made in R30 in block B(6).
It should be noted there that the actual modification is made only in V10, and, the modification does not cause a big change in the entire new program although there are secondary modification in R10 to R30 due to the modification of V10. Thus, in a case of such a small modification, even when compressed difference data is generated from the older version of the program and new program in the same units of blocks B(I), the data size thereof often becomes equal to or smaller than the reference value.
Thus, when a program is updated due to a software failure, compressed difference data in a sufficiently small size can be obtained by dividing the older version of the program and new program into blocks and generating the compressed difference data from the same blocks.
On the other hand,
The following new program in block B(5) of N20 is different to a great degree from the older version of the program in block B(5) of OL20 and may often be similar to the older version of the program in block B(4) of OL20. This is because that the older version of the program in B(4) of OL20 may be shifted to the part of the new program in B(5) of N20 due to an addition of AD10. Thus, regarding a method to select a proper block to generate compressed difference data, the same blocks cannot be simply used.
Here, CP100 in
The above describes that the details of the outline of selecting an older version of the program in block B(I), which is most preferable to the new program in blocks B(K) (K=1 to N).
Although the outline of selecting only one older block B(I) which is most preferable to the block (K) of the new program has been described, the number of older blocks B(I) may be more than one.
In general, since a difference generating algorithm finds out a similar binary code in the older block and generates a difference, a smaller difference can be generated with an older version of a larger program. Thus, the older blocks which are most preferable to the new block B(6) are six older blocks B(1) to B(6) indicated by CP100A in
In this manner, in a case that a large program is added, it is important to generate compressed difference data in descending order of the block numbers and to select more than one blocks in ascending order of block numbers as the older blocks corresponding to the block of the new program. By selecting the blocks of the older version of the program in this manner, the older version of the program which is used for restoring can be selected even if the block is rewritten in the new program.
Block B(4) of the new program N20 illustrates that a large program AD10B is deleted. Accordingly, the diagram illustrates that the content is similar to the content of the block B(5) of the older version of the program OL20. As a result, it can be considered that the block B(6) of OL20 is the most preferable to the block B(5) of N20. Thus, as the block of the older version of the program preferable to block B(5) of N20, a plurality of blocks B(5) to B(7) including block B(6) of OL20 may be selected. In general, since a difference generating algorithm finds out a binary code similar to the older version of the program and generates a difference, a smaller difference can be generated with an older version of a larger program.
Thus, the plurality of blocks of OL20, which is most preferable to block B(4) of N20, are four older blocks of B(4) to B(7) indicated by CP100B, the plurality of blocks OL20 most preferable to block B(5) of N20 are B(5) to B(7) indicated by CP110B, and the plurality of blocks of OL20 most preferable to block B(6) of N20 are B(6) to B(7) indicated by CP120B. In this manner, when a large program is deleted, it is important to generate compressed difference data in ascending order of block numbers and select a plurality of blocks having a larger number in descending order as a selection of a plurality of older blocks corresponding to the new block. By selecting the blocks of the older version of the program in this manner, the older version of the program which is used for restoring can be selected even if the block is rewritten in the new program.
Firstly,
In step S130, the computation unit 201 of the PC 1 divides the new program into blocks B(K) (K=1 to N) in the FLASH memory 303 of the ECU 300. Next, in step S135, the new program of the block B(K) (K=1: initial value) is selected. In step S140, the older version of the program is divided into blocks B(I) (I=1 to N) in the FLASH memory 303 of the ECU 300. In step S145, block B(I) (I=1: initial value) is selected and, in step S150, compressed difference data of B(K) and B(I) are generated. Next, in step S155, the compressed difference data size and the reference value are compared and, when the compressed difference data size is equal to or smaller than the reference value (step S155: YES), the older version of the program in block B(I) is selected in step S170. On the other hand, when the compressed difference data size is larger than the reference value (step S155: NO), it is set as I=I+1 in step S160 and the process returns to step S145 to repeat the process. As a result of the comparison between all blocks B(I) and the older version of the program in step S155, in a case that the result is NO, since it is determined whether I=N in step S160, the process in step S165 is executed to select no block (select to compress B(K)). Next, in step S175, it is checked whether or not the process for all B(K) (K=1 to N) is completed and, in a case that it is K=N, the process ends. In a case that it is K≠N, it is set as K=K+1, the process returns to step S135 to repeat the process.
With the above configuration, the older version of the program in the most preferable block can be selected for each B(K) (K=1 to N).
In step S130A, the computation unit 201 of the PC 1 divides the new program into blocks B(K) (K=N to 1) in the FLASH memory 303 of the ECU 300. Next, in step S135A, the new program in block B(K) (K=N: initial value) is selected. In step S140A, the older version of the program is divided into blocks B(I) (I=1 to N) in the FLASH memory 303 of the ECU 300.
In step S145A, the older version of the program in the K number of blocks BB (BB=B(1) to B(K)) is selected and, in step S150A, compressed difference data of the new program in B(K) and the older version of the program in BB is generated. Next, in step S155A, the compressed difference data size and the reference value are compared and, when the compressed difference data size is equal to or smaller than the reference value (step S155A: YES), the older version of the program in the blocks B(1) to B(K) is selected in step S170A. On the other hand, when the compressed difference data size is larger than the reference value (step S155A: NO), no block (compression of the new program in B(K)) is selected in step S165A and one is extracted from K (K=K−1) in step S175A and the process returns to step S135A to repeat the process. Here, when K is one (K=1), the process ends. In this manner, starting with the new program in block B(N) of the last block number N, the older version of the program in the plurality of blocks (B(1) to B(K)) corresponding to the new program in B(K) is selected and the compressed difference data thereof is generated.
Further, the order to decode data from the compressed difference data and the older version of the program may be started with the last block.
In step S130B, the computation unit 201 of the PC 1 divides the new program into blocks B(K) (K=1 to N) in the FLASH memory 303 of the ECU 300. Next, in step S135B, the new program of block B(K) (K=1: initial value) is selected. In step 9140B, the older version of the program is divided into blocks B(I) (I=1 to N) in the FLASH memory 303 of the ECU 300.
In step S145B, the older version of the program in a plurality of blocks BB (BB=B(K) to B(N)) is selected and, in step S150B, compressed difference data of the new program in B(K) and the older version of the program in BB is generated. Next, in step S155B, the compressed difference data size and the reference value are compared and, when the compressed difference data size is equal to or smaller than the reference value (step S155B: YES), the older version of the program in block B(K) to B(N) is selected in step 9170B. On the other hand, when the compressed difference data size is larger than the reference value (step S155B: NO), no block (compression of the new program in B(K)) is selected in step 9165B, it is set as K=K+1 in step S175B, and the process returns to step S135B to repeat the process. Here, in a case that it is K=N, the process ends. In this manner, starting with the new program in block B(1) having the first block number 1, the older version of the program in the plurality of blocks (B(K) to B(N)) corresponding to the new program in B(K) is selected, and compressed difference data thereof is selected.
Further, the order of decoding from the compressed difference data and the older version of the program may be started with the first block.
The above explains in detail a method to select the older version of the program in a plurality of blocks most preferable to the new program in a block. Here, in the examples described in
Next, with reference to
In response to a request from the PC 1, the computation unit 201S of the server 2 receives, by the communication unit 204, data (the compressed difference data, compressed data, or new program as it is) in blocks B(K) (K=1 to N) from the PC 1 (step S180). The computation unit 201S of the server 2 stores the data received from the PC 1 to the memory unit 205 (step S185). Here, the computation unit 201S of the server 2 performs a processes from steps S180 to S185 on all the blocks B(K) (K=1 to N).
Next, the computation unit 201S of the server 2 transmits data of B(K) (K=1 to N) stored in the memory unit 205 to the gateway 310 in response to a trigger, which is a predetermined event (step S190). The predetermined event is, for example, a request from the gateway 310 at a predetermined timing, a request from the gateway 310 caused by user's predetermined operation, or the like.
Next, an operation by the gateway 310 will be explained.
In response to a request from the server 2, the microcomputer 311 of the gateway 310 receives data (the compressed difference data, compressed data, or new program) of blocks B(K) (K=1 to N) via the communication unit 316 (step S200). The microcomputer 311 of the gateway 310 stores the data received from the server 2 in the FLASH memory 313 (step S205). Next, the microcomputer 311 of the gateway 310 performs processes from steps S200 to S205 on all blocks B(K) (K=1 to N).
The microcomputer 311 of the gateway 310 determines whether or not a requirement of updating the program stored in the FLASH memory 303 of the ECU 300 is satisfied (step S210). For example, when the user performs a predetermined operation in a predetermined driving condition, it is determined that the requirement to update the program is satisfied.
When the requirement to update the program is satisfied (step S210: YES), the microcomputer 311 of the gateway 310 generates a frame from the data stored in the FLASH memory 313 (step S215).
In detail, as illustrated in
Here, to the command f1, a command to instruct for writing is set. The block data is the compressed difference data, compressed data, or new program of block B(K). The block data type f2 indicates whether the block data is the compressed difference data, compressed data, or new program. The block data size f3 indicates the size of the compressed difference data size, compressed data size, or the size of the new program as it is.
In this manner, the microcomputer 311 (computation unit) of the gateway 310 (the program writing device) generates a frame in which the block data type f2 is added to the block data f6.
Here, in
Referring back to
Next, restoration software provided in the FLASH memory 303 of the ECU 300 will be explained.
Inputs to the computation unit 301 (restoration software 1800) are compressed difference data 1810 and an older version of the program 1820. The restoration software 1800 includes a decompression unit 1840 for decompress the compressed difference data and a difference restoring unit 1850 for restoring a new program 1830 from a difference as an input from the decompression unit 1840 and the older version of the program 1820. In this manner, the restoration software 1800 is composed of the decompression unit and the difference restoring unit.
On the other hand, to handle selection-function-included compressed difference data and restriction-function-included compressed difference data, it is needed to restore the compressed data as well as the compressed difference data.
Firstly, inputs to the computation unit 301 (restoration software 1900) are block data 1910 and an older version of the program 1920. The block data 1910 is compressed difference data or compressed data. The new program, as it is, is not handled by the restoration software 1900, which will be described later with reference to
The restoration software 1900 has a characteristic that a data type determination unit 1960 is included in addition to a decompression unit 1940 and a difference restoring unit 1950. When the block data 1910 is input, the decompression unit 1940 generates data by decompressing the block data 1910. When it is determined that the type of the decompressed data is a difference in a determination 1961, the data type determination unit 1960 transfers the difference to the difference restoring unit 1950. The difference restoring unit 1950 generates new program 1930 by using the difference and the older version of the program 1920 as inputs. On the other hand, when it is determined the type of the decompressed data is a new program in the determination 1961, the new program is output as the new program 1930.
In this manner, the restoration software 1900 includes a function to determine a difference or new program in the restoration software 1900. The output data 850 of the selection-function-included compressed difference data generating software 800 in
Next, a flowchart will be explained with reference to
When a frame is received in step S230, the ECU 300 inputs its block data and an older version of the program in the blocks of the FLASH memory in the ECU 300 to the restoration software 1900 in step S235 and executes the restoration software 1900. As a result, the new program is restored in a second area in the SRAM. Next, in step S240, block in the FLASH having the address f4 in the ECU 300 is deleted and rewritable. At last, in step S245, the new program in the second area of the SRAM is written in the block and the process ends.
With the above configuration, the new program can be updated for each block. All of the programs can be updated by receiving all of the frames (step S230) and writing the new program in each block.
Next, a flowchart will be explained with reference to
When a frame is received in step S250, the ECU 300 defines two cases including a case of compressed difference data or compressed data and a case of a new program as it is based on the block data type f2 in step S255. In the case of compressed difference data or compressed data, in step S260, the block data and the older version of the program in the block of the FLASH memory in the ECU 300 are input to the restoration software 1900 and the restoration software 1900 is executed.
As a result, the new program is restored in the second area of the SRAM. Next, in step S265, the block in the FLASH of the address f4 in the ECU 300 is deleted and made rewritable. Next, in step S270, the new program in the second area of the SRAM is written in the block and the process ends. On the other hand, when the case that the block data type f2 is the new program as it is in step S255, the block of the FLASH of the address f4 in the ECU 300 is deleted and made writable in step S265. Next, in step S270, the new program is written in the block and the process ends.
With the above configuration, the new program can be updated for each block. All the programs can be updated by receiving all the frames (step S250) and writing the new program in each block.
As described above, according to the present embodiment, reprogramming can be carried out quickly and easily. Further, the user can perform reprogramming anywhere without bringing the vehicle to a dealer.
Here, the present invention is not limited to the above described embodiment and various modifications are included. For example, the above embodiment has been described in detail to clearly explain the present invention and the present invention is not limit to the configuration including all the above described configurations. Further, a part of the configuration of one embodiment may be replaced with a configuration of another embodiment, and a configuration of one embodiment may be added to a configuration of another embodiment. Further, a part of a configuration of each embodiment may be added with, deleted, or replaced with another configuration.
In the above embodiment, the program generating device 100 includes two computers (the PC 1 and server 2); however, any number of computers may be used.
According to the above embodiment, the data is transmitted in units of blocks from the PC 1 to the server 2; however, the compressed difference data and compressed data in a plurality of blocks may be transmitted at once when the PC 1 and server 2 have sufficient memory capacities. Further, the transmission from the server 2 to the gateway 310 relies on the capacities of the SRAM 312 and FLASH memory 313 in the gateway 310. When the SRAM 312 and FLASH memory 313 have a sufficient size, some pieces of the data may be transmitted all at once.
On the other hand, in the transmission from the gateway 310 to the ECU 300 via the CAN, since the SRAM capacity 302 in the ECU is small, the data needs to be transmitted in units of one or more blocks. The example describes that the SRAM size required to restore is the size of one block; however, the compressed difference data or compressed data may be generated in units of a plurality of blocks according to the size of the SRAM 302. This selection may be determined according to the size of the SRAM 302.
The above described embodiment describes that the FLASH memory 303 is composed of blocks of two sizes; however, the FLASH memory 303 may include blocks in three different sizes. Further, the FLASH memory 303 may include blocks in one size.
Further, a part of or all of the above described configurations, functions, and the like may be realized by hardware by designing an integrated circuit or the like, for example. Further, the above described configurations, functions, and the like may be realized by software by interpreting and executing a program that causes a processer to realize each function. The program that realizes each function and information such as a tale, a file, or the like may be stored in a memory device such as a memory, a hard disk, a solid state drive (SSD), or the like or in a recording medium such as an IC card, an SD card, a DVD, or the like.
Here, the embodiment of the present invention may be made in the following aspects.
(First Aspect)
A vehicle-mounted control device has a configuration that,
when a type of the block data is compressed difference data, the computation unit restores a new program from the block data and the older version of the program stored in a block corresponding to the address, and writes the restored new program in the block of the write address.
(Second Aspect)
A vehicle-mounted control device has a configuration that,
when a type of the block data is compressed data, the computation unit restores a new program from the block data and writes the restored new program in the block of the write address.
(Third Aspect)
A vehicle-mounted control device has a configuration that
the non-volatile memory is configured from at least two blocks in different sizes.
(Fourth Aspect)
A vehicle-mounted control device has a configuration that
the non-volatile memory is a FLASH memory.
(Fifth Aspect)
A vehicle-mounted control device has a configuration that
the volatile memory is an SRAM.
(Sixth Aspect)
A vehicle-mounted control device has a configuration that
the computation unit is a microcomputer and
the volatile memory and non-volatile memory are provided inside the microcomputer.
(Seventh Aspect)
A compressed difference data generating program includes
an input determination step of determining whether or not there is an input of first data, and
in a selecting step,
when it is determined that there is no input of the first data in the input determination step, compressed data in which second data is compressed is output.
(Eighth Aspect)
A compressed difference data generating program includes
an input determination step of determining whether or not there is an input of first data, and
in selecting step,
when it is determined that there is an input of the first data in the input determination step and the size of the compressed difference data is smaller than a reference value, compressed difference data is output.
Number | Date | Country | Kind |
---|---|---|---|
2015-012021 | Jan 2015 | JP | national |
Filing Document | Filing Date | Country | Kind |
---|---|---|---|
PCT/JP2016/050409 | 1/8/2016 | WO | 00 |
Publishing Document | Publishing Date | Country | Kind |
---|---|---|---|
WO2016/121442 | 8/4/2016 | WO | A |
Number | Name | Date | Kind |
---|---|---|---|
6999976 | Abdallah | Feb 2006 | B2 |
7814474 | Chen | Oct 2010 | B2 |
8418167 | Meller | Apr 2013 | B2 |
8615500 | Armangau | Dec 2013 | B1 |
20040054858 | Chandrasekaran | Mar 2004 | A1 |
20060190939 | Chen | Aug 2006 | A1 |
20110066788 | Eleftheriou | Mar 2011 | A1 |
20110173601 | de los Reyes | Jul 2011 | A1 |
20130080580 | Nagai | Mar 2013 | A1 |
20140245275 | Elias | Aug 2014 | A1 |
20150301823 | Hatakeyama | Oct 2015 | A1 |
20160004530 | Liang | Jan 2016 | A1 |
20160364230 | Moeller | Dec 2016 | A1 |
20170228741 | Dilevski | Aug 2017 | A1 |
20180018164 | Kurosawa | Jan 2018 | A1 |
Number | Date | Country |
---|---|---|
2011-081604 | Apr 2011 | JP |
2013-073417 | Apr 2013 | JP |
2014-112419 | Jun 2014 | JP |
2014-182571 | Sep 2014 | JP |
WO-2014148003 | Sep 2014 | WO |
Entry |
---|
Japanese Office Action and its English translation thereof issued in the corresponding application No. 2016-871893 dated Apr. 3, 2018. |
Extended European Search Report dated Dec. 14, 2018 in Application No. 16743046.1. |
Number | Date | Country | |
---|---|---|---|
20180018164 A1 | Jan 2018 | US |