WO2023036302A1 - 用于刷写安装于车辆上的ecu的方法、车辆及存储介质 - Google Patents

用于刷写安装于车辆上的ecu的方法、车辆及存储介质 Download PDF

Info

Publication number
WO2023036302A1
WO2023036302A1 PCT/CN2022/118148 CN2022118148W WO2023036302A1 WO 2023036302 A1 WO2023036302 A1 WO 2023036302A1 CN 2022118148 W CN2022118148 W CN 2022118148W WO 2023036302 A1 WO2023036302 A1 WO 2023036302A1
Authority
WO
WIPO (PCT)
Prior art keywords
ecu
flashing
vehicle
program
flashed
Prior art date
Application number
PCT/CN2022/118148
Other languages
English (en)
French (fr)
Inventor
王博
潘欢
李腾飞
Original Assignee
长城汽车股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 长城汽车股份有限公司 filed Critical 长城汽车股份有限公司
Priority to EP22866763.0A priority Critical patent/EP4404053A1/en
Publication of WO2023036302A1 publication Critical patent/WO2023036302A1/zh

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • G06F8/654Updates using techniques specially adapted for alterable solid state memories, e.g. for EEPROM or flash memories
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/4401Bootstrapping

Definitions

  • the present application relates to the technical field of vehicles, in particular to a method for flashing an ECU installed on a vehicle, a vehicle and a storage medium.
  • ECU Electronic Control Unit
  • the ECU fails or needs to update the program inside, the ECU needs to be removed from the vehicle, and the ECU is manually flashed through a specific device. The entire ECU flashing process takes a lot of time.
  • One of the purposes of the embodiments of the present application is to provide a method for flashing an ECU installed on a vehicle, a vehicle and a storage medium.
  • a method for flashing an ECU mounted on a vehicle including:
  • the first data to be flashed is acquired, and the first data to be flashed is stored.
  • prior to entering emergency start mode including:
  • the first pin is a pin on the OBD interface used to connect the Ethernet communication interface on the vehicle, when the level signal is high, the The Ethernet communication interface in the ECU is in an open state, and the Ethernet communication interface is in a closed state when the level signal is a low level;
  • the emergency start mode including:
  • the first pin is an Ethernet active line pull-up pin.
  • the first operation includes at least one of a brake operation, an air conditioner button operation, and a button operation on the steering wheel.
  • the detecting whether there is a first operation includes:
  • the level signal meets a preset operation requirement, it is determined that the first operation is detected.
  • the detection of whether the first operation exists it includes:
  • after entering the normal startup mode it includes:
  • the application program has a faulty program and receives a fault query instruction sent by the flashing device, send the fault code of the faulty program to the flashing device, wherein the fault code is used to indicate the flashing device Generate a program flashing instruction based on the second data to be flashed of the faulty application corresponding to the fault code, and send the program flashing instruction to the ECU;
  • an electronic control unit including:
  • a detection module configured to detect whether there is a first operation after the ECU is powered on, wherein the first operation is an operation that acts on the vehicle on which the ECU is installed;
  • a time testing module configured to obtain the duration of the first operation if the first operation is detected
  • a mode selection module configured to enter an emergency start mode if the duration is greater than a preset threshold, wherein the ECU does not run applications in the ECU in the emergency start mode;
  • the program flashing module is used to acquire the first data to be flashed, and flash the first data to be flashed.
  • a vehicle including: a memory, an ECU, and a computer program stored in the memory and operable on the ECU, characterized in that, when the ECU executes the computer program, the above-mentioned first The method for flashing an ECU mounted on a vehicle according to any one of the aspects.
  • a computer-readable storage medium stores a computer program, and it is characterized in that, when the computer program is executed by a processor, it implements any one of the above-mentioned first aspects.
  • a computer program product is provided.
  • the terminal device is made to execute the method for flashing the ECU installed on the vehicle according to any one of the above first aspects. .
  • the ECU can detect whether there is a first operation acting on the vehicle. If there is the first operation and the duration of the first operation is longer than the preset threshold, the ECU enters the emergency start mode. After the ECU enters the emergency start mode, the first data to be flashed is obtained, and the flashing of the ECU is completed based on the first data to be flashed.
  • this application can flash the ECU without removing the ECU, which makes the flashing of the ECU easier and more efficient.
  • FIG. 1 is a schematic diagram of an application scenario of a method for flashing an ECU installed on a vehicle provided by an embodiment of the present application;
  • FIG. 2 is a schematic flow diagram of a method for flashing an ECU installed on a vehicle provided by an embodiment of the present application
  • FIG. 3 is a schematic flowchart of a method for flashing an ECU installed on a vehicle provided by another embodiment of the present application;
  • Fig. 4 is the structural representation that computer, OBD interface and ECU connection provided by another embodiment of the present application.
  • FIG. 5 is a schematic structural diagram of an OBD interface provided by an embodiment of the present application.
  • Fig. 6 is a schematic flow chart of ECU flashing in normal startup mode provided by an embodiment of the present application.
  • Fig. 7 is a schematic structural diagram of an electronic control unit provided by an embodiment of the present application.
  • Fig. 8 is a schematic structural diagram of a vehicle provided by an embodiment of the present application.
  • ECU generally has fault self-diagnosis and protection functions. When the system fails, it can automatically record the fault code in random access memory (Random Access Memory, RAM) or Flash and take protective measures to read the replacement program from the inherent program to maintain functions that must be maintained involving, for example, security lights.
  • RAM Random Access Memory
  • Flash Flash
  • the present application provides a method for flashing an ECU installed on a vehicle, which sets conditions for automatic flashing of the ECU, reduces unexpected ECU flashing, and avoids misoperation of the ECU.
  • the present application can complete the flashing of the ECU without removing the ECU from the vehicle, which makes the flashing of the ECU simpler and more convenient, and improves the efficiency of the flashing of the ECU.
  • FIG. 1 is a schematic diagram of an application scenario of a method for flashing an ECU installed on a vehicle provided by an embodiment of the present application.
  • the above method for flashing an ECU installed on a vehicle can be used to update a vehicle ECU.
  • the computer 10 is used to store the data to be flashed
  • the ECU 20 is used to obtain the data to be flashed from the computer 10 when it is determined that flashing is necessary, and write the data to be flashed into the ECU.
  • Figures 2 and 3 show a schematic flowchart of a method for flashing an ECU installed in a vehicle provided by the present application. Referring to Figures 2 and 3, the method includes steps S101-S104.
  • the ECU detects whether there is a first operation.
  • the process from power-off to power-on of the ECU is a restart process.
  • the ECU detects whether there is a first operation acting on the vehicle on which the ECU is installed.
  • the preset time can be set as required, for example, the preset time can be set to 50 seconds, 60 seconds or 70 seconds and so on.
  • the first operation can be set as required.
  • the first operation may include at least one of a brake operation, an air conditioner key operation, and a key operation on the steering wheel.
  • the key operation on the steering wheel may include the operation of turning on the turn signal, the operation of turning on the wiper, the operation of turning on the horn and so on.
  • the detection method of the first operation may include: acquiring a level signal of a preset circuit in the vehicle. If the level signal meets the preset operation requirement, it is determined that the first operation is detected.
  • the preset circuit may be a circuit corresponding to a brake switch, a circuit corresponding to an air-conditioning switch, a switch corresponding to operation on the steering wheel, and the like. If the preset circuit includes a circuit corresponding to a brake switch, the preset operation requirement includes a brake operation. If the preset circuit includes a circuit corresponding to an air conditioner switch, the preset operation requirement includes an air conditioner start operation. If the preset circuit includes a circuit corresponding to a correspondingly operated switch on the steering wheel, the preset operation request includes an activation operation of a corresponding device on the steering wheel.
  • the detection of the key operation of the air conditioner may include: acquiring a level signal of the switch of the air conditioner, and if the level signal meets the start requirement, for example, the level signal is at a high level, then it is determined that the key operation of the air conditioner is detected. In the same way, button operations on the steering wheel can be detected, and details will not be repeated here.
  • step S101 may include:
  • the brake switch of the vehicle can be controlled by two lines. Specifically, the brake switch can be jointly controlled by line 1 and line 2. When line 1 is at low level and line 2 is at high level, the braking switch is in a non-braking state. When line 1 is at high level and line 2 is at low level, the brake switch is in the braking state. The ECU can determine whether the brake switch is in the braking state according to the level signal of the brake switch.
  • the brake switch when the level signal of the brake switch meets the braking requirement, the brake switch is in the braking state, that is, a braking operation is detected. Specifically, the level signal of the brake switch satisfies the braking requirement, including that the line 1 is at a high level and the line 2 is at a low level.
  • the ECU if the ECU detects the first operation, it can start timing, and obtain the duration of the first operation through timing. During the timing period, the first operation needs to be continuously detected to determine whether the first operation is still continuing. If the first operation cannot be detected, it may be determined that the first operation does not continue.
  • the time of the timer in the ECU can be recorded, which can be recorded as the initial time in this application.
  • the time of the timer in the ECU can be recorded, which can be recorded as the initial time in this application.
  • the time of the timer is 10 when the first operation is detected, the first operation is still going on at the current time, and the current time timer is 15, then the first operation has lasted for 5 seconds.
  • Emergency start mode can be a way to start before normal work flow.
  • the preset threshold can be set as required, for example, the preset threshold can be set to 5 seconds, 8 seconds, or 10 seconds.
  • the preset time is 5 seconds, and the current time detects that the first operation has lasted for 6 seconds, it is determined that the time of the first operation is greater than the preset threshold, and the ECU enters the emergency start mode.
  • the start sequence of programs in the ECU is boot program -> App program (application program), and the application program will not be run until the boot program is completed.
  • Emergency start mode does not run applications in the ECU.
  • the boot program is the boot file of the system, which can be used to boot into which operating system. Specifically, the boot program is used to complete the positioning of the specific location of the kernel code in the external storage. According to the requirements The entire system boot process that correctly loads the kernel into the memory and finally makes the kernel run. In this process, starting the bootloader needs to complete multiple initialization processes, and various services of the system can be used only after these processes are successfully completed. These processes include initial boot, kernel initialization, and full system initialization.
  • the ECU can obtain data to be flashed from an external computer. Specifically, after the ECU acquires the data from the computer, it can determine whether the version of the data currently stored in the ECU is the same as that of the acquired data. If they are the same, the currently stored data may be overwritten with the obtained data, or the data may not be processed. If they are different, the obtained data can be stored in the FLASH to complete the flashing of the ECU. In this application, the data obtained from the computer is recorded as the first data to be flashed.
  • the ECU can detect whether there is a first operation acting on the vehicle, and if there is a first operation, the duration of the first operation can be obtained to determine whether the emergency start mode can be entered. If the duration of the first operation is greater than a preset threshold, the ECU enters the emergency start mode. After the ECU enters the emergency start mode, the first data to be flashed is obtained, and the flashing of the ECU is completed based on the first data to be flashed.
  • the application can flash the ECU without removing the ECU, which makes the flashing of the ECU easier and more efficient.
  • the application sets the conditions for entering the emergency start mode, and the emergency start mode can only be entered when the entry conditions are met, preventing the flashing of the ECU under unexpected circumstances.
  • the Ethernet communication interface on the ECU can be used to connect to the computer via a wired connection.
  • the data to be flashed is obtained in the computer.
  • the computer can be connected to the On Board Diagnostics (OBD) system interface through a network cable, the ODB interface is connected to the Ethernet communication interface in the ECU, and the communication between the computer and the ECU is realized through the ODB interface.
  • ODB On Board Diagnostics
  • the computer can be connected to EHERNET TX+, EHERNET TX-, EHERNET RX+ and EHERNET RX- in the OBD interface through a network cable.
  • RX is signal reception
  • TX is signal transmission
  • pin 3 is EHERNET RX+
  • pin 11 is EHERNET RX-
  • pin 12 is EHERNET TX+
  • pin 13 is EHERNET TX- .
  • the start of the Ethernet communication interface requires the control of the enable signal. If there is an enable signal, the Ethernet communication interface can communicate, otherwise the Ethernet communication interface cannot communicate.
  • the signal of the pull-up pin on the Ethernet activation line in the OBD interface can provide an enable signal for the Ethernet communication interface, and the positive pole of the battery of the vehicle can be connected to the pull-up pin of the Ethernet activation line in the OBD interface through a wire.
  • the level signal of the pull-up pin on the Ethernet activation line is at a high level, as shown in FIG. 5
  • pin 8 is a pull-up pin on the Ethernet activation line.
  • the Ethernet activation line pulls the pin to a high level, the Ethernet communication interface is turned on.
  • the Ethernet activation line pulls the pin to a low level, the Ethernet communication interface is closed.
  • the pull-up pin of the Ethernet activation line may be recorded as the first pin.
  • the conditions for the ECU to enter the emergency start mode can also include detection The level signal of the first pin of the OBD interface connected to the Ethernet communication interface on the vehicle, if the level signal is a high level signal, and the duration of the first operation is greater than the preset threshold, the emergency start mode will be entered.
  • the level signal of the first pin when the level signal of the first pin is at a high level, it can be determined that the Ethernet communication interface is in an open state, ensuring that the ECU can obtain the first data to be flashed from the computer through the Ethernet communication interface. Taking the first pin at a high level as the condition for entering the emergency start mode ensures that the ECU can smoothly perform data flashing after entering the emergency start mode.
  • the above method may further include:
  • the first operation is not detected within a preset time after the ECU is powered on, enter the normal startup mode. If the duration is less than or equal to the preset threshold, and/or the level signal of the first pin is low level, enter the normal startup mode.
  • the ECU if the first operation is not detected within the preset time, the condition for entering the emergency start mode is not met, and the ECU enters the normal start mode (Normal boot).
  • the ECU can normally run the application programs in the ECU, and the application programs in the ECU may include a program for lighting up a car light, a program for lighting up a screen, a program for igniting a vehicle, and the like.
  • the condition for entering the emergency start mode is not met, and the ECU enters the normal start mode.
  • the ECU when it is necessary to obtain the first data to be flashed through the Ethernet communication interface, if the level signal of the first pin is low, it does not meet the conditions for entering the emergency start mode, and the ECU enters the normal start mode. model.
  • the normal startup mode is a mode in which the ECU is started and the application programs in the ECU are running. After the ECU enters the normal startup mode, it runs the boot program first, and then runs the application program after the boot program is finished.
  • the ECU entering the normal start-up mode can transmit the data to be flashed to the ECU by means of the flashing device, thereby completing the flashing of the ECU.
  • the above method includes:
  • the flashing device may be an automobile fault diagnosis instrument.
  • Automobile fault diagnosis instrument is a vehicle fault self-inspection terminal. It is a portable intelligent automobile fault self-diagnosis instrument for detecting automobile faults. Users can use it to quickly read the faults of each ECU of the car, and quickly find out what happened by displaying fault information. The location and cause of the failure.
  • the ECU if the application program has a fault program, the ECU generates a fault code of the fault program.
  • the user can send a fault query command to the ECU through the flashing device, and the ECU sends the fault code of the fault program to the flashing device after receiving the fault query command sent by the flashing device.
  • the flashing device After the flashing device receives the fault code, it analyzes the fault code, obtains the fault application corresponding to the fault code, and displays the fault application to the user.
  • the flashing device searches for the corresponding data to be flashed according to the faulty application, which is recorded as the second data to be flashed in this application.
  • the flashing device generates a program flashing instruction according to the second data to be flashed, and sends the program flashing instruction to the ECU.
  • the flashing device may send an inquiry message to the ECU after generating the program flashing instruction, and if the ECU receives the inquiry information sent by the flashing device, the ECU may return a confirmation instruction to the flashing device.
  • the flashing device sends a program flashing instruction to the ECU after receiving the confirmation instruction sent by the ECU.
  • the program flashing instruction may include an identifier of the application to be flashed and second data to be flashed. Identifiers can be numbers, letters or symbols. Each application uniquely corresponds to an identifier.
  • the ECU after receiving the program flashing instruction sent by the flashing device, the ECU analyzes the program flashing instruction to obtain the second data to be flashed of the application to be flashed, and then the second data to be flashed The data is flushed.
  • the processing of the second data to be flashed by the ECU is the same as that of the first data to be flashed, please refer to the description of the above step S104, which will not be repeated here.
  • the flashing device when there is no faulty program in the application program, can also send the flashing data of the latest version of the application program to the ECU, and the ECU receives the flashing data of the latest version of the application program sent by the flashing device , and store the flash data of the latest version of the application.
  • step S202 may include:
  • the ECU after the ECU receives the fault query instruction sent by the flashing device, it can acquire the status information of the vehicle.
  • the status information of the vehicle may include vehicle speed, engine speed, power gear and so on.
  • the purpose of obtaining the status information of the vehicle is to determine whether the vehicle is running. If the vehicle is running, the ECU cannot be flashed. Specifically, vehicle speed and engine are used to determine whether the vehicle is stationary. The power gear is used to determine whether the electrical appliances in the vehicle are powered on.
  • the vehicle speed is in the first preset range, whether the engine speed is in the second preset range, and whether the power gear is in the ON gear.
  • the power gear when the power gear is in the ON gear, it supplies power to all electrical appliances in the car.
  • the first preset range and the second preset range can be set as required.
  • the status information meeting the preset requirements includes that the vehicle speed is in the first preset range, the engine speed is in the second preset range, and the power gear is in the ON gear.
  • the state of the vehicle is judged before the flashing, and the ECU is flashed when the vehicle state information meets the requirements, which can avoid the phenomenon of flashing when the vehicle is running and causing vehicle failure.
  • Fig. 7 shows the structural block diagram of the electronic control unit provided by the embodiment of the present application. The relevant part of the application example.
  • the electronic control unit 300 may include: a detection module 310 , a time test module 320 , a mode selection module 330 and a program flashing module 340 .
  • the detection module 310 is configured to detect whether there is a first operation after the ECU is powered on, wherein the first operation is an operation acting on the vehicle on which the ECU is installed;
  • a time testing module 320 configured to obtain the duration of the first operation if the first operation is detected
  • a mode selection module 330 configured to enter an emergency start mode if the duration is greater than a preset threshold, wherein the ECU does not run applications in the ECU in the emergency start mode;
  • the program flashing module 340 is configured to acquire first data to be flashed, and flash the first data to be flashed.
  • the mode selection module 330 may also specifically be used for:
  • the first pin is a pin on the OBD interface used to connect the Ethernet communication interface on the vehicle, and when the level signal is a high level, the The Ethernet communication interface in the ECU is in the open state, and the Ethernet communication interface is in the closed state when the level signal is low;
  • the emergency start mode is entered.
  • the first pin is an Ethernet activation line pull-up pin.
  • the first operation includes at least one of a brake operation, an air conditioner button operation, and a button operation on a steering wheel.
  • the detection module 310 may be specifically configured to:
  • the detection module 310 may also include:
  • a first selection module configured to enter a normal start-up mode if the first operation is not detected within a preset time after the ECU is powered on, wherein the ECU runs the ECU in the normal start-up mode s application;
  • the second selection module is configured to enter the normal start-up mode if the duration is less than or equal to the preset threshold and/or the level signal of the first pin is low level.
  • the program flashing module 340 can also be specifically configured to:
  • the application program has a faulty program and receives a fault query instruction sent by the flashing device, send the fault code of the faulty program to the flashing device, wherein the fault code is used to indicate the flashing device Finding the second data to be flashed of the faulty application corresponding to the fault code, and generating a program flashing instruction based on the second data to be flashed, and sending the program flashing instruction to the flashing device;
  • the program flashing module 340 can also be specifically used for:
  • the status information includes vehicle speed, engine speed and power gear
  • the vehicle 400 may include: an ECU 410, a memory 420, and a computer program stored in the memory 420 and operable on the ECU 410, and the ECU 410 executes the
  • the steps in any of the above method embodiments are implemented, for example, step S101 to step S104 in the embodiment shown in FIG. 2 .
  • the ECU 410 executes the computer program, it realizes the functions of the modules/units in the above-mentioned device embodiments, such as the functions of the modules 310 to 340 shown in FIG. 7 .
  • the computer program can be divided into one or more modules/units, and one or more modules/units are stored in the memory 420 and executed by the ECU 410 to complete the present application.
  • the one or more modules/units may be a series of computer program segments capable of accomplishing specific functions, and the program segments are used to describe the execution process of the computer program in the vehicle 400 .
  • Fig. 8 is only an example of a vehicle, and does not constitute a limitation to the vehicle, and may include more or less components than those shown in the illustration, or combine certain components, or different components, such as input and output devices, network access devices, buses, etc.
  • the ECU 410 can be a central processing unit (Central Processing Unit, CPU), and can also be other general-purpose processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), off-the-shelf programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
  • a general-purpose processor may be a microprocessor, or the processor may be any conventional processor, or the like.
  • the method for flashing the ECU installed on the vehicle provided by the embodiment of the present application can be applied to computers, tablet computers, notebook computers, netbooks, personal digital assistants (personal digital assistants), etc. assistant, PDA) and other terminal devices, the embodiment of the present application does not impose any limitation on the specific type of the terminal device.
  • the embodiment of the present application also provides a computer-readable storage medium.
  • the computer-readable storage medium stores a computer program.
  • the computer program When the computer program is executed by a processor, it can realize the above-mentioned method for flashing the ECU installed on the vehicle. Steps in various embodiments of the method.
  • An embodiment of the present application provides a computer program product.
  • the mobile terminal can realize the steps in each embodiment of the above-mentioned method for flashing an ECU installed on a vehicle when it is executed. .
  • the integrated unit is realized in the form of a software function unit and sold or used as an independent product, it can be stored in a computer-readable storage medium.
  • all or part of the processes in the methods of the above embodiments in the present application can be completed by instructing related hardware through computer programs, and the computer programs can be stored in computer-readable storage media.
  • the computer program includes computer program code, and the computer program code may be in the form of source code, object code, executable file or some intermediate form.
  • the computer-readable medium may at least include: any entity or device capable of carrying computer program codes to a photographing device/terminal device, a recording medium, a computer memory, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), electrical carrier signals, telecommunication signals, and software distribution media.
  • ROM read-only memory
  • RAM random access memory
  • electrical carrier signals telecommunication signals
  • software distribution media Such as U disk, mobile hard disk, magnetic disk or optical disk, etc.
  • computer readable media may not be electrical carrier signals and telecommunication signals under legislation and patent practice.
  • the disclosed device/network device and method may be implemented in other ways.
  • the device/network device embodiments described above are only illustrative.
  • the division of the modules or units is only a logical function division.
  • the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces, and the indirect coupling or communication connection of devices or units may be in electrical, mechanical or other forms.
  • the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place, or may be distributed to multiple network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)
  • Lighting Device Outwards From Vehicle And Optical Signal (AREA)

