An ECU upgrading method and device based on vehicle-mounted Ethernet
Patent Information
- Application Number
- CN202110740068.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-06-30
- Publication Date
- 2026-10-16
- Estimated Expiration
- 2041-06-30
AI Technical Summary
[0006]本发明提供一种基于车载以太网的ECU升级方法及装置,旨在解决现有技术中的缺陷,实现在启动过程中通过车载以太网对各ECU进行升级,防止出现因为升级出错而导致系统无法启动的问题
[0059] The beneficial effects of this invention are as follows: This invention loads the vehicle Ethernet driver immediately after UBOOT starts, and starts the upgrade program when an upgrade command is detected in UBOOT. Through incremental upgrade packages and an Ethernet adaptive delay strategy, it realizes the upgrade of each ECU through the vehicle Ethernet during the startup process, preventing the system from failing to start due to upgrade errors.
Smart Images

Figure CN115202679B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of software upgrade technology, and in particular to an ECU upgrade method and apparatus based on in-vehicle Ethernet. Background Technology
[0002] With the development of intelligent automotive technology, the functions of cars are changing rapidly, and the system often needs to be upgraded a few months after the vehicle leaves the factory.
[0003] Currently, with the increasing number of controllers in vehicles, data transmission between various automotive systems is increasingly being achieved using in-vehicle Ethernet. Therefore, most upgrade data for various automotive systems is now transmitted via in-vehicle Ethernet.
[0004] However, currently, the Ethernet of various vehicle systems is integrated at the application layer. Upgrades need to be performed by starting the application layer program after the system has fully booted up. This means that if there is improper operation or power failure during the upgrade process, the upgrade will be interrupted, resulting in the inability to boot up. This greatly affects the user experience and can lead to various accidents and disputes.
[0005] Therefore, the existing technology needs further improvement. Summary of the Invention
[0006] This invention provides an ECU upgrade method and apparatus based on in-vehicle Ethernet, aiming to overcome the deficiencies in the prior art and realize the upgrade of each ECU through in-vehicle Ethernet during the startup process, thereby preventing the system from failing to start due to upgrade errors.
[0007] To achieve the above objectives, the technical solution adopted by the present invention is as follows:
[0008] This invention provides an ECU upgrade method based on in-vehicle Ethernet, comprising:
[0009] Step 1: Power on the system, start UBOOT, and load the vehicle Ethernet driver;
[0010] Step 2: Check if there is an upgrade command in U-Boot. If yes, proceed to the next step; otherwise, proceed to the normal startup process.
[0011] Step 3: Receive the upgrade command and start the upgrade process.
[0012] Specifically, step 3 includes:
[0013] Step 301: Receive the original upgrade data packet and store the original upgrade data packet;
[0014] Step 302: Decompress the original upgrade data package to obtain the decompressed upgrade data;
[0015] Step 303: Verify the decompressed upgrade data to determine whether the decompressed upgrade data is complete and valid. If yes, proceed to the next step; otherwise, request the server to resend the original upgrade data packet.
[0016] Step 304: Repackage the decompressed upgrade data according to each target upgrade ECU to generate an incremental update package for each target upgrade ECU;
[0017] Step 305: Send the incremental update package to each target upgrade ECU;
[0018] Step 306: Each target upgrade ECU receives its own incremental update package and performs the upgrade;
[0019] Step 307: Determine if an error occurred during the upgrade. If so, restart the system and return to step 306 or perform a rollback operation; otherwise, the upgrade is complete.
[0020] Specifically, the method for generating incremental update packages for each target upgrade ECU in step 304 includes:
[0021] Step 304a: Read the current system file data of each target upgrade ECU and generate a lexicographical order using a fast suffix sorting method;
[0022] Step 304b: Read the decompressed upgrade data and match it with the lexicographical order to obtain a similar data array and a dissimilar array. The similar data array is used to store data block information of similar regions, and the dissimilar array is used to store data information of dissimilar regions.
[0023] Step 304c: Use a reverse adjacency list to build a directed graph of the similar data array;
[0024] Step 304d: Determine whether the directed graph has a cycle. If yes, proceed to the next step; otherwise, proceed to step 304f.
[0025] Step 304e: Delete the vertex with the smallest data size in the current ring and insert it at the end of the dissimilar array, then return to step 304d;
[0026] Step 304f: Determine the insertion order of the similar data array based on the directed graph;
[0027] Step 304g: Generate an incremental update package based on the insertion order of the similar data array and the dissimilar array;
[0028] Step 304h: Compress the incremental update package.
[0029] Specifically, step 305 includes:
[0030] Step 305a: Set the total number of channel detections N, minimum delay exponent p, maximum delay exponent q, delay base D, and adaptive variable t;
[0031] Step 305b: Determine if the channel is idle. If yes, send the current data frame and proceed to the next step. Otherwise, increment the current channel detection count k by 1 and proceed to step 305d.
[0032] Step 305c: Determine whether the current channel detection count k is greater than the adaptive variable t. If yes, modify the maximum delay exponent q to the first delay parameter q1; otherwise, modify the maximum delay exponent q to the second delay parameter q2.
[0033] Step 305d: Determine whether the current channel detection count k is greater than the total channel detection count N. If yes, abandon sending the current data frame and return to step 305b; otherwise, proceed to the next step.
[0034] Step 305e: After a preset delay duration T, return to step 305b;
[0035] The first delay parameter q1 = min(q, 2*t), the second delay parameter q2 = min(q / 2, t-1), where q is the maximum delay exponent, t is an adaptive variable, and min() means taking the smaller of the two.
[0036] Specifically, the preset duration T = D * 2[min(p + k, q)], where D represents the delay base, p represents the minimum delay exponent, q represents the maximum delay exponent, and k represents the current channel detection count.
[0037] Specifically, step 306 includes:
[0038] Step 306a: Determine whether the preset upgrade conditions are met. If yes, proceed to the next step; otherwise, prompt that the upgrade cannot be completed.
[0039] Step 306b: Erase the memory space of the target upgrade ECU via the UDS diagnostic protocol service;
[0040] Step 306c: Decompress the incremental update package to obtain incremental upgrade data;
[0041] Step 306d: Write the incremental upgrade data into the memory space of the target upgrade ECU.
[0042] Specifically, the method for determining whether an upgrade has gone wrong in step 307 includes: reading back the upgrade package data from each target upgrade ECU, comparing the read-back upgrade package data with its corresponding incremental update package, and determining whether the two are completely consistent. If they are, the upgrade is considered successful; otherwise, the upgrade is considered abnormal.
[0043] Another aspect of the present invention provides an ECU upgrade device based on in-vehicle Ethernet, comprising:
[0044] The vehicle gateway and the system startup module, drive loading module, and ECU connected to the vehicle gateway, wherein the system startup module is also connected to the drive loading module;
[0045] The system startup module is used to start UBOOT and detect whether there is an upgrade command in UBOOT;
[0046] The driver loading module is used to load the Ethernet driver;
[0047] The vehicle gateway is used to receive raw upgrade data and process the raw data.
[0048] The ECU is the target for upgrade and is used to receive upgrade data sent by the vehicle gateway to execute the upgrade program.
[0049] Specifically, the vehicle gateway includes an upgrade startup module, a data download module, a data storage module, a data decompression module, a data verification module, a data repackaging module, and a data sending module;
[0050] The upgrade startup module is connected to the system startup module and the data download module; the data storage module is connected to the data download module, the data decompression module, the data verification module, and the data repackaging module; the data repackaging module is also connected to the data sending module; the data download module is also connected to the data decompression module and the data verification module.
[0051] The upgrade startup module is used to receive the upgrade command sent by the system startup module and start the upgrade process;
[0052] The data download module is used to receive the original upgrade data package and send it to the data storage module;
[0053] The data storage module is used to receive and store the original upgrade data packets sent by the data download module;
[0054] The data decompression module is used to read the original upgrade data packet in the storage module and decompress it to obtain the decompressed upgrade data;
[0055] The data verification module is used to verify the decompressed upgrade data and determine whether the decompressed upgrade data is complete and valid.
[0056] The data repackaging module is used to repackage the decompressed upgrade data according to each target upgrade ECU to generate an incremental update package for each target upgrade ECU.
[0057] The data sending module is used to send incremental update packages to each target upgrade ECU.
[0058] Furthermore, the vehicle gateway also includes a self-upgrade module connected to the upgrade startup module, used to upgrade the vehicle gateway itself.
[0059] The beneficial effects of this invention are as follows: This invention loads the vehicle Ethernet driver immediately after UBOOT starts, and starts the upgrade program when an upgrade command is detected in UBOOT. Through incremental upgrade packages and an Ethernet adaptive delay strategy, it realizes the upgrade of each ECU through the vehicle Ethernet during the startup process, preventing the system from failing to start due to upgrade errors. Attached Figure Description
[0060] Figure 1 This is a flowchart illustrating the ECU upgrade method based on in-vehicle Ethernet of the present invention;
[0061] Figure 2 This is a schematic diagram of the ECU upgrade device based on vehicle Ethernet of the present invention;
[0062] Figure 3 This is another structural schematic diagram of the ECU upgrade device based on vehicle Ethernet of the present invention. Detailed Implementation
[0063] The embodiments of the present invention are described in detail below with reference to the accompanying drawings. The drawings are for reference and illustration only and do not constitute a limitation on the scope of protection of the present invention.
[0064] Example 1
[0065] like Figure 1 As shown, this embodiment provides an ECU upgrade method based on in-vehicle Ethernet, including:
[0066] Step 1: Power on the system, start UBOOT, and load the vehicle Ethernet driver.
[0067] To enable OTA (Over-the-Air Technology) upgrades, the UBOOT in this embodiment is designed based on the UDS protocol. The UDS (Unified Diagnostic Services) protocol, defined by ISO 14229, is a communication standard for automotive ECU fault diagnosis and maintenance. In addition to containing implementation standards for commonly used diagnostic-related services, this protocol also provides the UBOOT software flashing process.
[0068] Step 2: Check if there is an upgrade command in U-Boot. If yes, proceed to the next step; otherwise, proceed to the normal startup process.
[0069] Step 3: Receive the upgrade command and start the upgrade process.
[0070] In this embodiment, by setting the upgrade procedure during the UBOOT stage, rather than after the system has started, the problem of the system failing to boot due to an upgrade failure caused by starting the application can be avoided.
[0071] Example 2
[0072] The difference from Embodiment 1 is that this embodiment provides a specific implementation method for step 3, including:
[0073] Step 301: Receive the original upgrade data packet and store the original upgrade data packet.
[0074] In practice, a connection can be established with the OTA server via the SSL communication protocol. The upgrade request information (such as the upgrade object, the current version number of the upgrade object, etc.) is sent to the OTA server. The OTA server receives the upgrade request information and issues the original upgrade data packet according to the upgrade request information.
[0075] The original upgrade data package is an incremental data package.
[0076] In practice, the original upgrade data package is downloaded using breakpoint resume technology.
[0077] Step 302: Decompress the original upgrade data package to obtain the decompressed upgrade data.
[0078] Step 303: Verify the decompressed upgrade data to determine whether the decompressed upgrade data is complete and valid. If yes, proceed to the next step; otherwise, request the server to resend the original upgrade data packet.
[0079] The specific method for verifying the decompressed upgrade data includes: extracting the MD5 value from the original upgrade data packet and comparing it with the MD5 value calculated based on the decompressed upgrade data. If the two are consistent, it means that the original upgrade data packet has passed the verification; otherwise, it means that the original upgrade data packet has failed the verification.
[0080] Step 304: Repackage the decompressed upgrade data according to each target upgrade ECU to generate an incremental update package for each target upgrade ECU.
[0081] Step 305: Send the incremental update package to each target upgrade ECU.
[0082] Step 306: Each target upgrade ECU receives its own incremental update package and performs the upgrade.
[0083] Step 307: Determine if an error occurred during the upgrade. If so, restart the system and return to step 306 or perform a rollback operation; otherwise, the upgrade is complete.
[0084] The specific method for determining whether an upgrade has gone wrong includes: reading back the upgrade package data from each target upgrade ECU, comparing the read-back upgrade package data with its corresponding incremental update package, and determining whether the two are completely consistent. If they are, the upgrade is considered successful; otherwise, the upgrade is considered abnormal.
[0085] This embodiment decompresses and verifies the original upgrade data package, and then repackages it according to each target upgrade ECU to generate an incremental upgrade package corresponding to each target upgrade ECU. This greatly reduces the size of the upgrade package sent to each target upgrade ECU and improves the transmission speed.
[0086] Example 3
[0087] Unlike Embodiment 2, this embodiment provides a method for generating incremental update packages for each target upgrade ECU in step 304, including:
[0088] Step 304a: Read the current system file data of each target upgrade ECU and generate a lexicographical order using a fast suffix sorting method;
[0089] Step 304b: Read the decompressed upgrade data and match it with the lexicographical order to obtain a similar data array A1 and a dissimilar array A2. The similar data array A1 is used to store data block information of similar regions, and the dissimilar array A2 is used to store data information of dissimilar regions.
[0090] Step 304c: Use a reverse adjacency list to construct a directed graph of the similar data array A1;
[0091] Step 304d: Determine whether the directed graph has a cycle. If yes, proceed to the next step; otherwise, proceed to step 304f.
[0092] Step 304e: Delete the vertex with the smallest data size in the current ring and insert it at the end of the dissimilar array A2, and return to step 304d;
[0093] Step 304f: Determine the insertion order of the similar data array A1 based on the directed graph;
[0094] Step 304g: Generate an incremental update package based on the insertion order of the similar data array A1 and the dissimilar array A2;
[0095] In other words, the incremental update package in this embodiment includes the insertion order of the similar data array A1 (i.e., the current system file data) and the dissimilar array A2 (i.e., the difference file data).
[0096] Step 304h: Compress the incremental update package.
[0097] Example 4
[0098] Unlike Embodiment 2, this embodiment provides a specific implementation method for step 305, including:
[0099] Step 305a: Set the total number of channel detections N, minimum delay exponent p, maximum delay exponent q, delay base D, and adaptive variable t;
[0100] In this embodiment, the adaptive variable t can be set based on experience.
[0101] Step 305b: Determine if the channel is idle. If yes, send the current data frame and proceed to the next step. Otherwise, increment the current channel detection count k by 1 and proceed to step 305d.
[0102] Step 305c: Determine whether the current channel detection count k is greater than the adaptive variable t. If yes, modify the maximum delay exponent q to the first delay parameter q1; otherwise, modify the maximum delay exponent q to the second delay parameter q2. The first delay parameter q1 = min(q, 2*t), and the second delay parameter q2 = min(q / 2, t-1), where q is the maximum delay exponent, t is the adaptive variable, and min() means taking the smaller of the two.
[0103] Step 305d: Determine whether the current channel detection count k is greater than the total channel detection count N. If yes, abandon sending the current data frame and return to step 305b; otherwise, proceed to the next step.
[0104] Step 305e: After a preset delay duration T, return to step 305b.
[0105] In this embodiment, the preset duration T = D*2[min(p+k,q)], where D represents the delay base, p represents the minimum delay exponent, q represents the maximum delay exponent, and k represents the current channel detection count.
[0106] Example 5
[0107] Unlike Embodiment 2, this embodiment provides a specific implementation method for step 306, including:
[0108] Step 306a: Determine whether the preset upgrade conditions are met. If yes, proceed to the next step; otherwise, prompt that the upgrade cannot be completed.
[0109] In this embodiment, the preset upgrade conditions are: vehicle speed is 0, generator speed is 0, gear is park, and the vehicle battery charge is greater than a threshold (e.g., 50%).
[0110] Step 306b: Erase the memory space of the target upgrade ECU via the UDS diagnostic protocol service;
[0111] Step 306c: Decompress the incremental update package to obtain incremental upgrade data;
[0112] In this embodiment, the incremental update package is decompressed using bzip.
[0113] Step 306d: Write the incremental upgrade data into the memory space of the target upgrade ECU.
[0114] Example 6
[0115] like Figure 2 As shown, the ECU upgrade device based on vehicle Ethernet in this embodiment includes: a vehicle gateway and a system startup module, a driver loading module, and an ECU connected to the vehicle gateway. The system startup module is also connected to the driver loading module.
[0116] The system startup module is used to start UBOOT and detect whether there is an upgrade command in UBOOT;
[0117] The driver loading module is used to load the Ethernet driver;
[0118] The vehicle gateway is used to receive raw upgrade data and process the raw data.
[0119] The ECU is the target for upgrade and is used to receive upgrade data sent by the vehicle gateway to execute the upgrade program.
[0120] The working process of this device is as follows:
[0121] First, the system startup module starts UBOOT, and the driver loading module loads the vehicle Ethernet driver;
[0122] Secondly, the system startup module detects whether there is an upgrade command in UBOOT. If there is, it enters the upgrade program; otherwise, it controls the system to enter the normal startup program.
[0123] Then, the vehicle gateway receives the original upgrade data, processes the original data, and sends it to the target upgrade ECU. The target upgrade ECU receives the upgrade data sent by the vehicle gateway and executes the upgrade program.
[0124] Example 7
[0125] like Figure 2 As shown, unlike Embodiment 6, this embodiment provides the specific structure of the vehicle gateway:
[0126] The vehicle gateway includes an upgrade startup module, a data download module, a data storage module, a data decompression module, a data verification module, a data repackaging module, and a data sending module;
[0127] The upgrade startup module is connected to the system startup module and the data download module; the data storage module is connected to the data download module, the data decompression module, the data verification module, and the data repackaging module; the data repackaging module is also connected to the data sending module; the data download module is also connected to the data decompression module and the data verification module.
[0128] The upgrade startup module is used to receive the upgrade command sent by the system startup module and start the upgrade process;
[0129] The data download module is used to receive the original upgrade data package and send it to the data storage module;
[0130] The data storage module is used to receive and store the original upgrade data packets sent by the data download module;
[0131] The data decompression module is used to read the original upgrade data packet in the storage module and decompress it to obtain the decompressed upgrade data;
[0132] The data verification module is used to verify the decompressed upgrade data and determine whether the decompressed upgrade data is complete and valid.
[0133] The data repackaging module is used to repackage the decompressed upgrade data according to each target upgrade ECU to generate an incremental update package for each target upgrade ECU.
[0134] The data sending module is used to send incremental update packages to each target upgrade ECU.
[0135] The working process of this device is as follows:
[0136] In the first step, the data download module receives the original upgrade data package and stores it in the data storage module.
[0137] In practical implementation, the vehicle gateway can establish a connection with the OTA server through the SSL communication protocol, and send the upgrade request information (such as the upgrade object, the current version number of the upgrade object, etc.) to the OTA server. The OTA server receives the upgrade request information and sends the original upgrade data packet according to the upgrade request information.
[0138] The original upgrade data package is an incremental data package.
[0139] In practice, the original upgrade data package is downloaded using breakpoint resume technology.
[0140] In the second step, the data decompression module decompresses the original upgrade data packet to obtain the decompressed upgrade data. If decompression fails, the data download module is notified to request the server to resend the upgrade data packet. Then, the data verification module verifies the decompressed upgrade data to determine whether it is complete and valid. If it is, the data repackaging module is notified to repackage the decompressed upgrade data according to each target upgrade ECU to generate an incremental update package for each target upgrade ECU. Otherwise, the data download module is notified to request the server to resend the upgrade data packet.
[0141] The data verification module verifies the decompressed upgrade data according to the following method: extract the MD5 value from the original upgrade data packet and compare it with the MD5 value calculated based on the decompressed upgrade data. If the two are consistent, it means that the original upgrade data packet has passed the verification; otherwise, it means that the original upgrade data packet has failed the verification.
[0142] The working process of the data repackaging module is as described in Example 3, and will not be repeated here.
[0143] Third, the data sending module sends the incremental update package to each target upgrade ECU.
[0144] The operation of the data transmission module is as described in Embodiment 4, and will not be repeated here.
[0145] In the fourth step, each target upgrade ECU receives its own incremental update package and performs the upgrade.
[0146] The process of upgrading each target ECU with incremental update packages is as described in Example 5 and will not be repeated here.
[0147] The fifth step involves each target upgrade ECU determining whether an upgrade has encountered an anomaly. If so, the system is restarted, and the upgrade is performed again or a rollback operation is initiated.
[0148] like Figure 3 As shown, in another embodiment of the present invention, the vehicle gateway further includes a self-upgrade module connected to the upgrade startup module, for upgrading the vehicle gateway itself.
[0149] The above-disclosed embodiments are merely preferred embodiments of the present invention and should not be construed as limiting the scope of protection of the present invention. Therefore, any equivalent variations made in accordance with the claims of the present invention are still within the scope of the present invention.
Claims
1. An ECU upgrade method based on in-vehicle Ethernet, characterized in that, include: Step 1: Power on the system, start UBOOT, and load the vehicle Ethernet driver; Step 2: Check if there is an upgrade command in U-Boot. If yes, proceed to the next step; otherwise, proceed to the normal startup process. Step 3: Receive the upgrade command and start the upgrade process; Step 3 includes: Step 301: Receive the original upgrade data packet and store the original upgrade data packet; Step 302: Decompress the original upgrade data package to obtain the decompressed upgrade data; Step 303: Verify the decompressed upgrade data to determine whether the decompressed upgrade data is complete and valid. If yes, proceed to the next step; otherwise, request the server to resend the original upgrade data packet. Step 304: Repackage the decompressed upgrade data according to each target upgrade ECU to generate an incremental update package for each target upgrade ECU; Step 305: Send the incremental update package to each target upgrade ECU; Step 306: Each target upgrade ECU receives its own incremental update package and performs the upgrade; Step 307: Determine if an upgrade has encountered an error. If so, restart the system and return to step 306 or perform a rollback operation; otherwise, the upgrade is complete. Step 305 includes: Step 305a: Set the total number of channel detections N, minimum delay exponent p, maximum delay exponent q, delay base D, and adaptive variable t; Step 305b: Determine if the channel is idle. If yes, send the current data frame and proceed to the next step. Otherwise, increment the current channel detection count k by 1 and proceed to step 305d. Step 305c: Determine whether the current channel detection count k is greater than the adaptive variable t. If yes, modify the maximum delay exponent q to the first delay parameter q1; otherwise, modify the maximum delay exponent q to the second delay parameter q2. Step 305d: Determine whether the current channel detection count k is greater than the total channel detection count N. If yes, abandon sending the current data frame and return to step 305b; otherwise, proceed to the next step. Step 305e: After a preset delay duration T, return to step 305b; The first delay parameter q1 = min(q, 2*t), the second delay parameter q2 = min(q / 2, t-1), where q is the maximum delay exponent, t is an adaptive variable, and min() means taking the smaller of the two; The preset duration T = D * 2[min(p + k, q)], where D represents the delay base, p represents the minimum delay exponent, q represents the maximum delay exponent, and k represents the current channel detection count.
2. The ECU upgrade method based on vehicle Ethernet according to claim 1, characterized in that, The method for generating incremental update packages for each target upgrade ECU in step 304 includes: Step 304a: Read the current system file data of each target upgrade ECU and generate a lexicographical order using a fast suffix sorting method; Step 304b: Read the decompressed upgrade data and match it with the lexicographical order to obtain a similar data array and a dissimilar array. The similar data array is used to store data block information of similar regions, and the dissimilar array is used to store data information of dissimilar regions. Step 304c: Use a reverse adjacency list to build a directed graph of the similar data array; Step 304d: Determine whether the directed graph has a cycle. If yes, proceed to the next step; otherwise, proceed to step 304f. Step 304e: Delete the vertex with the smallest data size in the current ring and insert it at the end of the dissimilar array, then return to step 304d; Step 304f: Determine the insertion order of the similar data array based on the directed graph; Step 304g: Generate an incremental update package based on the insertion order of the similar data array and the dissimilar array; Step 304h: Compress the incremental update package.
3. The ECU upgrade method based on vehicle Ethernet according to claim 1, characterized in that, Step 306 includes: Step 306a: Determine whether the preset upgrade conditions are met. If yes, proceed to the next step; otherwise, prompt that the upgrade cannot be completed. Step 306b: Erase the memory space of the target upgrade ECU via the UDS diagnostic protocol service; Step 306c: Decompress the incremental update package to obtain incremental upgrade data; Step 306d: Write the incremental upgrade data into the memory space of the target upgrade ECU.
4. The ECU upgrade method based on vehicle Ethernet according to claim 3, characterized in that, The specific method for determining whether the upgrade is abnormal in step 307 includes: reading back the upgrade package data from each target upgrade ECU, comparing the read-back upgrade package data with its corresponding incremental update package, and determining whether the two are completely consistent. If they are, the upgrade is considered successful; otherwise, the upgrade is considered abnormal.
5. An ECU upgrade device based on in-vehicle Ethernet, characterized in that, include: The vehicle gateway and the system startup module, drive loading module, and ECU connected to the vehicle gateway, wherein the system startup module is also connected to the drive loading module; The system startup module is used to start UBOOT and detect whether there is an upgrade command in UBOOT; The driver loading module is used to load the Ethernet driver; The vehicle gateway is used to receive raw upgrade data and process the raw upgrade data; The ECU is the target for upgrade and is used to receive upgrade data sent by the vehicle gateway and execute the upgrade program. The vehicle gateway includes an upgrade startup module, a data download module, a data storage module, a data decompression module, a data verification module, a data repackaging module, and a data sending module; The upgrade startup module is connected to the system startup module and the data download module; the data storage module is connected to the data download module, the data decompression module, the data verification module, and the data repackaging module; the data repackaging module is also connected to the data sending module; the data download module is also connected to the data decompression module and the data verification module. The upgrade startup module is used to receive the upgrade command sent by the system startup module and start the upgrade process; The data download module is used to receive the original upgrade data package and send it to the data storage module; The data storage module is used to receive and store the original upgrade data packets sent by the data download module; The data decompression module is used to read the original upgrade data packet in the storage module and decompress it to obtain the decompressed upgrade data; The data verification module is used to verify the decompressed upgrade data and determine whether the decompressed upgrade data is complete and valid. The data repackaging module is used to repackage the decompressed upgrade data according to each target upgrade ECU to generate an incremental update package for each target upgrade ECU. The data sending module is used to send incremental update packages to each target upgrade ECU, including: Step 305a: Set the total number of channel detections N, minimum delay exponent p, maximum delay exponent q, delay base D, and adaptive variable t; Step 305b: Determine if the channel is idle. If yes, send the current data frame and proceed to the next step. Otherwise, increment the current channel detection count k by 1 and proceed to step 305d. Step 305c: Determine whether the current channel detection count k is greater than the adaptive variable t. If yes, modify the maximum delay exponent q to the first delay parameter q1; otherwise, modify the maximum delay exponent q to the second delay parameter q2. Step 305d: Determine whether the current channel detection count k is greater than the total channel detection count N. If yes, abandon sending the current data frame and return to step 305b; otherwise, proceed to the next step. Step 305e: After a preset delay duration T, return to step 305b; The first delay parameter q1 = min(q, 2*t), the second delay parameter q2 = min(q / 2, t-1), where q is the maximum delay exponent, t is an adaptive variable, and min() means taking the smaller of the two; The preset duration T = D * 2[min(p + k, q)], where D represents the delay base, p represents the minimum delay exponent, q represents the maximum delay exponent, and k represents the current channel detection count.
6. The ECU upgrade device based on vehicle Ethernet according to claim 5, characterized in that, The vehicle gateway also includes a self-upgrade module connected to the upgrade startup module, used to upgrade the vehicle gateway itself.
Citation Information
Patent Citations
Method and device for upgrading embedded device system
CN103699421A
Terminal software upgrading method and device
CN104932909A
Vehicle-mounted internet gateway, vehicle OTA upgrading system and method and computer storage medium
CN111385191A
Operating system auto-update procedure
US20110173601A1