Vehicle offline flashing method and system for multiple electronic controls
Through intelligent switching of online and offline writing methods, combined with heartbeat packets to maintain connection, streamline command communication and external storage support, the problem of low write efficiency under networkless or weak network conditions is solved, and high success rate and traceable ECU program writing is achieved.
Patent Information
- Application Number
- CN202411850078.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-16
- Publication Date
- 2025-03-11
AI Technical Summary
The prior art cannot effectively perform automotive ECU program flushing under conditions without network or weak network, resulting in low flushing efficiency.
A smart switching brushing method is adopted, and it automatically switches to online brushing or offline brushing according to the network connection status. Online flashing keeps the server connected through the heartbeat packet, streamlining command communication to improve transmission success rate; offline flashing uses internal storage and external storage of the flashing device to record and save flashing logs to trace the flashing process.
It improves the success rate of flashing under weak network conditions, supports flashing under no network conditions, and increases the number of ECUs supported in offline flashing mode, and the flashing process is traceable.
Smart Images

Figure CN119597320A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of ECU program flashing, and in particular to a vehicle offline flashing method and system for multiple electronic controls. Background Art
[0002] With the rapid development of the automotive industry, the types of ECUs in automobiles are increasing, and their functions are becoming more and more complex, which brings severe challenges to ECU program flashing. There are two traditional ways to flash the program of automobile ECUs: online flashing and offline flashing.
[0003] Online flashing is to integrate the production files and flashing process files of each ECU on the server side, obtain the exclusive information of ECU through the human-computer interaction unit, pass it to the server side through the flashing device, locate the unique production file and flashing process on the server side, and the server side completes the flashing function by controlling the flashing device according to the flashing process. The above method has obvious disadvantages: flashing cannot be performed in the absence of network; in the case of weak network, the flashing failure rate is low and cannot meet the actual application needs.
[0004] Offline flashing is to integrate the production files and flashing process files of each ECU into the flashing device, obtain the exclusive information of the ECU through the human-computer interaction unit, locate the unique production file and flashing process through the flashing device, and the flashing device directly completes the flashing function according to the flashing process. The above method also has obvious disadvantages: the flashing device is an embedded device with limited internal storage, which cannot meet the growing number of ECUs; the processing power is limited, and it is difficult to realize the flashing log storage, data statistics and other functions under the premise of ensuring the flashing efficiency.
[0005] Therefore, how to provide an automobile ECU program flashing technology to overcome the above-mentioned defects in the prior art has increasingly become one of the technical problems that technical personnel in this field need to solve urgently. Summary of the invention
[0006] The purpose of the present invention is to propose a method and system for flashing a vehicle offline with multiple electronic controls, aiming to solve the problems of low flashing efficiency caused by the inability to flash in the absence of a network and the low flashing failure rate in a weak network condition in the prior art.
[0007] The present invention is implemented by adopting the following technical scheme: a vehicle offline flashing method for multiple electronic controls, comprising the following steps: S1: Start the flashing program and initialize the flashing program; S2: Determine whether to use online flashing or offline flashing according to the network connection status; if the connection to the server fails, enter the offline flashing mode; if the server connection is successful, enter the data transmission mode; if the amount of data transmitted does not reach the preset value, enter the offline flashing mode; if the amount of data transmitted reaches the preset value, enter the online flashing mode.
[0008] Furthermore, the offline flashing includes the following process: Flash the device to obtain ECU information; The flashing device selects the corresponding production file and process file through ECU information; The flashing device flashes the ECU using the flashing file according to the steps indicated in the process file; During the flashing process, the flashing log is recorded locally on the flashing device.
[0009] Furthermore, the online flashing uses a method of sending heartbeat packets to maintain connection with the server. A heartbeat message is sent at a preset time interval. If the heartbeat message fails to be sent, the network connection needs to be re-established. If the connection fails to be established for a preset number of consecutive times, the offline flashing is entered; if the connection is established successfully, the server task is obtained.
[0010] Furthermore, the online flashing also includes the following steps: determining whether the server pushes a flashing task to the flashing device, and if there is a flashing task, giving priority to the flashing work; if there is no flashing task, entering the no-task mode, the flashing device actively applies to the server to download production files and process files for use in offline flashing.
[0011] Furthermore, the flashing operation is as follows: Obtain ECU information and transmit it to the server; Download production files and process files; The flashing device flashes the ECU using the flashing file according to the steps indicated in the process file; Upload the flashing progress, prompt information, and save the flashing log.
[0012] Furthermore, the no-task mode is: Before the flash device downloads the production files and process files on the server, it needs to first download the file list, which includes the file ID and MD5 checksum. Flashing the device compares the ID and MD5 checksum of the files in the file list with the files stored in the device, downloads the files that need to be downloaded, and deletes the unnecessary files; After downloading a pair of production files and process files, the flashing device asks the server whether there is a flashing task to perform file upgrade.
[0013] Furthermore, if there is a flashing task, it will be performed first, and after waiting for free time, the file upgrade action will be performed again; If there is no flashing task, continue downloading the next pair of production files and process files.
[0014] A vehicle offline flashing system for multiple electronic controls, used for the above-mentioned vehicle offline flashing method for multiple electronic controls, includes an ECU flashing device, and the ECU flashing device includes: a human-computer interaction unit for identifying and obtaining ECU information; a wifi communication unit for network communication with a server; a CAN / CANFD communication unit for flashing communication with the ECU; and an internal storage unit for importing and exporting files.
[0015] The beneficial effects of the present invention are: the present invention improves the flashing success rate under weak network conditions and can also support flashing under no network conditions. In addition, the present invention also increases the number of ECUs supported in the offline flashing mode, and the flashing process can be traced. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the structures shown in these drawings without paying creative work.
[0017] Figure 1 It is a flow chart of the present invention; Figure 2 Flash the workflow diagram for online; Figure 3 Write workflow diagram for offline flashing; Figure 4 This is a system block diagram of the present invention. DETAILED DESCRIPTION
[0018] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Generally, the components of the embodiments of the present invention described and shown in the drawings here can be arranged and designed in various different configurations.
[0019] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.
[0020] Some embodiments of the present invention are described in detail below in conjunction with the accompanying drawings. In the absence of conflict, the following embodiments and features in the embodiments can be combined with each other.
[0021] See also Figure 1 , a vehicle offline flashing method for multiple electronic controls, comprising the following steps: Start the flashing program and initialize the flashing program; Determine whether to use online flashing or offline flashing based on the network connection status.
[0022] Furthermore, after the flashing program is started, the embedded system software first determines whether the network status can meet the online flashing requirements. First, it determines whether the network is connected. If the connection to the server fails, it enters the offline flashing mode; if the server connection is successful, 10s of data transmission is performed. If the amount of transmitted data does not reach the preset, it enters the offline flashing mode. If the amount of data reaches the preset, it enters the online flashing mode.
[0023] See also Figure 2 ,Online flashing method: Use the method of sending heartbeat packets to maintain the connection with the server, download the production file list from the server, compare the local production files according to the production file list, download the missing files, and delete the unnecessary files to ensure that the production files are in the latest state during offline flashing, and maximize the use of the internal storage of the flashing device. Flash the production files according to the steps of the process file, and upload the flashing progress and status information to the server. The communication instructions are simplified to only three. At the same time, notification and heartbeat messages do not need to be returned. At the same time, notification messages use 1 byte data to represent 256 states to reduce the amount of data transmission to increase the transmission success rate under weak network conditions. At the same time, save the log file. After the flashing is completed, upload the log file to the server. The log retransmission mechanism ensures the stability of log file transmission.
[0024] Furthermore, in the online flash mode, a heartbeat message is sent every 3 seconds. If the heartbeat fails to be sent, the network connection needs to be re-established. If the connection fails to be established for three consecutive times, the offline flash mode is entered.
[0025] If the heartbeat is sent successfully and the server does not push a flashing task to the flashing device, the flashing device will actively request the server to download the production files and process files for offline flashing. The flashing device needs to download the file list, which includes the file ID (file unique identifier) and MD5 checksum, before downloading the production files and process files on the server. The flashing device downloads the files that need to be downloaded and deletes the files that are no longer needed by comparing the IDs and MD5 checksums of the files in the file list with the files stored in the device. After downloading a pair of production files and process files, the flashing device will ask the server whether there is a production task. If there is a production task, flashing will be performed first, and after waiting for free time, the file upgrade action will be performed again. If there is no production task, continue to download the next pair of production files and process files.
[0026] It should be noted that the production files and process files on the server are set according to the latest production requirements. Considering the limitation of the internal storage space of the flashing device, too many files cannot be set, and at the same time, the flashing of the largest number of files and the latest files must be guaranteed as much as possible. It should also be noted that when there is no flashing task, the production files and process files are downloaded to ensure that the flashing requirements can be met to the greatest extent under offline conditions, and it will not affect the online flashing process.
[0027] In online mode, the flashing device obtains ECU information, sends the ECU information to the server, and the server sends the corresponding production files and process files to the flashing device. The flashing device uses the flashing files to flash the ECU according to the steps indicated by the process files, and sends the flashing progress, prompt information and other data to the server. At the same time, the flashing log is recorded locally on the flashing device.
[0028] It should be noted that in order to cope with the flashing requirements under weak network conditions, this method uses simplified command communication, that is, only 3 instructions are used to achieve all online flashing, and the notification means that no response is required, which greatly reduces the problem of flashing failure caused by poor network signals during frequent communications. At the same time, all information is encoded, and only 1 byte is used to represent all prompt information, which greatly simplifies the amount of data transmitted and improves the success rate of flashing.
[0029] After the flashing is completed, whether the flashing succeeds or fails, the flashing file device transmits the log to the server. It should be noted that if the log transmission fails, the flashing device has a retransmission mechanism. It will upload all unuploaded logs (including online logs and offline logs) without any production tasks, production files, and process files being updated.
[0030] See also Figure 3,Offline flashing method: Use internal production files and process files for flashing. At the same time, you can import production files and process files through external storage devices to support the flashing of multiple ECUs. During the flashing process, record the flashing log, sort the logs by time, and cyclically overwrite the old logs to ensure that the log files are the latest. At the same time, support external storage devices to export logs to maximize the use of internal storage of the device.
[0031] Furthermore, in the offline flashing mode, the flashing device obtains the ECU information, selects the corresponding production file and process file through the ECU information, and uses the flashing file to flash the ECU according to the steps indicated by the process file. At the same time, the flashing log is recorded locally on the flashing device.
[0032] It should be noted that after the flashing is completed, if the subsequent device enters the online mode, all unuploaded logs (including online logs and offline logs) will be uploaded without any production tasks, production files, and process files being updated.
[0033] It should be noted that in offline mode, the number of production files and process files stored in the flash device is limited. If the corresponding files are not found, the number of supported ECUs can be expanded through an external storage device.
[0034] It should be noted that in offline mode, the number of logs stored in the flash device is limited. When the remaining storage space reaches the preset threshold, the log files are sorted by date and the old log files are overwritten cyclically. At the same time, log files can be manually exported through an external storage device. After successful export, the flash device deletes the corresponding files.
[0035] See also Figure 4 , a vehicle offline flashing system for multiple electronic controls, used for the above-mentioned vehicle offline flashing method for multiple electronic controls, including an ECU flashing device, the ECU flashing device including: a human-computer interaction unit for identifying and obtaining ECU information; a wifi communication unit for network communication with a server; a CAN / CANFD communication unit for flashing communication with the ECU; an internal storage unit for importing and exporting files.
[0036] Based on the above embodiments, the present invention adopts the following technologies: 1. Simplify the instructions, there are only 3 instructions in the whole flashing process; 2. Use the heartbeat mechanism to maintain the continuity of the connection; 3. Use 1 byte of data to encode 256 states to reduce the amount of data transmission; 4. Download the production files and process files used in offline mode. The success rate of flashing under weak network conditions is improved, and flashing can also be supported under no network conditions.
[0037] The existing offline flashing technology has limited internal storage of the flashing equipment, and cannot automatically obtain the latest version of production files and process files in real time. The flashing process cannot be traced. The present invention uses the following technologies: 1. Update the production file and process file library when there is a network; 2. Use external storage to more flexibly support multiple ECU flashing; 3. The flashing log can be actively uploaded to the server under online conditions; 4. Use the loop overwrite technology to ensure that the internal flashing log is the latest. The number of ECUs supported in the offline flashing mode is increased, and the flashing process can be traced.
[0038] For the aforementioned embodiments, for the sake of simplicity, they are all described as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the order of the actions described, because according to the present application, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are preferred embodiments, and the actions involved are not necessarily required by the present application.
[0039] The above embodiments describe the basic principles and main features of the present invention and the advantages of the present invention. Those skilled in the art should understand that the present invention is not limited by the above embodiments, and the above embodiments and descriptions are only for explaining the principles of the present invention. Without departing from the spirit and scope of the present invention, the changes and modifications made by those skilled in the art shall be within the scope of protection of the appended claims of the present invention without departing from the spirit and scope of the present invention.
Claims
1. A vehicle offline flashing method for multiple electronic controls, characterized in that: The steps include: S1: Start the flashing program and initialize the flashing program; S2: Determine whether to use online flashing or offline flashing according to the network connection status; if the connection to the server fails, enter offline flashing; If the server connection is successful, enter data transmission. If the amount of data transmitted does not reach the preset value, enter offline flashing. If the amount of data transmitted reaches the preset value, enter online flashing.
2. A vehicle offline flashing method for multiple electronic controls as claimed in claim 1, characterized in that: The offline flashing process includes the following steps: Flash the device to obtain ECU information; The flashing device selects the corresponding production file and process file through ECU information; The flashing device flashes the ECU using the flashing file according to the steps indicated in the process file; During the flashing process, the flashing log is recorded locally on the flashing device.
3. A vehicle offline flashing method for multiple electronic controls as claimed in claim 2, characterized in that: The online flashing uses a method of sending a heartbeat packet to maintain the connection with the server. A heartbeat message is sent at a preset time interval. If the heartbeat message fails to be sent, the network connection needs to be re-established. If the connection fails to be established for a preset number of consecutive times, the offline flashing is entered; If the connection is established successfully, the server task is obtained.
4. A vehicle offline flashing method for multiple electronic controls as claimed in claim 3, characterized in that: The online flashing also includes the following steps: determining whether the server pushes a flashing task to the flashing device. If there is a flashing task, the flashing work is given priority; if there is no flashing task, the no-task mode is entered, and the flashing device actively applies to the server to download production files and process files for use in offline flashing.
5. A vehicle offline flashing method for multiple electronic controls as claimed in claim 4, characterized in that: The flashing work is as follows: Obtain ECU information and transmit it to the server; Download production files and process files; The flashing device flashes the ECU using the flashing file according to the steps indicated in the process file; Upload the flashing progress, prompt information, and save the flashing log.
6. A vehicle offline flashing method for multiple electronic controls as claimed in claim 5, characterized in that: The no-task mode is: Before the flash device downloads the production files and process files on the server, it needs to first download the file list, which includes the file ID and MD5 checksum. Flashing the device compares the ID and MD5 checksum of the files in the file list with the files stored in the device, downloads the files that need to be downloaded, and deletes the unnecessary files; After downloading a pair of production files and process files, the flashing device asks the server whether there is a flashing task to perform file upgrade.
7. A vehicle offline flashing method for multiple electronic controls as claimed in claim 6, characterized in that: If there is a flashing task, it will be performed first, and the file upgrade will be performed again after it is idle; If there is no flashing task, continue downloading the next pair of production files and process files.
8. A vehicle offline flashing system for multiple electronic controls, used to implement a vehicle offline flashing method for multiple electronic controls as described in any one of claims 1 to 7, characterized in that: It includes an ECU flashing device, which includes: a human-computer interaction unit for identifying and obtaining ECU information; a wifi communication unit for network communication with a server; a CAN / CANFD communication unit for flashing communication with the ECU; and an internal storage unit for importing and exporting files.