Abstract

本申请公开一种用于刷写安装于车辆上的ECU的方法、车辆及存储介质,该方法包括:在ECU重启后,ECU检测是否存在作用在车辆上的第一操作,如果存在第一操作、且第一操作的持续时间大于预设阈值,ECU进入紧急启动模式,ECU进入紧急启动模式后获取第一待刷写数据,并基于第一待刷写数据完成ECU的刷写。本申请不用将ECU拆下即可对ECU进行刷写,使ECU的刷写更简便、效率更高;本申请设置了进入紧急启动模式的条件,在满足进入条件时才可以进入紧急启动模式,防止了非预期情况下对ECU的刷写。

Description

用于刷写安装于车辆上的ECU的方法、车辆及存储介质
本申请要求于2021年09月13日在中国专利局提交的、申请号为202111070177.5、发明名称为“一种车辆ECU的刷写方法、车辆及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及车辆技术领域,具体涉及用于刷写安装于车辆上的ECU的方法、车辆及存储介质。
背景技术
电子控制单元(Electronic Control Unit,ECU)是车辆的核心原件之一。
ECU发生故障或需要更新里边的程序时,需要将ECU从车辆上拆下,人为地通过特定设备完成对ECU的刷写,整个ECU的刷写过程需要耗费大量时间。
技术问题
本申请实施例的目的之一在于:提供用于刷写安装于车辆上的ECU的方法、车辆及存储介质。
技术解决方案
本申请实施例采用的技术方案是:
第一方面,提供了一种用于刷写安装于车辆上的ECU的方法,包括:
在所述ECU上电后,响应于检测到在安装有所述ECU的车辆上发生第一操作,获得所述第一操作的持续时间;
若所述持续时间大于预设阈值,则进入紧急启动模式,其中,所述ECU在所述紧急启动模式不运行所述ECU中的应用程序;
获取第一待刷写数据,存储所述第一待刷写数据。
在一个实施例中,在进入紧急启动模式之前,包括:
获取第一引脚的电平信号,其中,所述第一引脚为所述车辆上的用于连接以太网通信接口的OBD接口上的引脚,所述电平信号为高电平时,所述ECU中的以太网通信接口为开启状态,所述电平信号为低电平时所述以太网通信接口为关闭状态;
相应的,若所述持续时间大于预设阈值,进入紧急启动模式,包括:
若所述持续时间大于预设阈值、且所述第一引脚的电平信号为高电平,进入所述紧急启动模式。
在一个实施例中,所述第一引脚为以太网激活线上拉引脚。
在一个实施例中,所述第一操作包括制动操作、空调按键操作和方向盘上的按键操作中的至少一种。
在一个实施例中,所述检测是否存在第一操作,包括:
获取所述车辆中预设电路的电平信号;
若所述电平信号满足预设的操作要求,则确定检测到所述第一操作。
在一个实施例中,在所述检测是否存在第一操作之后,包括:
若在所述ECU上电后的预设时间内未检测到所述第一操作,进入正常启动模式,其中,所述ECU在所述正常启动模式运行所述ECU中的应用程序;
若所述持续时间小于或等于所述预设阈值、和/或所述第一引脚的电平信号为低电平,则进入所述正常启动模式。
在一个实施例中,在所述进入所述正常启动模式之后,包括:
运行所述ECU中的应用程序;
若所述应用程序存在故障程序、且接收到刷写设备发送的故障查询指令,向所述刷写设备发送所述故障程序的故障码,其中,所述故障码用于指示所述刷写设备基于所述述故障码对应的故障应用的第二待刷写数据生成程序刷写指令,并向所述ECU发送所述程序刷写指令;
接收所述刷写设备发送的所述程序刷写指令,刷写所述程序刷写指令中包括的所述第二待刷写数据。
第二方面,提供了一种电子控制单元,包括:
检测模块,用于在所述ECU上电后,检测是否存在第一操作,其中,所述第一操作为作用在安装所述ECU的车辆上的操作;
时间测试模块,用于若检测到所述第一操作,获得所述第一操作的持续时间;
模式选择模块,用于若所述持续时间大于预设阈值,进入紧急启动模式,其中,所述ECU在所述紧急启动模式不运行所述ECU中的应用程序;
程序刷写模块,用于获取第一待刷写数据,刷写所述第一待刷写数据。
第三方面,提供了一种车辆,包括:存储器、ECU以及存储在所述存储器中并可在所述ECU上运行的计算机程序,其特征在于,所述ECU执行所述计算机程序时实现上述第一方面中任一项所述的用于刷写安装于车辆上的ECU的方法。
第四方面,提供了一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现上述第一方面中任一项所述的用于刷写安装于车辆上的ECU的方法。
第五方面,提供了一种计算机程序产品,当计算机程序产品在终端设备上运行时,使得终端设备执行上述第一方面中任一项所述的用于刷写安装于车辆上的ECU的方法。
有益效果
本申请中,在ECU重启后,ECU可以检测是否存在作用在车辆上的第一操作。如果存在第一操作、且第一操作的持续时间大于预设阈值,ECU进入紧急启动模式。ECU进入紧急启动模式后获取第一待刷写数据,并基于第一待刷写数据完成ECU的刷写。相对于现有技术中需要将ECU从车辆上拆下才能对ECU进行刷写的方法;本申请不用将ECU拆下即可对ECU进行刷写,使ECU的刷写更简便、效率更高。
附图说明
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例或示范性技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其它的附图。
图1是本申请一实施例提供的用于刷写安装于车辆上的ECU的方法的应用场景示意图;
图2是本申请一实施例提供的用于刷写安装于车辆上的ECU的方法的流程示意图;
图3是本申请另一实施例提供的用于刷写安装于车辆上的ECU的方法的流程示意图;
图4是本申请另一实施例提供的计算机、OBD接口与ECU连接的结构示意图;
图5是本申请一实施例提供的OBD接口的结构示意图;
图6是本申请一实施例提供的正常启动模式下ECU刷写的流程示意图;
图7是本申请一实施例提供的电子控制单元的结构示意图;
图8是本申请一实施例提供的车辆的结构示意图。
本发明的实施方式
为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处所描述的具体实施例仅用以解释本申请,并不用于限定本申请。
术语“第一”、“第二”仅用于便于描述目的,而不能理解为指示或暗示相对重要性或者隐含指明技术特征的数量。“多个”的含义是两个或两个以上,除非另有明确具体的限定。
为了说明本申请所提供的技术方案,以下结合具体附图及实施例进行详细说明。
ECU一般都具备故障自诊断和保护功能,当系统产生故障时,它能在随机存取存储器(Random Access Memory, RAM)或Flash中自动记录故障代码并采用保护措施从固有程序中读取替代程序来维持涉及诸如安全灯等必须维持的功能。
ECU在出现故障或ECU的程序版本较低时,需要对ECU中的程序进行更新。对ECU数据的管理和更新称为对ECU的刷写。
目前,当ECU重启上电后,ECU如果获取到连接的计算机中的程序,则会直接对ECU中的程序进行刷写。上述方法容易出现用户不想对ECU进行刷写但是ECU却自动进行了刷写的情况,导致最终得到的ECU并非是用户期望的,从而为用户带来困扰,使得用户体验变差。基于上述情况,本申请提供一种用于刷写安装于车辆上的ECU的方法,为ECU的自动刷写设置了条件,降低了非预期的ECU刷写的情况,避免了ECU的误操作。另外,本申请不用将ECU从车辆上拆下即可完成对ECU的刷写,使得ECU的刷写更简单、方便,提高了ECU刷写的效率。
图1为本申请实施例提供的用于刷写安装于车辆上的ECU的方法的应用场景示意图,上述用于刷写安装于车辆上的ECU的方法可以用于对车辆ECU进行更新。其中,计算机10用于存储待刷写数据,ECU 20用于在确定需要进行刷写时从计算机10中获取待刷写数据,并将待刷写数据刷写至ECU中。
以下对本申请实施例的用于刷写安装于车辆上的ECU的方法进行详细说明。
图2和3示出了本申请提供的用于刷写安装于车辆上的ECU的方法的示意性流程图,参照图2和3,该方法包括步骤S101-S104。
在S101,在ECU上电后,ECU检测是否存在第一操作。
在本实施例中,ECU断电到上电的过程为重启的过程。ECU在每次重启后的预设时间内,ECU检测是否存在作用在安装有该ECU的车辆上的第一操作。其中,预设时间可以根据需要进行设置,例如,预设时间可以设置为50秒、60秒或70秒等。
第一操作可以根据需要进行设置。第一操作可以包括制动操作、空调按键操作和方向盘上的按键操作中的至少一种。其中,方向盘上的按键操作可以包括转向灯开启操作、雨刷打开操作、喇叭开启操作等。
具体的,第一操作的检测方法可以包括:获取车辆中预设电路的电平信号。若电平信号满足预设的操作要求,则确定检测到第一操作。
在本实施例中,预设电路可以是制动开关对应的电路,空调开关对应的电路,方向盘上对应操作的开关等。若预设电路包括制动开关对应的电路,预设的操作要求包括制动操作。若预设电路包括空调开关对应的电路,预设的操作要求包括空调启动操作。若预设电路包括方向盘上对应操作的开关对应的电路,预设的操作要求包括方向盘上对应设备的启动操作。具体的,空调按键操作的检测可以包括:获取空调开关的电平信号,若电平信号满足启动要求,例如,电平信号为高电平,则确定检测到空调按键操作。同理可以检测方向盘上的按键操作,在此不再赘述。
具体的,若第一操作包括制动操作,步骤S101的实现过程可以包括:
在S1011,获取车辆中制动开关的电平信号。
在本实施例中,车辆的制动开关可以由两路线路控制。具体的,制动开关可以由线路1和线路2共同控制。在线路1为低电平、线路2为高电平时,制动开关为非制动状态。在线路1为高电平、线路2为低电平时,制动开关为制动状态。ECU根据制动开关的电平信号可以确定制动开关是否处于制动状态。
在S1012,若制动开关的电平信号满足制动要求,则确定检测到第一操作。
在S1013,若制动开关的电平信号不满足制动要求,则确定未检测到第一操作。
在本实施例中,制动开关的电平信号满足制动要求时,制动开关为制动状态,也就是检测到制动操作。具体的,制动开关的电平信号满足制动要求包括线路1为高电平、且线路2为低电平。
在S102,若检测到第一操作,获得第一操作的持续时间。
在本实施例中,如果ECU检测到第一操作,可以开始计时,通过计时得到第一操作的持续时间。在计时期间需要持续检测第一操作,以确定第一操作是否仍在继续。如果检测不到第一操作,则可以确定第一操作不再继续。
可选的,如果检测到第一操作,可以记录ECU中的计时器的时间,本申请中可以记为初始时间。持续关注计时器的时间,利用计时器的当前时间与初始时间的差值可以得到第一操作的持续时间。
作为举例,如果检测到第一操作时计时器的时间为10,当前时间第一操作仍在继续,当前时间计时器为15,则第一操作已经持续5秒。
在S103,若持续时间大于预设阈值,进入紧急启动模式。
在本实施例中,如果检测到第一操作的持续时间已经超过预设阈值,则确定满足ECU进入紧急启动模式的条件,ECU则可以进入紧急启动模式(Emergency boot)。紧急启动模式可以是正常工作流程前的一种启动方式。
在本实施例中,预设阈值可以根据需要进行设置,例如,预设阈值可以设置为5秒、8秒或10秒等。
作为举例,如果预设时间为5秒,当前时间检测到第一操作已经持续了6秒,则确定第一操作的时间大于预设阈值,ECU进入紧急启动模式。
在本实施例中,ECU中程序的启动顺序为boot程序->App程序(应用程序),在boot程序运行完成后才会运行应用程序。紧急启动模式不运行ECU中的应用程序。
紧急启动模式下可以运行引导启动程序,即boot程序,boot程序为系统的引导文件,可以用于引导进入哪个操作系统,具体的,boot程序用来完成定位内核代码在外存的具体位置、按照要求正确装入内核至内存并最终使内核运行起来的整个系统启动过程。该过程中,启动引导程序要完成多个初始化过程,当这些过程顺利完成后才能使用系统的各种服务。这些过程包括初始引导、内核初始化、全系统初始化。
在S104,获取第一待刷写数据,刷写第一待刷写数据。
在本实施例中,ECU可以从外部计算机中获取需要刷写的数据。具体的,ECU从计算机中获取到数据后,可以判断ECU中当前存储的数据与获取到的数据的版本是否相同。如果相同,则可以用获取到的数据覆盖当前存储的数据,或者不对数据进行处理。如果不同,则可以将获取到的数据存储至FLASH中,完成对ECU的刷写。本申请将从计算机中获取的数据记为第一待刷写数据。
本申请实施例中,在ECU重启后,ECU可以检测是否存在作用在车辆上的第一操作,如果存在第一操作,可以获取第一操作的持续时间以判断是否可以进入紧急启动模式。如果第一操作的持续时间大于预设阈值,ECU进入紧急启动模式。ECU进入紧急启动模式后获取第一待刷写数据,并基于第一待刷写数据完成ECU的刷写。本申请不用将ECU拆下即可对ECU进行刷写,使ECU的刷写更简便、效率更高。另外,本申请设置了进入紧急启动模式的条件,在满足进入条件时才可以进入紧急启动模式,防止了非预期情况下对ECU的刷写。
如图4所示,在一种可能的实现方式中,如果ECU需要通过有线连接的方式获得待刷写数据,可以利用ECU上的以太网通信接口与计算机进行有线连接,从与ECU有线连接的计算机中获得待刷写数据。
具体的,如果需要通过ECU中的以太网通信接口传输第一待刷写数据。计算机可以通过网线与车载自动诊断(On Board Diagnostics,OBD)系统接口相连,ODB接口与ECU中的以太网通信接口相连,通过ODB接口实现计算机与ECU的通信。具体的,计算机可以通过网线与OBD接口中的EHERNET TX+、EHERNET TX-、EHERNET RX+和EHERNET RX-相连。RX是信号接收,TX是信号发送,如图5所示的OBD接口的示意图,引脚3为EHERNET RX+,引脚11为EHERNET RX-,引脚12为EHERNET TX+,引脚13为EHERNET TX-。
以太网通信接口的启动需要使能信号的控制。如果存在使能信号,以太网通信接口可以进行通信,反之以太网通信接口不能进行通信。
具体的,OBD接口中以太网激活线上拉引脚的信号可以为以太网通信接口提供使能信号,可以将车辆的蓄电池正极通过导线与OBD接口中的以太网激活线上拉引脚相连,以使得以太网激活线上拉引脚的电平信号为高电平,如图5所示,引脚8为以太网激活线上拉引脚。以太网激活线上拉引脚为高电平时,以太网通信接口为开启状态。以太网激活线上拉引脚为低电平时,以太网通信接口为关闭状态。本申请中可以将以太网激活线上拉引脚记为第一引脚。
如果ECU需要通过有线连接的方式获得待刷写数据,为了保证ECU进入紧急启动模式后可以通过以太网通信接口从计算机中获得第一待刷写数据,ECU进入紧急启动模式的条件还可以包括检测车辆上连接以太网通信接口的OBD接口的第一引脚的电平信号,若电平信号为高电平信号、且第一操作的持续时间大于预设阈值则进入紧急启动模式。
在本实施例中,在第一引脚的电平信号为高电平时,可以确定以太网通信接口为开启状态,保证ECU可以通过以太网通信接口从计算机中获取第一待刷写数据。将第一引脚为高电平作为进入紧急启动模式的条件,保证了ECU进入紧急启动模式后可以顺利进行数据刷写。
如图3所示,在一种可能的实现方式中,在步骤S101之后,上述方法还可以包括:
若在ECU上电后的预设时间内未检测到第一操作,进入正常启动模式。若持续时间小于或等于预设阈值、和/或第一引脚的电平信号为低电平,进入正常启动模式。
在本实施例中,如果在预设时间内没有检测到第一操作,则不符合进入紧急启动模式的条件,ECU进入正常启动模式(Normal boot)。ECU在正常启动模式下可以正常运行ECU中的应用程序,ECU中的应用程序可以包括点亮车灯程序、屏幕点亮程序、车辆点火程序等。
在本实施例中,如果检测到第一操作,但是第一操作的持续时间小于或等于预设阈值,则不符合进入紧急启动模式的条件,ECU进入正常启动模式。
在本实施例中,在需要通过以太网通信接口获取第一待刷写数据时,如果第一引脚的电平信号为低电平,则不符合进入紧急启动模式的条件,ECU进入正常启动模式。
在本实施例中,正常启动模式为ECU启动、且运行ECU中的应用程序的模式。ECU进入正常启动模式后,先运行boot程序,运行完boot程序后运行应用程序。
在一种可能的实现方式中,进入正常启动模式的ECU可以借助刷写设备向ECU传输需要刷写的数据,进而完成对ECU的刷写。
如图6所示,具体的,在所述进入所述正常启动模式之后,上述方法包括:
在S201,运行所述ECU中的应用程序。
在S202,若应用程序存在故障程序、且接收到刷写设备发送的故障查询指令,向刷写设备发送故障程序的故障码。
在本实施例中,刷写设备可以为汽车故障诊断仪。汽车故障诊断仪是车辆故障自检终端,是用于检测汽车故障的便携式智能汽车故障自检仪,用户可以利用它迅速地读取汽车各ECU的故障,并通过显示故障信息,迅速查明发生故障的部位及原因。
在本实施例中,若应用程序存在故障程序,ECU生成故障程序的故障码。用户可以通过刷写设备向ECU发送故障查询指令,ECU在接收到刷写设备发送的故障查询指令后,向刷写设备发送故障程序的故障码。
刷写设备接收到故障码后,对故障码进行解析,得到故障码对应的故障应用,并向用户展示故障应用。刷写设备根据故障应用查找对应的待刷写数据,本申请中记为第二待刷写数据。刷写设备根据第二待刷写数据生成程序刷写指令,并向ECU发送程序刷写指令。
可选的,刷写设备在生成程序刷写指令后,可以向ECU发送询问信息,ECU若接收到刷写设备发送的询问信息,ECU可以向刷写设备返回确定指令。刷写设备在接收到ECU发送的确定指令后,向ECU发送程序刷写指令。
在S203,接收刷写设备发送的程序刷写指令,刷写程序刷写指令中包括的第二待刷写数据。
在本实施例中,程序刷写指令可以包括待刷写的应用的标识符和第二待刷写数据。标识符可以为数字、字母或符号等组成。每个应用程序唯一对应一个标识符。
在本实施例中,ECU在接收到刷写设备发送的程序刷写指令后,通过对程序刷写指令进行解析得到待刷写的应用的第二待刷写数据,然后对第二待刷写数据进行刷写。
具体的,ECU对第二待刷写数据处理与对第一待刷写数据处理相同,请参照上述步骤S104的说明,在此不再赘述。
在本实施例中,在应用程序中不存在故障程序时,刷写设备还可以向ECU发送最新版本的应用程序的刷写数据,ECU接收刷写设备发送的最新版本的应用程序的刷写数据,并将最新版本的应用程序的刷写数据进行存储。
在一种可能的实现方式中,步骤S202的实现过程可以包括:
在S2021,获取车辆的状态信息。
在本实施例中,ECU接收到刷写设备发送的故障查询指令后,可以获取车辆的状态信息。
在本实施例中,车辆的状态信息可以包括车速、发动机转速和电源档位等。获取车辆的状态信息是为了确定车辆是否在运行状态,如果车辆在运行状态则不可以对ECU进行刷写。具体的,车速和发动机用于确定车辆是否在静止状态。电源档位用于确定车辆内的电器是否上电。
具体的,获取到车辆的状态信息后,可以判断车速是否在第一预设范围,发动机转速是否在第二预设范围,电源档位是否在ON档。其中,电源档位在ON档时为车内所有电器供电。第一预设范围和第二预设范围可以根据需要进行设置。
在S2022,若状态信息满足预设要求,向所述刷写设备发送所述故障程序的故障码。
在本实施例中,状态信息满足预设要求包括车速在第一预设范围、发动机转速在第二预设范围、且电源档位在ON档。
本申请实施例中,在刷写之前判断车辆状态,在车辆状态信息满足要求时对ECU进行刷写,可以避免在车辆运行时进行刷写而导致车辆故障的现象。
应理解,上述实施例中各步骤的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。
对应于上文实施例所述的用于刷写安装于车辆上的ECU的方法,图7示出了本申请实施例提供的电子控制单元的结构框图,为了便于说明,仅示出了与本申请实施例相关的部分。
参照图7,该电子控制单元300可以包括:检测模块310、时间测试模块320、模式选择模块330和程序刷写模块340。
其中,检测模块310,用于在所述ECU上电后,检测是否存在第一操作,其中,所述第一操作为作用在安装所述ECU的车辆上的操作;
时间测试模块320,用于若检测到所述第一操作,获得所述第一操作的持续时间;
模式选择模块330,用于若所述持续时间大于预设阈值,进入紧急启动模式,其中,所述ECU在所述紧急启动模式不运行所述ECU中的应用程序;
程序刷写模块340,用于获取第一待刷写数据,刷写所述第一待刷写数据。
在一种可能的实现方式中,模式选择模块330具体还可以用于:
获取第一引脚的电平信号,其中,所述第一引脚为所述车辆上的用于连接以太网通信接口的OBD接口上的引脚,所述电平信号为高电平时所述ECU中的以太网通信接口为开启状态,所述电平信号为低电平时所述以太网通信接口为关闭状态;
相应的,若所述持续时间大于预设阈值、且所述第一引脚的电平信号为高电平,进入所述紧急启动模式。
在一种可能的实现方式中,所述第一引脚为以太网激活线上拉引脚。
在一种可能的实现方式中,所述第一操作包括制动操作、空调按键操作和方向盘上的按键操作中的至少一种。
在一种可能的实现方式中,在所述第一操作包括所述制动操作时,检测模块310具体可以用于:
获取所述车辆中预设电路的电平信号;
若所述电平信号满足预设的操作要求,则确定检测到所述第一操作。在一种可能的实现方式中,与检测模块310相连的还可以包括:
第一选择模块,用于若在所述ECU上电后的预设时间内未检测到所述第一操作,进入正常启动模式,其中,所述ECU在所述正常启动模式运行所述ECU中的应用程序;
第二选择模块,用于若所述持续时间小于或等于所述预设阈值、和/或所述第一引脚的电平信号为低电平,进入所述正常启动模式。
在一种可能的实现方式中,在所述进入所述正常启动模式之后,程序刷写模块340具体还可以用于:
运行所述ECU中的应用程序;
若所述应用程序存在故障程序、且接收到刷写设备发送的故障查询指令,向所述刷写设备发送所述故障程序的故障码,其中,所述故障码用于指示所述刷写设备查找所述故障码对应的故障应用的第二待刷写数据,并基于所述第二待刷写数据生成程序刷写指令,向所述刷写设备发送所述程序刷写指令;
接收所述刷写设备发送的所述程序刷写指令,刷写程序刷写指令中包括的第二待刷写数据。
在一种可能的实现方式中,程序刷写模块340具体还可以用于:
获取车辆的状态信息,其中,所述状态信息包括车速、发动机转速和电源档位;
若所述状态信息满足预设要求,向所述刷写设备发送所述故障程序的故障码。
需要说明的是,上述装置/单元之间的信息交互、执行过程等内容,由于与本申请方法实施例基于同一构思,其具体功能及带来的技术效果,具体可参见方法实施例部分,此处不再赘述。
所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,仅以上述各功能单元、模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能单元、模块完成,即将所述装置的内部结构划分成不同的功能单元或模块,以完成以上描述的全部或者部分功能。实施例中的各功能单元、模块可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中,上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。另外,各功能单元、模块的具体名称也只是为了便于相互区分,并不用于限制本申请的保护范围。上述系统中单元、模块的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。
本申请实施例还提供了一种车辆,参见图8,该车辆400可以包括:ECU410、存储器420以及存储在所述存储器420中并可在所述ECU410上运行的计算机程序,所述ECU410执行所述计算机程序时实现上述任意各个方法实施例中的步骤,例如图2所示实施例中的步骤S101至步骤S104。或者,ECU 410执行所述计算机程序时实现上述各装置实施例中各模块/单元的功能,例如图7所示模块310至340的功能。
示例性的,计算机程序可以被分割成一个或多个模块/单元,一个或者多个模块/单元被存储在存储器420中,并由ECU 410执行,以完成本申请。所述一个或多个模块/单元可以是能够完成特定功能的一系列计算机程序段,该程序段用于描述计算机程序在车辆400中的执行过程。
本领域技术人员可以理解,图8仅仅是车辆的示例,并不构成对车辆的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件,例如输入输出设备、网络接入设备、总线等。
ECU 410可以是中央处理单元(Central Processing Unit,CPU),还可以是其他通用处理器、数字信号处理器 (Digital Signal Processor,DSP)、专用集成电路 (Application Specific Integrated Circuit,ASIC)、现成可编程门阵列 (Field-Programmable Gate Array,FPGA) 或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。
本申请实施例提供的用于刷写安装于车辆上的ECU的方法可以应用于计算机、平板电脑、笔记本电脑、上网本、个人数字助理(personal digital assistant,PDA)等终端设备上,本申请实施例对终端设备的具体类型不作任何限制。
本申请实施例还提供了一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行时实现可实现上述用于刷写安装于车辆上的ECU的方法各个实施例中的步骤。
本申请实施例提供了一种计算机程序产品,当计算机程序产品在移动终端上运行时,使得移动终端执行时实现可实现上述用于刷写安装于车辆上的ECU的方法各个实施例中的步骤。
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请实现上述实施例方法中的全部或部分流程,可以通过计算机程序来指令相关的硬件来完成,所述的计算机程序可存储于计算机可读存储介质中,该计算机程序在被处理器执行时,可实现上述各个方法实施例的步骤。其中,所述计算机程序包括计算机程序代码,所述计算机程序代码可以为源代码形式、对象代码形式、可执行文件或某些中间形式等。所述计算机可读介质至少可以包括:能够将计算机程序代码携带到拍照装置/终端设备的任何实体或装置、记录介质、计算机存储器、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、电载波信号、电信信号以及软件分发介质。例如U盘、移动硬盘、磁碟或者光盘等。在某些司法管辖区,根据立法和专利实践,计算机可读介质不可以是电载波信号和电信信号。
在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述或记载的部分,可以参见其它实施例的相关描述。
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。
在本申请所提供的实施例中,应该理解到,所揭露的装置/网络设备和方法,可以通过其它的方式实现。例如,以上所描述的装置/网络设备实施例仅仅是示意性的,例如,所述模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通讯连接可以是通过一些接口,装置或单元的间接耦合或通讯连接,可以是电性,机械或其它的形式。
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
以上仅为本申请的可选实施例而已,并不用于限制本申请。对于本领域的技术人员来说,本申请可以有各种更改和变化。凡在本申请的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本申请的权利要求范围之内。

Claims (15)

  1. 一种用于刷写安装于车辆上的ECU的方法,其特征在于,应用于电子控制单元,即ECU,所述方法包括:
    在所述ECU上电后,响应于检测到在安装有所述ECU的车辆上发生第一操作,获得所述第一操作的持续时间;
    若所述持续时间大于预设阈值,则进入紧急启动模式,其中,所述ECU在所述紧急启动模式不运行所述ECU中的应用程序;
    获取第一待刷写数据,刷写所述第一待刷写数据。
  2. 根据权利要求1所述的用于刷写安装于车辆上的ECU的方法,其特征在于,在进入紧急启动模式之前,包括:
    获取第一引脚的电平信号,其中,所述第一引脚为所述车辆上的用于连接以太网通信接口的OBD接口上的引脚,所述电平信号为高电平时,所述ECU中的以太网通信接口为开启状态,所述电平信号为低电平时,所述以太网通信接口为关闭状态;
    相应的,若所述持续时间大于预设阈值,则进入紧急启动模式,包括:
    若所述持续时间大于预设阈值、且所述第一引脚的电平信号为高电平,则进入所述紧急启动模式。
  3. 根据权利要求2所述的用于刷写安装于车辆上的ECU的方法,其特征在于,所述第一引脚为以太网激活线上拉引脚。
  4. 根据权利要求1至3任一项所述的用于刷写安装于车辆上的ECU的方法,其特征在于,所述第一操作包括制动操作、空调按键操作和方向盘上的按键操作中的至少一种。
  5. 根据权利要求1至4任一项所述的用于刷写安装于车辆上的ECU的方法,其特征在于,检测在安装有所述ECU的车辆上是否发生第一操作,包括:
    获取所述车辆中预设电路的电平信号;
    若所述电平信号满足预设的操作要求,则确定安装有所述ECU的车辆上发生所述第一操作。
  6. 根据权利要求2所述的用于刷写安装于车辆上的ECU的方法,其特征在于,所述方法还包括:
    若在所述ECU上电后的预设时间内未检测到所述第一操作,则进入正常启动模式,其中,所述ECU在所述正常启动模式运行所述ECU中的应用程序;
    若所述持续时间小于或等于所述预设阈值、和/或所述第一引脚的电平信号为低电平,则进入所述正常启动模式。
  7. 根据权利要求6所述的用于刷写安装于车辆上的ECU的方法,其特征在于,在所述进入所述正常启动模式之后,包括:
    运行所述ECU中的应用程序;
    若所述应用程序存在故障程序、且接收到刷写设备发送的故障查询指令,向所述刷写设备发送所述故障程序的故障码,其中,所述故障码用于指示所述刷写设备基于所述述故障码对应的故障应用的第二待刷写数据生成程序刷写指令,并向所述ECU发送所述程序刷写指令;
    接收所述刷写设备发送的所述程序刷写指令,刷写所述程序刷写指令中包括的所述第二待刷写数据。
  8. 根据权利要求7所述的用于刷写安装于车辆上的ECU的方法,其特征在于,所述向所述刷写设备发送所述故障程序的故障码,包括:
    获取车辆的状态信息,其中,所述状态信息包括车速、发动机转速和电源档位;
    若所述状态信息满足预设要求,向所述刷写设备发送所述故障程序的故障码。
  9. 根据权利要求8所述的用于刷写安装于车辆上的ECU的方法,其特征在于,所述状态信息满足预设要求包括车速在第一预设范围、发动机转速在第二预设范围、且电源档位在ON档。
  10. 根据权利要求1所述的用于刷写安装于车辆上的ECU的方法,其特征在于,所述ECU在所述紧急启动模式下运行引导启动程序,即boot程序,所述boot程序为系统的引导文件,所述boot程序用于引导进入对应的操作系统。
  11. 根据权利要求4所述的用于刷写安装于车辆上的ECU的方法,其特征在于,所述第一操作包括制动操作,所述检测是否存在第一操作,包括:
    获取车辆中制动开关的电平信号;
    若制动开关的电平信号满足制动要求,则确定检测到第一操作;
    若制动开关的电平信号不满足制动要求,则确定未检测到第一操作。
  12. 根据权利要求4所述的用于刷写安装于车辆上的ECU的方法,其特征在于,所述方向盘上的按键操作包括:转向灯开启操作、雨刷打开操作和/或喇叭开启操作。
  13. 一种电子控制单元,其特征在于,包括:
    检测模块,用于在所述ECU上电后,检测是否存在第一操作,其中,所述第一操作为作用在安装所述ECU的车辆上的操作;
    时间测试模块,用于若检测到所述第一操作,获得所述第一操作的持续时间;
    模式选择模块,用于若所述持续时间大于预设阈值,进入紧急启动模式,其中,所述ECU在所述紧急启动模式不运行所述ECU中的应用程序;
    程序刷写模块,用于获取第一待刷写数据,刷写所述第一待刷写数据。
  14. 一种车辆,包括存储器、ECU以及存储在所述存储器中并可在所述ECU上运行的计算机程序,其特征在于,所述ECU执行所述计算机程序时实现如权利要求1至12任一项所述的用于刷写安装于车辆上的ECU的方法。
  15. 一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现如权利要求1至12任一项所述的用于刷写安装于车辆上的ECU的方法。
