Program update method and update system
By setting the search range and offset area in the program update, the problem of increasing differential data capacity is solved, and faster and more efficient program updates are achieved.
Patent Information
- Application Number
- CN202110752036.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2020-09-07
- Filing Date
- 2021-06-29
- Publication Date
- 2025-02-11
- Estimated Expiration
- 2041-06-29
AI Technical Summary
In program updates using differential data, the capacity of differential data is prone to increase, resulting in an increase in the time required for program updates.
By setting a search range in the first program and setting an offset area at the beginning of the program, the capacity of the differential data is suppressed. The specific method includes setting the search range in the first program to include more data located at the rear address than the data in the second program with the same address as the data in the second program, and setting the data at the beginning of the first program. Excluding offset areas as program data.
Effectively suppresses the increase in the capacity of differential data, reduces the time required for program updates, and reduces processing complexity.
Smart Images

Figure CN114153474B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to a program update method and an update system. Background Art
[0002] For example, there is a known method in which, when updating a program of a control device or the like, instead of sending all the data of the update program (new file) to the control device to be updated, differential data between the update program and the program (old file) serving as the basis is generated and the differential data is sent to the control device to be updated. As a method for generating differential data, Japanese Patent Application Laid-Open No. 2003-337723 discloses a method for generating differential data by sequentially comparing data with the old file in predetermined data units (e.g., 1-byte units) from the beginning of the new file (see Japanese Patent Application Laid-Open No. 2003-337723).
[0003] Here, if the data of the search object (search object data) is searched with the entire range of the old file as the object, there is a possibility that the processing requires a lot of time. In view of this, there is a situation where the search range is set for the old file. In the old file, for example, sometimes the focus is placed on the address behind the address of the search object data on the new file to set the search range. In this way, for example, when a program is added, there may be data located behind the address in the old file in the new file because the program is added to the address in front of itself. In other words, since such data is located in front of the address in the new file in the old file, it is out of the search object and is extracted as a difference. If there is a large amount of such data, the capacity of the differential data becomes large, and there is a possibility that the time required for updating the program increases. Summary of the invention
[0004] The present disclosure has been made to solve the above-mentioned problem, and an object of the present disclosure is to suppress an increase in the capacity of differential data when updating a program using differential data.
[0005] The program update method involved in the present disclosure is a program update method that sends differential data between the first program and the second program from the first device to the second device, and updates the control program installed in the second device to the second program based on the differential data. The update method includes: a step of obtaining the first program; a step of obtaining the second program and searching whether the first program contains search target data divided into search units based on the search range; a step of not extracting the search target data as a difference when the first program contains the search target data, and extracting the search target data as a difference to generate differential data when the first program does not contain the search target data; and a step of outputting the generated differential data to the second device. The search range is set in the first program to include more data located at addresses located behind the address that is located in front of the same address as the search target data of the second program. An offset area that does not contain data as a program is set in the head area of the first program.
[0006] The update system according to another aspect of the present disclosure is an update system that transmits differential data between a first program and a second program to an update target device, and updates a control program installed in the update target device to the second program based on the differential data. The update system includes: a first storage device that stores the first program; a second storage device that stores the second program; and a differential extraction device that generates the differential data and transmits it to the update target device. The differential extraction device obtains the first program and the second program from the first storage device and the second storage device, respectively, and searches the first program for whether the search target data of the second program is included in the first program with the search range as the object for each search unit. If the search target data is included in the first program, the search target data is not extracted as a difference. If the search target data is not included in the first program, the search target data is extracted as a difference to generate differential data. The search range is set in the first program so as to include more data located at addresses located in the rear than data located at addresses located in the front of the same address as the search target data of the second program. An offset area not including data as a program is provided in the head area of the first program.
[0007] According to the above structure, the search range is set in the first program to include more data located at addresses behind the same address as the search object data of the second program than at addresses ahead of the data located at addresses ahead of the same address as the search object data of the second program. In addition, an offset area that does not include data as a program is provided in the head area of the first program. By providing the offset area, for example, even if a program is added and data with a changed address exists, it is possible to suppress the situation where the address of the data in the second program is located behind the address of the data in the first program. Therefore, the search range in the case of searching for the data can include the data. Therefore, it is possible to suppress the situation where the search object data is extracted as a difference, and it is possible to suppress the increase in the capacity of the differential data.
[0008] In one embodiment, the first program is a program that is installed in the second device in order to update the control program and is not updated.
[0009] According to the above configuration, since the first program which is not updated is used to generate the difference data, it is possible to suppress complication of the processing.
[0010] In one embodiment, the control program is a first program. The first program is a program that is one version previous to the second program.
[0011] According to the above configuration, the differential data is the difference between the first program, which is the previous version of the second program, and the second program. Therefore, since the differential data has a capacity corresponding to one update, the capacity of the differential data can be made relatively small.
[0012] In one embodiment, the first program is a program of a version previous to the second program, and when updating from the first program to the second program includes adding data, the data is added to the second program in a manner that reduces an offset region.
[0013] According to the above structure, in the case where data is added due to the update of the program, the above data is added in the second program in a manner of reducing the offset area. By adding data in a manner of reducing the offset area, the address of the data located at an address behind the address where the added data is located in the second program is not changed. In addition, in the second program, the address of the data located at an address in front of the address where the added data is located is moved to the front side. Therefore, in the corresponding data in the first program and the data in the second program, it is possible to prevent the address of the data in the first program from becoming an address in front of the corresponding address of the data in the second program due to the addition of data. Therefore, even if data is added due to the update of the program, it is possible to prevent the search object data from leaving the search range.
[0014] In one embodiment, the first program and the second program are each divided into divided data of a predetermined data size. The capacity of the divided data is larger than the search unit. The search range includes the divided data at the same address as the divided data including the search target data of the second program in the first program, and the divided data at an address later than the divided data.
[0015] According to the above structure, the search range includes the split data at the same address as the split data including the search object data of the second program and the split data at an address later than the split data in the first program. By providing an offset area in the head area of the first program, even if there is data whose address is changed due to program addition, it is possible to prevent the address of the data in the second program from being located later than the address of the data in the first program. Therefore, the search object data can be included in the search range. Therefore, it is possible to prevent the search object data from being extracted as a difference, and it is possible to prevent the capacity of the difference data from increasing.
[0016] In one embodiment, the capacity of the offset region is set based on an estimation of a design change that may be made to a program installed in the second device.
[0017] According to the above configuration, since the capacity of the offset region is set based on an estimation of a design change that may be made to the program installed in the second device, it is possible to suppress setting of an excessive offset region.
[0018] According to the present disclosure, when updating a program using differential data, it is possible to suppress an increase in the capacity of the differential data. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Hereinafter, features, advantages, technical and industrial significance of exemplary embodiments of the present invention will be described with reference to the accompanying drawings, in which like reference numerals represent like components, wherein:
[0020] Figure 1 This is a diagram schematically showing the overall configuration of the software updating system according to the first embodiment.
[0021] Figure 2 This is a diagram for explaining the difference extraction technique.
[0022] Figure 3 This is a diagram for explaining difference extraction when the control program is updated by logic addition.
[0023] Figure 4 This is a diagram for explaining a situation in which a common program is developed in conjunction with an update of a control program.
[0024] Figure 5This is a diagram for explaining the common procedure in Implementation Example 1.
[0025] Figure 6 This is a functional block diagram for explaining the difference extraction processing in the difference extraction device.
[0026] Figure 7 This is a functional block diagram (part 1) for explaining the update process of the control program in the ECU.
[0027] Figure 8 This is a diagram for explaining the effect of providing an offset area in a common program.
[0028] Fig. 9 This is a diagram for explaining the updating of the control program in the second embodiment.
[0029] Fig.10 This is a diagram for explaining the data structure of the control program in the second embodiment.
[0030] Fig.11 This is a functional block diagram for explaining the difference extraction processing of the OTA server.
[0031] Fig.12 This is a functional block diagram (part 2) for explaining the update process of the control program in the ECU. DETAILED DESCRIPTION
[0032] Hereinafter, the embodiments of the present disclosure will be described in detail with reference to the accompanying drawings. In addition, the same reference numerals are attached to the same or corresponding parts in the drawings, and their description will not be repeated.
[0033] [Implementation Method 1]
[0034] <Overall structure of the software update system>
[0035] Figure 1 1 is a diagram schematically showing the overall structure of a software update system 1 according to Embodiment 1. The software update system 1 is a system for updating a control program installed in an ECU (Electronic Control Unit) 100 mounted on a vehicle 200. The updating of the control program in Embodiment 1 includes writing the initial control program to the ECU 100.
[0036] The software updating system 1 includes a first server 10 , a second server 20 , a difference extraction device 30 , and a reprogramming tool 40 .
[0037] The first server 10 stores the control program of the ECU 100. The control program is developed, for example, by a developer who develops the control program of the ECU 100 and is stored in the first server 10. For example, the control program (control program A, B, C, ...) stored in the first server 10 is prepared for each destination (for example, Japan, Europe, North America, China, etc.) of the vehicle 200 equipped with the ECU 100. In the present embodiment, as an example, an example of installing a control program for Japan (hereinafter, also referred to as a "control program") in the vehicle 200 is described.
[0038] The first server 10 also stores attribute information associated with the control program. The attribute information includes identification information for identifying the ECU to which the control program is to be installed.
[0039] The second server 20 stores a common program commonly used in the ECU 100 regardless of the destination of the vehicle 200. The common program is developed by, for example, a developer who develops the common program of the ECU 100 and is stored in the second server 20. For example, the common program is developed based on any one of the control programs A, B, C, ...
[0040] like Figure 1 As shown, the common program is written into ECU 100 in an ECU factory that manufactures the ECU. The common program can be written into ECU 100 using, for example, a writing tool (not shown).
[0041] The ECU 100 in which the common program is written in the ECU factory is transported to a vehicle assembly factory and mounted on the vehicle 200 in the vehicle assembly factory. Although details will be described later, the control program is written in the ECU 100 in a state of being mounted on the vehicle 200 in the vehicle assembly factory.
[0042] The difference extraction device 30 extracts the difference between the common program and the control program, and generates difference data.
[0043] The difference extraction device 30 obtains the control program from the first server 10. In addition, the difference extraction device 30 obtains the common program from the second server 20. The difference extraction device 30 compares the common program with the control program and extracts the difference data. The difference extraction device 30 outputs the generated difference data to the reprogramming tool 40. In addition, the details of the method for generating the difference data will be described later.
[0044] In addition, the difference extraction device 30 obtains the control program and the attribute information from the first server 10. The difference extraction device 30 outputs the attribute information to the reprogramming tool 40 together with the generated difference data.
[0045] The reprogramming tool 40 is installed, for example, in a vehicle assembly plant. The reprogramming tool 40 is configured to be able to communicate with the difference extraction device 30, and obtain the difference data and attribute information from the difference extraction device 30. In addition, the reprogramming tool 40 is configured to be able to communicate with the vehicle 200. The communication between the reprogramming tool 40 and the vehicle 200 may be wired communication or wireless communication.
[0046] After acquiring the difference data and the attribute information from the difference extraction device 30 , the reprogramming tool 40 specifies the vehicle 200 equipped with the ECU 100 to which the control program is to be written based on the attribute information.
[0047] When receiving the difference data from the reprogramming tool 40 , the vehicle 200 outputs the received difference data to the ECU 100 .
[0048] ECU100 includes a CPU (Central Processing Unit), a memory, and an input / output port (not shown). The memory includes a ROM (Read Only Memory) and a RAM (Random Access Memory). The ROM stores control programs executed by the CPU and common programs installed in the ECU factory. The CPU expands the programs stored in the ROM in the RAM and executes them.
[0049] When receiving the difference data, the ECU 100 restores the control program using the difference data and the common program. When the control program is restored, the ECU 100 stores the restored control program in the memory (ROM).
[0050] Here, in the vehicle assembly plant, it is required that the writing of the control program to the ECU 100 of the vehicle 200 (or the updating of the control program) be completed within the tact time. For example, if the capacity of the differential data is large, there is a possibility that the writing of the control program to the ECU 100 (or the updating of the control program) cannot be completed within the tact time. The following specifically describes the case where the differential data becomes large.
[0051] Figure 2 This is a diagram for explaining the difference extraction method. Figure 2 The difference extraction method is explained below. Figure 2As shown, the common program is composed of divided data A1 to Ax (x: a natural number) divided into blocks of the first predetermined data size. The common program (divided data A1 to Ax) is read out from the second server 20 to the difference extraction device 30. In addition, the divided data A1 to Ax divided into blocks of the first predetermined data size are also referred to as "blocks A1 to Ax" hereinafter.
[0052] In addition, the control program is also composed of divided data B1 to By (y: natural number) divided into blocks of the first predetermined data size, similarly to the common program. The control program is sequentially read from the first server 10, for example, in divided data units (block units) to the difference extraction device 30. In addition, the divided data B1 to By divided into blocks of the first predetermined data size are also referred to as "blocks B1 to By" hereinafter.
[0053] The difference extraction device 30 compares the control program division data B1 to By acquired sequentially with the common program division data A1 to Ax acquired together, extracts the difference, and generates difference data.
[0054] More specifically, the difference extraction device 30 searches the divided data of the control program acquired in sequence to determine whether the data (search target data) is included in the common program in units of a second predetermined data size. The second predetermined data size is a data size smaller than the data amount of the block (the first predetermined data size). The difference extraction device 30 identifies the data that cannot be detected as updated data (added or changed data) and extracts it as a difference. The difference extraction device 30 identifies the data that can be detected as existing data and does not extract it as a difference.
[0055] For example, the difference extraction device 30 is Figure 2 The data L (second predetermined data size) of the block B3 of the control program shown is searched to see whether it is included in the common program (division data A1 to Ax), and when there is no data matching the data L in the common program, the data L is extracted as a difference.
[0056] Here, if the search object data (for example, data L) is detected from the entire range of the common program (divided data A1 to Ax), it is possible to accurately search whether the search object data is existing data. On the other hand, the processing requires a lot of time, resulting in processing delays. In view of this, in order to appropriately balance the search accuracy and processing time to extract the difference, the search range of the search object data is determined. The search range is set in the common program, for example, to include a block (any one of A1 to Ax) corresponding to the address of the block (any one of B1 to By) of the control program containing the search object data and a specified number of blocks (for example, 3 blocks, etc.) that are continuous behind the block. The above-mentioned specified amount can be appropriately set from the perspective of search accuracy and processing time.
[0057] To explain using a specific example, for example, in the case of searching for data L in block B3, in the common program, the block corresponding to the address of block B3 containing data L, that is, block A3, and a predetermined number of blocks (for example, if the predetermined number is 3, blocks A4 to A6) that are continuous after block A3 are set as the search range (that is, blocks A3 to A6 are set as the search range). When searching for data L, data L is compared with each data from the data located at the head address of block A3 to the data at the final address of block A6, for example. The reason for setting the search range by focusing on the block (for example, block A3) that corresponds to the address of the block containing the search target data (for example, block B3) is to facilitate the restoration of the control program in ECU 100.
[0058] If the search range is set as described above, in the common procedure, when data L is included in block A3 and / or block A4, data L is detected as existing data because block A3 and block A4 are included in the search range. That is, data L is not extracted as a difference.
[0059] However, in the common program, when the blocks after block A3 do not include data L, but the block with an address earlier than block A3 (for example, block A2) includes data L, the block with an address earlier than block A3 is out of the search range, so data L is not detected as existing data and is extracted as a difference. For example, such a situation may occur due to an update of the control program caused by a design change (especially logic addition).
[0060] In the common program, the search range may be set to include a block (any one of A1 to Ax) corresponding to the address of the control program block (any one of B1 to By) including the search target data, and a predetermined number of blocks (for example, 3 blocks) that are continuous behind the block. In the above specific example, if the data L of block B3 is to be searched, the common program sets the block A2 that is the block corresponding to the address of block B3 including the data L, and a predetermined number of blocks (for example, if the predetermined number is 3, then blocks A3 to A5) that are continuous behind block A2 as the search range (that is, blocks A2 to A5 are set as the search range).
[0061] Figure 3FIG. 2 is a diagram for explaining difference extraction when the control program is updated due to logic addition. Figure 3 As shown in FIG. 1 , for example, it is assumed that the first additional data and the second additional data are added to the control program due to the update of the control program. Due to the addition of the first additional data and the second additional data, for example, data E included in the block Bn before the update is included in the block Bm after the update. On the other hand, since the common program is not updated even if the control program is updated, in the common program, the data E is included in the block An corresponding to the block Bn.
[0062] The search range of data E in the search is block Am corresponding to the address of block Bm including data E and a predetermined number of blocks that are continuous after block Am. That is, in the search of data E, since block An is not included in the search range, data E is not recognized as existing data, resulting in data E being extracted as a difference. Therefore, compared with the case where data E is recognized as existing data, the capacity of differential data may become larger.
[0063] As a countermeasure to the above situation, for example, a common program may be newly developed based on the updated control program. Figure 4 This is a diagram for explaining a situation in which a common program is developed in conjunction with an update of a control program.
[0064] First, if Figure 4 As shown, it is assumed that control program Ver.1 is developed and stored in the first server 10. Furthermore, it is assumed that common program Ver.1 is developed based on control program Ver.1 and stored in the second server 20. At this time, the difference extraction device 30 extracts the difference between common program Ver.1 and control program Ver.1 to generate difference data.
[0065] Next, assume that a design change is added to the control program Ver.1, and the control program Ver.1 is updated to the control program Ver.2. Figure 4 In the example shown, common program Ver. 2 is newly developed based on control program Ver. 2. The difference extraction device 30 extracts the difference between common program Ver. 2 and control program Ver. 2 to generate difference data. By newly developing common program Ver. 2, the capacity of the difference data can be made the same as the capacity of the difference data before the design change (difference data based on the difference between common program Ver. 1 and control program Ver. 1).
[0066] However, in this case, since a common program needs to be developed every time the control program is updated, the development cost increases. When the control program is updated, it is desirable to suppress an increase in the capacity of the difference data without increasing the development cost.
[0067] In view of this, in the software update system 1 involved in the first embodiment, an offset area is set in the head area of the common program. Thus, even if the control program is updated, a new common program is not developed, and the increase in the capacity of the differential data can be suppressed. That is, by setting the offset area in the head area of the common program, even if the control program is updated, the common program (Ver.1) initially developed can be used. The following is a specific description.
[0068] Figure 5 FIG. 1 is a diagram for explaining the common procedure in Implementation Example 1. Figure 5 As shown, an offset area is set in the head area of the common program. The offset area is, for example, a blank area that does not include data as a control program. Alternatively, the offset area may be an area that includes dummy data that does not function as a control program.
[0069] By setting an offset area, the addresses of corresponding data in the initial control program (Ver.1) and the common program (Ver.1) developed based on the initial control program are different. Specifically, by setting an offset area, for example, the address of data E in the common program becomes an address behind the address of data E in the control program. Therefore, even if the address of data E in the control program is moved backward by adding, for example, the first additional data and the second additional data by updating the control program, the block of the common program including data E can be included in the search range in the search for data E. Therefore, data E is identified as existing data and is not extracted as a differential. Therefore, compared with the case where data E is extracted as a differential, the increase of differential data can be suppressed.
[0070] The offset region is determined based on, for example, a prediction of design changes that can be made in the development of the control program. For example, the offset region is set to a region of three blocks, etc. The model life of the vehicle 200 may also be considered in setting the offset region.
[0071] Figure 6 This is a functional block diagram for explaining the difference extraction process in the difference extraction device 30. The difference extraction device 30 includes a common program acquisition unit 31, a control program acquisition unit 33, a difference extraction unit 35, and an output unit 37.
[0072] The common program acquisition unit 31 acquires the common program from the second server 20. Specifically, the common program acquisition unit 31 acquires the division data A1 to Ax of the common program divided into blocks of the first predetermined data size from the second server 20. The common program acquisition unit 31 outputs the acquired common program to the difference extraction unit 35.
[0073] The control program acquisition unit 33 acquires the control program from the first server 10. Specifically, the control program acquisition unit 33 sequentially acquires the divided data B1 to By of the control program divided into blocks of the first predetermined data size from the first server 10. Whenever receiving the divided data B1 to By, the control program acquisition unit 33 outputs the received divided data B1 to By to the difference extraction unit 35.
[0074] Furthermore, the control program acquisition unit 33 receives attribute information associated with the control program from the first server 10. The control program acquisition unit 33 outputs the received attribute information to the output unit 37.
[0075] The difference extraction unit 35 generates differential data by extracting the difference between the divided data A1 to Ax and the divided data B1 to By of the control program received in sequence while referring to the divided data A1 to Ax of the common program. For example, if the divided data Bn of the control program is received, the difference extraction unit 35 searches for whether the divided data A1 to Ax of the common program within the search range includes the search object data according to each second specified data size (search object data) included in the divided data Bn. When the search object data is not included in the divided data A1 to Ax within the search range, the difference extraction unit 35 extracts the search object data as a difference. When the search object data is included in the divided data A1 to Ax within the search range, the difference extraction unit 35 identifies the search object data as existing data and does not extract it as differential data.
[0076] The output unit 37 receives the difference data from the difference extraction unit 35. The output unit 37 also receives the attribute information from the control program acquisition unit 33. The output unit 37 associates the attribute information with the difference data, and outputs the difference data and the attribute information to the reprogramming tool 40.
[0077] The reprogramming tool 40 that has acquired the differential data and the attribute information specifies, based on the attribute information, a vehicle 200 equipped with an ECU 100 to which the differential data is to be output (a control program to be written using the differential data) and outputs the differential data to the specified vehicle 200 .
[0078] Figure 7 This is a functional block diagram for explaining the updating process of the control program in the ECU 100. The ECU 100 includes a difference data acquisition unit 101, a common program reading unit 103, a difference development unit 105, and a program storage unit 107.
[0079] The difference data acquisition unit 101 acquires the difference data via the reprogramming tool 40 . The difference data acquisition unit 101 outputs the acquired difference data to the difference expansion unit 105 .
[0080] The common program reading unit 103 reads out the common program stored in the memory of the ECU 100 at the ECU factory, for example. The common program is read out as divided data A1 to Ax divided into blocks of a first predetermined data size. The common program reading unit 103 outputs the read divided data A1 to Ax to the difference expansion unit 105 .
[0081] The difference expansion unit 105 decodes the difference data while referring to the divided data A1 to Ax, and restores the control program. The difference expansion unit 105 outputs the restored control program to the program storage unit 107.
[0082] The program storage unit 107 stores the received control program in the memory of the ECU 100. As a result, the control program of the ECU 100 is updated (initially written).
[0083] Figure 8 This is a diagram for explaining the effect of setting an offset area in a common program. Figure 8 Experimental data showing the relationship between the number of design changes of the control program and the capacity of the difference data is shown in . In this experiment, even when the control program is updated due to a design change, the common program developed based on the initial control program is still used.
[0084] Figure 8 The solid line L1 in FIG. 1 shows the relationship between the number of design changes of the control program and the capacity of the differential data when the offset area is not provided in the common program. The solid line L2 shows the relationship between the number of design changes of the control program and the capacity of the differential data when the offset area is provided in the head area of the common program.
[0085] For example, if we focus on the third design change, the capacity of the differential data when the offset area is not set in the common program is D2, and the capacity of the differential data when the offset area is set in the head area of the common program is D1 (<D2). The difference between capacity D1 and capacity D2 is the increase caused by the retrieval object data being out of the retrieval range due to the addition of programs, etc. in the retrieval of the retrieval object data. That is, by setting an offset area in the head area of the common program, the capacity of the differential data can be reduced by D2-D1 compared to the case where the offset area is not set in the common program. In this experiment, the difference between capacity D1 and capacity D2 (D2-D1) is approximately equivalent to a few percent of the capacity of the control program.
[0086] If we focus on the fourth design change, when an offset area is set at the beginning of the common program, as shown by the solid line L2, the capacity increases by ΔDa (= D3-D1) from the third design change. This capacity increase ΔDa is approximately equal to the capacity of the program added due to the fourth design change.
[0087] On the other hand, when the offset region is not set in the common program, the difference data increases significantly from the third to the fourth design change. Specifically, when the offset region is not set in the common program, as shown by the solid line L1, the capacity increases by ΔDb (= D4-D2) from the third design change. This capacity increase ΔDb greatly exceeds the capacity of the program added due to the fourth design change.
[0088] The capacity difference ΔDc (= D4 - D3) between the capacity D3 of the differential data when the offset area is set at the beginning of the common program in the fourth design change and the capacity D4 of the differential data when the offset area is not set at the beginning of the common program is approximately equivalent to a few percent to more than ten percent of the capacity of the control program. According to the experimental results, even if the number of design changes of the control program increases and the amount of program additions to the control program increases, the increase of differential data can be suppressed by setting the offset area at the beginning of the common program.
[0089] As described above, in the software update system 1 involved in the first embodiment, an offset area is set in the head area of the common program. By setting the offset area in the head area of the common program, the address of the data in the common program becomes an address behind the address of the data in the corresponding control program in the initial control program and the common program developed based on the initial control program. Therefore, even if a program is added to the control program due to the update of the control program, the address of the data in the common program can be suppressed from becoming an address that is ahead of the address of the data in the corresponding control program to the extent of being out of the search range. Therefore, it is possible to suppress the situation in which data that can be identified as existing data is not identified as existing data because it is out of the search range and is extracted as a difference. Thus, the increase of differential data can be suppressed.
[0090] In addition, in the software updating system 1 according to the first embodiment, the common program that is not updated is used to generate the difference data. Therefore, in the generation of the difference data, it is possible to suppress the complexity of the process compared with the case where the comparison target with the control program is changed.
[0091] [Implementation Method 2]
[0092] In the first embodiment, in the control program of the ECU 100, the difference between the common program that is not updated and the control program (update program) is extracted to generate difference data, and the control program is updated using the difference data. In the second embodiment, an example is described in which the difference between the current control program (for example, Ver. 1) and the new control program (for example, Ver. 2) whose design has been changed is extracted to generate difference data, and the control program is updated using the difference data.
[0093] Fig. 9 This is a diagram for explaining the updating of the control program in Embodiment 2. In Embodiment 2, a case where the control program of a vehicle 200 (ECU 100) circulating in the market is updated by so-called OTA (Over The Air) will be described as an example.
[0094] When an update program for the control program of the vehicle 200 is developed, the OTA server 300 transmits the update program to the vehicle 200 via a communication network such as the Internet.
[0095] The OTA server 300 stores the current control program of ECU100. If there is a design change in the control program or the control program is updated (developed), the OTA server 300 stores the updated control program (update program) in addition to the current control program. Moreover, the OTA server 300 extracts the difference between the current control program (e.g., control program Ver.1) and the update program (e.g., control program Ver.2) to generate differential data. The OTA server 300 outputs differential data to the vehicle 200 equipped with the ECU100 that is the application object of the update program. Moreover, if the update of the control program of ECU100 is completed, the OTA server 300 overwrites the update program (control program Ver.2) on the current control program (control program Ver.1) and stores the update program (control program Ver.2) as the current control program.
[0096] Fig.10 FIG. 2 is a diagram for explaining the data structure of the control program in Implementation Example 2. Fig.10 In the embodiment 2, (a) shows the data structure of the initial control program, (b) shows the data structure of the control program that has undergone the first design change (that has undergone the first update), and (c) shows the data structure of the control program that has undergone the second design change. The initial control program in the second embodiment is, for example, a control program installed in the ECU 100 when the vehicle 200 is shipped from the factory.
[0097] The offset region is provided in the head region of the initial control program as in the first embodiment. As in the first embodiment, the offset region in the second embodiment is also determined based on, for example, prediction of a design change.
[0098] For example, in the first design change, it is assumed that the first additional data is added to the control program. More specifically, it is assumed that the first additional data is added between data D and data E. In this case, the first additional data is added to the control program in a manner that reduces the offset area. More specifically, Fig.10 As shown, the first additional data is added to the area before the data E without changing the address of the data E. Thus, the addresses of the data A to D are moved to the front addresses, and the offset area is reduced.
[0099] If the first additional data is added in this way, when searching for the difference between the initial control program and the control program after the first design change, it is possible to properly retrieve the data A~D located in the area before the added first additional data, and it is also possible to properly retrieve the data E~I located in the area after the first additional data.
[0100] Specifically, for example, if data A is considered, the address of data A in the control program that has undergone the first design change is located ahead of the address of data A in the initial control program. Therefore, the search range of data A includes data A in the initial program. Therefore, data A is identified as existing data by searching for data A, and data A is determined to be "no difference".
[0101] In addition, for example, if the data E is focused on, the address of the data E in the control program that has undergone the first design change is the same as the address of the data E in the initial control program. Therefore, the search range of the data E includes the data E in the initial program. Therefore, the data E is identified as existing data by the search of the data E, and the data E is judged as "no difference".
[0102] Assume that when no offset area is provided in the head area of the control program, the addresses of data E to I in the control program that has undergone the first design change become addresses located later than data E to I in the original control program due to the addition of the first additional data. Therefore, for example, when searching for data E, the search range of data E may not include data E in the original program, and data E may be extracted as a difference. This leads to an increase in the capacity of differential data, an increase in the information traffic of the communication line, and an increase in the update time of the control program. By providing an offset area in the head area of the control program, the increase in the capacity of differential data can be suppressed compared to the case where no offset area is provided in the head area of the control program, and the information traffic of the communication line and the update time of the control program can be reduced.
[0103] In addition, in the second design change, even if the second additional data is added between data B and data C, the second additional data is added to the control program in a manner that reduces the offset area, similar to the first design change. That is, the second additional data is added to the area in front of data C without changing the address of data C. As a result, the addresses of data A and B are moved to the front addresses, and the offset area is reduced.
[0104] Fig.11 2 is a functional block diagram for explaining the difference extraction process of the OTA server 300. The OTA server 300 includes an update program acquisition unit 301, a current program acquisition unit 303, a difference extraction unit 305, an output unit 307, and a storage unit 309.
[0105] The update program acquisition unit 301 acquires the updated control program (update program) from the server storing the update program. The update program is also divided into blocks of the first predetermined data size, similarly to the control program described in the first embodiment. The update program acquisition unit 301 sequentially acquires the segmented data D1 to Dw (w: a natural number) of the update program divided into blocks of the first predetermined data size from the server. Whenever the segmented data D1 to Dw is acquired, the update program acquisition unit 301 outputs the acquired segmented data D1 to Dw to the difference extraction unit 305 and the storage unit 309.
[0106] The update program acquisition unit 301 also acquires attribute information associated with the update program from the server and outputs the acquired attribute information to the current program acquisition unit 303 and the output unit 307 .
[0107] The current program acquisition unit 303 determines the ECU to which the update program is to be applied based on the attribute information. The current program acquisition unit 303 determines, for example, that the application object of the update program is the ECU 100 of the vehicle 200. The current program acquisition unit 303 obtains, for example, the control program (current control program) of the ECU 100 currently installed in the vehicle 200 from a storage device not shown in the figure. The control program is divided into blocks of a first specified data size, similar to the control program described in Implementation Example 1. The current program acquisition unit 303 obtains the segmented data C1 to Cz (z: a natural number) of the current program divided into blocks of a first specified data size from the storage device. The current program acquisition unit 303 outputs the obtained current program to the difference extraction unit 305. In addition, in the case where the current control program is stored in a server (not shown) outside the OTA server 300, the current program acquisition unit 303 only needs to be configured to obtain the current program from the server storing the current control program.
[0108] The difference extraction unit 305 refers to the division data C1 to Cz of the current program, extracts the difference between the division data C1 to Cz and the division data D1 to Dw of the update program received in sequence, and generates difference data. The difference extraction unit 305 outputs the generated difference data to the output unit 307.
[0109] The output unit 307 receives the difference data from the difference extraction unit 305. The output unit 307 also receives the attribute information from the update program acquisition unit 301. The output unit 307 transmits the difference data to the vehicle 200 equipped with the ECU 100 specified by the attribute information.
[0110] The storage unit 309 stores the update program acquired by the update program acquisition unit 301 in a storage device as a current program.
[0111] Fig.12 This is a functional block diagram for explaining the updating process of the control program in the ECU 100. The ECU 100 includes a difference data acquisition unit 111, a current program reading unit 113, a difference development unit 115, and a program storage unit 117.
[0112] The difference data acquisition unit 111 acquires the difference data from the OTA server 300 . The difference data acquisition unit 111 outputs the acquired difference data to the difference expansion unit 115 .
[0113] The current program reading unit 113 reads the current control program from the memory. The current control program is read as divided data divided into blocks of a first predetermined data size. The current program reading unit 113 outputs the read divided data to the difference expansion unit 115.
[0114] The difference expansion unit 115 decodes the difference data while referring to the division data of the current control program to restore the control program (update program) and outputs the restored control program to the program storage unit 117 .
[0115] The program storage unit 117 stores the control program received from the difference development unit 115 as the current control program in the memory of the ECU 100. As a result, the control program of the ECU 100 is updated.
[0116] As described above, in Embodiment 2, an offset area is set in the head area of the control program. Moreover, when adding a program to the control program, the program is added in a manner that reduces the offset area. By adding the program in this way, it is possible to suppress the address of the data in the control program before the update from becoming an address closer to the front of the address of the corresponding data in the updated control program due to the addition of the program. Therefore, even if a program is added to the control program due to the update of the control program, it is possible to suppress the retrieval object data from escaping the retrieval range. Therefore, it is possible to suppress the situation in which data that would be identified as existing data is not identified as existing data due to escaping the retrieval range but is extracted as a difference. Thus, the increase of differential data can be suppressed.
[0117] In the second embodiment, the difference between the current control program (e.g., Ver. 1) and the new control program (e.g., Ver. 2) with a design change is extracted to generate the difference data. That is, the difference between the new control program and the control program of the previous version of the new control program is extracted to generate the difference data. Since the comparison is made with the previous version of the control program, the capacity of the difference data can be reduced compared with the case where the difference between the initial control program and the new control program is extracted to generate the difference data.
[0118] The embodiments disclosed herein are illustrative rather than restrictive in all respects. The scope of the present disclosure is not the description of the embodiments described above, but is represented by the scope of the technical solution, and is intended to include all changes within the meaning and scope equivalent to the scope of the technical solution.
Claims
1. A program updating method, comprising: sending differential data between a first program and a second program from a first device to a second device, and updating a control program installed in the second device to the second program based on the differential data, wherein: The first device includes the following steps: A step of obtaining the first program divided into a plurality of first blocks; The step of obtaining the second program divided into a plurality of second blocks, and searching the search range of the first block to determine whether the search target data of the second program divided into search units is included in the first program; A step of not extracting the search object data as a difference when the first program includes the search object data, and extracting the search object data as a difference to generate differential data when the first program does not include the search object data; as well as a step of outputting the generated differential data to the second device, In the second device, updating the control program executed by the second device to the second program based on the differential data, In the first program, the search range of the first block is set to include a total number of first blocks that is less than the plurality of first blocks, and to include a greater number of first blocks located at addresses that are later than the same address as one of the second blocks containing the search target data of the second program than the number of first blocks located at addresses that are earlier than the same address as one of the second blocks containing the search target data of the second program. An offset area not including data serving as the program is provided in the head area of the first program.
2. The program updating method according to claim 1, wherein: The first program is a program that is installed in the second device in order to update the control program and is not updated.
3. The program updating method according to claim 1, wherein: The control program is the first program, The first program is a program that is one version previous to the second program.
4. The program updating method according to claim 3, wherein: When the update from the first program to the second program includes the addition of data, the data is added in the second program so as to reduce the offset area.
5. The program updating method according to any one of claims 1 to 4, wherein: The first program and the second program are divided into divided data of a predetermined data size, respectively. The capacity of the split data is larger than the retrieval unit. The search range is set in the first program to include divided data located at the same address as divided data including the search target data in the second program and divided data located at a subsequent address than the divided data.
6. The program updating method according to any one of claims 1 to 4, wherein: The capacity of the offset region is set based on an estimation of a design change to be made to a program installed in the second device.
7. An update system that sends differential data between a first program and a second program to an update target device, and updates a control program installed in the update target device to the second program based on the differential data, wherein: The updating system comprises: A first storage device storing the first program divided into a plurality of first blocks; a second storage device storing the second program divided into a plurality of second blocks; as well as A difference extraction device generates the difference data and sends it to the update target device, The difference extraction device obtains the first program and the second program from the first storage device and the second storage device, respectively. For each search unit, searching the search range of the first block to search whether the search target data of the second program is included in the first program, When the search object data is included in the first program, the search object data is not extracted as a difference, and when the search object data is not included in the first program, the search object data is extracted as a difference to generate differential data, In the second storage device, The control program executed by the second storage device is updated to the second program based on the differential data, and in the first program, the search range of the first block is set to: the total number of the included first blocks is less than the plurality of first blocks, and the number of the included first blocks located at addresses later than the same address as one of the second blocks containing the search target data of the second program is greater than the number of the first blocks located at addresses earlier than the same address as one of the second blocks containing the search target data of the second program, An offset area not including data serving as the program is provided in the head area of the first program.
Citation Information
Patent Citations
Difference transfer method, program, and system
JP2003337723A
Electric control device for vehicles, program updating method, and server apparatus
US20190138298A1
Address layout varying process
US20190155743A1