Vehicle-mounted system and vehicle software updating method
By using the communication unit and control unit of the on-board system for data verification in the online upgrade of vehicle software, the problems of data loss, tampering and unreliable sources are solved, ensuring the reliability and security of vehicle software updates.
Patent Information
- Application Number
- CN202310524191.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-10
- Publication Date
- 2024-11-12
AI Technical Summary
During the online upgrade of vehicle software, there is a risk of data loss, data tampering or data replacement, resulting in the received software update version being unavailable, and the source of the updated version is unreliable and the configuration information is mismatched.
A vehicle-mounted system is designed, including a communication unit and a control unit. By verifying message frames during reception, the correctness, integrity, source reliability and matching configuration information are ensured, and the message authentication code is used. Signature checksum hybrid verification and other methods ensure the reliability and security of software updates.
It effectively prevents data tampering and source mismatch, ensures the reliability and security of vehicle software updates, and improves the trustworthiness of online upgrades.
Smart Images

Figure CN118945642A_ABST
Abstract
Description
Technical Field
[0001] In general, the present invention relates to the technical field of vehicle over-the-air (OTA) downloading. Specifically, the present invention relates to a vehicle-mounted system for updating vehicle software, and also to a vehicle software updating method and a corresponding machine-readable storage medium. Background Art
[0002] As vehicles become more intelligent and connected, over-the-air (OTA) technology will be widely used for online upgrades of vehicle software (for example, what is commonly referred to as "flashing the vehicle ECU"). The biggest difference between OTA vehicle software upgrades and existing vehicle software upgrades is that the communication environment has changed. Existing vehicle software upgrades usually involve sending the vehicle to a predetermined location for offline updates. The OTA method uses communication between the vehicle and external nodes such as cloud servers for online updates. In this way, one of the difficulties of vehicle OTA technology is to verify the availability and integrity of the software update version received by the vehicle. This is because malicious attacks are likely to occur during data transmission via OTA, such as data loss, data tampering, or data replacement, which may result in the software update version received by the vehicle being unusable. Summary of the invention
[0003] In this context, one aspect of the present invention provides an in-vehicle system for updating vehicle software. The in-vehicle system includes a communication unit configured to communicate with an external node storing an updated version of the vehicle software to receive a message frame of the updated version. The in-vehicle system also includes a control unit configured to: during the process of receiving the message frame of the updated version to the vehicle, verify at least part of the received message frames to verify the correctness of the data during the receiving process; if the verification during the receiving process passes, allow the communication unit to continue to receive new message frames; after all message frames of the updated version are received to the vehicle, perform a hybrid verification on the updated version, wherein the hybrid verification includes verifying the data integrity, source reliability and matching of the configuration information of the updated version; and if the hybrid verification passes, allow the updated version to be installed in the vehicle.
[0004] In one embodiment, the control unit is configured to verify the correctness of the data during the receiving process based on the data transmission mode between the communication unit and the external node and the data type of the received message frame.
[0005] In one embodiment, the control unit is configured as follows: if the data type of the received message frame is software code, and the data transmission mode between the communication unit and the external node is normal mode or sequential mode, a message authentication code is used to verify the correctness of the data during the receiving process and perform authentication; if the data type of the received message frame is software code, and the data transmission mode between the communication unit and the external node is parallel mode, a message authentication code or signature check is used to verify the correctness of the data during the receiving process; and if the data type of the received frame message is vehicle configuration information, and the data transmission mode between the communication unit and the external node is normal mode or sequential mode, a signature check is used to verify the correctness of the data during the receiving process.
[0006] In one embodiment, when each of the multiple verifications of the hybrid verification passes, the hybrid verification passes, and when at least one of the multiple verifications fails, the hybrid verification fails.
[0007] In one embodiment, verifying the data integrity of the updated version includes: when the value calculated by the predetermined algorithm is equal to the predetermined value, the verification is passed; and when the value calculated by the predetermined algorithm is not equal to the predetermined value, the verification is failed. For example, the integrity of the software is verified by using a hash method or other similar functional algorithms.
[0008] In one embodiment, verifying the reliability of the source of the updated version includes: verifying the signature representing the source of the updated version. If the signature verification passes, the verification passes; if the signature verification fails, the verification fails. For example, a public key is stored in the vehicle ECU, and the public key is used to verify the signature signed with the private key in the software package. The signature includes, for example, one or more of the following: a signature determined by the supplier (i.e., a signature provided only by the supplier), a signature determined by the vehicle manufacturer (i.e., a signature provided only by the vehicle manufacturer), and a signature jointly determined by the supplier and the vehicle manufacturer (i.e., a signature determined after negotiation between the supplier and the vehicle manufacturer).
[0009] In one embodiment, verifying the matching of the configuration information in the updated version includes: verifying the signature of the configuration information. If the signature verification passes, it means that the configuration information is available (for example, the vehicle brand and model match), and the verification passes; if the signature verification fails, it means that the configuration information is not available (for example, the vehicle brand and / or model do not match), and the verification fails. For example, a public key is stored in the vehicle ECU, and the signature signed with the private key in the software package is verified using the public key.
[0010] In one embodiment, the control unit is also configured to verify the correctness of the data during the receiving process in one of the following ways: during the receiving process, verify each received frame of the message; and during the receiving process, verify part of the received message frames, and optionally, verify the first frame of the message or the last frame of the message in the multi-frame message received within a predetermined time length.
[0011] In one embodiment, the control unit is further configured to: when the verification fails during the receiving process, control the communication unit to send a request message for requesting to resend the message frame that fails the verification to the external node;
[0012] The received and resent message frames are verified for data correctness again; if the verification passes, the communication unit is allowed to receive new message frames; and if the verification fails, the vehicle software update is exited.
[0013] According to another aspect of the present invention, a vehicle software updating method is provided, which is optionally executed by the vehicle-mounted system as described above, and the method includes: receiving a message frame of an updated version of the vehicle software from an external node to the vehicle; in the process of receiving the message frame of the updated version to the vehicle, verifying the data correctness of at least part of the received message frame; if the verification in the receiving process passes, allowing the communication unit to continue to receive new message frames; after all message frames of the updated version are received to the vehicle, performing a hybrid verification on the updated version, wherein the hybrid verification includes verifying the data integrity, source reliability and matching of configuration information of the updated version; and if the hybrid verification passes, allowing the updated version to be installed in the vehicle.
[0014] According to yet another aspect of the present invention, a computer-readable medium is provided, storing a computer program, wherein when the computer program is executed by a processor, the processor executes the method as described above. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] The technical solution of the present invention will be more clearly understood according to the following detailed description in conjunction with the accompanying drawings. It is understood that these drawings are only used for exemplary description and are not intended to limit the protection scope of the present invention.
[0016] Figure 1 is a schematic block diagram of an in-vehicle system for updating vehicle software according to an embodiment of the present invention.
[0017] Figure 2 is a flow chart of a vehicle software updating method according to an embodiment of the present invention. DETAILED DESCRIPTION
[0018] The inventors have found that when the vehicle software is updated by OTA, the updated version of the vehicle software received by the vehicle may be tampered with. Moreover, the updated version received by the vehicle may not be released by the correct supplier (e.g., a pre-agreed supplier). Moreover, the vehicle configuration information in the updated version (e.g., vehicle parameters applicable to the brand and model of the vehicle) may not match the vehicle.
[0019] In this regard, the present invention proposes an on-vehicle system and method for updating vehicle software. According to an embodiment of the present invention, first, in the process of receiving the message frame of the updated version of the vehicle software to the vehicle, at least part of the received message frames are verified to ensure the correctness of the data in the receiving process. If the verification in the receiving process passes, it is allowed to continue to receive new message frames. After all message frames are received by the vehicle, the integrity and source reliability of the entire package data of the updated version are verified, and the matching of the configuration information in the updated version with the vehicle is verified. If all verifications are passed, the software update version received by the vehicle is allowed to be installed in the vehicle, thereby improving the reliability and security of the vehicle software update.
[0020] In addition, the vehicle software updating method according to the embodiment of the present invention can be embedded in relevant industry standards, national standards and international standards for diagnostic communications in the automotive industry and can be widely applicable.
[0021] The specific implementation of the present invention is described below in conjunction with the accompanying drawings.
[0022] Figure 1 An in-vehicle system 100 for vehicle software update according to an embodiment of the present invention is shown, which is disposed on a vehicle V (ie, the vehicle itself) and includes: a communication unit 10 and a control unit 20 .
[0023] The communication unit 10 can communicate with an external node N of the vehicle V so as to receive an updated version of the vehicle software from the external node N. The communication method between the communication unit 10 and the external node N can adopt a wired and / or wireless communication method. The communication method between the communication unit 10 and the external node N can be adaptively selected according to the communication distance and communication environment between the two.
[0024] It can be understood that the communication between the communication unit 10 and the external node N includes direct communication between the two and indirect communication through other nodes. For example, the external node N communicates with the node X in the vehicle body network and sends a message to the node X, and forwards the message to the communication unit 10 via the node X. The situation in this example is that the communication unit 10 cannot communicate with the external node N, but can communicate with the node X in the vehicle body network that can communicate with the external node N.
[0025] The external node N stores an updated version of the software of the vehicle V. Here, software should be broadly understood to include firmware. The updated version of the vehicle software includes, for example, an upgrade program and a firmware patch program for the vehicle ECU. Specifically, the updated version of the vehicle software may be an upgrade program for the vehicle steering system, an optimization program for the accelerator pedal response, or an interface update program for the multimedia system.
[0026] The external node N is, for example, a cloud server, an edge server, other connected vehicles in the Internet of Vehicles other than the vehicle V, or a smart device of a user of the vehicle V. It should be understood that the external node N means that the node is not a component of the vehicle V, and does not limit the physical location of the node relative to the vehicle V. The node can be located in the vehicle V, for example, when the node is implemented as a user's smartphone, the user carries his smartphone in the vehicle V. The node can also be located outside the vehicle V, for example, when the node is implemented as a cloud server.
[0027] The control unit 20 is used to verify the software update version of the vehicle received by the communication unit 10 from the external node N, so as to ensure the correctness of the data during the transmission process, as well as the integrity of the whole package data, the reliability of the source and the matching of the configuration information. If all the verifications are passed, the update version is allowed to be installed in the vehicle. In this way, the availability of the software update version installed in the vehicle can be ensured.
[0028] The control unit 20 can be implemented in hardware or software or a combination of software and hardware. For the hardware-implemented part, it can be implemented in one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), processors, controllers, microcontrollers, microprocessors, electronic units designed to perform their functions, or a combination thereof. For the software-implemented part, it can be implemented with the aid of microcodes, program codes, or code segments, and can also be stored in a machine-readable storage medium such as a storage component.
[0029] In one embodiment, the control unit 20 may be implemented as including a memory and a processor. Instructions are stored in the memory, and when the instructions are executed by the processor, the processor executes the vehicle software update method according to the embodiment of the present invention.
[0030] In one embodiment, the control unit 20 can be set in an electronic control unit (ECU) of the vehicle V, or in a domain controller of the vehicle V, or in a vehicle control unit (VCU) of the vehicle V.
[0031] Figure 2A vehicle software update method 200 according to an embodiment of the present invention is shown. The method 200 can be executed by the vehicle system 100 and / or the control unit 20, so the above description of the vehicle system 100 and the control unit 20 is also applicable here.
[0032] In block 202 , the communication unit 10 receives a frame message of an updated version of vehicle software from an external node N. The external node N transmits message frames to the communication unit 10 (i.e., transmits data) in the following modes: Normal mode, Sequential mode, and Parallel mode.
[0033] In one embodiment, the above three modes can be defined by flashing. Specifically, the normal mode means: before transmitting data, perform a memory erase action (1 or more sectors), and then request data. The process includes: memory erase → request download → transmit data → end of transmission and exit. The process of sequential mode includes: memory erase (1 sector) → transmit data → end of transmission and exit (terminate after 1 sector ends). The parallel mode means: before transmitting data, perform a memory erase action (1 sector), and then request data. Then, data transmission and download are performed, and at the same time, a memory erase action (the next sector to be written) is performed. That is, data transmission and memory erasure are performed simultaneously.
[0034] It is understood that the software update version includes a predetermined number of message frames according to its size. Each message frame can be assigned a transmission timestamp. The external node N sends the software update version to the vehicle V in the form of a message frame.
[0035] In block 204 , the control unit 20 acquires the message frame received to the own vehicle from the communication unit 10 via the vehicle bus (eg, CAN bus).
[0036] In block 206 , the control unit 20 verifies at least a portion of the message frame received from the vehicle during the process in which the communication unit 10 receives the message frame of the software update version from the external node N, so as to verify the correctness of the data during the receiving process.
[0037] In one embodiment, the control unit 20 determines the verification method according to the data transmission mode between the external node N and the communication unit 10 and the data type of the received message frame, and uses the determined verification method to verify the correctness of the data in the receiving process. For example, if the data type of the received message frame is software code, and the data transmission mode between the communication unit 10 and the external node N is normal mode or sequential mode, a message authentication code (MAC) is used to verify the correctness of the message frame. If the data type of the received message frame is software code, and the data transmission mode between the communication unit 10 and the external node N is parallel mode, a message authentication code (MAC) or a signature check (Signature) is used to verify the correctness of the message frame. If the data type of the received frame message is vehicle configuration information, and the data transmission mode between the communication unit 10 and the external node N is normal mode or sequential mode, a signature check (Signature) is used to verify the correctness of the message frame.
[0038] A message authentication code (MAC) or a signature check (Signature) is used to verify the correctness of the data during the transmission process, that is, the data during the transmission process has not been tampered with. It should be noted that the present invention does not limit the specific implementation of the message authentication code (MAC) or the signature check (Signature) verification method.
[0039] This hybrid verification has the advantage of not being easily attacked. In addition, different verification methods require different time lengths, and the appropriate verification method can be selected based on the different requirements for verification time length in specific application scenarios.
[0040] If the verification in block 206 passes, the method 200 proceeds to block 208. In block 208, the control unit 20 allows the communication unit 10 to receive new message frames. Then, the communication unit 10 continues to receive new message frames.
[0041] In one embodiment, the control unit 20 may perform the above verification on each received message frame. The control unit 20 may also perform the above verification on only part of the received message frames. For example, the control unit 20 performs the above verification on the first or last frame of a multi-frame message received within a predetermined time (e.g., 5 seconds or 10 seconds).
[0042] In block 210, after receiving all message frames of the software update version to the vehicle, the control unit 20 performs a hybrid verification on the update version. The hybrid verification includes: verifying the data integrity of the received update version, verifying the source reliability of the received update version, and verifying the matching of the vehicle configuration information in the received update version. If each of the three verifications passes, the hybrid verification passes. If at least one of the three verifications fails, the hybrid verification fails.
[0043] In one embodiment, the data integrity of the received update version is verified to determine whether data loss or data tampering has occurred. When the value calculated by the predetermined algorithm is equal to the predetermined value, the verification is passed; and when the value calculated by the predetermined algorithm is not equal to the predetermined value, the verification is not passed. The integrity of the software can be verified by hashing or other similar functional algorithms. For example, after the software package is hashed, a fixed-length value is output, which is similar to compression, but irreversible. Only when the software packages are the same, an equal fixed-length value will be obtained after hashing.
[0044] In one embodiment, the source reliability of the received update version is verified to determine whether the update version is released by a predetermined supplier (e.g., a predetermined Tier 1 manufacturer). For example, verifying the source reliability of the received update version includes the following steps: verifying whether the signature representing the source of the update version (e.g., the signature of a Tier 1 manufacturer) is consistent with the software supplier signature pre-stored in the vehicle (e.g., the signature of the predetermined Tier 1 manufacturer). If the two signatures are consistent, the verification is passed. If the two signatures are inconsistent, the verification is not passed.
[0045] In one embodiment, the matching of the vehicle configuration information in the updated version is verified to determine whether the configuration information matches the brand and model of the vehicle, thereby avoiding incorrect configuration of vehicle parameters of other brands or other models for the vehicle (e.g., target wheelbase, target braking force, etc.). Verifying the matching of the vehicle configuration information in the updated version may include the following steps: verifying whether the signature of the configuration object (e.g., OEM signature and / or a certain model signature) representing the configuration information in the updated version is consistent with the signature of the configuration object pre-stored in the vehicle (e.g., a predetermined OEM signature and / or a predetermined model signature). If the two signatures are consistent, the verification is passed. If the two signatures are inconsistent, the verification fails.
[0046] If each verification of the hybrid verification in the frame 210 is passed, the method 200 proceeds to the frame 212. In the frame 212, the control unit 20 allows the software update version received by the host vehicle to be installed in the host vehicle.
[0047] If at least one of the hybrid verifications in box 210 fails, the method 200 proceeds to box 214. In box 214, the control unit 20 prohibits the received vehicle software update version from being installed in the vehicle. In addition, in the case, the control unit 20 can also control the human-machine interface (HMI) of the vehicle V to issue a reminder to the vehicle user to remind the user that the software update version is unavailable. In one embodiment, the HMI reminds the user in a text reminder and / or a voice reminder.
[0048] If the verification in block 206 fails, that is, the verification during the receiving process fails, the method 200 proceeds to block 216. In block 216, the control unit 20 prohibits the communication unit 10 from receiving new message frames.
[0049] Next, in block 218, the control unit 20 generates a retransmission request to request the external node N to retransmit the message frame that has failed the verification.
[0050] In block 220 , the communication unit 210 transmits the generated retransmission request to the external node N to receive the retransmitted message frame from the external node N.
[0051] In block 222 , the control unit 20 acquires the retransmitted message frame received from the vehicle from the communication unit 10 .
[0052] In block 224, the control unit 20 performs the verification in block 206 on the retransmitted message frame, so as to verify the correctness of the data in the transmission process again.
[0053] If the verification in block 224 passes, the method proceeds to block 208 and then executes blocks 208 , 210 , and 212 or executes blocks 208 , 210 , and 214 .
[0054] If the verification in frame 224 fails, the method 200 enters frame 226. In frame 226, the control unit 20 terminates the vehicle software update. In addition, in this case, the HMI of the vehicle V can also provide the user with information that the vehicle software update failed.
[0055] In addition, if the verification in block 224 fails, the process of blocks 218-224 may be circulated again to verify the correctness of the data in the transmission process again. Here, a predetermined number of verification failures may be set, for example, 3 or 5 times. Once the number of verification failures reaches the predetermined number, the software update is terminated.
[0056] The present invention also provides a machine-readable storage medium storing executable instructions, which, when executed, enable one or more processors to perform the vehicle software update method 200 .
[0057] It is to be understood that the processor can be implemented using electronic hardware, computer software or any combination thereof. Whether these processors are implemented as hardware or software will depend on specific application and the overall design constraints imposed on the system. As an example, the processor provided in the present invention, any part of the processor or any combination of the processor can be implemented as a microprocessor, a microcontroller, a digital signal processor (DSP), a field programmable gate array (FPGA), a programmable logic device (PLD), a state machine, a gate logic, a discrete hardware circuit and other suitable processing components configured to perform the various functions described in the present disclosure. The function of the processor provided in the present invention, any part of the processor or any combination of the processor can be implemented as software performed by a microprocessor, a microcontroller, a DSP or other suitable platforms.
[0058] It is to be understood that software should be broadly considered to represent instructions, instruction sets, codes, code segments, program codes, programs, subroutines, software modules, applications, software applications, software packages, routines, subroutines, objects, running threads, processes, functions, etc. Software can reside in a computer-readable medium. A computer-readable medium can include, for example, a memory, which can be, for example, a magnetic storage device (e.g., a hard disk, a floppy disk, a magnetic stripe), an optical disk, a smart card, a flash memory device, a random access memory (RAM), a read-only memory (ROM), a programmable ROM (PROM), an erasable PROM (EPROM), an electrically erasable PROM (EEPROM), a register, or a removable disk. Although the memory is shown as being separated from the processor in the various aspects provided in the present disclosure, the memory can also be located inside the processor (e.g., a cache or a register).
[0059] Although some embodiments have been described above, these embodiments are given by way of example only and are not intended to limit the scope of the invention. The appended claims and their equivalents are intended to cover all modifications, substitutions and changes made within the scope and spirit of the invention.
Claims
1. A vehicle-mounted system for updating vehicle software, comprising: a communication unit configured to be communicatively connected to an external node storing an updated version of the vehicle software to receive a message frame of the updated version; as well as A control unit configured to: In the process of receiving the updated version of the message frame to the vehicle, verifying at least part of the received message frame to verify the correctness of the data in the receiving process; If the verification during the receiving process is passed, the communication unit is allowed to continue receiving new message frames; After receiving all message frames of the updated version to the vehicle, performing hybrid verification on the updated version, wherein the hybrid verification includes verifying the data integrity, source reliability and matching of configuration information of the updated version; and When the hybrid verification is passed, the updated version is allowed to be installed in the vehicle.
2. The vehicle-mounted system according to claim 1, wherein: The control unit is configured to: The correctness of the data in the receiving process is verified based on the data transmission mode between the communication unit and the external node and the data type of the received message frame.
3. The vehicle-mounted system according to claim 1 or 2, wherein: The control unit is configured to: If the data type of the received message frame is software code, and the data transmission mode between the communication unit and the external node is normal mode or sequential mode, a message authentication code is used to verify the correctness of the data during reception; If the data type of the received message frame is software code, and the data transmission mode between the communication unit and the external node is parallel mode, a message authentication code or signature check is used to verify the correctness of the data in the receiving process; as well as If the data type of the received frame message is vehicle configuration information, and the data transmission mode between the communication unit and the external node is normal mode or sequential mode, signature verification is used to verify the correctness of the data during the receiving process.
4. The vehicle-mounted system according to any one of claims 1 to 3, wherein: When each of the multiple verifications of the hybrid verification passes, the hybrid verification passes, and when at least one of the multiple verifications fails, the hybrid verification fails.
5. The vehicle-mounted system according to any one of claims 1 to 4, wherein: Verifying the data integrity of the updated version includes: comparing the value calculated based on the predetermined algorithm with a predetermined value; When the calculated value is equal to the predetermined value, the verification is passed; and When the calculated value is not equal to the predetermined value, the verification fails.
6. The vehicle-mounted system according to any one of claims 1 to 5, wherein: Verifying the authenticity of the source of the update version includes: Verifying the signature of the updated version indicating its source; If the signature verification passes, the verification passes; and If the signature verification fails, the verification fails.
7. The vehicle-mounted system according to claim 6, wherein: The signature indicating the source of the update version includes one or more of the following: Signature of supplier confirmation; Signature confirmed by the OEM; and Signature jointly determined by the supplier and the OEM.
8. The vehicle-mounted system according to any one of claims 1 to 7, wherein: Verifying the matching of the configuration information in the updated version includes: Verify the signature of the configuration information; If the signature verification passes, the verification passes; and If the signature verification fails, the verification fails.
9. The vehicle-mounted system according to any one of claims 1 to 8, wherein: The control unit is also configured to verify the correctness of the data during the receiving process by one of the following methods: During the receiving process, each received message frame is verified; as well as During the receiving process, some of the received message frames are verified. Optionally, the first frame message or the last frame message in multiple frame messages received within a predetermined time period is verified.
10. The vehicle-mounted system according to any one of claims 1 to 9, wherein: The control unit is also configured to: When the verification fails during the receiving process, the control communication unit sends a request message for requesting to resend the message frame that fails the verification to the external node; Verify the data correctness of the received and resent message frames again; If the verification is successful, the communication unit is allowed to receive new message frames; as well as If the verification fails, exit the vehicle software update.
11. A vehicle software updating method, optionally the method is executed by the vehicle-mounted system according to any one of claims 1 to 10, the method comprising: Receiving a message frame of an updated version of the vehicle software from an external node to the vehicle; In the process of receiving the updated version of the message frame to the vehicle, verifying the data correctness of at least part of the received message frame; If the verification during the receiving process is passed, the communication unit is allowed to continue receiving new message frames; After all message frames of the updated version are received by the vehicle, hybrid verification is performed on the updated version, wherein the hybrid verification includes verifying the data integrity, source reliability and matching of configuration information of the updated version; and When the hybrid verification is passed, the updated version is allowed to be installed in the vehicle.
12. A computer readable medium storing a computer program, which, when executed by a processor, causes the processor to perform the method according to claim 11.
