Variable rate OTA upgrade method, device and VBOX
By using VBOX and the vehicle gateway for adaptive rate adjustment during OTA upgrades of the vehicle's internal ECUs, the problem of inconsistent flashing rate requirements for different ECUs is solved, achieving efficient and reliable data transmission.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHONGQING JINKANG NEW ENERGY VEHICLE CO LTD
- Filing Date
- 2023-09-28
- Publication Date
- 2026-05-05
AI Technical Summary
In the existing technology, the OTA upgrade flashing rate of the vehicle's internal ECU is fixed at 250Kbps or 500Kbps, which cannot meet the personalized flashing rate requirements of different ECUs, resulting in low upgrade efficiency.
By determining the maximum slave bus rate of the target ECU and adjusting the master bus rate and slave bus rate, a variable-rate OTA upgrade method is achieved. The VBOX and vehicle gateway are used for adaptive rate adjustment to ensure the reliability and efficiency of data transmission.
It enables variable-rate data transmission based on the ECU's flashing capability, improving the efficiency of OTA upgrades and the reliability of data transmission.
Smart Images

Figure CN117278353B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of intelligent connected vehicles, and in particular to a variable-rate OTA upgrade method, device, and VBOX. Background Technology
[0002] Currently, the upgrade and flashing schemes based on OTA (Over-the-Air Technology) that use CAN (UDS protocol) to upgrade and flash the ECU (Electronic Control Unit) inside the vehicle have a fixed flashing rate of 250Kbps or 500Kbps.
[0003] For the numerous ECUs inside a vehicle, different ECUs have different flashing speed capabilities and requirements. For example, some ECUs may support a flashing speed of 1Mbps, while others only support 250Kbps. If the existing upgrade and flashing scheme is followed, the only option is to choose the method that supports the minimum flashing speed to upgrade and flash each ECU in the vehicle. For ECUs that support higher flashing speeds, this method is extremely inefficient. Summary of the Invention
[0004] In view of this, embodiments of this application provide a variable-rate OTA upgrade method, apparatus, and VBOX to solve the problem that the prior art can only select the method that supports the minimum flashing rate to upgrade and flash various ECU components in the vehicle, and the upgrade and flashing efficiency is low for ECUs that support higher flashing rates.
[0005] A first aspect of this application provides a variable-rate OTA upgrade method, comprising:
[0006] Determine the maximum slave bus rate of the target ECU to be flashed, and send a first message frame to the target ECU at the first master bus rate. The first message frame includes the first master bus rate and its corresponding first master bus code. The first master bus rate is less than the maximum slave bus rate.
[0007] Receive the first response message from the target ECU in response to the first message frame, and extract the first slave load rate and the first slave bus rate of the target ECU from the first response message;
[0008] The second slave bus rate and its corresponding second master bus code are determined based on the first slave load rate and the first slave bus rate.
[0009] A rate adjustment message is sent to the target flashing ECU. The rate adjustment message includes a second slave bus code, so that the target flashing ECU can determine the second slave bus rate based on the second slave bus code and adjust the first slave bus rate to the second slave bus rate.
[0010] Upon receiving the second response message from the target ECU, the second master bus rate is determined, and the first master bus rate is adjusted to the second master bus rate, wherein the second slave bus rate is consistent with the second master bus rate.
[0011] The second message frame is sent to the target ECU at the second master control bus rate.
[0012] A second aspect of this application provides a variable-rate OTA upgrade device, comprising:
[0013] The first determining module is configured to determine the maximum slave bus rate of the target flashing ECU, and send a first message frame to the target flashing ECU at the first master bus rate. The first message frame includes the first master bus rate and its corresponding first master bus code. The first master bus rate is less than the maximum slave bus rate.
[0014] The receiving module is configured to receive the first response message fed back by the target flashing ECU in response to the first message frame, and extract the first slave load rate and the first slave bus rate of the target flashing ECU from the first response message.
[0015] The second determining module is configured to determine the second slave bus rate and its corresponding second master bus code based on the first slave load rate and the first slave bus rate.
[0016] The first sending module is configured to send a rate adjustment message to the target flashing ECU. The rate adjustment message includes a second slave bus code, so that the target flashing ECU can determine the second slave bus rate based on the second slave bus code and adjust the first slave bus rate to the second slave bus rate.
[0017] The adjustment module is configured to determine the second master bus rate and adjust the first master bus rate to the second master bus rate when it receives the second response message from the target flashing ECU. The second slave bus rate is consistent with the second master bus rate.
[0018] The second sending module is configured to send a second message frame to the target flashing ECU at the second master control bus rate.
[0019] A third aspect of the embodiments of this application provides a VBOX, which includes the variable-rate OTA upgrade device of the second aspect.
[0020] A fourth aspect of this application provides an electronic device including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the method described above.
[0021] A fifth aspect of this application provides a readable storage medium storing a computer program that, when executed by a processor, implements the steps of the above-described method.
[0022] Compared with the prior art, the beneficial effects of this application embodiment include at least the following: In this application embodiment, when the VBOX sends each message frame to the target flashing ECU, it determines the required adjustment rate information (second slave control rate code) based on the slave control load rate of the target flashing ECU, and sends the second slave control rate code to the target flashing ECU, so that the target flashing ECU adaptively adjusts its slave control bus rate, adjusting its slave control load rate upwards / downwards. At the same time, after the target flashing ECU completes the adjustment, it will feed back to the VBOX. After receiving the feedback from the target flashing ECU, the VBOX will also adaptively adjust its master control bus rate to maintain consistency with the slave control bus rate of the target flashing ECU. Then, it reads the next frame of data and transmits it at the adjusted master control bus rate. The above scheme can realize variable rate data transmission, which not only helps to ensure reliable data transmission, but also improves the efficiency of upgrade flashing. Attached Figure Description
[0023] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0024] Figure 1 This is a schematic diagram illustrating one application scenario of this application.
[0025] Figure 2 This is a schematic diagram of a hardware / software layered design structure for UMC / UA / US provided in an embodiment of this application;
[0026] Figure 3 This is a flowchart illustrating a variable-rate OTA upgrade method provided in an embodiment of this application;
[0027] Figure 4 This is a schematic diagram of the structure of a first message frame in the variable-rate OTA upgrade method provided in this application embodiment;
[0028] Figure 5This is a schematic diagram illustrating the division of a load range in the variable-rate OTA upgrade method provided in this application embodiment;
[0029] Figure 6 This is a flowchart illustrating another variable-rate OTA upgrade method provided in an embodiment of this application;
[0030] Figure 7 This is a schematic diagram of the structure of a variable-rate OTA upgrade device provided in an embodiment of this application;
[0031] Figure 8 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0032] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application may also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods have been omitted so as not to obscure the description of this application with unnecessary detail.
[0033] The following describes in detail, with reference to the accompanying drawings, a variable-rate OTA upgrade method and apparatus according to embodiments of this application.
[0034] Figure 1 This is a schematic diagram illustrating an application scenario according to an embodiment of this application. The application scenario may include an in-vehicle VBOX 101, a VGW (vehicle gateway) 102, and the ECUs being flashed. The in-vehicle VBOX 101 carries an OTA upgrade master controller (UMC), the vehicle gateway VGW 102 carries an OTA upgrade agent (UA), and the ECUs being flashed carry an OTA upgrade slave controller (US). The in-vehicle VBOX 101 and the vehicle gateway VGW 102 can be connected via a CAN bus; the vehicle gateway VGW 102 can be connected to each of its flashed ECUs via a CAN bus.
[0035] Figure 2 This is a schematic diagram of a variable-rate OTA upgrade system provided in an embodiment of this application. For ease of explanation, only the parts related to the embodiment of this application are shown in the figure, which are described in detail below:
[0036] Please see Figure 2The vehicle-mounted VBOX 101 includes an OTA master control application layer, a rate adjustment module, middleware, an operating system, and a hardware layer; the master control rate adjustment module includes a rate adaptive adjustment unit, a bus rate monitoring unit, and a remote monitoring unit. The vehicle gateway VGW 102 includes an OTA slave control application layer, a local rate adjustment module, a UDS protocol stack, and an operating system; the local rate adjustment module includes a local rate adaptive adjustment unit, a bus rate monitoring unit, and a local load monitoring unit. The ECU being flashed includes an OTA slave control application layer, a local rate adjustment module, middleware, an operating system, and a hardware layer; the local rate adjustment module includes a local rate adaptive adjustment unit, a bus rate monitoring unit, and a local load monitoring unit.
[0037] The onboard VBOX 101 is primarily responsible for the overall scheduling of OTA upgrades and real-time monitoring of the bus speed, adaptively adjusting the speed based on the capabilities of the ECU components. The vehicle gateway VGW 102 is mainly responsible for forwarding messages transmitted from the onboard VBOX 101 to the ECU being upgraded and completing its own OTA upgrade task. The ECU being upgraded (i.e., the target ECU) can adaptively adjust its speed based on its own load rate and maximum speed, and report its load rate and the adaptively adjusted slave bus speed to the onboard VBOX 101 via messages. This ensures synchronized speed adjustments between the onboard VBOX 101 and the upgraded ECU, guaranteeing reliable data transmission and improving the efficiency of the upgrade process.
[0038] The technical solutions provided in this application are based on the concept of layered software and hardware design, which can achieve software and hardware decoupling of UMC / UA / US, facilitating subsequent functional expansion and porting.
[0039] Figure 3 This is a flowchart illustrating a variable-rate OTA upgrade method provided in an embodiment of this application. Figure 3 The variable-rate OTA upgrade method can be provided by Figure 1 The UMC, carried in the vehicle's VBOX 101, is used for execution. For example... Figure 3 As shown, this variable-rate OTA upgrade method may specifically include the following steps:
[0040] Step S301: Determine the maximum slave bus rate of the target ECU to be flashed, and send a first message frame to the target ECU to be flashed at the first master bus rate. The first message frame includes the first master bus rate and its corresponding first master bus code. The first master bus rate is less than the maximum slave bus rate.
[0041] The maximum slave bus rate refers to the maximum flashing rate that the target ECU can support. For example, for a target ECU with a maximum supported flashing rate of 1 Mbps, its maximum slave bus rate is 1 Mbps.
[0042] In one example, a mapping table can be pre-established between the identification information (such as ECU ID) of each ECU and its maximum slave bus speed that it can support for flashing, and this mapping table can be stored in VBOX. When VBOX needs to transfer upgrade files to an ECU, it first needs to read the identification information (such as ECU ID) of the ECU to be flashed (target ECU). Then, using the read ECU ID, it can determine the maximum slave bus speed of the target ECU by querying the above mapping table.
[0043] The flashing rate supported by the ECU being flashed is generally in the range of 250Kbps to 1Mbps, such as 250Kbps, 500Kbps, and 1Mbps. To ensure the reliability and efficiency of data / file transfer between the VBOX and the ECU being flashed, the first master bus rate is generally lower than the maximum flashing rate supported by the ECU being flashed. For example, if the maximum slave bus rate of the target ECU being flashed is 1Mbps, then the first master bus rate could be 250Kbps, 500Kbps, etc.
[0044] The first master bus code is encoded information used to characterize the speed of the first master bus.
[0045] In one example, if the maximum slave bus rate of the target ECU to be flashed is 1Mbps, then the master control bus rate from 250Kbps to 1Mbps can be divided into 15 rate segments with a step size of 50Kbps. The length of each rate segment is 50Kbps. The endpoint of each rate segment corresponds to a first master control bus code. The first master control bus rate corresponding to code "0" is 250Kbps, the first master control bus rate corresponding to code "1" is 300Kbps, the first master control bus rate corresponding to code "2" is 350Kbps, and so on. The first master control bus rate corresponding to code "15" is 1Mbps.
[0046] In another example, if the maximum slave bus rate of the target ECU to be flashed is 500Kbps, then the master bus rate from 250Kbps to 500Kbps can be divided into 5 rate segments with a step size of 50Kbps. Among them, the first master bus rate corresponding to code "0" is 250Kbps, the first master bus rate corresponding to code "1" is 300Kbps, the first master bus rate corresponding to code "2" is 350Kbps, and so on, with the first master bus rate corresponding to code "6" being 500Kbps.
[0047] Please see Figure 4 The "DATA" field in the first message frame includes an upgrade flashing data area (occupying 0-7 bytes), a bus rate encoding area (occupying 4 bits, or one byte), and an ECU load area (occupying 4 bits, or one byte). The bus rate encoding area is mainly used to record the slave bus rate encoding (containing the current first slave bus rate and the rate information to be adjusted), while the ECU load area is mainly used to record the ECU load rate information (i.e., slave load rate) of the ECU currently being flashed (the target flashing ECU).
[0048] In one example, if the VBOX splits the upgrade file to be sent to the target ECU into 10 message frames to be transmitted, namely the first message frame, the second message frame, ... the tenth message frame; then when the VBOX sends the first message frame to the target ECU at the first master bus rate (e.g., initialized to 250Kbps), the bus rate encoding area and the ECU load area in the first message frame are 0 and 0%, respectively.
[0049] Step S302: Receive the first response message from the target flashing ECU in response to the first message frame, and extract the first slave load rate and the first slave bus rate of the target flashing ECU from the first response message.
[0050] In one example, when the target ECU receives the first message frame sent by VBOX, it can monitor its current first slave bus rate and first slave load rate through the bus rate monitoring unit and local load monitoring unit in its local rate adjustment module; then, it sends a first response message back to VBOX, which includes the first slave load rate and first slave bus rate it has monitored.
[0051] In one example, a mapping table between slave load rate and slave bus rate can be pre-configured based on the flashing rate supported by the target ECU. Table 1 shows the mapping table between slave load rate and slave bus rate of the ECU to be flashed with a flashing rate of 1 Mbps supported by this embodiment of the application. This mapping table can be pre-stored in the target ECU.
[0052] Table 1. Correspondence between "Slave Load Rate - Slave Bus Speed"
[0053]
[0054]
[0055] Given the first slave load rate or the first slave bus rate, the corresponding first slave bus rate or the first slave load rate can be uniquely determined by consulting Table 1 above; then, the first response message is sent back to VBOX.
[0056] Step S303: Determine the second slave bus rate and its corresponding second master bus code based on the first slave load rate and the first slave bus rate.
[0057] Step S304: Send a rate adjustment message to the target flashing ECU. The rate adjustment message includes a second slave bus code, so that the target flashing ECU can determine the second slave bus rate based on the second slave bus code and adjust the first slave bus rate to the second slave bus rate.
[0058] In one example, a mapping table between slave load rate, slave bus rate, and slave bus rate encoding can be pre-configured based on the flashing rate supported by the target flashing ECU. Table 2 shows the mapping table between slave load rate and slave bus rate for a flashing ECU with a flashing rate of 1 Mbps supported by this embodiment. This mapping table can be pre-stored in the target flashing ECU and VBOX.
[0059] Table 2: Correspondence between "Slave Load Rate - Slave Bus Speed - Slave Bus Speed Encoding"
[0060] Controlled load rate Slave bus speed Slave bus rate encoding 0% 250Kbps 0 6.6% 300Kbps 1 13.2% 350Kbps 2 ... ... ... 100% 1Mbps 15
[0061] When the target ECU receives the rate adjustment message from VBOX, it extracts the second slave bus code, determines the second slave bus rate by consulting Table 2 above, and then adjusts the first slave bus rate to the second slave bus rate. For example, if the second slave bus code is 11, its corresponding second slave bus rate is 800Kbps. Therefore, the target ECU will adjust the first slave bus rate from 250Kbps to the second slave bus rate of 800Kbps.
[0062] Step S305: Upon receiving the second response message from the target ECU, determine the second master bus rate and adjust the first master bus rate to the second master bus rate, wherein the second slave bus rate is consistent with the second master bus rate.
[0063] Step S306: Send a second message frame to the target ECU at the second master control bus rate.
[0064] Since ECUs typically support flashing rates of 250Kbps, 500Kbps, or 1Mbps, when initially transmitting upgrade messages to the target ECU, the first master bus rate can be initialized to 250Kbps. This ensures that both ECUs supporting low flashing rates (e.g., 250Kbps) and high flashing rates (e.g., 1Mbps) can successfully and reliably receive the first message frame. Subsequently, the VBOX can adaptively adjust its first slave bus rate based on the slave load rate of the target ECU. Simultaneously, the VBOX adaptively adjusts the first master bus rate based on the rate adjustment feedback from the target ECU to maintain consistency with the current slave bus rate of the target ECU, thereby ensuring data transmission reliability and improving data transmission efficiency.
[0065] The technical solution provided in this application embodiment involves the VBOX determining the required adjustment rate information (second slave control rate code) based on the slave control load rate of the target flashing ECU when sending each message frame to it. This second slave control rate code is then sent to the target flashing ECU, enabling it to adaptively adjust its slave control bus rate by increasing or decreasing its slave control load rate. Simultaneously, after adjustment, the target flashing ECU provides feedback to the VBOX. Upon receiving this feedback, the VBOX also adaptively adjusts its master control bus rate to maintain consistency with the slave control bus rate of the target flashing ECU. Then, it reads the next frame of data and transmits it at the adjusted master control bus rate. This solution enables variable-rate data transmission, which not only ensures reliable data transmission but also improves the efficiency of the upgrade flashing process.
[0066] In some embodiments, determining the second slave bus rate and its corresponding second master bus code based on the first slave load rate and the first slave bus rate includes:
[0067] If the first slave load rate is within the first set load range, then calculate the first write rate corresponding to the first endpoint value of the first slave load rate being reduced to the second set load range, and the second write rate corresponding to the second endpoint value of the first slave load rate being reduced to the second set load range.
[0068] If the first slave bus rate is greater than the second write rate, then a rate reduction strategy is executed to gradually reduce the first slave bus rate to the first write rate, or the second write rate, or any rate value between the first write rate and the second write rate, and the second slave bus rate is determined.
[0069] If the first slave bus rate is greater than the second write rate, then a rate reduction strategy is executed to gradually reduce the first slave bus rate to the first write rate, or the second write rate, or any rate value between the first write rate and the second write rate, and the second master bus rate is determined.
[0070] Calculate the second slave bus code based on the second slave bus rate.
[0071] Combination Figure 5 The first set load range refers to the range where the load rate is greater than 89%; the second set load range refers to the range where the load rate is between [70% and 89%], with the first endpoint value being 70% and the second endpoint value being 89%. When the first slave control load rate of the target ECU being flashed is greater than 89%, it indicates that the load on the target ECU being flashed is too heavy, which may easily lead to packet loss or failure during transmission due to the high transmission rate. In this case, the first slave control bus rate of the target ECU being flashed should be appropriately reduced to reduce its first slave control bus load rate, thereby ensuring the reliability of data transmission.
[0072] Taking a target ECU with a maximum slave bus rate of 1Mbps as an example, the first write rate corresponding to 70% of the first endpoint value is approximately 780Kbps, and the second write rate corresponding to 89% of the second endpoint value is approximately 931Kbps.
[0073] As an example, suppose VBOX sends a first message frame to the target flashing ECU at a first master bus rate of 250Kbps, and the first slave load rate extracted from the first response message from the target flashing ECU is 92%, with a first slave bus rate of approximately 950Kbps. Therefore, it can be determined that the first slave load rate of the target flashing ECU falls within a first set load range (greater than 89%). Next, the first slave bus rate is compared with the first flashing rate. According to the comparison, the first slave bus rate of 950Kbps is greater than the second flashing rate of 931Kbps. At this point, a rate reduction strategy is executed, that is, the first slave bus rate is gradually reduced from 950Kbps to 780Kbps, 931Kbps, or any rate value between 780Kbps and 931Kbps, and the second master bus rate is determined.
[0074] In other embodiments, if the first slave load rate is within a third set load range, a rate increase strategy is executed to increase the first slave bus rate to a first write rate or a second write rate or any rate value between the first write rate and the second write rate, and a second slave bus rate is determined.
[0075] As an example, please continue reading Figure 5 The third setting is a load range of less than 70%. When the first slave control load rate of the target ECU is less than 70%, it means that the current load of the target ECU is too light, resulting in a waste of resources. Therefore, it is necessary to appropriately increase the load rate of the target ECU to improve its upgrade and flashing efficiency.
[0076] As another example, suppose VBOX sends a first message frame to the target flashing ECU at a first slave bus rate of 250Kbps, and the first slave load rate extracted from the first response message from the target flashing ECU is 0%, with the first slave bus rate being approximately 250Kbps. The maximum slave bus rate of the target flashing ECU is 1Mbps. Therefore, it can be determined that the first slave load rate of the target flashing ECU falls within a first set load range (less than 70%). At this point, a rate increase strategy is executed, gradually increasing the first slave bus rate from 250Kbps to 780Kbps, 931Kbps, or any rate value between 780Kbps and 931Kbps, and determining the second master bus rate.
[0077] In some embodiments, a rate reduction strategy is implemented to gradually reduce the first slave bus rate to a first write rate, a second write rate, or any rate value between the first write rate and the second write rate, and the second slave bus rate is determined, including:
[0078] Calculate the i-th down-adjustment bus rate based on the preset down-adjustment rate step size and the first slave bus rate, where i is a positive integer;
[0079] If the i-th down-adjustment bus rate is less than the first write rate, then let i = i + 1, and continue to calculate the i-th down-adjustment bus rate according to the preset down-adjustment step size and the i-th down-adjustment bus rate.
[0080] If the i-th down-adjusted bus rate is equal to the second write rate, or greater than the first write rate and less than the second write rate, or equal to the first write rate, then the i-th down-adjusted bus rate is determined as the second slave bus rate.
[0081] The preset up-rate step size can be flexibly set according to the actual situation, and can generally be set to 50Kbps.
[0082] In one example, combined Figure 6First, VBOX initiates the OTA task, initializing the CAN rate (first master bus rate) to 250Kbps. Then, it reads the identifier (e.g., ECU ID) of the ECU to be flashed and the first upgrade file version number. Next, VBOX reads the second upgrade file version number corresponding to the ECU from the cloud. Then, VBOX compares the first and second upgrade file version numbers to determine if the second upgrade file version number in the cloud is an updated version. If so, VBOX downloads the upgrade file corresponding to the second upgrade file version number from the cloud to its local cache and converts the S19 / HEX upgrade file into a flashable BIN file. Then, it starts transmitting the first message frame to the ECU at the first master bus rate of 250Kbps. VBOX then determines whether the ECU is flashed... If the ECU being written times out, the OTA upgrade process is exited. If the ECU being written does not times out, it is further determined whether the ECU has sent back a first response message. If a first response message has been sent, the first slave load rate of the ECU being written is extracted from the first response message, and it is determined whether the first slave load rate (if it is 100%) is within the first set load range (e.g., whether the first slave load rate is greater than 89%). If so, the i-th down-rate bus speed (i=1) is calculated based on the preset down-rate step size and the first slave bus speed. In this example, the i-th down-rate bus speed is... The bus rate is reduced by: First slave bus rate - Compensation rate = 1000Kbps - 50Kbps = 950Kbps. According to the formula: Slave rate code = (Current bus rate - Compensation rate) / Step size = (1000Kbps - 50Kbps) / 50Kbps = 14, the slave rate code is calculated to be 14. Referring to Table 2 above, the slave load rate corresponding to code 14 is 92.4%. Next, it is determined whether the i-th reduced bus rate is greater than the second write rate of 931Kbps. If the i-th reduced bus rate is greater than the second write rate, then i = i + 1, and the reduction continues according to the preset value. Given the rate step size and the i-th down-adjustment bus rate, calculate the i-th down-adjustment bus rate (i=2). In this example, the i-th down-adjustment bus rate = i-th down-adjustment bus rate - 50Kbps = 950Kbps - 50Kbps = 900Kbps. Repeat the above steps to calculate the i-th up-adjustment bus rate until the i-th up-adjustment bus rate is equal to the second write rate, or greater than the first write rate and less than the second write rate, or equal to the first write rate. Then, determine the i-th down-adjustment bus rate as the second slave bus rate, and end the above loop steps. The last calculated i-th up-adjustment bus rate before the end is determined as the second slave bus rate.Next, the second slave control rate code is determined based on the second slave control bus rate, and a rate adjustment message is sent to the target flashing ECU. After receiving the rate adjustment message, the target flashing ECU extracts the second slave control rate code from the message, determines the second slave control bus rate based on the code, adjusts the first slave control bus rate to the second, and then sends a second response message to the VBOX. After receiving the response message, the VBOX adjusts the first master control bus rate to match the second slave control bus rate to maintain consistency with the target flashing ECU's second slave control bus rate. Then, the next message frame is read, and a second message frame is sent to the target flashing ECU at the second master control bus rate. This process is repeated until the reading is complete, at which point the OTA upgrade flashing process for the target flashing ECU is exited.
[0083] In other embodiments, the first slave bus rate is gradually reduced to the first write / fetch rate, and a second slave bus rate is determined, including:
[0084] Calculate the first rate difference between the first slave bus rate and the first write rate;
[0085] The first slave bus rate is reduced to the first write rate by a one-time reduction of the first rate difference, and the first write rate is determined as the second slave bus rate.
[0086] To facilitate understanding, let's continue with the example above. Assume the first slave bus speed is 1000Kbps and the first write speed is 780Kbps. Then, the first speed difference between the first slave bus speed and the first write speed is 220Kbps. Using 220Kbps as the one-time increase increment, the first slave bus speed is directly reduced from 1000Kbps to 780Kbps in one go, and the first write speed of 780Kbps is determined as the second master bus speed.
[0087] This application embodiment first calculates the first rate difference between the first slave bus rate and the first flashing rate, and then uses the first rate difference as the one-time upward adjustment amount to directly reduce the first slave bus rate to the first flashing rate, which can realize the target flashing ECU to quickly adjust its first slave bus rate.
[0088] Similarly, the first slave bus rate can be gradually reduced to the second flash rate, or reduced to any rate value between the first and second flash rates. Alternatively, the above-mentioned one-time reduction method can be used to directly reduce it to the target in one step, thereby improving the efficiency of adjusting the first slave bus rate of the target flash ECU.
[0089] For cases where the first slave bus rate is less than the first write rate, similarly, the rate difference that needs to be increased at once can be determined first by referring to the above method. Then, the rate difference can be used as the one-time increase amount to directly increase the first slave bus rate to the second write rate, the first write rate, or any rate value between the first write rate and the second write rate. This will not be elaborated further here.
[0090] In some embodiments, calculating the second slave bus code based on the second slave bus rate includes:
[0091] Calculate the rate difference between the first slave bus rate and the second slave bus rate;
[0092] Based on the rate difference and the first set step size, calculate the second slave bus code corresponding to the second slave bus rate.
[0093] The first step size can be set flexibly according to the actual situation, and is generally set to 50Kbps.
[0094] In one example, taking the target ECU's maximum slave bus rate as 1Mbps as an example, assuming the first slave bus rate is 250Kbps, and the second slave bus rate is determined to be 800Kbps according to the above steps, then the rate difference between the first and second slave bus rates can be calculated to be 550Kbps. According to the following formula: Second slave bus code = Rate difference / First set step size, the second slave bus code can be calculated to be 11.
[0095] In some embodiments, adjusting the first master bus rate to the second master bus rate includes:
[0096] Calculate the second rate difference between the first master control bus rate and the second master control bus rate;
[0097] Based on the second rate difference, the rate of the first master bus is adjusted up or down to make the rate of the first master bus consistent with the rate of the second master bus.
[0098] The second response message includes at least one of the second slave bus code / second slave load rate after the target ECU is flashed and adjusted. VBOX can look up the second slave bus rate in Table 2 based on the known second slave bus code / second slave load rate, determine the second master bus rate based on the obtained second slave bus rate, calculate the second rate difference between the first master bus rate and the second master bus rate, and then adjust the target once using the second rate difference, increasing or decreasing the first master bus rate to adjust the first master bus rate to the second master bus rate, so as to keep the second slave bus rate consistent with the second master bus rate, thereby ensuring the reliability of data / file transmission and improving the data / file transmission efficiency.
[0099] Through the technical solutions provided in the above embodiments, this application can achieve variable-rate flashing based on the ECU's flashing capability, and can achieve optimal upgrade flashing based on the ECU's flashing capability, resulting in high efficiency. That is, this application supports variable-rate data transmission between the VBOX and the ECU, and supports adjusting the rate according to the ECU load rate, which ensures both the reliability of data transmission and improves data transmission efficiency, thereby enhancing the efficiency of OTA upgrades.
[0100] All of the above-mentioned optional technical solutions can be combined in any way to form the optional embodiments of this application, and will not be described in detail here.
[0101] The following are embodiments of the apparatus described in this application, which can be used to execute the embodiments of the method described in this application. For details not disclosed in the apparatus embodiments of this application, please refer to the embodiments of the method described in this application.
[0102] Figure 7 This is a schematic diagram of a variable-rate OTA upgrade device provided in an embodiment of this application. Figure 7 As shown, the variable-rate OTA upgrade device includes:
[0103] The first determining module 701 is configured to determine the maximum slave bus rate of the target flashing ECU, and send a first message frame to the target flashing ECU at the first master bus rate. The first message frame includes the first master bus rate and its corresponding first master bus code. The first master bus rate is less than the maximum slave bus rate.
[0104] The receiving module 702 is configured to receive the first response message fed back by the target flashing ECU in response to the first message frame, and extract the first slave load rate and the first slave bus rate of the target flashing ECU from the first response message.
[0105] The second determining module 703 is configured to determine the second slave bus rate and its corresponding second master bus code based on the first slave load rate and the first slave bus rate.
[0106] The first sending module 704 is configured to send a rate adjustment message to the target flashing ECU. The rate adjustment message includes a second slave bus code, so that the target flashing ECU can determine the second slave bus rate based on the second slave bus code and adjust the first slave bus rate to the second slave bus rate.
[0107] The adjustment module 705 is configured to determine the second master bus rate and adjust the first master bus rate to the second master bus rate when it receives the second response message from the target flashing ECU. The second slave bus rate is consistent with the second master bus rate.
[0108] The second sending module 706 is configured to send a second message frame to the target flashing ECU at a second master bus rate.
[0109] The technical solution provided in this application embodiment involves the VBOX determining the required adjustment rate information (second slave control rate code) based on the slave control load rate of the target flashing ECU when sending each message frame to it. This second slave control rate code is then sent to the target flashing ECU, enabling it to adaptively adjust its slave control bus rate by increasing or decreasing its slave control load rate. Simultaneously, after adjustment, the target flashing ECU provides feedback to the VBOX. Upon receiving this feedback, the VBOX also adaptively adjusts its master control bus rate to maintain consistency with the slave control bus rate of the target flashing ECU. Then, it reads the next frame of data and transmits it at the adjusted master control bus rate. This solution enables variable-rate data transmission, which not only ensures reliable data transmission but also improves the efficiency of the upgrade flashing process.
[0110] In some embodiments, Figure 7 The second determining module 703 includes:
[0111] The first calculation unit is configured to calculate, if the first slave load rate is within the first set load range, a first write rate corresponding to a first endpoint value of the first slave load rate being reduced to the second set load range, and a second write rate corresponding to a second endpoint value of the first slave load rate being reduced to the second set load range.
[0112] The down-adjustment unit is configured to execute a rate down-adjustment strategy if the first slave bus rate is greater than the second write rate, so as to gradually reduce the first slave bus rate to the first write rate, or the second write rate, or any rate value between the first write rate and the second write rate, and determine the second slave bus rate.
[0113] The second calculation unit is configured to calculate the second slave bus code based on the second slave bus rate.
[0114] In other embodiments, Figure 7 The second determining module 703 also includes:
[0115] The up-adjustment unit is configured to execute a rate up-adjustment strategy if the first slave control load rate is within a third set load range, so as to up-adjust the first slave control bus rate to a first write rate or a second write rate or any rate value between the first write rate and the second write rate, and determine the second slave control bus rate.
[0116] In some embodiments, the aforementioned down-adjustment unit includes:
[0117] The computing component is configured to calculate the i-th down-adjustment bus rate based on a preset down-adjustment rate step size and the first slave bus rate, where i is a positive integer;
[0118] The first down-adjustment component is configured to, if the i-th down-adjustment bus rate is greater than the second write rate, set i = i + 1 and continue to calculate the i-th down-adjustment bus rate according to the preset down-adjustment rate step size and the i-th down-adjustment bus rate.
[0119] The second down-adjustment component is configured to determine the i-th down-adjustment bus rate as the second slave bus rate if the i-th down-adjustment bus rate is equal to the second write rate, or greater than the first write rate and less than the second write rate, or equal to the first write rate.
[0120] In some embodiments, the second down-adjustment component described above includes a down-adjustment device;
[0121] The down-adjustment device is configured to: calculate a first rate difference between the first slave bus rate and the first write rate; use the first rate difference as the down-adjustment amount to reduce the first slave bus rate to the first write rate in one go, and determine the first write rate as the second slave bus rate.
[0122] In some embodiments, the second computing unit includes:
[0123] The difference calculation component is configured to calculate the rate difference between the first slave bus rate and the second slave bus rate;
[0124] The encoding calculation component is configured to calculate the second slave bus encoding corresponding to the second slave bus rate based on the rate difference and a first set step size.
[0125] In some embodiments, Figure 7 The adjustment module 705 includes:
[0126] The difference calculation unit is configured to calculate a second rate difference between the first master bus rate and the second master bus rate;
[0127] The rate adjustment unit is configured to adjust the rate of the first master bus up or down according to the second rate difference, so as to adjust the rate of the first master bus to be consistent with the rate of the second master bus.
[0128] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0129] This application also provides a VBOX, which includes, as in the following embodiments: Figure 7 The variable-rate OTA upgrade device shown.
[0130] Figure 8 This is a schematic diagram of the electronic device 8 provided in an embodiment of this application. For example... Figure 8 As shown, the electronic device 8 of this embodiment includes a processor 801, a memory 802, and a computer program 803 stored in the memory 802 and executable on the processor 801. When the processor 801 executes the computer program 803, it implements the steps in the various method embodiments described above. Alternatively, when the processor 801 executes the computer program 803, it implements the functions of each module / unit in the various device embodiments described above.
[0131] Electronic device 8 can be a desktop computer, laptop, handheld computer, cloud server, or other electronic device. Electronic device 8 may include, but is not limited to, processor 801 and memory 802. Those skilled in the art will understand that... Figure 8 This is merely an example of electronic device 8 and does not constitute a limitation on electronic device 8. It may include more or fewer components than shown, or different components.
[0132] The processor 801 can be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
[0133] The memory 802 can be an internal storage unit of the electronic device 8, such as a hard disk or RAM of the electronic device 8. The memory 802 can also be an external storage device of the electronic device 8, such as a plug-in hard disk, Smart Media Card (SMC), Secure Digital (SD) card, or Flash Card equipped on the electronic device 8. The memory 802 can also include both internal and external storage units of the electronic device 8. The memory 802 is used to store computer programs and other programs and data required by the electronic device.
[0134] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0135] If integrated modules / units are implemented as software functional units and sold or used as independent products, they can be stored in a readable storage medium (e.g., a computer-readable storage medium). Based on this understanding, all or part of the processes in the methods of the above embodiments can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program may include computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. A computer-readable storage medium may include: any entity or device capable of carrying computer program code, recording media, USB flash drives, portable hard drives, magnetic disks, optical disks, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc.
[0136] The above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.
Claims
1. A variable-rate OTA upgrade method, characterized in that, include: Determine the maximum slave bus rate of the target ECU to be flashed, and send a first message frame to the target ECU at a first master bus rate. The first message frame includes the first master bus rate and its corresponding first master bus code. The first master bus rate is less than the maximum slave bus rate. Receive the first response message from the target flashing ECU in response to the first message frame, and extract the first slave load rate and the first slave bus rate of the target flashing ECU from the first response message; Based on the first slave load rate and the first slave bus rate, determine the second slave bus rate and its corresponding second master bus code; Send a rate adjustment message to the target flashing ECU, the rate adjustment message including the second slave bus code, so that the target flashing ECU determines the second slave bus rate based on the second slave bus code, and adjusts the first slave bus rate to the second slave bus rate; Upon receiving the second response message from the target ECU, the second master bus rate is determined, and the first master bus rate is adjusted to the second master bus rate, wherein the second slave bus rate is consistent with the second master bus rate. The second message frame is sent to the target ECU at the second master control bus rate.
2. The method according to claim 1, characterized in that, Based on the first slave load rate and the first slave bus rate, the second slave bus rate and its corresponding second master bus code are determined, including: If the first slave control load rate is within the first set load range, then calculate the first write rate corresponding to the first endpoint value of the first slave control load rate being reduced to the second set load range, and the second write rate corresponding to the second endpoint value of the first slave control load rate being reduced to the second set load range; If the first slave bus rate is greater than the second write rate, then a rate reduction strategy is executed to gradually reduce the first slave bus rate to the first write rate, or the second write rate, or any rate value between the first write rate and the second write rate, and the second slave bus rate is determined. Calculate the second slave bus code based on the second slave bus rate.
3. The method according to claim 2, characterized in that, Before calculating the second slave bus code based on the second slave bus rate, the following steps are also included: If the first slave control load rate is within the third set load range, then a rate increase strategy is executed to increase the first slave control bus rate to the first write rate or the second write rate or any rate value between the first write rate and the second write rate, and the second slave control bus rate is determined.
4. The method according to claim 2, characterized in that, The execution rate reduction strategy is used to gradually reduce the first slave bus rate to the first write rate, or the second write rate, or any rate value between the first write rate and the second write rate, and to determine the second slave bus rate, including: The i-th down-adjustment bus rate is calculated based on the preset down-adjustment rate step size and the first slave bus rate, where i is a positive integer; If the i-th down-adjustment bus rate is greater than the second write rate, then let i = i + 1, and continue to calculate the i-th down-adjustment bus rate according to the preset down-adjustment rate step size and the i-th down-adjustment bus rate. If the i-th down-adjusted bus rate is equal to the second write rate, or greater than the first write rate and less than the second write rate, or equal to the first write rate, then the i-th down-adjusted bus rate is determined as the second slave bus rate.
5. The method according to claim 2, characterized in that, Gradually reduce the first slave bus rate to the first write / fetch rate, and determine the second slave bus rate, including: Calculate the first rate difference between the first slave bus rate and the first write rate; The first slave bus rate is reduced to the first write rate by a one-time reduction of the first rate difference, and the first write rate is determined as the second slave bus rate.
6. The method according to claim 2, characterized in that, Calculate the second slave bus code based on the second slave bus rate, including: Calculate the rate difference between the first slave bus rate and the second slave bus rate; Based on the rate difference and the first set step size, calculate the second slave bus code corresponding to the second slave bus rate.
7. The method according to claim 1, characterized in that, Adjusting the first master bus speed to the second master bus speed includes: Calculate the second rate difference between the first master control bus rate and the second master control bus rate; Based on the second rate difference, the rate of the first master bus is adjusted up or down to make the rate of the first master bus consistent with the rate of the second master bus.
8. A variable-rate OTA upgrade device, characterized in that, include: The first determining module is configured to determine the maximum slave bus rate of the target flashing ECU, and send a first message frame to the target flashing ECU at a first master bus rate. The first message frame includes the first master bus rate and its corresponding first master bus code, and the first master bus rate is less than the maximum slave bus rate. The receiving module is configured to receive the first response message fed back by the target flashing ECU in response to the first message frame, and extract the first slave load rate and the first slave bus rate of the target flashing ECU from the first response message. The second determining module is configured to determine the second slave bus rate and its corresponding second master bus code based on the first slave load rate and the first slave bus rate. The first sending module is configured to send a rate adjustment message to the target flashing ECU. The rate adjustment message includes the second slave bus code, so that the target flashing ECU determines the second slave bus rate based on the second slave bus code and adjusts the first slave bus rate to the second slave bus rate. The adjustment module is configured to determine the second master bus rate when it receives the second response message from the target flashing ECU, and adjust the first master bus rate to the second master bus rate, wherein the second slave bus rate is consistent with the second master bus rate. The second sending module is configured to send a second message frame to the target flashing ECU at the second master control bus rate.
9. A VBOX, characterized in that, The VBOX includes the variable-rate OTA upgrade device as described in claim 8.
10. A readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Automobile complete vehicle electronic appliance CANBUS network control system
CN101456392A
CAN FD bus-based parallel flashing method
CN109828935A