PCT/CN2022/118148 2021-09-13 2022-09-09 用于刷写安装于车辆上的ecu的方法、车辆及存储介质 WO2023036302A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
EP22866763.0A EP4404053A1 (en) 2021-09-13 2022-09-09 Method for flashing ecu mounted on vehicle, vehicle, and storage medium

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202111070177.5 2021-09-13
CN202111070177.5A CN115809078A (zh) 2021-09-13 2021-09-13 一种车辆ecu的刷写方法、车辆及存储介质

Publications (1)

Publication Number Publication Date
WO2023036302A1 true WO2023036302A1 (zh) 2023-03-16

Family

ID=85481223

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/118148 WO2023036302A1 (zh) 2021-09-13 2022-09-09 用于刷写安装于车辆上的ecu的方法、车辆及存储介质

Country Status (3)

Country Link
EP (1) EP4404053A1 (zh)
CN (1) CN115809078A (zh)
WO (1) WO2023036302A1 (zh)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130212571A1 (en) * 2010-10-29 2013-08-15 Honda Motor Co., Ltd. Program rewriting system for vehicles
CN105511912A (zh) * 2015-11-28 2016-04-20 惠州市蓝微新源技术有限公司 一种基于can总线的程序下载方法
CN107544473A (zh) * 2017-10-13 2018-01-05 北京经纬恒润科技有限公司 一种重编程方法及装置
CN110532001A (zh) * 2019-09-09 2019-12-03 阳光电源股份有限公司 车辆控制器的刷写方法、系统、诊断设备及车辆控制器
CN112114832A (zh) * 2020-09-21 2020-12-22 华人运通(上海)云计算科技有限公司 车辆升级控制方法、终端设备、车辆和计算机存储介质
CN112506535A (zh) * 2020-05-22 2021-03-16 上海擎度汽车科技有限公司 一种汽车ECU控制器更新升级Bootloader软件的方法
CN112764786A (zh) * 2021-01-04 2021-05-07 东风商用车有限公司 汽车ECU Bootloader的启动方法及装置
CN113010200A (zh) * 2021-03-23 2021-06-22 深圳市元征科技股份有限公司 一种刷写方法、刷写系统、刷写装置及服务器

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130212571A1 (en) * 2010-10-29 2013-08-15 Honda Motor Co., Ltd. Program rewriting system for vehicles
CN105511912A (zh) * 2015-11-28 2016-04-20 惠州市蓝微新源技术有限公司 一种基于can总线的程序下载方法
CN107544473A (zh) * 2017-10-13 2018-01-05 北京经纬恒润科技有限公司 一种重编程方法及装置
CN110532001A (zh) * 2019-09-09 2019-12-03 阳光电源股份有限公司 车辆控制器的刷写方法、系统、诊断设备及车辆控制器
CN112506535A (zh) * 2020-05-22 2021-03-16 上海擎度汽车科技有限公司 一种汽车ECU控制器更新升级Bootloader软件的方法
CN112114832A (zh) * 2020-09-21 2020-12-22 华人运通(上海)云计算科技有限公司 车辆升级控制方法、终端设备、车辆和计算机存储介质
CN112764786A (zh) * 2021-01-04 2021-05-07 东风商用车有限公司 汽车ECU Bootloader的启动方法及装置
CN113010200A (zh) * 2021-03-23 2021-06-22 深圳市元征科技股份有限公司 一种刷写方法、刷写系统、刷写装置及服务器

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
YU SHANG, YAN YANG: "Diagnostics and Software Updata of Vehicle Unit Based on Telematics", AUTOMOBILE APPLIED TECHNOLOGY., vol. 09, no. 9, 30 September 2016 (2016-09-30), pages 183 - 185, XP093046063, ISSN: 1671-7988, DOI: 10.16638/j.cnki.1671-7988.2016.09.061 *

