[go: up one dir, main page]
More Web Proxy on the site http://driver.im/

CN113448604A - OTA (over the air) flashing method, OTA flashing system, readable storage medium and vehicle - Google Patents

OTA (over the air) flashing method, OTA flashing system, readable storage medium and vehicle Download PDF

Info

Publication number
CN113448604A
CN113448604A CN202110592939.1A CN202110592939A CN113448604A CN 113448604 A CN113448604 A CN 113448604A CN 202110592939 A CN202110592939 A CN 202110592939A CN 113448604 A CN113448604 A CN 113448604A
Authority
CN
China
Prior art keywords
vehicle
control unit
ota
electronic control
flash
Prior art date
Legal status (The legal status 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 status listed.)
Granted
Application number
CN202110592939.1A
Other languages
Chinese (zh)
Other versions
CN113448604B (en
Inventor
吴皓源
辜云
陈江波
夏永强
郑玉圆
苌乐
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Jiangling Motors Corp Ltd
Original Assignee
Jiangling Motors Corp Ltd
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 Jiangling Motors Corp Ltd filed Critical Jiangling Motors Corp Ltd
Priority to CN202110592939.1A priority Critical patent/CN113448604B/en
Publication of CN113448604A publication Critical patent/CN113448604A/en
Application granted granted Critical
Publication of CN113448604B publication Critical patent/CN113448604B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/08Error detection or correction by redundancy in data representation, e.g. by using checking codes
    • G06F11/10Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's
    • G06F11/1004Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's to protect a block of data words, e.g. CRC or checksum
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/64Protecting data integrity, e.g. using checksums, certificates or signatures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Computer Security & Cryptography (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Quality & Reliability (AREA)
  • Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • General Health & Medical Sciences (AREA)
  • Computer Hardware Design (AREA)
  • Stored Programmes (AREA)

Abstract

The invention provides an OTA (over the air) flashing method, an OTA flashing system, a readable storage medium and a vehicle, wherein the OTA flashing method comprises the following steps: when an upgrading request of a cloud server is received, judging whether a vehicle meets a flashing condition; if yes, controlling the vehicle to enter an OTA mode, downloading a data packet from the cloud server in the OTA mode, and issuing a flash instruction to the electronic control unit ECU so as to enable the electronic control unit ECU to perform flash upgrading; after the electronic control unit ECU is successfully written, reading the software version number of the electronic control unit ECU, and judging whether the software version number is consistent with the data packet or not; if not, the vehicle is controlled to enter a rollback mode, and the original and old version data is printed into an electronic control unit ECU in the rollback mode. The invention determines whether the vehicle carries out OTA (over the air) flashing updating or not by judging whether the vehicle meets the flashing condition or not, can store the original and old version data, and can directly flush the original and old version data into the electronic control unit ECU when the flashing fails, thereby avoiding the loss of the original and old version data caused by the flashing failure.

Description

OTA (over the air) flashing method, OTA flashing system, readable storage medium and vehicle
Technical Field
The invention relates to the technical field of communication, in particular to an OTA (over the air) flashing method, an OTA flashing system, a readable storage medium and a vehicle.
Background
With the high-speed development of the automobile industry and the network communication technology, the automobile industry is not limited to local upgrade through an OBD interface any more, and the introduction of the OTA technology provides a new upgrade approach for updating the module software of the whole automobile.
When The vehicle uses The Over The Air (OTA) function, The vehicle needs to go through The steps of downloading an upgrade package, verifying The upgrade package, flashing an Electronic Control Unit (ECU) firmware, clearing The flash information, and restarting The whole vehicle. The OTA flash of the whole vehicle needs to download data from a cloud end to a vehicle end, the integrity of the data is guaranteed in the data transmission process, and meanwhile, the data of the vehicle end needs to be prevented from being tampered, updated packages are stolen, decoded and the like.
In the prior art, the original version data cannot be stored in the OTA flash process of the whole vehicle, so that the flash cannot return to the original version after the flash fails, and the problem of data loss exists.
Disclosure of Invention
Based on this, the invention aims to provide an OTA flash method, a system, a readable storage medium and a vehicle. The method is used for solving the problems that in the prior art, the original version data cannot be stored in the OTA flash process of the whole vehicle, the flash cannot be returned to the original version after the flash failure, and the data are lost.
The invention provides an OTA (over the air) flashing method, which is applied to a vehicle-mounted TBox of a vehicle, wherein the vehicle also comprises an Electronic Control Unit (ECU), and the method comprises the following steps:
when an upgrading request of a cloud server is received, judging whether the vehicle meets a writing condition;
if yes, controlling the vehicle to enter an OTA mode, downloading a data packet from a cloud server in the OTA mode, and issuing a flash instruction to an Electronic Control Unit (ECU) to enable the ECU to perform flash upgrading;
after the electronic control unit ECU is successfully written, reading the software version number of the electronic control unit ECU, and judging whether the software version number is consistent with the data packet or not;
if not, controlling the vehicle to enter a rollback mode, and brushing original and old version data into the electronic control unit ECU in the rollback mode.
In addition, according to the OTA flashing method provided by the invention, the following additional technical features can be provided:
further, the step of judging whether the vehicle meets the flash condition comprises:
acquiring a software version number of the electronic control unit ECU, and judging whether the software version number is lower than a cloud version number of the cloud server;
and if so, determining that the vehicle meets the flash condition.
Further, the method further comprises:
and when the electronic control unit ECU fails in the flashing, controlling the vehicle to enter a rollback mode, and flashing original version data into the electronic control unit ECU in the rollback mode.
Further, the step of obtaining the software version number of the ECU further includes:
performing handshake authentication with a gateway GW;
after finishing handshake authentication, the gateway GW performs anti-theft authentication with a keyless management system (BCM/PEPS);
and when the BCM/PEPS completes the anti-theft authentication, controlling the vehicle to be powered on.
Further, the step of performing handshake authentication with the gateway GW further includes:
initiating a handshake request to the gateway GW to enable the gateway GW to feed back a response signal according to the handshake request;
when the response signal is received, feeding back a handshake key to the gateway GW to enable the gateway GW to compare with a decryption key in the electronic control unit ECU according to the handshake key;
and when the comparison result of the handshake key and the decryption key meets a preset result, the gateway GW completes handshake authentication.
Further, the step of performing anti-theft authentication with the keyless management system BCM/PEPS further comprises:
initiating a power-on request to the BCM/PEPS so as to enable the BCM/PEPS to feed back an authentication signal;
and when the authentication signal is received, feeding back an authentication key to the BCM/PEPS so as to enable the BCM/PEPS to complete anti-theft authentication.
The OTA flash system according to the embodiment of the invention is applied to a vehicle-mounted TBox of a vehicle, and comprises:
the judging module is used for judging whether the vehicle meets the flash condition or not when an upgrading request of the cloud server is received;
the OTA control module is used for controlling the vehicle to enter an OTA mode when the vehicle meets the flash condition, downloading a data packet from a cloud server in the OTA mode, and issuing a flash instruction to an Electronic Control Unit (ECU) so as to enable the ECU to perform flash upgrading;
the acquisition module is used for reading the software version number of the electronic control unit ECU after the electronic control unit ECU is successfully written, and judging whether the software version number is consistent with the data packet or not;
and the rollback control module is used for controlling the vehicle to enter a rollback mode when the software version number is inconsistent with the data packet, and brushing the original version data into the electronic control unit ECU in the rollback mode.
The invention also proposes a computer-readable storage medium on which a computer program is stored which, when being executed by a processor, implements the OTA flashing method described above.
The invention also provides a vehicle, which comprises a processor, a memory and a computer program stored on the memory and capable of running on the processor, wherein the vehicle comprises an on-board controller for controlling the vehicle, and the OTA flash method is realized when the processor executes the program.
According to the OTA flash method, the OTA flash system, the readable storage medium and the vehicle, whether the vehicle carries out OTA flash updating or not is determined by judging whether the vehicle meets flash conditions or not, after the electronic control unit ECU flash succeeds, whether the flash succeeds or not is judged by comparing the software version number in the electronic control unit ECU after flash with the data packet, on the other hand, the old version data can be stored, and when the flash fails, the old version data can be directly flash into the electronic control unit ECU, so that the loss of the old version data caused by the flash failure is avoided. The problem of among the prior art, the in-process of whole car OTA flash can't store former version data, can't get back to the old version after leading to the flash failure, exist and lose data is solved.
Drawings
Fig. 1 is a schematic structural view of a vehicle provided in an embodiment of the invention;
FIG. 2 is a flow chart of an OTA flash method in a first embodiment of the present invention;
FIG. 3 is a schematic structural diagram of an OTA flash system according to a second embodiment of the present invention;
fig. 4 is a schematic structural view of a vehicle in a third embodiment of the invention.
Description of the main element symbols:
information acquisition module 1 Information judgment logic block 22
Vehicle TBox 2 Function allocation enable logic block 23
Electronic control unit ECU 3 Control management logic block 24
Processor with a memory having a plurality of memory cells 10 Information acquisition unit 111
Memory device 20 Information transfer unit 112
Computer program 30 Information judging unit 113
Vehicle-mounted controller 40 First flash unit 121
Judging module 11 Version number reading unit 131
OTA control module 12 Version number judging unit 132
Acquisition module 13 Control unit 141
Rollback control module 14 Second flash unit 142
Information acquisition logic block 21
The following detailed description will further illustrate the invention in conjunction with the above-described figures.
Detailed Description
To facilitate an understanding of the invention, the invention will now be described more fully with reference to the accompanying drawings. Several embodiments of the invention are presented in the drawings. This invention may, however, be embodied in many different forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete.
It will be understood that when an element is referred to as being "secured to" another element, it can be directly on the other element or intervening elements may also be present. When an element is referred to as being "connected" to another element, it can be directly connected to the other element or intervening elements may also be present. The terms "vertical," "horizontal," "left," "right," and the like as used herein are for illustrative purposes only.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs. The terminology used in the description of the invention herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used herein, the term "and/or" includes any and all combinations of one or more of the associated listed items.
The following embodiments can be applied to the vehicle shown in fig. 1, where fig. 1 shows that the vehicle includes an information acquisition module 1, a vehicle-mounted TBox 2 and an electronic control unit ECU 3, and the vehicle-mounted TBox 2 includes an information acquisition logic block 21, an information determination logic block 22, a function allocation enabling logic block 23 and a control management logic block 24, which are not exhaustive in the figure.
Wherein, information acquisition module 1, on-vehicle TBox 2 and electronic control unit ECU 3 all can take place the communication effect each other through electric connection. Specifically, gather the upgrade request of cloud server by information acquisition module 1, pass through signal transmission this type of signal to on-vehicle TBox 2 in, carry out the computer judgement by on-vehicle TBox 2, include: the information obtaining logic block 21 is configured to obtain the upgrade request, and transmit the upgrade request to the information determining logic block 22; the information judgment logic block 22 judges whether the vehicle meets the flashing condition according to the upgrading request, and transmits the judgment result to the function distribution enabling logic block 23; the function distribution enabling logic block 23 analyzes the judgment result and transmits the analysis result to the control management logic block 24; the control management logic block 24 outputs a flash instruction to the electronic control unit ECU 3 outside the vehicle-mounted TBox 2 according to the analysis structure, so that the electronic control unit ECU 3 performs flash upgrading;
after the electronic control unit ECU is successfully written, the information acquisition logic block 21 reads the software version number of the electronic control unit ECU 3 and transmits the software version number to the information judgment logic block 22; the information judgment logic block 22 judges whether the software version number is consistent with the data packet according to the comparison between the software version number and the data packet, and transmits the judgment result to the function distribution enabling logic block 23; the function distribution enabling logic block 23 analyzes the judgment result and transmits the analysis result to the control management logic block 24; the control management logic block 24 outputs a rollback instruction to the electronic control unit ECU 3 outside the vehicle-mounted TBox 2 according to the above analysis structure, and flushes the old and old version data into the electronic control unit ECU.
It should be noted that the configuration shown in fig. 1 does not constitute a limitation of the vehicle, which may in other embodiments also comprise fewer or more components than shown, or some components may be combined, or a different arrangement of components.
Example one
Referring to fig. 2, an OTA flashing method in a first embodiment of the present invention is shown, which is applied to a vehicle-mounted TBox, and the method specifically includes steps S101 to S104:
s101, when an upgrading request of a cloud server is received, judging whether the vehicle meets a flashing condition;
in specific implementation, the vehicle-mounted TBox and the gateway GW perform handshake authentication; after finishing handshake authentication, the gateway GW performs anti-theft authentication with a keyless management system (BCM/PEPS); after the BCM/PEPS completes the anti-theft authentication, controlling the vehicle to be powered on; meanwhile, acquiring a software version number of the electronic control unit ECU, and judging whether the software version number is lower than a cloud version number of the cloud server; and if so, determining that the vehicle meets the flash condition.
In the handshake authentication with the gateway GW, the vehicle-mounted TBox initiates a handshake request to the gateway GW so that the gateway GW feeds back a response signal according to the handshake request; when the vehicle-mounted TBox receives the response signal, a handshake key is fed back to the gateway GW, so that the gateway GW compares the handshake key with a decryption key in the electronic control unit ECU; and when the comparison result of the handshake key and the decryption key meets a preset result, the gateway GW completes handshake authentication.
In the anti-theft authentication with a keyless management system BCM/PEPS, a vehicle-mounted TBox initiates a power-on request to the keyless management system BCM/PEPS so as to enable the keyless management system BCM/PEPS to feed back an authentication signal; and when the vehicle-mounted TBox receives the authentication signal, feeding back an authentication key to the BCM/PEPS so as to enable the BCM/PEPS to complete anti-theft authentication.
It can be understood that when there is an upgrade request, the vehicle-mounted TBox is awakened by the upgrade task and initiates a handshake process, and at this time, the gateway GW is in a state of waiting for the handshake process. The handshake flow comprises four steps of handshake request, handshake response, handshake key and handshake result. The vehicle-mounted TBox firstly initiates a handshake request Check _ Requst message to the gateway GW, then the gateway GW sends a Check Seed message to the vehicle-mounted TBox, the vehicle-mounted TBox calculates a correct Key after receiving the Seed and sends the Check _ Key message to the gateway GW, the gateway GW compares the Key with the Key stored in the ECU of the gateway GW after receiving the Key, and the handshake state sends a corresponding value in the Check _ Response message according to the comparison result. After the handshake is successful, the vehicle-mounted TBox initiates a remote power-on request to the bus through the gateway GW, the vehicle-mounted TBox and the keyless management system BCM/PEPS perform anti-theft authentication, after the authentication is passed, the keyless management system BCM/PEPS controls the IG relay to be attracted and the IG state is fed back by the vehicle body controller BCM, after the remote power-on awakens the whole vehicle, the vehicle-mounted TBox reads the software version number of the relevant electronic control unit ECU, simultaneously stores the old data in the software version number, and judges whether the upgrading and updating are needed. And determining that the vehicle meets the flash condition if the upgrade is determined.
S102, if yes, controlling the vehicle to enter an OTA mode, downloading a data packet from a cloud server in the OTA mode, and issuing a flash instruction to an Electronic Control Unit (ECU) to enable the ECU to perform flash upgrading;
in specific implementation, the vehicle is controlled to enter an OTA mode, the vehicle-mounted TBox downloads an upgrading data packet from the cloud server, a flash instruction is sent, and the gateway GW forwards the instruction to the corresponding electronic control unit ECU.
In order to ensure the integrity of data, the electronic control unit ECU needs to be upgraded according to the following procedures:
1. the ECU of the whole vehicle electronic control unit enters an extended session mode: the vehicle TBox sends a $10$03 instruction by using the functional addressing ID, and the gateway GW routes the message to each network segment;
2. the vehicle-mounted TBox sends $85$02 and $28$03 instructions to control the ECU communication and DTC recording functions of the whole vehicle;
3. sending a $27 command for secure access by the target electronic control unit ECU;
4. transmitting a drive program and verifying the downloading integrity of the drive program through a CRC algorithm;
5. after analyzing the initial byte and the data length in the data packet, the vehicle-mounted TBox sends an instruction to erase an APP program in the target electronic control unit ECU;
6. transmitting an APP program and verifying the data integrity of the APP through a CRC algorithm;
7. the vehicle-mounted TBox sends a $11 instruction to reset the target electronic control unit ECU;
8. the vehicle TBox sends $28, $85 instruction to restore the ECU communication and DTC recording functions of the whole vehicle electronic control unit.
S103, after the electronic control unit ECU is successfully written, reading the software version number of the electronic control unit ECU, and judging whether the software version number is consistent with the data packet or not;
in specific implementation, after the flash is finished, the vehicle-mounted TBox reads the software version number of the target electronic control unit ECU, and judges whether the software version number is consistent with the data packet or not.
It should be noted that, after the electronic control unit ECU fails to write by flash, the vehicle-mounted TBox controls the vehicle to enter a rewrite mode, and in the rewrite mode, the data packet is repeatedly written into the electronic control unit ECU; and when the electronic control unit ECU fails in three-time flash writing, controlling the vehicle to enter a rollback mode, and in the rollback mode, flashing original version data into the electronic control unit ECU.
And S104, if not, controlling the vehicle to enter a rollback mode, and brushing original and old version data into the electronic control unit ECU in the rollback mode.
In specific implementation, if the software version number is consistent with the cloud package, the information of successful upgrade of the electronic control unit ECU is fed back, and the vehicle-mounted TBox controls the keyless management system BCM/PEPS to perform power-off operation to wait for the whole vehicle to sleep.
And if the software version number is inconsistent with the data packet, the vehicle-mounted TBox controls the vehicle to enter a rollback mode again, and the original and old version data is refreshed into the target electronic control unit ECU.
In summary, in the OTA flashing method in the above embodiments of the present invention, whether the vehicle performs OTA flashing updating is determined by determining whether the vehicle meets the flashing condition, and after the electronic control unit ECU successfully flashes, whether the flashing is successful is determined by comparing the software version number inside the electronic control unit ECU after flashing with the data packet. The problem of among the prior art, the in-process of whole car OTA flash can't store former version data, can't get back to the old version after leading to the flash failure, exist and lose data is solved.
Example two
In another aspect, referring to fig. 3, an OTA flashing system according to a second embodiment of the present invention is applied to a vehicle-mounted TBox of a vehicle, and the system includes:
the judging module 11 is configured to, when an upgrade request of a cloud server is received, judge whether the vehicle meets a flash condition;
further, the determining module 11 includes:
the information acquisition unit 111 is used for acquiring the software version number of the electronic control unit ECU when an upgrade request of a cloud server is received;
an information delivery unit 112, configured to deliver the cloud version number and the software version number in the cloud server, and store old data in the software version number;
the information determining unit 113 is configured to determine whether the software version number is lower than a cloud version number of the cloud server, and when the software version number is lower than the cloud version number of the cloud server, determine that the vehicle meets a flashing condition.
In specific implementation, the vehicle-mounted TBox and the gateway GW perform handshake authentication; after finishing handshake authentication, the gateway GW performs anti-theft authentication with a keyless management system (BCM/PEPS); after the BCM/PEPS completes the anti-theft authentication, controlling the vehicle to be powered on; meanwhile, acquiring a software version number of the electronic control unit ECU, and judging whether the software version number is lower than a cloud version number of the cloud server; and if so, determining that the vehicle meets the flash condition.
In the handshake authentication with the gateway GW, the vehicle-mounted TBox initiates a handshake request to the gateway GW so that the gateway GW feeds back a response signal according to the handshake request; when the vehicle-mounted TBox receives the response signal, a handshake key is fed back to the gateway GW, so that the gateway GW compares the handshake key with a decryption key in the electronic control unit ECU; and when the comparison result of the handshake key and the decryption key meets a preset result, the gateway GW completes handshake authentication.
In the anti-theft authentication with a keyless management system BCM/PEPS, a vehicle-mounted TBox initiates a power-on request to the keyless management system BCM/PEPS so as to enable the keyless management system BCM/PEPS to feed back an authentication signal; and when the vehicle-mounted TBox receives the authentication signal, feeding back an authentication key to the BCM/PEPS so as to enable the BCM/PEPS to complete anti-theft authentication.
It can be understood that when there is an upgrade request, the vehicle-mounted TBox is awakened by the upgrade task and initiates a handshake process, and at this time, the gateway GW is in a state of waiting for the handshake process. The handshake flow comprises four steps of handshake request, handshake response, handshake key and handshake result. The vehicle-mounted TBox firstly initiates a handshake request Check _ Requst message to the gateway GW, then the gateway GW sends a Check Seed message to the vehicle-mounted TBox, the vehicle-mounted TBox calculates a correct Key after receiving the Seed and sends the Check _ Key message to the gateway GW, the gateway GW compares the Key with the Key stored in the ECU of the gateway GW after receiving the Key, and the handshake state sends a corresponding value in the Check _ Response message according to the comparison result. After the handshake is successful, the vehicle-mounted TBox initiates a remote power-on request to the bus through the gateway GW, the vehicle-mounted TBox and the keyless management system BCM/PEPS perform anti-theft authentication, after the authentication is passed, the keyless management system BCM/PEPS controls the IG relay to be attracted and the IG state is fed back by the vehicle body controller BCM, and after the remote power-on awakens the whole vehicle, the vehicle-mounted TBox reads the software version number of the relevant electronic control unit ECU and judges whether the upgrading and updating are needed. And determining that the vehicle meets the flash condition if the upgrade is determined.
The OTA control module 12 is used for controlling the vehicle to enter an OTA mode when the vehicle meets the flash condition, downloading a data packet from a cloud server in the OTA mode, and issuing a flash instruction to an Electronic Control Unit (ECU) so as to enable the ECU to perform flash upgrading;
further, the OTA control module 12 includes:
the first flash unit 121 is configured to issue a flash instruction to the electronic control unit ECU when the vehicle meets a flash condition, so that the electronic control unit ECU performs flash upgrading.
In specific implementation, the vehicle is controlled to enter an OTA mode, the vehicle-mounted TBox downloads an upgrading data packet from the cloud server, a flash instruction is sent, and the gateway GW forwards the instruction to the corresponding electronic control unit ECU.
In order to ensure the integrity of data, the electronic control unit ECU needs to be upgraded according to the following procedures:
1. the ECU of the whole vehicle electronic control unit enters an extended session mode: the vehicle TBox sends a $10$03 instruction by using the functional addressing ID, and the gateway GW routes the message to each network segment;
2. the vehicle-mounted TBox sends $85$02 and $28$03 instructions to control the ECU communication and DTC recording functions of the whole vehicle;
3. sending a $27 command for secure access by the target electronic control unit ECU;
4. transmitting a drive program and verifying the downloading integrity of the drive program through a CRC algorithm;
5. after analyzing the initial byte and the data length in the data packet, the vehicle-mounted TBox sends an instruction to erase an APP program in the target electronic control unit ECU;
6. transmitting an APP program and verifying the data integrity of the APP through a CRC algorithm;
7. the vehicle-mounted TBox sends a $11 instruction to reset the target electronic control unit ECU;
8. the vehicle TBox sends $28, $85 instruction to restore the ECU communication and DTC recording functions of the whole vehicle electronic control unit.
The obtaining module 13 is configured to, after the electronic control unit ECU succeeds in flashing, read a software version number of the electronic control unit ECU, and determine whether the software version number is consistent with the data packet;
further, the obtaining module 13 includes:
the version number reading unit 131 is used for reading the software version number of the electronic control unit ECU and transmitting the software version number after the electronic control unit ECU succeeds in writing;
a version number determining unit 132, configured to receive the software version number, compare the software version number with the data packet, and determine whether the software version number is consistent with the data packet.
In specific implementation, after the flash is finished, the vehicle-mounted TBox reads the software version number of the target electronic control unit ECU, and judges whether the software version number is consistent with the data packet or not.
It should be noted that, after the electronic control unit ECU fails to write by flash, the vehicle-mounted TBox controls the vehicle to enter a rewrite mode, and in the rewrite mode, the data packet is repeatedly written into the electronic control unit ECU; and when the electronic control unit ECU fails in three-time flash writing, controlling the vehicle to enter a rollback mode, and in the rollback mode, flashing original version data into the electronic control unit ECU.
And the rollback control module 14 is configured to control the vehicle to enter a rollback mode when the software version number is inconsistent with the data packet, and in the rollback mode, flush the old version data into the electronic control unit ECU.
Further, the rollback control module 14 includes:
the control unit 141 is configured to control the vehicle to enter a rollback mode when the software version number is inconsistent with the data packet;
and a second brushing unit 142, configured to brush the old and old version data into the electronic control unit ECU in the rollback mode.
In specific implementation, if the software version number is consistent with the cloud package, the information of successful upgrade of the electronic control unit ECU is fed back, and the vehicle-mounted TBox controls the keyless management system BCM/PEPS to perform power-off operation to wait for the whole vehicle to sleep.
And if the software version number is inconsistent with the data packet, the vehicle-mounted TBox controls the vehicle to enter a rollback mode again, and the original and old version data is refreshed into the target electronic control unit ECU.
The functions or operation steps of the modules and units when executed are substantially the same as those of the method embodiments, and are not described herein again.
In summary, in the OTA flashing system in the above embodiments of the present invention, the determining module 11 determines whether the vehicle meets the flashing condition, and stores the original version data, when the vehicle meets the flashing condition, the OTA control module 12 controls the ECU to perform the flashing update, and when the ECU succeeds in the flashing, the obtaining module 13 compares the software version number in the electronic control unit ECU after the flashing with the data packet to determine whether the flashing succeeds, and when the flashing fails, the rollback control module 14 can directly flush the original version data into the ECU, so as to avoid the loss of the original version data due to the failed flashing. The problem of among the prior art, the in-process of whole car OTA flash can't store former version data, can't get back to the old version after leading to the flash failure, exist and lose data is solved.
EXAMPLE III
The present invention also provides a vehicle, please refer to fig. 4, which shows a vehicle according to a third embodiment of the present invention, comprising a processor 10, a memory 20, and a computer program 30 stored on the memory 20 and operable on the processor 10, wherein the vehicle comprises an on-board controller 40 for controlling the vehicle, and the processor executes the program to implement the OTA brushing method as described above.
In specific implementation, when an upgrade request of a cloud server is received, the processor 10 determines whether the vehicle meets a flash condition, and controls the on-board controller 40 to control the vehicle according to different results.
Wherein the different results include:
when the vehicle meets the flash condition, the vehicle-mounted controller 40 controls the vehicle to enter an OTA mode, downloads a data packet from a cloud server in the OTA mode, and issues a flash instruction to an Electronic Control Unit (ECU) so that the ECU performs flash upgrading; after the electronic control unit ECU is successfully written, the vehicle-mounted controller 40 reads the software version number of the electronic control unit ECU and judges whether the software version number is consistent with the data packet; if the software version number is consistent with the data packet, the vehicle-mounted controller 40 controls the vehicle to enter a rollback mode, and in the rollback mode, the original and old version data is flushed into the electronic control unit ECU.
When the vehicle does not meet the flash condition, the vehicle-mounted controller 40 controls the vehicle not to enter the OTA mode and feeds back the OTA mode to the cloud server.
In some embodiments, the processor 10 may be an Electronic Control Unit (ECU), a Central Processing Unit (CPU), a controller, a microcontroller, a microprocessor or other data Processing chip, and is configured to run program codes stored in the memory 20 or process data, such as executing an access restriction program.
The memory 20 includes at least one type of readable storage medium, which includes a flash memory, a hard disk, a multimedia card, a card type memory (e.g., SD or DX memory, etc.), a magnetic memory, a magnetic disk, an optical disk, and the like. The memory 20 may in some embodiments be an internal storage unit of the vehicle, such as a hard disk of the vehicle. The memory 20 may also be an external storage device of the vehicle in other embodiments, such as a plug-in hard disk provided on the vehicle, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like. Further, the memory 20 may also include both an internal storage unit and an external storage device of the vehicle. The memory 20 may be used not only to store application software installed in the vehicle and various types of data, but also to temporarily store data that has been output or will be output.
It should be noted that the configuration shown in fig. 4 is not intended to be limiting to vehicles, and in other embodiments, the vehicle may include fewer or more components than shown, or some components may be combined, or a different arrangement of components.
In summary, in the vehicle in the above embodiment of the present invention, whether the vehicle performs OTA refresh is determined by determining whether the vehicle satisfies a refresh condition, and after the electronic control unit ECU successfully refreshes the vehicle, whether the vehicle succeeds in the refresh is determined by comparing the software version number in the electronic control unit ECU after the refresh with the data packet. The problem of among the prior art, the in-process of whole car OTA flash can't store former version data, can't get back to the old version after leading to the flash failure, exist and lose data is solved.
An embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the OTA flashing method described above.
Those of skill in the art will understand that the logic and/or steps represented in the flowcharts or otherwise described herein, e.g., an ordered listing of executable instructions that can be viewed as implementing logical functions, can be embodied in any computer-readable medium for use by or in connection with an instruction execution system, apparatus, or device, such as a computer-based system, processor-containing system, or other system that can fetch the instructions from the instruction execution system, apparatus, or device and execute the instructions. For the purposes of this description, a "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device.
More specific examples (a non-exhaustive list) of the computer-readable medium would include the following: an electrical connection (electronic device) having one or more wires, a portable computer diskette (magnetic device), a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). Additionally, the computer-readable medium could even be paper or another suitable medium upon which the program is printed, as the program can be electronically captured, via for instance optical scanning of the paper or other medium, then compiled, interpreted or otherwise processed in a suitable manner if necessary, and then stored in a computer memory.
It should be understood that portions of the present invention may be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, the various steps or methods may be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, any one or combination of the following techniques, which are known in the art, may be used: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application specific integrated circuit having an appropriate combinational logic gate circuit, a Programmable Gate Array (PGA), a Field Programmable Gate Array (FPGA), or the like.
In the description herein, references to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., mean that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, the schematic representations of the terms used above do not necessarily refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
The above-mentioned embodiments only express several embodiments of the present invention, and the description thereof is more specific and detailed, but not construed as limiting the scope of the present invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the inventive concept, which falls within the scope of the present invention. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (9)

1. An OTA flash method applied to a vehicle-mounted TBox of a vehicle, wherein the vehicle further comprises an Electronic Control Unit (ECU), the method comprising:
when an upgrading request of a cloud server is received, judging whether the vehicle meets a writing condition;
if yes, controlling the vehicle to enter an OTA mode, downloading a data packet from a cloud server in the OTA mode, and issuing a flash instruction to an Electronic Control Unit (ECU) to enable the ECU to perform flash upgrading;
after the electronic control unit ECU is successfully written, reading the software version number of the electronic control unit ECU, and judging whether the software version number is consistent with the data packet or not;
if not, controlling the vehicle to enter a rollback mode, and brushing original and old version data into the electronic control unit ECU in the rollback mode.
2. The OTA brush-writing method of claim 1 wherein the step of determining whether the vehicle meets a brush-writing condition comprises:
acquiring a software version number of the electronic control unit ECU, and judging whether the software version number is lower than a cloud version number of the cloud server;
and if so, determining that the vehicle meets the flash condition.
3. The OTA flashing method of claim 1, further comprising:
and when the electronic control unit ECU fails in the flashing, controlling the vehicle to enter a rollback mode, and flashing original version data into the electronic control unit ECU in the rollback mode.
4. An OTA flashing method according to claim 2 wherein the step of obtaining the software version number of the electronic control unit ECU is preceded by the step of:
performing handshake authentication with a gateway GW;
after finishing handshake authentication, the gateway GW performs anti-theft authentication with a keyless management system (BCM/PEPS);
and when the BCM/PEPS completes the anti-theft authentication, controlling the vehicle to be powered on.
5. The OTA flash method of claim 4, wherein the step of performing handshake authentication with the gateway GW further comprises:
initiating a handshake request to the gateway GW to enable the gateway GW to feed back a response signal according to the handshake request;
when the response signal is received, feeding back a handshake key to the gateway GW to enable the gateway GW to compare with a decryption key in the electronic control unit ECU according to the handshake key;
and when the comparison result of the handshake key and the decryption key meets a preset result, the gateway GW completes handshake authentication.
6. The OTA flash method of claim 4, wherein the step of performing anti-theft authentication with the BCM/PEPS further comprises:
initiating a power-on request to the BCM/PEPS so as to enable the BCM/PEPS to feed back an authentication signal;
and when the authentication signal is received, feeding back an authentication key to the BCM/PEPS so as to enable the BCM/PEPS to complete anti-theft authentication.
7. An OTA flash system for use with an onboard TBox for a vehicle, the system comprising:
the judging module is used for judging whether the vehicle meets the flash condition or not when an upgrading request of the cloud server is received;
the OTA control module is used for controlling the vehicle to enter an OTA mode when the vehicle meets the flash condition, downloading a data packet from a cloud server in the OTA mode, and issuing a flash instruction to an Electronic Control Unit (ECU) so as to enable the ECU to perform flash upgrading;
the acquisition module is used for reading the software version number of the electronic control unit ECU after the electronic control unit ECU is successfully written, and judging whether the software version number is consistent with the data packet or not;
and the rollback control module is used for controlling the vehicle to enter a rollback mode when the software version number is inconsistent with the data packet, and brushing the original version data into the electronic control unit ECU in the rollback mode.
8. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the OTA flashing method as claimed in any of the claims 1 to 6.
9. A vehicle comprising a processor, a memory, and a computer program stored on the memory and executable on the processor, wherein the vehicle comprises an onboard controller to control the vehicle, and wherein the processor, when executing the program, implements the OTA swipe method of any one of claims 1-6.
CN202110592939.1A 2021-05-28 2021-05-28 OTA (over the air) flashing method, OTA flashing system, readable storage medium and vehicle Active CN113448604B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110592939.1A CN113448604B (en) 2021-05-28 2021-05-28 OTA (over the air) flashing method, OTA flashing system, readable storage medium and vehicle

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110592939.1A CN113448604B (en) 2021-05-28 2021-05-28 OTA (over the air) flashing method, OTA flashing system, readable storage medium and vehicle

Publications (2)

Publication Number Publication Date
CN113448604A true CN113448604A (en) 2021-09-28
CN113448604B CN113448604B (en) 2023-03-31

Family

ID=77810321

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110592939.1A Active CN113448604B (en) 2021-05-28 2021-05-28 OTA (over the air) flashing method, OTA flashing system, readable storage medium and vehicle

Country Status (1)

Country Link
CN (1) CN113448604B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113612804A (en) * 2021-10-08 2021-11-05 江铃汽车股份有限公司 Vehicle configuration upgrading method and system, storage medium and intelligent gateway
CN114363385A (en) * 2021-12-28 2022-04-15 重庆长安新能源汽车科技有限公司 Method, system, equipment and storage medium for cloud updating of automobile end software
CN115146280A (en) * 2022-06-28 2022-10-04 重庆长安汽车股份有限公司 OTA (over the air) security upgrading method and system for whole vehicle ECU (electronic control Unit)
WO2024197570A1 (en) * 2023-03-28 2024-10-03 华为技术有限公司 Upgrading detection method and device

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110032382A (en) * 2019-03-25 2019-07-19 深圳猛犸电动科技有限公司 A kind of vehicle electronic control unit upgrade method, system and terminal device
CN110471680A (en) * 2019-07-23 2019-11-19 武汉格罗夫氢能汽车有限公司 Control method for the upgrading of hydrogen energy automobile controller software and failure rollback
US20200174779A1 (en) * 2018-11-30 2020-06-04 Paccar Inc Error-resilient over-the-air software updates for vehicles
CN111385191A (en) * 2018-12-28 2020-07-07 联合汽车电子有限公司 Vehicle-mounted interconnected gateway, vehicle OTA upgrading system and method and computer storage medium
CN111782234A (en) * 2019-04-04 2020-10-16 北京新能源汽车股份有限公司 Vehicle-mounted software flashing method, control device, central processing unit and automobile
CN111930407A (en) * 2020-10-19 2020-11-13 广州汽车集团股份有限公司 Vehicle ECU software upgrading method and system, vehicle TBOX microcontroller and SOC terminal
CN112104702A (en) * 2020-08-18 2020-12-18 广州汽车集团股份有限公司 Power supply management method for vehicle TBOX, and medium
CN112612490A (en) * 2020-12-17 2021-04-06 华人运通(上海)云计算科技有限公司 Vehicle upgrading method, vehicle and storage medium

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20200174779A1 (en) * 2018-11-30 2020-06-04 Paccar Inc Error-resilient over-the-air software updates for vehicles
CN111385191A (en) * 2018-12-28 2020-07-07 联合汽车电子有限公司 Vehicle-mounted interconnected gateway, vehicle OTA upgrading system and method and computer storage medium
CN110032382A (en) * 2019-03-25 2019-07-19 深圳猛犸电动科技有限公司 A kind of vehicle electronic control unit upgrade method, system and terminal device
CN111782234A (en) * 2019-04-04 2020-10-16 北京新能源汽车股份有限公司 Vehicle-mounted software flashing method, control device, central processing unit and automobile
CN110471680A (en) * 2019-07-23 2019-11-19 武汉格罗夫氢能汽车有限公司 Control method for the upgrading of hydrogen energy automobile controller software and failure rollback
CN112104702A (en) * 2020-08-18 2020-12-18 广州汽车集团股份有限公司 Power supply management method for vehicle TBOX, and medium
CN111930407A (en) * 2020-10-19 2020-11-13 广州汽车集团股份有限公司 Vehicle ECU software upgrading method and system, vehicle TBOX microcontroller and SOC terminal
CN112612490A (en) * 2020-12-17 2021-04-06 华人运通(上海)云计算科技有限公司 Vehicle upgrading method, vehicle and storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
GUOYONG SHI 等: "A vehicle electric control unit over-the-air reprogramming system" *
谭凡: "智能网联汽车FOTA系统安全机制的研究与实现" *

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113612804A (en) * 2021-10-08 2021-11-05 江铃汽车股份有限公司 Vehicle configuration upgrading method and system, storage medium and intelligent gateway
CN113612804B (en) * 2021-10-08 2021-12-14 江铃汽车股份有限公司 Vehicle configuration upgrading method and system, storage medium and intelligent gateway
CN114363385A (en) * 2021-12-28 2022-04-15 重庆长安新能源汽车科技有限公司 Method, system, equipment and storage medium for cloud updating of automobile end software
CN114363385B (en) * 2021-12-28 2023-05-23 重庆长安新能源汽车科技有限公司 Method, system, equipment and storage medium for updating automobile end software by cloud
CN115146280A (en) * 2022-06-28 2022-10-04 重庆长安汽车股份有限公司 OTA (over the air) security upgrading method and system for whole vehicle ECU (electronic control Unit)
WO2024197570A1 (en) * 2023-03-28 2024-10-03 华为技术有限公司 Upgrading detection method and device

Also Published As

Publication number Publication date
CN113448604B (en) 2023-03-31

Similar Documents

Publication Publication Date Title
CN113448604B (en) OTA (over the air) flashing method, OTA flashing system, readable storage medium and vehicle
US10678454B2 (en) Vehicle information communication system
CN112470118B (en) Vehicle electronic control system and program update consent determination method
US20190361696A1 (en) Control apparatus, program update method, and computer program
CN111385191A (en) Vehicle-mounted interconnected gateway, vehicle OTA upgrading system and method and computer storage medium
CN111061499A (en) ECU updating method and system based on file system
CN102135922B (en) The method for refreshing of application program and system
CN107450518A (en) A kind of program upgrade apparatus and its control method based on vehicle-mounted Ethernet framework
CN107132788A (en) A kind of vehicle electronic control unit writes with a brush dipped in Chinese ink method and apparatus automatically
CN113613953A (en) In-vehicle update device, update processing program, and program update method
CN102103511A (en) Method and system for refreshing application program
CN108241494A (en) Vehicle Electronic Control Unit upgrade method, device, vehicle control electronics and vehicle
CN111782234A (en) Vehicle-mounted software flashing method, control device, central processing unit and automobile
US20060218340A1 (en) Data validity determining method for flash EEPROM and electronic control system
CN113094072A (en) Vehicle upgrading method and device, electronic device and storage medium
CN109086058A (en) Onboard program upgrade-system
US20240069905A1 (en) Vehicular electronic control device, vehicular electronic control system, and updated configuration information determination program
US12087103B2 (en) Electronic control unit and non-transitory computer readable medium storing session establishment program
CN102033765B (en) BCM (Body Control Module) program upgrading method and vehicle-mounted electronic control system upgrading method
CN115543395A (en) Vehicle-mounted ECU upgrading method and device, electronic equipment and storage medium
CN114281374A (en) Remote flash method and system for vehicle electronic control unit and storage medium
CN111831324A (en) Rail transit control device parameter configuration method based on functional safety
US20220405080A1 (en) Ota master, system, method, non-transitory storage medium, and vehicle
CN116866172A (en) Diagnostic flashing system, method, device and medium in automobile OTA upgrading process
CN116400944A (en) Vehicle system refreshing method and device, electronic equipment, vehicle and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant