Method for updating program of vehicle-mounted main control instrument through CANopen protocol
The local upgrade of the on-board main control instrument is achieved through the block transmission and fast SDO transmission mode of the CANopen protocol, solving the problems of high hardware investment, complex design and limited transmission speed in the existing technology, and achieving an efficient and reliable upgrade process.
Patent Information
- Application Number
- CN202510317080.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-18
- Publication Date
- 2025-07-04
AI Technical Summary
The existing vehicle-mounted main control instrument program upgrade method has problems such as high hardware investment, high design cost, complex operation, limited transmission speed and poor anti-interference.
The block transmission mode and fast SDO transmission mode of the CANopen protocol are used for local upgrades, the CAN bus in the vehicle system is used for data transmission, the upgrade interface design is simplified, the operation is carried out using a laptop or tablet, and the upgrade flag is added to ensure reliability and traceability.
It realizes efficient and reliable local instrument program upgrades, reduces design costs and operational complexity, improves anti-interference and transmission speed, and traces the upgrade process.
Smart Images

Figure CN120255926A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of vehicle master instrument program upgrade, and specifically provides a method for realizing vehicle master instrument program update through the CANopen protocol. Background Art
[0002] Currently, with the development of science and technology, in order to meet various daily production and living needs of people, vehicles with various functions emerge in an endless stream. As an important component for interaction between vehicles and drivers, vehicle master instruments play an increasingly important role in practical applications. At the same time, they have more and more functions, and upgrades and improvements are becoming more and more frequent.
[0003] At present, most of the instrument program upgrades adopt two modes. One is remote OTA upgrade, that is, the instrument communicates with the network platform through the built-in mobile communication module to download the upgrade program. This method requires the instrument to increase hardware investment and the management and maintenance of the server platform. At the same time, the upgrade process is also affected by the environment, and program upgrades cannot be carried out in areas without signals.
[0004] The other method is local upgrade. The instrument reserves a debugging interface and uses a dedicated programming program download tool. Using a specific data transfer protocol, it is not convenient for expansion, the transmission speed is limited, and the anti-interference ability is poor. Moreover, this reserved debugging interface needs to consider dust and water protection in the design, which increases the design cost. At the same time, generally, professional programming tools are required, and special training for operators is required, which increases the labor cost. Therefore, the above methods all have certain drawbacks. Summary of the Invention
[0005] The purpose of the present invention is to provide a method for realizing vehicle master instrument program update through the CANopen protocol to solve the problems raised in the above background art.
[0006] To achieve the above purpose, the present invention provides the following technical solution: A method for realizing vehicle master instrument program update through the CANopen protocol, including the following steps:
[0007] Step 1: First, after the on-site maintenance personnel obtain the upgrade file, they first use the upgrade software on the computer to load the upgrade file.
[0008] Step 2: Check whether the format of the upgrade file is correct through the upgrade software. If it shows incorrect, the subsequent steps cannot be carried out, and re-detection is required. After the format is correct, the program version information is displayed.
[0009] Step 3: Connect the USB-to-CAN debugging cable between the USB interface of the computer and the ODB interface of the vehicle. Select the baud rate for system communication, click the start upgrade button for the upgrade software to initiate the upgrade process. The data transfer protocol uses the block transfer mode in the CANopen protocol.
[0010] Step 4: After the in-vehicle master control instrument receives the upgrade file data sent in the block transfer mode of the CANopen protocol, it saves it to the internally reserved storage chip.
[0011] Step 5: The in-vehicle master control instrument will continuously detect whether the upgrade software has been completely downloaded. When it has not been downloaded completely, it will remind the staff to perform the operation again.
[0012] Step 6: After the upgrade software sends the upgrade file, it sends an upgrade flag through the fast SDO transfer mode of CANopen and saves it to the internally reserved storage chip.
[0013] Step 7: The upgrade software on the computer side sends an instrument restart command. After the instrument receives the restart command, it performs a system reset and restart. After the system restarts, it first enters the BOOT program storage area of the main chip. In the BOOT program, it detects the upgrade flag in the storage chip. When the upgrade flag is found, it imports the upgrade file in the storage chip into the main program storage area of the main chip and clears the upgrade flag at the same time.
[0014] Step 8: After the program is migrated to the main program storage area, it will jump from the BOOT program storage area of the main chip to the main program storage area and start running the new program, thus completing the program upgrade.
[0015] Preferably, in Step 1, a laptop computer, a mobile tablet, a customized handheld device, or other devices that can install the upgrade tool can be used to load and send the upgrade file.
[0016] Preferably, the data transfer protocol in Step 3 uses the block transfer mode in the CANopen communication protocol to achieve efficient data transmission, but it is not limited to this protocol.
[0017] Preferably, the program file in Step 4 can be saved in a dedicated storage chip or also in the internal storage space of the main chip.
[0018] Preferably, in Step 6, if an exception occurs during the program transmission, resulting in a transmission interruption, the upgrade flag bit will not be modified, and this upgrade will fail, but it will not affect the normal operation of the original program, and the upgrade process can be restarted.
[0019] Preferably, every time the instrument starts in Step 7, it first enters the BOOT program to determine whether there is an upgrade flag. If there is no upgrade flag, it is a normal start and directly jumps to the main program to run. Only when there is an upgrade flag will the upgrade operation be performed.
[0020] Preferably, in Step 7, the record of the upgrade process can be carried out simultaneously to ensure the traceability of the upgrade process.
[0021] Compared with the prior art, the beneficial effects of the present invention are as follows:
[0022] The present invention adopts a local upgrade solution, uses the block transfer mode in the standard CANopen communication protocol to achieve efficient data transmission, has high reliability, simple maintenance, the upgrade process is traceable, adds an upgrade flag bit, and modifies it through the fast SDO communication mode in the CANopen protocol. The failure of the upgrade process will not affect the normal operation of the original program. The common CAN bus in the vehicle system is used as the upgrade interface, without the need to separately reserve an upgrade interface, reducing the product design difficulty and improving the product reliability. A laptop, tablet computer or handheld device can be used to facilitate the operation of on-site personnel. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] Figure 1 It is a schematic diagram of the overall structure provided by an embodiment of the present invention.
[0024] Figure 2 It is a schematic diagram of the block transfer mode of the CANopen protocol of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0025] The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0026] Please refer to Figure 1 , the present invention provides a technical solution: a method for realizing the update of the in-vehicle main control instrument program through the CANopen protocol, including the following steps;
[0027] First, on-site operators execute Step S101, use the upgrade software on the computer side to load the upgrade file and parse it.
[0028] Then execute Step S102 to determine whether the upgrade file meets the preset format requirements. If it does not meet the format requirements, a format error is prompted, and the step of reloading the program file is returned. If the format is correct, proceed to the next operation.
[0029] In step S103, the operator needs to connect the USB-to-CAN debugging cable between the USB interface of the computer and the ODB interface of the vehicle or a similar CAN bus interface, select the baud rate for system communication, and directly click the software upgrade button to start the upgrade process. For the subsequent steps, the operator does not need to perform any operations and only needs to observe whether the upgrade is completed.
[0030] In steps S104 and S105, the data transmission process is started, and the block transfer mode in the CANopen protocol is adopted to achieve efficient transmission of the upgrade file. For the specific process, please refer to Figure 2 As shown, the instrument writes the received upgrade file data into the storage chip inside the instrument, and then repeatedly checks whether the program data transmission is completed. After the transmission is completed, the next operation is carried out.
[0031] In step S106, after the data transmission is completed, the upgrade software on the computer side issues an upgrade completion flag through the fast SDO transmission mode in the CANopen protocol, and the instrument also writes the upgrade completion flag into the storage chip inside the instrument for subsequent detection.
[0032] In step S107, after the instrument stores the upgrade flag, the upgrade software on the computer side issues an instrument restart command, and the instrument automatically restarts and then first enters the BOOT program.
[0033] In step S108, the instrument reads the upgrade flag bit in the BOOT program. If the upgrade flag is detected, it enters the upgrade process of the next step S109. If there is no upgrade flag, it is a normal startup process and directly jumps to step S110.
[0034] In step S109, because the upgrade flag was detected in the previous step, the new program in the internal storage chip of the instrument needs to be imported into the program area of the main chip. After the import is completed, the upgrade flag is cleared, and then it jumps to step S110.
[0035] In step S110, the instrument jumps from the BOOT program to the main program area. At this time, the main program area already contains the latest program, and the instrument starts to run the latest program.
[0036] The computer used in step S101 can be a laptop, a tablet computer, a handheld device, etc. that have a USB interface and can install the upgrade software.
[0037] The data transmission protocol used in step S103 is the fast transmission protocol in the CANopen communication protocol to achieve efficient data transmission. For the specific process, please refer to Figure 2 As shown, but not limited to this protocol.
[0038] In the step S104, the program file can be stored in a dedicated storage chip inside the instrument or in the storage space inside the main chip of the instrument.
[0039] In the step S106, if an exception occurs during the program transmission, resulting in the interruption of the transmission, the upgrade flag bit will not be modified, and this upgrade fails. However, it will not affect the normal operation of the original program, and the upgrade process can be restarted.
[0040] In the step S107, the record of the upgrade process can be made simultaneously to ensure the traceability of the upgrade process.
[0041] It should be noted that in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements not only includes those elements, but also includes other elements not expressly listed, or elements inherent to such process, method, article or device.
[0042] Although the embodiments of the present invention have been shown and described, those of ordinary skill in the art can understand that various changes, modifications, substitutions and variations can be made to these embodiments without departing from the principles and spirit of the present invention. The scope of the present invention is defined by the appended claims and their equivalents.
Claims
1. A method for realizing the program update of an in-vehicle main control instrument through the CANopen protocol, characterized in that It includes the following steps: Step 1: First, after the on-site maintenance personnel obtain the upgrade file, they first use the upgrade software on the computer side to load the upgrade file; Step 2: Check whether the format of the upgrade file is correct through the upgrade software. If it shows incorrect, the subsequent steps cannot be carried out, and re-detection is required. After the format is correct, the program version information is displayed; Step 3: Connect the USB-to-CAN debugging cable between the USB interface of the computer and the ODB interface of the vehicle, select the baud rate of the system communication, click the start upgrade button of the upgrade software to start the upgrade process. The data transmission protocol uses the block transfer mode in the CANopen protocol; Step 4: After the in-vehicle main control instrument receives the upgrade file data sent in the CANopen protocol block transfer mode, it is saved to the internally reserved storage chip; Step 5: The in-vehicle main control instrument will detect at any time whether the upgrade software has been sent completely. When it has not been downloaded completely, it will remind the staff to perform the operation again; Step 6: After the upgrade software sends the upgrade file, it sends an upgrade flag through the fast SDO transmission mode of CANopen and saves it to the internally reserved storage chip; Step 7: The upgrade software on the computer side sends an instrument restart command. After the instrument receives the restart command, it performs a system reset and restart. After the system restarts, it first enters the BOOT program storage area of the main chip. In the BOOT program, it detects the upgrade flag of the storage chip. When the upgrade flag is found, the upgrade file in the storage chip is imported into the main program storage area of the main chip, and at the same time the upgrade flag is cleared; Step 8: After the program migrates to the main program storage area, it will jump from the BOOT program storage area of the main chip to the main program storage area and start running the new program, thus completing the program upgrade.
2. A method for implementing the program update of the vehicle main control instrument through the CANopen protocol according to claim 1, characterized in that: In Step 1, a notebook computer, a mobile tablet, a customized handheld device, or other devices that can install the upgrade tool can be used to load and send the upgrade file.
3. A method for implementing the program update of a vehicle main control instrument through the CANopen protocol according to claim 1, characterized in that: In Step 3, the data transmission protocol uses the block transfer protocol in the CANopen communication protocol to achieve efficient data transmission, but it is not limited to this protocol.
4. A method for implementing the program update of an in-vehicle main control instrument through the CANopen protocol according to claim 1, characterized in that: In Step 4, the program file can be saved in a dedicated storage chip or in the internal storage space of the main chip.
5. A method for implementing the program update of an in-vehicle main control instrument through the CANopen protocol according to claim 1, characterized in that: In Step 6, if an exception occurs during the program transmission process, resulting in a transmission interruption, the upgrade flag bit will not be modified, and this upgrade fails, but it will not affect the normal operation of the original program, and the upgrade process is restarted.
6. A method for implementing the program update of an in-vehicle main control instrument through the CANopen protocol according to claim 1, characterized in that: In Step 7, each time the instrument starts, it first enters the BOOT program. It judges whether there is an upgrade flag. If there is no upgrade flag, it is a normal start and directly jumps to the main program to run. Only when there is an upgrade flag will the upgrade operation be carried out.
7. A method for implementing the program update of an in-vehicle master control instrument through the CANopen protocol according to claim 1, characterized in that: In Step 7, the record of the upgrade process can be carried out at the same time to ensure the traceability of the upgrade process.