Also Published As

Publication number Publication date
EP4404053A1 (en) 2024-07-24
CN115809078A (zh) 2023-03-17

Similar Documents

Publication Publication Date Title
CN108268264B (zh) 预关闭交换验证
US20180341476A1 (en) Software updating device, software updating system, and software updating method
US20150186150A1 (en) Baseboard management controller and method of loading firmware
US10860425B2 (en) Method for recovering basic input/output system image file of a computer system and the computer system
CN108446129B (zh) 用于多周期车辆软件更新符合性处理的方法和设备
US9424022B2 (en) Method for updating firmware of an electronic device within a computer
US8397053B2 (en) Multi-motherboard server system
CN110659038B (zh) 车载毫米波雷达升级方法、装置、计算机设备和存储介质
CN113377384A (zh) 一种程序烧录方法、装置、车载终端及介质
WO2022160816A1 (zh) 一种数据处理方法以及相关设备
CN116737244A (zh) 芯片多硬件域启动方法及装置
KR102109125B1 (ko) Autosar 기반 차량 ecu 상태 관리 방법
CN113050960B (zh) Ota升级方法、装置、车载终端及存储介质
WO2023036302A1 (zh) 用于刷写安装于车辆上的ecu的方法、车辆及存储介质
CN114564179A (zh) 参数配置方法、装置及系统
CN114860512A (zh) 车辆的soc芯片工作状态检测方法、装置、设备和系统
WO2022160745A1 (zh) 一种网络安全功能检测的方法及相关设备
CN116560688A (zh) 用于域控制器的软件更新方法
CN113535213B (zh) 一种可编程逻辑器件的固件更新方法及系统
CN111679649B (zh) 车载终端启动方法、装置、终端设备及存储介质
CN116909609B (zh) 车载智能设备的软件升级方法、装置及车载智能设备
CN112783535A (zh) 固件升级方法、嵌入式装置及存储介质
CN114138572B (zh) NVMe背板的NVMe盘热插拔管理方法及相关组件
US20240019919A1 (en) Method of updating power firmware and power supply
CN115562698B (zh) 基本输入输出系统bios的升级方法和电子设备

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22866763

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 2022866763

Country of ref document: EP

NENP Non-entry into the national phase

Ref country code: DE

ENP Entry into the national phase

Ref document number: 2022866763

Country of ref document: EP

Effective date: 20240415