Electronic control unit flashing method and device, electronic equipment and storage medium
By selecting and adapting multiple communication links between the mobile terminal module and the diagnostic device module, the problem of low flashing efficiency in the existing technology is solved, achieving efficient and stable flashing data transmission, and improving the flashing efficiency and success rate of the electronic control unit.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- LAUNCH SOFTWARE DEV
- Filing Date
- 2026-03-26
- Publication Date
- 2026-06-30
AI Technical Summary
In the existing technology, the flashing efficiency of automotive electronic control units is low, and it fails to effectively adapt to the differences in the amount of flashing data, resulting in low communication connection efficiency.
By dynamically selecting multiple communication links between the mobile terminal module and the diagnostic device module, and selecting the appropriate target communication link based on the amount of data to be written, a stable connection is established, and the data to be written is transmitted to the target electronic control unit via the wireless communication link.
It improves the flashing efficiency of automotive electronic control units, avoids transmission lag and data loss caused by insufficient link bandwidth and transmission quality, and enhances the success rate and smoothness of flashing operations.
Smart Images

Figure CN122308850A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of electronic control unit (ECU) flashing technology, and more particularly to an ECU flashing method, apparatus, electronic device, and storage medium. Background Technology
[0002] With the rapid development of automotive electronics technology, electronic control units (ECUs) have become core components of vehicle control systems, widely used in key areas such as engine control, body control, and power transmission control. The operating logic and control parameters of ECUs rely on internally stored flashable data, such as firmware programs and calibration parameters. During vehicle production, maintenance, and functional upgrades, it is often necessary to update the flashable data of the target ECU, i.e., to complete the ECU flashing operation, in order to optimize vehicle control performance, fix software vulnerabilities, or adapt to new functional requirements. The communication connection between terminal equipment and diagnostic connectors is mostly a single connection mode, using either a fixed wireless communication link or a fixed wired communication link. This does not consider the impact of differences in flashable data volume on communication connection compatibility, resulting in low flashing efficiency for automotive ECUs. Therefore, improving the flashing efficiency of automotive ECUs is an urgent problem to be solved. Summary of the Invention
[0003] This application provides an electronic control unit (ECU) flashing method, apparatus, electronic device, and storage medium, which improves the flashing efficiency of automotive ECUs.
[0004] In a first aspect, embodiments of this application provide an electronic control unit (ECU) flashing method, applied to a mobile terminal module, wherein the mobile terminal module is located in an ECU flashing system, and the ECU flashing system includes the mobile terminal module, a diagnostic equipment module, and a target vehicle; the method includes: Obtain a flashing request for the target electronic control unit of the target vehicle; the flashing request includes the amount of flashing data corresponding to the flashing data of the target electronic control unit; When the amount of data written exceeds the preset amount of data written, n communication links between the mobile terminal module and the diagnostic device module are determined; n is a positive integer. Select the communication link that matches the amount of data to be written from the n communication links to obtain the target communication link; The mobile terminal module and the diagnostic device module are controlled to establish a communication connection based on the target communication link; The flashing data of the target electronic control unit is sent to the diagnostic device module based on the target communication link; The diagnostic device module is controlled to transmit the flashing data to the storage module of the target electronic control unit; The target electronic control unit is controlled to complete the flashing operation based on the flashing data.
[0005] Secondly, this application provides an electronic control unit (ECU) flashing device, applied to a mobile terminal module. The mobile terminal module is located in an ECU flashing system, which includes the mobile terminal module, a diagnostic device module, and a target vehicle. The ECU flashing device includes an acquisition unit and a processing unit. The acquisition unit is used to acquire a flashing request for a target electronic control unit of the target vehicle; the flashing request includes the amount of flashing data corresponding to the flashing data of the target electronic control unit. The processing unit is configured to determine n communication links between the mobile terminal module and the diagnostic device module when the amount of data written is greater than a preset amount of data written; n is a positive integer. Select the communication link that matches the amount of data to be written from the n communication links to obtain the target communication link; The mobile terminal module and the diagnostic device module are controlled to establish a communication connection based on the target communication link; The flashing data of the target electronic control unit is sent to the diagnostic device module based on the target communication link; The diagnostic device module is controlled to transmit the flashing data to the storage module of the target electronic control unit; The target electronic control unit is controlled to complete the flashing operation based on the flashing data.
[0006] Thirdly, embodiments of the present invention provide an electronic device, including: a processor, a memory, a wireless communication interface, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the processor to cause the electronic device to perform the method as described in the first aspect.
[0007] Fourthly, embodiments of the present invention provide a computer-readable storage medium storing a computer program that is executed by a processor to implement the method as described in the first aspect.
[0008] Fifthly, embodiments of the present invention provide a computer program product including a non-transitory computer-readable storage medium storing a computer program, such that a computer performs the method as described in the first aspect.
[0009] Implementing the embodiments of the present invention has the following beneficial effects: As can be seen, the electronic control unit (ECU) flashing method described in this embodiment of the invention is applied to a mobile terminal module located in an ECU flashing system. The ECU flashing system includes the mobile terminal module, a diagnostic device module, and a target vehicle. First, a flashing request for the target ECU of the target vehicle is obtained. The flashing request includes the amount of flashing data corresponding to the target ECU's flashing data. When the flashing data amount is greater than a preset flashing data amount, n communication links between the mobile terminal module and the diagnostic device module are determined. Then, a communication link adapted to the flashing data amount is selected from the n communication links to obtain a target communication link. Next, the mobile terminal module and the diagnostic device module establish a communication connection based on the target communication link. Then, the flashing data of the target ECU is sent to the diagnostic device module based on the target communication link. The diagnostic device module then transmits the flashing data to the storage module of the target ECU. Finally, the target ECU completes the flashing operation based on the flashing data. Using this embodiment improves the flashing efficiency of automotive ECUs. Attached Figure Description
[0010] To more clearly illustrate the technical solutions in the embodiments of this application or the background art, the accompanying drawings used in the embodiments of this application or the background art will be described below.
[0011] Figure 1 This is a schematic diagram of an electronic control unit flashing system provided in an embodiment of this application; Figure 2 This is a flowchart of an electronic control unit flashing method provided in the embodiments of this application; Figure 3 This is a flowchart illustrating the determination of a target communication link according to an embodiment of this application; Figure 4 This is a flowchart of determining the transmission quality values of k communication links according to an embodiment of this application; Figure 5 This is a flowchart illustrating how to transmit flash data to a target electronic control unit, as provided in an embodiment of this application. Figure 6 This is a flowchart illustrating how to determine the transmission order according to an embodiment of this application; Figure 7 This is a schematic diagram of the structure of an electronic control unit writing device provided in an embodiment of this application; Figure 8 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0012] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present application.
[0013] The terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish different objects, not to describe a specific order. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or apparatuses.
[0014] In this document, the term "implementation" means that a specific feature, structure, or characteristic described in connection with an implementation may be included in at least one implementation of this application. The appearance of this phrase in various places in the specification does not necessarily refer to the same implementation, nor is it a separate or alternative implementation mutually exclusive with other implementations. It will be explicitly and implicitly understood by those skilled in the art that the implementations described herein can be combined with other implementations.
[0015] Please see Figure 1 , Figure 1 This is a schematic diagram of an electronic control unit (ECU) flashing system provided in an embodiment of this application. The ECU flashing system 10 includes a mobile terminal module 101, a diagnostic device module 102, and a target vehicle 103.
[0016] In this embodiment, the mobile terminal module 101 is the control core and data initiator of the electronic control unit flashing system 10. It is a terminal device with data processing, communication connection, and command issuance functions. It can obtain flashing requests for the electronic control unit of the target vehicle, determine the amount of flashing data, and complete the selection and establishment of communication links. At the same time, it is responsible for sending the flashing data to the diagnostic equipment module. It can also issue flashing-related control commands to the diagnostic equipment module and the electronic control unit of the target vehicle, and lead the advancement of the entire flashing process. The diagnostic equipment module 102 is the communication relay, data verification, and transmission module between the mobile terminal module 101 and the target vehicle 103 in the electronic control unit flashing system 10, serving as a key bridge connecting the two. It can establish a compatible communication connection with the mobile terminal module 101 and receive flashing data. It can perform integrity verification and data packet processing on the flashing data, and can also stably and accurately transmit the processed flashing data to the electronic control unit storage module of the target vehicle 103, ensuring the effective transmission of flashing data from the mobile terminal module 101 to the electronic control unit of the target vehicle 103. The target vehicle 103 is the object of the flashing operation. It is equipped with a target electronic control unit that needs to complete the flashing data update. The target electronic control unit has a dedicated storage module that can receive the flashing data transmitted by the diagnostic device module 102 and update its own firmware, program or parameters based on the flashing data, ultimately realizing the flashing operation.
[0017] It should be explained that, in this embodiment, the mobile terminal module 101 is a smart mobile device equipped with a dedicated diagnostic and flashing application, such as a smartphone or tablet. These devices possess independent computing, storage, and networking capabilities, and can autonomously complete core operations such as hotspot creation, protocol stack operation, data processing, link selection, and task control. They can also achieve bidirectional data interaction with the diagnostic device module through their own Bluetooth, Wi-Fi, and other communication modules, serving as the main control terminal for the entire flashing process. The diagnostic device module 102 does not require complex protocol operation and logic processing capabilities; it only acts as a physical layer transmission intermediary. It can receive various credentials and data from the mobile terminal module 101, establishing a communication connection with it. It can also forward received upper-layer data to the bus of the target vehicle 103 and transmit the target vehicle 103's status data back to the mobile terminal module 101. It is a crucial bridge connecting the mobile terminal module 101 and the electronic control unit of the target vehicle 103, performing only simple operations such as data pass-through and basic status response.
[0018] Please see Figure 2 , Figure 2 This is a flowchart of an electronic control unit flashing method provided in this application, including but not limited to the following steps: S201: Obtain a flashing request for the target electronic control unit of the target vehicle.
[0019] In this embodiment, the flashing request includes determining the amount of flashing data corresponding to the flashing data of the target electronic control unit.
[0020] The flashing request for the target electronic control unit of the target vehicle is an instructional request initiated by the mobile terminal module to trigger the specified target electronic control unit on the target vehicle to perform a flashing operation. This request is the core trigger signal to start the entire electronic control unit flashing process. The entity initiating the flashing request can be the operator, the background management system, or other related control modules, depending on the actual application scenario of the flashing system.
[0021] The flashing request may also include flashing data of the target electronic control unit of the target vehicle. The flashing data of the target electronic control unit of the target vehicle can be retrieved by the mobile terminal module from a locally stored database, downloaded from a cloud server via the network, or read from an external storage device.
[0022] S202: When the amount of data written is greater than the preset amount of data written, determine the n communication links between the mobile terminal module and the diagnostic device module.
[0023] In this embodiment, n is a positive integer. When the amount of data written to the target electronic control unit exceeds a preset data writing limit, the mobile terminal module can identify and confirm all available communication links, including wireless LAN and Bluetooth, that can be established between itself and the diagnostic connector module. Specifically, when the amount of data written to the target electronic control unit exceeds a preset data writing limit, the mobile terminal module, as the core control and communication unit of the electronic control unit writing system, will comprehensively identify, detect, and sort out all available communication links that can be established between itself and the diagnostic device module that performs the pass-through adaptation function, and confirm the connectivity and communication capability of each communication link one by one, thereby determining the n communication links between the mobile terminal module and the diagnostic device module.
[0024] In this embodiment, the communication link can be a wireless communication link or a wired communication link, but it is mainly a wireless communication link. The wireless communication link is highly compatible with the system architecture design with the mobile terminal module as the main controller and the diagnostic equipment module for transparent transmission. At the same time, it is adapted to the on-site operation characteristics of vehicle electronic control unit (ECU) flashing. On the one hand, the mobile terminal module itself uses wireless communication as its native communication method. Using a wireless link can give full play to its native computing and communication capabilities without the need for additional wired adapter hardware. As a lightweight transparent transmission device, the diagnostic equipment module can also have its hardware design simplified by the wireless link, avoiding the size and wiring problems caused by wired interfaces, which is in line with the lightweight and integrated design concept of the system. On the other hand, vehicle flashing is mostly completed on-site in outdoor areas, repair shops, etc. The wireless link does not require the laying of physical cables, getting rid of the space limitations of cable length and interface docking. The mobile terminal and the diagnostic equipment can be flexibly placed within a reasonable communication range to adapt to the operation requirements of different vehicle models and different parking environments. Moreover, the wireless link connection can be established without plugging and unplugging cables, and the link can be quickly set up and switched, reducing on-site operation preparation time and improving the efficiency of single vehicle flashing and the smoothness of multi-vehicle continuous flashing operations. Furthermore, wireless LAN-type wireless links can provide sufficient bandwidth and stable transmission quality, meeting the high-speed transmission requirements of large-volume data writing. The adaptation solution is designed for links with large data writing volumes, and the wireless link has no physical contact, which can reduce hardware wear and poor contact caused by frequent on-site operations, reducing equipment damage and subsequent maintenance costs. In addition, the transmission process of the wireless link is also more compatible with the mobile terminal module's processing logic for data writing, such as data segmentation, verification, and breakpoint resumption, ensuring the integrity and reliability of data writing transmission.
[0025] S203: Select a communication link from the n communication links that is compatible with the amount of data to be written, and obtain the target communication link.
[0026] In this embodiment, the minimum bandwidth of the communication link required to complete the data transmission can be calculated first based on the amount of data to be written. Then, the actual link bandwidth of each of the n links is detected and counted one by one. From these bandwidth data, k communication links with values greater than the minimum link bandwidth are selected. Then, the transmission quality of these k links that meet the basic bandwidth requirements is tested to determine the communication link transmission quality value corresponding to each link. Then, the largest value is found from the k transmission quality values. Finally, the communication link corresponding to the largest transmission quality value is determined as the target communication link that meets the data transmission requirements.
[0027] S204: Control the mobile terminal module and the diagnostic device module to establish a communication connection based on the target communication link.
[0028] In this embodiment, after determining the target communication link that meets the data transmission requirements for flashing, the mobile terminal module can initiate a communication connection control command. On the one hand, it completes the configuration of communication parameters matching the target communication link and the activation of the link channel. On the other hand, it sends the connection command and adaptation parameters of the target communication link to the diagnostic device module. After receiving the command, the diagnostic device module completes the configuration of the corresponding communication parameters and the response of the link channel according to the command. The mobile terminal module and the diagnostic device module complete the construction of a bidirectional communication path based on the unified target communication link parameters, realizing a dedicated, stable and adapted communication connection for flashing data transmission between the mobile terminal module and the diagnostic device module, ensuring that subsequent flashing data can be accurately and efficiently transmitted across modules through this link.
[0029] S205: Send the flashing data of the target electronic control unit to the diagnostic device module based on the target communication link.
[0030] In this embodiment, after the mobile terminal module and the diagnostic equipment module establish a stable communication connection based on the target communication link, the mobile terminal module will use this dedicated target communication link, which is adapted to the data transmission requirements of the flashing data, as the core transmission channel. The flashing data, which is pre-retrieved, downloaded, or read and precisely matched with the target electronic control unit on the target vehicle, will be processed according to the system's preset transmission rules and then sent to the diagnostic equipment module in an orderly and complete manner. The entire data transmission process relies on the bandwidth and transmission quality assurance of the target communication link to ensure that the flashing data is not lost or corrupted during transmission and can be accurately received by the diagnostic equipment module.
[0031] S206: Control the diagnostic device module to transmit the flashing data to the storage module of the target electronic control unit.
[0032] In this embodiment, a data transmission control command can be sent from the mobile terminal module to the diagnostic equipment module. After receiving the command, the diagnostic equipment module accurately obtains the flashing data that matches the target electronic control unit from the mobile terminal module through the target communication link, performs format conversion and data adaptation according to the vehicle bus communication specifications, and then forwards the processed flashing data stably and completely to the target electronic control unit of the target vehicle through its own connection channel with the vehicle bus. The flashing data is then accurately transmitted to the built-in storage module of the electronic control unit for storage, ensuring that the flashing data is properly saved and can be read and called by the target electronic control unit later.
[0033] S207: Control the target electronic control unit to complete the flashing operation based on the flashing data.
[0034] In this embodiment, after receiving the relevant flashing request, the target electronic control unit reads the successfully stored flashing data that precisely matches its own from its own storage module. Then, according to the preset flashing program and industry-standard diagnostic protocol specifications, it sequentially completes a series of operations such as verifying the flashing data, overwriting the firmware or program, and verifying the integrity of the data after writing. If no abnormalities such as data errors or writing failures occur during the entire process, the target electronic control unit will complete the update of its own program, parameters, or firmware, and can perform a restart operation according to the instructions, thereby formally completing all flashing operations based on the flashing data and realizing the functional update or fault repair of the electronic control unit.
[0035] As can be seen, the method first obtains the flashing data volume of the target electronic control unit through a flashing request. Then, for large-volume flashing data, a process of determining and adapting multiple communication links is initiated to select target communication links that match the data transmission requirements and establish stable communication connections. Subsequently, relying on this link, the flashing data is transmitted in an orderly manner from the mobile terminal module to the diagnostic device module and then to the target electronic control unit's storage module. Finally, the target electronic control unit is controlled to complete the flashing process. The core advantage of this method lies in its dedicated communication link adaptation optimization for large-volume flashing data. It abandons the fixed mode of single-link transmission and ensures the high speed and stability of large-volume flashing data transmission by accurately matching the link selection of the data volume. This effectively avoids problems such as transmission lag, data loss, and flashing failure caused by insufficient link bandwidth and transmission quality. At the same time, with the mobile terminal module as the main control core and combined with the transparent transmission function of the diagnostic device module, the computing and communication capabilities of the mobile terminal are fully utilized, simplifying the operation logic of the flashing system and making the flashing process more targeted and adaptable, thereby improving the overall flashing efficiency and success rate of the electronic control unit.
[0036] It should be explained that, in this embodiment, the unique identifier of the target electronic control unit can be added to the flashing request to ensure that the flashing request can accurately match the hardware unit to be flashed. Furthermore, before determining the target communication link, the steps can be added: the mobile terminal module automatically creates a wireless hotspot, encrypts the hotspot credentials, and sends them to the diagnostic device module; simultaneously, the diagnostic device module receives the credentials and completes the hotspot connection and authentication. It can also be clarified that the diagnostic device module only performs data pass-through and does not implement any diagnostic or flashing-related upper-layer protocol stack. Additionally, when transmitting flashing data packets, windowed transmission can be added, along with technical details such as cyclic redundancy check and support for breakpoint resumption. After the target electronic control unit completes the flashing data reception, it can perform overall verification of the flashing data and perform its own restart operation. Finally, after the entire flashing operation is completed, the mobile terminal module can close the created wireless hotspot and switch the communication mode with the diagnostic device module back to Bluetooth mode or close the communication with the diagnostic device module.
[0037] Please see Figure 3 , Figure 3 This is a flowchart of a method for determining a target communication link according to an embodiment of this application, including but not limited to the following steps: S301: Determine the minimum link bandwidth of the communication link required for the amount of data to be written.
[0038] In this embodiment, the mapping relationship between the preset amount of data to be written and the minimum link bandwidth of the communication link can be used to determine the minimum link bandwidth of the communication link required for the amount of data to be written. The preset mapping relationship between the amount of data to be written and the minimum link bandwidth of the communication link can be a pre-established correspondence between the amount of data to be written and the minimum link bandwidth of the communication link, based on the actual application scenario of electronic control unit writing, the general standard of industry writing operations, and the transmission requirements of system design. The determination process requires first sorting out the range of data to be written at different levels, and then, for each range of data, combined with the preset reasonable transmission time limit of the writing operation, the link loss in data transmission, and additional data overhead such as verification retransmission, the minimum link bandwidth required for stable transmission of the data to be written in each range is calculated through the bandwidth calculation model. At the same time, the calculated minimum link bandwidth is calibrated and optimized based on the transmission verification results of the links corresponding to different data volumes in the actual writing test, and finally a one-to-one preset mapping relationship between different amounts of data to the corresponding adapted minimum link bandwidth of the communication link is established.
[0039] S302: Determine the link bandwidth corresponding to each of the n communication links to obtain n link bandwidths.
[0040] In this embodiment, the mobile terminal module acts as the main control unit, initiating bandwidth detection commands for each of the n identified available communication links. For each link, a corresponding bandwidth detection mechanism is adopted. This involves sending standard detection data packets to the diagnostic device module, statistically analyzing the size and number of successfully transmitted data packets per unit time, and considering factors such as the actual transmission delay and data frame interaction efficiency of the link. After eliminating accidental fluctuations during the detection process, the effective transmission bandwidth that each link can currently stably provide is calculated. The detection calculation result of each link is used as the link bandwidth value corresponding to that link, ultimately obtaining n link bandwidth data that correspond one-to-one with the n communication links.
[0041] S303: Determine the k link bandwidths among the n link bandwidths that are greater than the minimum link bandwidth.
[0042] In this implementation, k is an integer less than or equal to n. The mobile terminal module uses the minimum link bandwidth required for the previously calculated amount of data to be written as a threshold. It compares and screens the n actual link bandwidth data corresponding to the n available communication links, and sequentially determines whether the value of each actual link bandwidth is greater than the minimum link bandwidth threshold. All actual link bandwidths that meet the condition of being greater than the minimum link bandwidth are filtered, extracted, and summarized to obtain k link bandwidths that meet the basic bandwidth transmission requirements.
[0043] S304: Determine the k communication links corresponding to the k link bandwidths.
[0044] In this embodiment, each bandwidth value is back-matched to its corresponding specific communication link, and the communication link corresponding to each of the k bandwidths is identified and extracted one by one, thereby determining the k communication links corresponding to the k link bandwidths.
[0045] S305: Determine the communication link transmission quality value corresponding to each of the k communication links to obtain k communication link transmission quality values.
[0046] In this embodiment, for any one of the k communication links, the mobile terminal module first performs actual transmission detection to accurately determine the two core transmission quality indicators of the link: the actual transmission rate and the packet loss rate. Then, the first communication link transmission quality value corresponding to the measured transmission rate and the second communication link transmission quality value corresponding to the measured packet loss rate are determined respectively. Subsequently, according to the system's preset calculation logic, these two quality values are combined to obtain the unique communication link transmission quality value corresponding to the link. Then, following the same detection, matching, and calculation process, the above operation is performed on all the remaining links in the k communication links in sequence, finally obtaining k communication link transmission quality values that correspond one-to-one with the k communication links.
[0047] S306: Determine the maximum communication link transmission quality value among the k communication link transmission quality values.
[0048] In this embodiment, the communication link transmission quality value with the largest value is selected from the k communication link transmission quality values. This value corresponds to the link with the best overall transmission quality among the k links.
[0049] S307: Determine the communication link corresponding to the maximum communication link transmission quality value to obtain the target communication link.
[0050] In this embodiment, the maximum transmission quality value is reverse-matched to accurately locate the specific communication link corresponding to that value. The communication link that meets the basic bandwidth requirements for flashing data transmission and has the best overall transmission quality among all qualified links is determined as the target communication link required for this electronic control unit flashing operation.
[0051] As can be seen, first determining the minimum required link bandwidth based on the amount of data to be written, then selecting communication links that meet the bandwidth requirements, and subsequently further testing the link transmission quality and selecting the link with the best quality as the target communication link, ensures that the selected links have the basic capability to support the data transmission of the writing process. This eliminates links with insufficient bandwidth at the source, avoiding data transmission stuttering, timeouts, or incomplete transmissions caused by bandwidth issues, thus guaranteeing the basic feasibility of writing data transmission. Selecting the link with the best transmission quality from among the links that meet the basic bandwidth requirements ensures that the writing data maintains a high-speed and stable state during transmission, effectively reducing the probability of data loss and transmission delays, and improving the integrity and reliability of data transmission. This approach can adapt to different writing data volumes and link selection needs under different communication environments, improving the adaptability and flexibility of link selection, maximizing the transmission efficiency of the communication links, and laying a solid link foundation for the efficient transmission of subsequent writing data and the smooth completion of the electronic control unit writing operation, thereby improving the overall efficiency and success rate of electronic control unit writing.
[0052] Please see Figure 4 , Figure 4 This is a flowchart of determining the transmission quality values of k communication links according to an embodiment of this application, including but not limited to the following steps: S401: Determine the transmission rate and packet loss rate corresponding to the first communication link.
[0053] In this embodiment, the first communication link is any one of the k communication links.
[0054] The transmission rate of the first communication link has a positive impact on its transmission quality value. The transmission rate represents the amount of data that the link can transmit per unit time. Under the premise of a fixed amount of data to be written, the higher the transmission rate of the link, the shorter the overall data transmission time, and the more efficient the transmission of data to be written. At the same time, a higher transmission rate can better adapt to the transmission needs of large-volume data to be written, reducing congestion during data transmission. According to the preset quantization rules, the corresponding first communication link transmission quality value will be higher, which in turn drives the improvement of the overall communication link transmission quality value. Conversely, the lower the transmission rate, the lower the data transmission efficiency, the weaker the ability to adapt to large-volume data transmission, the lower the first communication link transmission quality value, and the lower the overall communication link transmission quality value of the link will also decrease.
[0055] The packet loss rate of the first communication link has an inverse impact on its transmission quality value. The packet loss rate represents the proportion of data packets lost during data transmission to the total number of data packets sent. A higher packet loss rate indicates a greater probability of data loss during transmission, requiring frequent data retransmissions. This not only increases the overall data transmission time but may also compromise the integrity of the data being written due to data loss, or even cause data transmission failure. According to the preset quantization rules, the corresponding transmission quality value of the second communication link will be lower, thus lowering the overall transmission quality value of the entire link. Conversely, a lower packet loss rate results in higher data transmission integrity and stability, eliminating the need for frequent data retransmissions. Consequently, the transmission quality value of the second communication link will be higher, and the overall transmission quality value of the link will also improve.
[0056] It should be explained that, since the first communication link is any one of the k communication links, the transmission quality values of the k communication links corresponding to the first communication link can be determined according to the method for determining the transmission quality value of the communication link corresponding to the first communication link. In this embodiment, the first communication link is used as an example for explanation.
[0057] S402: Determine the first communication link transmission quality value corresponding to the transmission rate and the second communication link transmission quality value corresponding to the packet loss rate.
[0058] In this embodiment, it can be a first mapping relationship between a preset transmission rate and a communication link transmission quality value. Based on this first mapping relationship, a first communication link transmission quality value corresponding to the transmission rate can be determined.
[0059] It can be a second mapping relationship between a preset packet loss rate and a communication link transmission quality value. Based on this second mapping relationship, a second communication link transmission quality value corresponding to the packet loss rate can be determined.
[0060] S403: Determine the communication link transmission quality value corresponding to the first communication link based on the first communication link transmission quality value and the second communication link transmission quality value.
[0061] In this embodiment, the operation can be performed according to the pre-set comprehensive calculation rules for transmission quality. Based on the actual needs of the electronic control unit's data transmission, appropriate weight ratios are assigned to the transmission quality values of the first and second communication links. Among them, transmission rate and packet loss rate are the core indicators of data transmission and are assigned corresponding weights according to the priority of link transmission. Then, through a preset mathematical operation method, the first weight corresponding to the transmission quality value of the first communication link, the second weight corresponding to the transmission quality value of the second communication link, and the first and second communication link transmission quality values are comprehensively calculated to obtain the transmission quality value of the first communication link. The transmission quality value of the first communication link integrates the two core indicators of transmission rate and packet loss rate, ensuring that it can objectively reflect the comprehensive transmission quality of the link in combination with transmission efficiency and transmission stability.
[0062] It should be noted that, in this embodiment, since the wireless signal strength corresponding to the first communication link has a positive impact on its communication link transmission quality value, the higher the signal strength, the higher the communication link transmission quality value, and the lower the signal strength, the lower the communication link transmission quality value, it is also necessary to consider the impact of the wireless signal strength corresponding to the first communication link on the communication link transmission quality value corresponding to the first communication link.
[0063] For example, a reference communication link transmission quality value is determined based on the first communication link transmission quality value and the second communication link transmission quality value. Specifically, the two values are weighted and fused using a preset mathematical operation method to obtain a basic quantitative value that integrates transmission efficiency and transmission stability, namely the reference communication link transmission quality value.
[0064] For example, the wireless signal strength corresponding to the first communication link is obtained. Specifically, wireless signal strength is a core fundamental indicator of the transmission quality of a wireless communication link. It directly determines the basic stability of the link transmission and affects the actual performance of the transmission rate and the packet loss rate. Even if a reference link transmission quality has been obtained through the transmission rate and packet loss rate, the actual situation of the wireless signal strength can still reflect the communication status of the link from the bottom layer. It is an important factor affecting the link transmission quality. Including this indicator can make the final determined communication link transmission quality value more comprehensively and objectively reflect the actual comprehensive transmission capability of the link, and make the quantitative result of the link transmission quality more in line with the actual communication scenario. Therefore, it is necessary to obtain the wireless signal strength corresponding to the first communication link.
[0065] For example, an adjustment parameter corresponding to the wireless signal strength is determined. Specifically, it can be a preset mapping relationship between wireless signal strength and adjustment parameters, and the adjustment parameter corresponding to the wireless signal strength can be determined based on this mapping relationship.
[0066] For example, the transmission quality value of the reference communication link is adjusted based on the adjustment parameters to obtain the transmission quality value of the communication link corresponding to the first communication link. Specifically, the transmission quality value of the communication link corresponding to the first communication link is calculated in the following manner: The transmission quality value of the first communication link = the transmission quality value of the reference communication link × (1 + adjustment parameter); Based on the above method, the transmission quality value of the reference communication link can be adjusted according to the adjustment parameters to obtain the transmission quality value of the communication link corresponding to the first communication link.
[0067] As can be seen, the method of first determining the corresponding quality value through transmission rate and packet loss rate, and then introducing wireless signal strength in conjunction with parameter adjustment to obtain the final link transmission quality value, makes the quantitative judgment of communication link transmission quality more in line with the actual characteristics of wireless communication. It controls the transmission efficiency and data transmission stability of the link through the two core indicators of transmission rate and packet loss rate, forming a reference value that can reflect the core transmission performance of the link. At the same time, it incorporates signal strength, which is the basis of wireless link transmission, into the judgment system and makes precise corrections to the reference value by adjusting parameters. This makes up for the one-sidedness of relying solely on transmission rate and packet loss rate for judgment, so that the final transmission quality value can comprehensively reflect the multiple core transmission indicators of the wireless link, more objectively and accurately match the actual comprehensive transmission capability of the link, and avoid the situation where the quality value judgment does not match the actual link state due to ignoring signal strength.
[0068] Please see Figure 5 , Figure 5 This application provides a flowchart of a method for transmitting flash data to a target electronic control unit, including but not limited to the following steps: S501: The integrity of the written data is verified by the diagnostic device module.
[0069] In this embodiment, the diagnostic device module can first obtain the data to be written sent by the mobile terminal module and the pre-set verification identifier of the data. Then, relying on the system's built-in integrity verification algorithm, it performs full byte verification and feature value calculation on the written data. The calculated actual verification feature value is accurately compared with the preset verification identifier. At the same time, it checks whether there are any abnormalities such as missing bytes, broken data segments, or content tampering. If the actual verification feature value matches the preset verification identifier completely and the data is without any abnormalities, the integrity verification is determined to be passed. If the two do not match or the data is abnormal, the verification is determined to be failed. In this way, the integrity and accuracy of the written data are strictly controlled from the intermediate link of data transmission, avoiding problems such as writing failure and device failure caused by incomplete or abnormal written data being transmitted to the target electronic control unit.
[0070] S502: After the integrity verification is passed, the write data is divided into m data packets according to the preset number of bytes.
[0071] In this embodiment, m is an integer greater than 1. Based on a pre-set fixed number of bytes as the capacity standard for a single data packet, starting from the beginning byte position of the data to be written, the complete data to be written is sequentially and continuously segmented without overlap. The first m-1 data packets are all segmented to the preset number of bytes. If the number of remaining undivided data packets is less than the preset number of bytes, all remaining bytes are integrated into the m-th data packet. During the segmentation process, it is ensured that all bytes of the data to be written are allocated to the corresponding data packets without omission or duplication. Finally, the entire segment of data to be written is broken down into m independent data packets.
[0072] It should be explained that if the integrity check fails, the diagnostic device module sends a prompt message to the mobile terminal module. This prompt message indicates that the flashing operation on the target electronic control unit has failed, triggering the mobile terminal module to retransmit the flashing data of the target electronic control unit to the diagnostic device module. Specifically, during the integrity check of the received flashing data by the diagnostic device module, if the preset check algorithm detects problems such as missing bytes, content tampering, data corruption, or inconsistent feature values, and determines that the integrity check has failed, the diagnostic device module will immediately trigger a preset information feedback mechanism. The system proactively sends a corresponding prompt message to the mobile terminal module that sent the flashing data. The core function of this prompt message is to clearly inform the mobile terminal module that the flashing operation for the target electronic control unit has failed due to incomplete data. At the same time, this prompt message will act as a trigger signal to start the preset flashing data retransmission program in the mobile terminal module, prompting the mobile terminal module to retransmit the complete flashing data of the target electronic control unit to the diagnostic device module. This avoids problems such as electronic control unit flashing failure and hardware failure caused by incomplete flashing data entering subsequent processes from the data transmission stage, thus ensuring the integrity and effectiveness of the flashing data from the source to the diagnostic device module.
[0073] S503: Determine the transmission order corresponding to the m data packets.
[0074] In this embodiment, the vehicle hardware flashing logic and functional association rules of the target vehicle can be combined to determine the vehicle hardware association degree corresponding to each of the m data packets. This association degree reflects the tightness of the binding between the flashing data of each data packet and the target vehicle hardware. Thus, m vehicle hardware association degrees corresponding one-to-one with the m data packets are obtained. Then, according to the positive correspondence rule between vehicle hardware association degree and transmission priority, a corresponding transmission priority is matched for each data packet. The greater the vehicle hardware association degree of the data packet, the higher the corresponding transmission priority. Thus, m one-to-one corresponding transmission priorities are obtained. Finally, all data packets are sorted in descending order of transmission priority. Data packets with the same priority can be ordered according to a preset rule. The final sorting result is the transmission order of the m data packets.
[0075] S504: Based on the transmission order, transmit the m data packets to the storage module of the target electronic control unit.
[0076] In this embodiment, based on the transmission order, each data packet is transmitted sequentially to the target electronic control unit through the selected target communication link. During the transmission process, it is ensured that each data packet is sent in order. At the same time, all data packets are accurately transmitted to the storage module of the target electronic control unit, which is used for temporary storage of flashing data. This ensures that each data packet can arrive at the storage module in order and complete the storage. This not only ensures the orderliness of data packet transmission, but also provides an orderly and complete data storage foundation for the electronic control unit to retrieve data packets from the storage module, reassemble and restore the complete flashing data in order, and perform the flashing operation. This avoids subsequent data splicing failure or flashing process errors due to out-of-order storage of data packets.
[0077] As can be seen, by first determining the degree of binding between each data packet and the vehicle hardware to obtain the correlation degree of the vehicle hardware, the importance of the flashing data corresponding to each data packet in the flashing of the vehicle hardware can be accurately distinguished. Then, the transmission priority is set according to the rule that the greater the correlation, the higher the priority. This allows data packets that are more critical to the flashing of the vehicle hardware and are more tightly bound to it to receive higher transmission priority. Finally, the transmission order is determined according to the priority and transmitted in sequence. This ensures that the core and critical flashing data packets are transmitted to the storage module of the target electronic control unit first. Even if there are sudden abnormalities in the link or transmission interruption during the transmission process, the core data packets can still be transmitted first, reducing the probability of failure in the transmission of critical data, thereby improving the efficiency of the electronic control unit in retrieving data packets for splicing and flashing.
[0078] It should be explained that, in this embodiment, the diagnostic device module can also transmit the flashing data to the storage module of the target electronic control unit in a windowed manner. The diagnostic device module can first combine the transmission performance of the target communication link and the storage and receiving capabilities of the target electronic control unit to preset a fixed-size transmission window. This window corresponds to a preset number of data packets that can be sent to the electronic control unit at one time. During transmission, the m data packets, which have been sorted according to rules, are first divided into several groups of window data packets according to the window size. The first group of window data packets is sent to the storage module of the electronic control unit through the target communication link. The diagnostic device module then waits for the electronic control unit to return the data. Upon receiving a confirmation instruction for the first set of data packets, confirming that there were no lost or erroneous packets and that the packets have been successfully stored, the window immediately slides to send the next set of data packets. Subsequent transmissions follow the rule of sending one set, confirming one set, sliding the window, and resending continuously. If a set of data packets does not receive a confirmation instruction from the electronic control unit, the diagnostic device module triggers a retransmission mechanism to resend that set of data packets until a confirmation instruction is received, at which point the window slides to continue transmission. All write data packets are transmitted sequentially to the storage module of the electronic control unit in a predetermined transmission order through this window sliding, confirmation, and retransmission method, ensuring the orderliness and effectiveness of data packet transmission throughout the process.
[0079] Please see Figure 6 , Figure 6 This is a flowchart of a method for determining the transmission order provided in an embodiment of this application, including but not limited to the following steps: S601: Determine the vehicle hardware correlation degree corresponding to each of the m data packets to obtain m vehicle hardware correlation degrees.
[0080] In this embodiment, the vehicle hardware correlation degree refers to the tightness of the binding between the flashing data corresponding to the data packet and the vehicle hardware of the target vehicle.
[0081] First, the system retrieves the flashing configuration information, hardware functional architecture, and overall mapping relationship of the flashing data of the target vehicle's onboard hardware. This clarifies the corresponding binding relationship between each data segment in the entire flashing data and each functional module and core component of the onboard hardware. Then, for each split data packet, the system analyzes its flashing data content one by one, locating the specific onboard hardware module and core execution link corresponding to that data content. Simultaneously, combined with the onboard hardware flashing process rules, the system quantitatively evaluates the importance and binding tightness of the flashing data of that data packet to the corresponding onboard hardware's functional activation, program operation, and flashing completion. Through a preset quantification algorithm, this tightness is converted into a specific onboard hardware correlation value, ultimately obtaining m onboard hardware correlation values that correspond one-to-one with m data packets.
[0082] S602: Determine the m transmission priorities corresponding to the m data packets based on the m vehicle hardware correlations.
[0083] In this embodiment, each data packet corresponds to a transmission priority. The greater the correlation between the data packet and the vehicle hardware, the higher the transmission priority of the data packet. Since the greater the correlation between the data packet and the vehicle hardware, the higher the transmission priority of the data packet, the m transmission priorities corresponding to the m data packets can be determined according to the magnitude of the correlation between the m vehicle hardware.
[0084] S603: Determine the transmission order based on the m transmission priorities.
[0085] In this embodiment, by determining the m transmission priorities corresponding to the m data packets, the transmission order can be determined according to the m transmission priorities.
[0086] As can be seen, by first quantifying the binding tightness between the flashing data and the vehicle hardware of each data packet through correlation, the importance level of each data packet in the vehicle hardware flashing process can be accurately distinguished, and the difference between core critical data packets and ordinary data packets can be clarified. Then, following the rule that the greater the correlation, the higher the priority, a unique transmission priority is assigned to each data packet, so that data packets that are more critical to vehicle hardware flashing and function activation receive higher transmission priority. Finally, the transmission order is determined according to the priority, which ensures that core critical data packets are transmitted to the storage module of the target electronic control unit first. Even if unexpected situations such as link fluctuations or temporary interruptions occur during transmission, the core data can still be transmitted. Prioritizing data transmission significantly reduces the probability of critical data transmission failures. This transmission order aligns with the flashing logic of the vehicle's hardware, preventing non-core data packets from accumulating and consuming link resources. This improves the overall targeting and efficiency of data packet transmission, reduces unnecessary consumption of link transmission resources, and makes data packet transmission more logical and organized. This facilitates the orderly scheduling of transmission by diagnostic equipment modules and the sequential reception and storage by the electronic control unit. It lays a solid foundation for the subsequent sequential splicing of data packets, complete restoration of flashing data, and the smooth and efficient execution of vehicle hardware flashing operations, ensuring the stability and reliability of the flashing process at the transmission level.
[0087] In summary, implementing the embodiments of the present invention has the following beneficial effects: As can be seen, the electronic control unit (ECU) flashing method described in this embodiment of the invention is applied to a mobile terminal module located in an ECU flashing system. The ECU flashing system includes the mobile terminal module, a diagnostic device module, and a target vehicle. First, a flashing request for the target ECU of the target vehicle is obtained. The flashing request includes the amount of flashing data corresponding to the target ECU's flashing data. When the flashing data amount is greater than a preset flashing data amount, n communication links between the mobile terminal module and the diagnostic device module are determined. Then, a communication link adapted to the flashing data amount is selected from the n communication links to obtain a target communication link. Next, the mobile terminal module and the diagnostic device module establish a communication connection based on the target communication link. Then, the flashing data of the target ECU is sent to the diagnostic device module based on the target communication link. The diagnostic device module then transmits the flashing data to the storage module of the target ECU. Finally, the target ECU completes the flashing operation based on the flashing data. Using this embodiment improves the flashing efficiency of automotive ECUs.
[0088] Please see Figure 7 , Figure 7This is a schematic diagram of an electronic control unit (ECU) flashing device provided in an embodiment of this application. The ECU flashing device is applied to a mobile terminal module, which is located in an ECU flashing system. The ECU flashing system includes the mobile terminal module, a diagnostic device module, and a target vehicle. The ECU flashing device 700 includes: an acquisition unit 701 and a processing unit 702. The acquisition unit 701 is used to acquire a flashing request for a target electronic control unit of the target vehicle; the flashing request includes the amount of flashing data corresponding to the flashing data of the target electronic control unit. The processing unit 702 is used to determine n communication links between the mobile terminal module and the diagnostic device module when the amount of data written is greater than a preset amount of data written; n is a positive integer. Select the communication link that matches the amount of data to be written from the n communication links to obtain the target communication link; The mobile terminal module and the diagnostic device module are controlled to establish a communication connection based on the target communication link; The flashing data of the target electronic control unit is sent to the diagnostic device module based on the target communication link; The diagnostic device module is controlled to transmit the flashing data to the storage module of the target electronic control unit; The target electronic control unit is controlled to complete the flashing operation based on the flashing data.
[0089] In some possible implementations, in selecting a communication link from the n communication links that matches the amount of data to be written, and obtaining a target communication link, the processing unit 702 is specifically used for: Determine the minimum link bandwidth of the communication link required for the amount of data to be written; Determine the link bandwidth corresponding to each of the n communication links to obtain n link bandwidths; Determine the bandwidths of k links out of the n link bandwidths that are greater than the minimum link bandwidth; k is an integer less than or equal to n; Determine the k communication links corresponding to the k link bandwidths; Determine the transmission quality value of each of the k communication links to obtain k communication link transmission quality values; Determine the maximum communication link transmission quality value among the k communication link transmission quality values; The target communication link is obtained by determining the communication link corresponding to the maximum communication link transmission quality value.
[0090] In some possible implementations, in determining the communication link transmission quality value corresponding to each of the k communication links to obtain k communication link transmission quality values, the processing unit 702 is specifically used for: Determine the transmission rate and packet loss rate corresponding to the first communication link; the first communication link is any one of the k communication links; Determine the first communication link transmission quality value corresponding to the transmission rate and the second communication link transmission quality value corresponding to the packet loss rate; The transmission quality value of the first communication link is determined based on the transmission quality value of the first communication link and the transmission quality value of the second communication link.
[0091] In some possible implementations, in determining the communication link transmission quality value corresponding to the first communication link based on the first communication link transmission quality value and the second communication link transmission quality value, the processing unit 702 is specifically used for: A reference communication link transmission quality value is determined based on the first communication link transmission quality value and the second communication link transmission quality value. Obtain the wireless signal strength corresponding to the first communication link; Determine the adjustment parameters corresponding to the wireless signal strength; The transmission quality value of the reference communication link is adjusted based on the adjustment parameters to obtain the transmission quality value of the communication link corresponding to the first communication link.
[0092] In some possible implementations, the processing unit 702 is specifically configured to: control the diagnostic device module to transmit the write data to the storage module of the target electronic control unit. The integrity of the written data is verified by the diagnostic device module. After the integrity check passes, the data to be written is divided into m data packets according to a preset number of bytes; m is an integer greater than 1. Determine the transmission order of the m data packets; Based on the transmission order, the m data packets are transmitted to the storage module of the target electronic control unit.
[0093] In some possible implementations, the processing unit 702 is specifically configured to: determine the transmission order corresponding to the m data packets. The vehicle hardware correlation degree corresponding to each of the m data packets is determined to obtain m vehicle hardware correlation degrees; the vehicle hardware correlation degree is the degree of binding between the flashing data corresponding to the data packet and the vehicle hardware of the target vehicle; Based on the m vehicle hardware correlation degrees, m transmission priorities corresponding to the m data packets are determined; each data packet corresponds to a transmission priority, and the greater the vehicle hardware correlation degree of the data packet, the higher the transmission priority of the data packet. The transmission order is determined based on the m transmission priorities.
[0094] In some possible implementations, the processing unit 702 is further specifically used for: If the integrity verification fails, the diagnostic device module sends a prompt message to the mobile terminal module; the prompt message indicates that the flashing operation of the target electronic control unit has failed, thereby triggering the mobile terminal module to retransmit the flashing data of the target electronic control unit to the diagnostic device module.
[0095] Please see Figure 8 , Figure 8 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. The electronic device is applied to a mobile terminal module, which is located in an electronic control unit (ECU) flashing system. The ECU flashing system includes the mobile terminal module, a diagnostic equipment module, and a target vehicle; as shown... Figure 8 As shown, the electronic device 800 includes a transceiver 801, a processor 802, and a memory 803. These are connected via a bus 804. The memory 803 stores computer programs and data, and the transceiver 801 can transmit data stored in the memory 803 to the processor 802. The program includes instructions for performing the following steps: Obtain a flashing request for the target electronic control unit of the target vehicle; the flashing request includes the amount of flashing data corresponding to the flashing data of the target electronic control unit; When the amount of data written exceeds the preset amount of data written, n communication links between the mobile terminal module and the diagnostic device module are determined; n is a positive integer. Select the communication link that matches the amount of data to be written from the n communication links to obtain the target communication link; The mobile terminal module and the diagnostic device module are controlled to establish a communication connection based on the target communication link; The flashing data of the target electronic control unit is sent to the diagnostic device module based on the target communication link; The diagnostic device module is controlled to transmit the flashing data to the storage module of the target electronic control unit; The target electronic control unit is controlled to complete the flashing operation based on the flashing data.
[0096] In some possible implementations, the above procedure includes instructions for performing the following steps in order to select a communication link from the n communication links that is compatible with the amount of data to be written: Determine the minimum link bandwidth of the communication link required for the amount of data to be written; Determine the link bandwidth corresponding to each of the n communication links to obtain n link bandwidths; Determine the bandwidths of k links out of the n link bandwidths that are greater than the minimum link bandwidth; k is an integer less than or equal to n; Determine the k communication links corresponding to the k link bandwidths; Determine the transmission quality value of each of the k communication links to obtain k communication link transmission quality values; Determine the maximum communication link transmission quality value among the k communication link transmission quality values; The target communication link is obtained by determining the communication link corresponding to the maximum communication link transmission quality value.
[0097] In some possible implementations, in determining the communication link transmission quality value corresponding to each of the k communication links to obtain k communication link transmission quality values, the above procedure includes instructions for performing the following steps: Determine the transmission rate and packet loss rate corresponding to the first communication link; the first communication link is any one of the k communication links; Determine the first communication link transmission quality value corresponding to the transmission rate and the second communication link transmission quality value corresponding to the packet loss rate; The transmission quality value of the first communication link is determined based on the transmission quality value of the first communication link and the transmission quality value of the second communication link.
[0098] In some possible implementations, in determining the communication link transmission quality value corresponding to the first communication link based on the first communication link transmission quality value and the second communication link transmission quality value, the above procedure includes instructions for performing the following steps: A reference communication link transmission quality value is determined based on the first communication link transmission quality value and the second communication link transmission quality value. Obtain the wireless signal strength corresponding to the first communication link; Determine the adjustment parameters corresponding to the wireless signal strength; The transmission quality value of the reference communication link is adjusted based on the adjustment parameters to obtain the transmission quality value of the communication link corresponding to the first communication link.
[0099] In some possible implementations, the above procedure includes instructions for performing the following steps in controlling the diagnostic device module to transmit the write data to the storage module of the target electronic control unit: The integrity of the written data is verified by the diagnostic device module. After the integrity check passes, the data to be written is divided into m data packets according to a preset number of bytes; m is an integer greater than 1. Determine the transmission order of the m data packets; Based on the transmission order, the m data packets are transmitted to the storage module of the target electronic control unit.
[0100] In some possible implementations, the above procedure includes instructions for performing the following steps in determining the transmission order of the m data packets: The vehicle hardware correlation degree corresponding to each of the m data packets is determined to obtain m vehicle hardware correlation degrees; the vehicle hardware correlation degree is the degree of binding between the flashing data corresponding to the data packet and the vehicle hardware of the target vehicle; Based on the m vehicle hardware correlation degrees, m transmission priorities corresponding to the m data packets are determined; each data packet corresponds to a transmission priority, and the greater the vehicle hardware correlation degree of the data packet, the higher the transmission priority of the data packet. The transmission order is determined based on the m transmission priorities.
[0101] In some possible implementations, the above procedure includes instructions for performing the following steps: If the integrity verification fails, the diagnostic device module sends a prompt message to the mobile terminal module; the prompt message indicates that the flashing operation of the target electronic control unit has failed, thereby triggering the mobile terminal module to retransmit the flashing data of the target electronic control unit to the diagnostic device module.
[0102] It should be understood that the electronic devices mentioned in this application may include smartphones (such as Android phones, iOS phones, Windows Phones, etc.), tablets, PDAs, laptops, mobile internet devices (MIDs) or wearable devices, servers, edge computing nodes, etc. The above-mentioned electronic devices are merely examples and not exhaustive, and include, but are not limited to, the electronic devices described above.
[0103] This application also provides a computer-readable storage medium storing a computer program that is executed by a processor to implement some or all of the steps of any of the methods described in the above method embodiments.
[0104] This application also provides a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program operable to cause a computer to perform some or all of the steps of any of the methods described in the above method embodiments.
[0105] It should be noted that, for the sake of simplicity, the aforementioned methods are described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are optional, and the actions and modules involved are not necessarily essential to this application.
[0106] In the above embodiments, the descriptions of each embodiment have their own emphasis. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0107] In the several embodiments provided in this application, it should be understood that the disclosed apparatus can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the mutual coupling or direct coupling or wireless communication connection shown or discussed may be through some interface; the indirect coupling or wireless communication connection between devices or units may be electrical or other forms.
[0108] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment, depending on actual needs.
[0109] Furthermore, the functional units in the various embodiments of this application 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 program module.
[0110] If the integrated unit is implemented as a software program module and sold or used as an independent product, it can be stored in a computer-readable storage device (CMD). Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a memory and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned memory includes various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.
[0111] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage device, which may include: flash drive, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.
[0112] The embodiments of this application have been described in detail above. Specific examples have been used in this document to illustrate the principles and implementation methods of this application. The description of the embodiments above is only for the purpose of helping to understand the method and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. A method for flashing an electronic control unit, characterized in that, The method is applied to a mobile terminal module located in an electronic control unit (ECU) flashing system, which includes the mobile terminal module, a diagnostic equipment module, and a target vehicle. Obtain a flashing request for the target electronic control unit of the target vehicle; the flashing request includes the amount of flashing data corresponding to the flashing data of the target electronic control unit; When the amount of data written exceeds the preset amount of data written, n communication links between the mobile terminal module and the diagnostic device module are determined; n is a positive integer. Select the communication link that matches the amount of data to be written from the n communication links to obtain the target communication link; The mobile terminal module and the diagnostic device module are controlled to establish a communication connection based on the target communication link; The flashing data of the target electronic control unit is sent to the diagnostic device module based on the target communication link; The diagnostic device module is controlled to transmit the flashing data to the storage module of the target electronic control unit; The target electronic control unit is controlled to complete the flashing operation based on the flashing data.
2. The method as described in claim 1, characterized in that, The step of selecting a communication link from the n communication links that matches the amount of data to be written, to obtain the target communication link, includes: Determine the minimum link bandwidth of the communication link required for the amount of data to be written; Determine the link bandwidth corresponding to each of the n communication links to obtain n link bandwidths; Determine the bandwidths of k links out of the n link bandwidths that are greater than the minimum link bandwidth; k is an integer less than or equal to n; Determine the k communication links corresponding to the k link bandwidths; Determine the transmission quality value of each of the k communication links to obtain k communication link transmission quality values; Determine the maximum communication link transmission quality value among the k communication link transmission quality values; The target communication link is obtained by determining the communication link corresponding to the maximum communication link transmission quality value.
3. The method as described in claim 2, characterized in that, The process of determining the transmission quality value of each of the k communication links to obtain k communication link transmission quality values includes: Determine the transmission rate and packet loss rate corresponding to the first communication link; the first communication link is any one of the k communication links; Determine the first communication link transmission quality value corresponding to the transmission rate and the second communication link transmission quality value corresponding to the packet loss rate; The transmission quality value of the first communication link is determined based on the transmission quality value of the first communication link and the transmission quality value of the second communication link.
4. The method as described in claim 3, characterized in that, The step of determining the communication link transmission quality value corresponding to the first communication link based on the first communication link transmission quality value and the second communication link transmission quality value includes: A reference communication link transmission quality value is determined based on the first communication link transmission quality value and the second communication link transmission quality value. Obtain the wireless signal strength corresponding to the first communication link; Determine the adjustment parameters corresponding to the wireless signal strength; The transmission quality value of the reference communication link is adjusted based on the adjustment parameters to obtain the transmission quality value of the communication link corresponding to the first communication link.
5. The method as described in claim 4, characterized in that, The process of controlling the diagnostic device module to transmit the flash data to the storage module of the target electronic control unit includes: The integrity of the written data is verified by the diagnostic device module. After the integrity check passes, the data to be written is divided into m data packets according to a preset number of bytes; m is an integer greater than 1. Determine the transmission order of the m data packets; Based on the transmission order, the m data packets are transmitted to the storage module of the target electronic control unit.
6. The method as described in claim 5, characterized in that, Determining the transmission order of the m data packets includes: The vehicle hardware correlation degree corresponding to each of the m data packets is determined to obtain m vehicle hardware correlation degrees; the vehicle hardware correlation degree is the degree of binding between the flashing data corresponding to the data packet and the vehicle hardware of the target vehicle; Based on the m vehicle hardware correlation degrees, m transmission priorities corresponding to the m data packets are determined; each data packet corresponds to a transmission priority, and the greater the vehicle hardware correlation degree of the data packet, the higher the transmission priority of the data packet. The transmission order is determined based on the m transmission priorities.
7. The method as described in claim 6, characterized in that, The method further includes: If the integrity verification fails, the diagnostic device module sends a prompt message to the mobile terminal module; the prompt message indicates that the flashing operation of the target electronic control unit has failed, thereby triggering the mobile terminal module to retransmit the flashing data of the target electronic control unit to the diagnostic device module.
8. An electronic control unit writing device, characterized in that, The device is applied to a mobile terminal module, which is located in an electronic control unit (ECU) flashing system. The ECU flashing system includes the mobile terminal module, a diagnostic equipment module, and a target vehicle. The ECU flashing device includes an acquisition unit and a processing unit. The acquisition unit is used to acquire a flashing request for a target electronic control unit of the target vehicle; the flashing request includes the amount of flashing data corresponding to the flashing data of the target electronic control unit. The processing unit is configured to determine n communication links between the mobile terminal module and the diagnostic device module when the amount of data written is greater than a preset amount of data written; n is a positive integer. Select the communication link that matches the amount of data to be written from the n communication links to obtain the target communication link; The mobile terminal module and the diagnostic device module are controlled to establish a communication connection based on the target communication link; The flashing data of the target electronic control unit is sent to the diagnostic device module based on the target communication link; The diagnostic device module is controlled to transmit the flashing data to the storage module of the target electronic control unit; The target electronic control unit is controlled to complete the flashing operation based on the flashing data.
9. An electronic device, characterized in that, The method includes a processor, a memory, a communication interface, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the processor, and the one or more programs include instructions for performing the steps of the method according to any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that is executed by a processor to implement the method as described in any one of claims 1-7.