Program upgrading method and device, vehicle and storage medium

By compressing the upgrade files and writing them directly to the controller's backup area, the problem of slow upgrade speed of traditional OTAs is solved, and faster and more efficient program upgrades are achieved.

CN119668659APending Publication Date: 2025-03-21GUANGZHOU AUTOMOBILE GROUP CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411497256.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-24
Publication Date
2025-03-21

AI Technical Summary

Technical Problem

The traditional OTA remote upgrade method has a slow upgrade speed, resulting in insufficient program upgrade speed.

Method used

By compressing the upgrade file in advance, the controller receives the compressed upgrade file and writes it directly to the backup area for storage, reducing the transmission time and storage space requirements, while simplifying the file writing process.

Benefits of technology

It greatly improves the speed of program upgrade, reduces the time required for file writing, and optimizes the use of storage space.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119668659A_ABST
    Figure CN119668659A_ABST
Patent Text Reader

Abstract

The invention discloses a program upgrading method and device, a vehicle and a storage medium. The program upgrading method comprises the steps that a compressed upgrading file sent by remote equipment is received; writing the compressed upgrading file into a backup area corresponding to the controller; decompressing the compressed upgrading file in the backup area to an operation area corresponding to the controller; and performing program upgrading on the controller according to a decompressed file obtained by decompressing the compressed upgrading file in the running area. Thus, the upgrading file is compressed in advance, the controller receives the compressed upgrading file obtained through compression and directly writes the compressed upgrading file into the backup area corresponding to the controller, the requirement for the storage space of the backup area is reduced, meanwhile, the time needed for file transmission and writing is shortened, and therefore the program upgrading speed is greatly increased.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of vehicle technology, and more specifically, to a program upgrade method, device, vehicle and storage medium. Background Art

[0002] As car manufacturers introduce new features, fix security vulnerabilities or optimize product performance, the onboard controller needs to be updated from time to time, and usually uses online remote upgrade (Over the Air, OTA) technology to achieve rapid iteration and upgrade of vehicle programs. However, the traditional OTA remote upgrade method has a slow upgrade speed, so how to improve the program upgrade speed has become an important technical issue. Summary of the invention

[0003] The present application proposes a program upgrade method, device, vehicle and storage medium to improve the above-mentioned defects.

[0004] In a first aspect, an embodiment of the present application provides a program upgrade method, which is applied to a controller of a vehicle, comprising: receiving a compressed upgrade file sent by a remote device; writing the compressed upgrade file into a backup area corresponding to the controller; decompressing the compressed upgrade file in the backup area to an operating area corresponding to the controller; and performing a program upgrade on the controller according to a decompressed file in the operating area after decompressing the compressed upgrade file.

[0005] In the second aspect, an embodiment of the present application provides a program upgrade device, which is applied to a controller of a vehicle, including: a file receiving module, used to receive a compressed upgrade file sent by a remote device; a writing module, used to write the compressed upgrade file into a backup area corresponding to the controller; a decompression module, used to decompress the compressed upgrade file in the backup area to an operating area corresponding to the controller; and an upgrade module, used to perform a program upgrade on the controller according to a decompressed file in the operating area after decompressing the compressed upgrade file.

[0006] In a third aspect, an embodiment of the present application also provides a vehicle, comprising: one or more processors; a memory; one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs are configured to execute the above-mentioned method.

[0007] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, in which a program code is stored, and the program code can be called by a processor to execute the above method.

[0008] In the program upgrade method provided by the present application, the upgrade file is compressed in advance, and the controller receives the compressed upgrade file, thereby reducing the time required for file transmission, and the compressed upgrade file is directly written to the backup area corresponding to the controller for storage, thereby reducing the demand for storage space in the backup area. At the same time, it simplifies the process of first storing the upgrade file in the memory area and then synchronizing it to the backup area for storage, thereby reducing the time required for file writing and greatly improving the program upgrade speed.

[0009] Other features and advantages of the embodiments of the present application will be described in the subsequent description, and partly become apparent from the description, or can be understood by practicing the embodiments of the present application. The purposes and other advantages of the embodiments of the present application can be realized and obtained by the structures specifically pointed out in the written description, claims, and drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0010] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.

[0011] Figure 1 A schematic diagram of the hardware environment of a vehicle provided in an embodiment of the present application is shown.

[0012] Figure 2 A flowchart of a program upgrade method provided in an embodiment of the present application is shown.

[0013] Figure 3 A flowchart of a program upgrade method provided in another embodiment of the present application is shown.

[0014] Figure 4 Shows this application Figure 3 FIG. 5 is a flowchart of sub-steps of step S330 in one embodiment.

[0015] Figure 5 Shows this application Figure 3 A flowchart of the sub-steps of step S360 in another embodiment.

[0016] Figure 6 A structural block diagram of a program upgrading device provided in one embodiment of the present application is shown.

[0017] Figure 7 A structural block diagram of a vehicle provided in an embodiment of the present application is shown.

[0018] Figure 8A structural block diagram of a computer-readable storage medium provided in an embodiment of the present application is shown. DETAILED DESCRIPTION

[0019] In order to make those skilled in the art better understand the present application scheme, the technical scheme in the present application embodiment will be clearly and completely described below in conjunction with the drawings in the present application embodiment. Obviously, the described embodiment is only a part of the present application embodiment, rather than all the embodiments. The components of the present application embodiment usually described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the present application for protection, but merely represents the selected embodiment of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.

[0020] It should be noted that in some processes described in the specification, claims and the above-mentioned drawings of the present application, multiple operations that appear in a specific order are included, and these operations may not be executed or executed in parallel in the order in which they appear in this article. The sequence numbers of operations such as S110, S120, etc. are only used to distinguish different operations, and the sequence numbers themselves do not represent any execution order. In addition, these processes may include more or less operations, and these operations may be executed in sequence or in parallel. And, the terms "first", "second", etc. in the specification, claims and the above-mentioned drawings of the present application are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described here can be implemented in an order other than those illustrated or described here. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or server that includes a series of steps or sub-modules is not necessarily limited to those steps or sub-modules explicitly listed, but may include other steps or sub-modules that are not explicitly listed or that are inherent to these processes, methods, products, or devices.

[0021] See also Figure 1 , Figure 1 The schematic diagram of the hardware environment of a vehicle provided by an embodiment of the present application is shown. The vehicle 110 at least includes a controller 111 , and the controller 111 establishes a communication connection with a remote device 120 .

[0022] Optionally, based on online remote upgrade technology, the vehicle 110 is connected to the remote device 120 through a server, a mobile communication network, etc., and the program upgrade of the vehicle 110 controller 111 can be completed by clicking the upgrade on the interface, just like upgrading the mobile phone system. Compared with the traditional offline store after-sales program upgrade method, the online remote upgrade method can achieve rapid iterative upgrades of the program in the vehicle 110, which can largely avoid the recall of the vehicle 110 due to program failure, thereby reducing the upgrade and update cost of the vehicle 110 and improving the user experience.

[0023] In some embodiments, a compression tool is provided in the remote device 120, and the remote device 120 compresses the upgrade file using the compression tool to obtain a compressed upgrade file, and the controller 111 of the vehicle 110 receives the compressed upgrade file sent by the remote device 120 to complete the subsequent program upgrade work based on the received compressed upgrade file. Before transmitting the upgrade file to the controller 111, the upgrade file is pre-compressed in the remote device 120, and the compressed upgrade file is sent to the controller 111 of the vehicle 110, which can improve the transmission speed of the upgrade file, thereby improving the speed of the program upgrade.

[0024] In other embodiments, the compressed upgrade file is obtained by compressing the upgrade file by other devices that are communicatively connected to the remote device 120. When the vehicle 110 requests the upgrade file from the remote device 120, the remote device 120 is used to forward the compressed upgrade file obtained from other devices to the controller 111 of the vehicle 110.

[0025] In some embodiments, the vehicle 110 may also be provided with a communication connection system having a connection function, responsible for connecting to the remote device 120 , receiving and sending information to the remote device 120 , and transmitting corresponding information to the controller 111 of the vehicle 110 .

[0026] Optionally, when a target application is running in the running area 1111 of the controller 111, when the controller 111 is in communication connection with the remote device 120, the controller 111 receives the compressed upgrade file sent by the remote device 120 through the target application, and the target application is also used to write the received compressed upgrade file into the backup area 1112 corresponding to the controller 111 for storage.

[0027] Optionally, in a traditional program upgrade solution, the upgrade file is usually stored in the memory area. In order to ensure that the compressed upgrade file written into the storage area of ​​the controller can still maintain data after power failure during the program upgrade process, the upgrade file stored in the memory area needs to be synchronized to the backup area 1112 for storage. In the present application, the target application writes the received compressed upgrade file directly into the backup area 1112 for storage, without executing the step of storing the compressed upgrade file in the memory area, thereby reducing the time required for file writing, thereby greatly improving the program upgrade speed. Among them, since the upgrade file received by the controller 111 for upgrading the program is a compressed upgrade file obtained by compressing the upgrade file, in the process of storing the compressed upgrade file in the backup area 1112, compared with storing uncompressed upgrade files, the demand for storage space in the backup area 1112 can be greatly reduced.

[0028] Furthermore, based on the compressed upgrade file stored in the backup area 1112 corresponding to the controller 111, jump to the boot program in the boot area 1113, and decompress the compressed upgrade file in the backup area 1112 to the running area 1111 corresponding to the controller 111 by running the boot program. Therefore, based on the decompressed file after decompressing the compressed upgrade file in the running area 1111, the program of the controller 111 can be upgraded, that is, the target running program in the running area 1111 can be upgraded.

[0029] In this embodiment, by pre-compressing the upgrade file, the time required for file transmission is reduced during the process in which the controller 111 receives the compressed upgrade file sent by the remote device 120, and the compressed upgrade file is directly written to the backup area 1112 corresponding to the controller 111 for storage, thereby reducing the demand for storage space in the backup area 1112 and simplifying the process of first storing the upgrade file in the memory area and then synchronizing it to the backup area 1112 for storage, thereby reducing the time required for file writing and greatly improving the program upgrade speed.

[0030] See also Figure 2 , Figure 2 The flowchart of the program upgrade method provided by an embodiment of the present application is shown, which is applied to the controller of the above-mentioned vehicle. Figure 2 The program upgrade method provided in the embodiment of the present application is described in detail. Figure 2 , which may include the following steps:

[0031] Step S210: receiving a compressed upgrade file sent by a remote device.

[0032] In this embodiment, the controller of the vehicle receives the compressed upgrade file sent by the remote device to complete the subsequent program upgrade work based on the received compressed upgrade file.

[0033] Optionally, the remote device connected to the vehicle for communication may compress the upgrade file in advance before sending it to the controller, and send the compressed upgrade file to the vehicle controller as the file required for program upgrade; or, when the vehicle requests the upgrade file from the remote device, the remote device may forward the compressed upgrade file obtained by compressing the upgrade file from other devices to the vehicle controller. In this way, the transmission speed of the upgrade file can be improved, thereby improving the speed of program upgrade.

[0034] In some embodiments, when the target application is updated, the remote device can compress the updated upgrade file and send the compressed upgrade file to the controller of each vehicle connected to it. Alternatively, the remote device sends an upgrade request to each vehicle connected to it, and after receiving the upgrade request, the vehicle displays it on the human-computer interaction interface of the vehicle. If the user clicks on the upgrade on the human-computer interaction interface, in response to the user's click action, the controller generates an upgrade start instruction and feeds it back to the remote device, triggering the remote device to compress the upgrade file based on the feedback upgrade start instruction, and send the compressed upgrade file to the controller of each vehicle connected to it.

[0035] Step S220: writing the compressed upgrade file into the backup area corresponding to the controller.

[0036] In this embodiment, when a compressed upgrade file is received from a remote device, the received compressed upgrade file is written into a backup area corresponding to the controller for storage. Since the file written into the backup area for implementing the program upgrade is a compressed upgrade file obtained through compression, the storage space requirement of the backup area can be greatly reduced in the process of storing the compressed upgrade file in the backup area, compared with storing an uncompressed upgrade file, and the time required for writing the file can be reduced, thereby increasing the program upgrade rate.

[0037] Optionally, the backup area can be powered by a special battery or by non-volatile storage technology to ensure that the data stored in the device will not be lost after power failure. For example, the data is stored in the flash memory area of ​​the backup area. Since the flash memory is non-volatile, that is, the data will not be lost after power failure, the data stored in the flash memory area of ​​the backup area can still maintain the data after power failure. At this time, since the data stored in the backup area can still be maintained after power failure, when the compressed upgrade file is written to the backup area for storage during the program upgrade process, the compressed upgrade file stored in the backup area can be used as a backup file, so that when a sudden power failure or other fault causes the program upgrade to fail, there is no need to re-download the compressed upgrade file, and the compressed upgrade file stored in the backup area can be used to re-execute the program upgrade steps, thereby improving the efficiency of the program upgrade.

[0038] In this embodiment, the remote device transmits the compressed upgrade file to the vehicle's controller based on the Unified Diagnostic Services (UDS) protocol, which is a communication protocol widely used in the automotive industry for diagnosing and programming the vehicle's controller. Furthermore, writing data to the backup area is a function in the Unified Diagnostic Services protocol, so based on the Unified Diagnostic Services protocol, the compressed upgrade file transmitted to the vehicle's controller can be written to the backup area specified by the controller.

[0039] Step S230: decompress the compressed upgrade file in the backup area to the running area corresponding to the controller.

[0040] In this embodiment, by decompressing the compressed upgrade file stored in the backup area to the running area corresponding to the controller, a decompressed file after decompressing the compressed upgrade file can be obtained.

[0042] Optionally, when the controller receives a compressed upgrade file transmitted by a remote device, the controller directly writes the compressed upgrade file into the backup area of ​​the controller for storage, and upgrades the program by decompressing the compressed upgrade file stored in the backup area to the running area. During this program process, the process of first storing the upgrade file in the memory area and then synchronizing it to the backup area for storage is simplified, reducing the data transmission time required during the program upgrade process, thereby improving the rate of program upgrades in the controller.

[0043] Step S240: upgrading the program of the controller according to the decompressed file obtained by decompressing the compressed upgrade file in the running area.

[0044] In this embodiment, according to the decompressed file after decompressing the compressed upgrade file in the running area, the program file of the target application can be updated based on the decompressed file corresponding to the upgrade file, and the target application can be run based on the updated program file to complete the program upgrade, so that the controller can run normally.

[0045] In this embodiment, by pre-compressing the upgrade file, the time required for file transmission is reduced when the controller receives the compressed upgrade file sent by the remote device, and the compressed upgrade file is directly written to the backup area corresponding to the controller for storage, thereby reducing the demand for storage space in the backup area. At the same time, it simplifies the process of first storing the upgrade file in the memory area and then synchronizing it to the backup area for storage, thereby reducing the time required for file writing and greatly improving the program upgrade speed.

[0046] See also Figure 3 , Figure 3 A schematic diagram of a program upgrade method provided by another embodiment of the present application is shown below. Figure 3 The program upgrade method provided in the embodiment of the present application is described in detail. Figure 3 , which may include the following steps:

[0047] Step S310: receiving a compressed upgrade file sent by a remote device.

[0048] In this embodiment, when a target application is running in the current controller, the compressed upgrade file sent by the remote device is received by the target application, so as to complete the subsequent program upgrade work based on the received compressed upgrade file.

[0049] Optionally, before sending the upgrade file to the controller, the target device compresses the upgrade file according to the target compression algorithm, so as to send the compressed upgrade file as the file required for the program upgrade to the controller of the vehicle, which can improve the transmission speed of the upgrade file, thereby improving the speed of the program upgrade, and the target device is a remote device or other device connected to the remote device. Among them, the target compression algorithm includes but is not limited to the QuickLZ compression algorithm. As a widely used and efficient compression algorithm, the QuickLZ compression algorithm can achieve fast data compression and decompression, especially in scenarios with limited network transmission and storage space. During the compression process: the QuickLZ compression algorithm searches for repeated strings by maintaining a fixed-size compression dictionary. When compressing data, the algorithm searches for repeated sequences of 3 bytes or more in length in the data, and then replaces these sequences with a short code, which contains a reference to the corresponding position in the dictionary; during the decompression process: the original data can be restored by simply replacing the referenced code back to the original string sequence.

[0050] In this embodiment, the QuickLZ compression algorithm can be used to quickly compress the upgrade file, and when the compressed upgrade file is decompressed based on the decompression algorithm corresponding to the QuickLZ compression algorithm, the file can be quickly decompressed. In addition, the upgrade file can be compressed as much as possible during the file compression process using the QuickLZ compression algorithm, which reduces the storage space occupied by the upgrade file and reduces the time required for transmitting the compressed upgrade file, thereby improving the program upgrade speed.

[0051] Step S320: When the target application is currently running, the compressed upgrade file is written into the backup area corresponding to the controller through the target application, and the target application is used to receive the compressed upgrade file sent by the remote device.

[0052] In this embodiment, when the target application is currently running in the controller, the target application writes the received compressed upgrade file into the backup area corresponding to the controller for storage after receiving the compressed upgrade file sent by the remote device. Since the compressed upgrade file stored in the backup area can be used as a backup file, when a sudden power failure or other fault causes the program upgrade to fail, there is no need to re-download the compressed upgrade file, and the compressed upgrade file stored in the backup area can be used to re-execute the program upgrade steps, thereby improving the efficiency of the program upgrade.

[0053] Step S330: verify the compressed upgrade file.

[0054] In this embodiment, the data in the compressed upgrade file may be erroneous or lost during transmission due to factors such as channel noise and interference, thereby affecting the reliability and accuracy of the compressed upgrade file transmission. At this time, by verifying the compressed upgrade file, the accuracy and integrity of the compressed upgrade file transmission process are detected, thereby ensuring the success rate of the program upgrade.

[0055] In some embodiments, see Figure 4 Step S330 at least includes the following steps:

[0056] Step S331: Verify the verification code of the compressed upgrade file.

[0057] Optionally, the method of verifying the compressed upgrade file includes but is not limited to a cyclic redundancy check (CRC) check algorithm, that is, by processing the data in the compressed upgrade file to generate a check code, the accuracy and integrity of the compressed upgrade file can be quickly verified. By performing a CRC check on the data in the compressed upgrade file, we can promptly detect errors during data transmission and correct the data, thereby ensuring reliable data transmission.

[0058] Among them, CRC check means that the sender adds a check code for verification (at least the remainder generated by dividing the data frame by the selected CRC divisor) after the data frame to be sent, and generates a new data frame to send to the receiving end. After the new data frame arrives at the receiving end, the receiving end uses the same method to compare the remainder generated by dividing the data frame by the CRC divisor with the check code sent by the remote device. If they are the same, it is determined that the data in the received compressed upgrade file is accurate and complete, otherwise the data is wrong.

[0059] In this embodiment, after the compressed upgrade file is transmitted, the verification code written into the compressed upgrade file is verified using a CRC verification algorithm to verify the accuracy and integrity of the compressed upgrade file obtained by transmission, thereby ensuring the success rate of program upgrades based on the compressed upgrade file obtained by transmission.

[0060] Step S332: If the verification code of the compressed upgrade file matches the first verification code, it is determined that the compressed upgrade file verification is successful, the first verification code is sent by the remote device, and the remote device writes the first verification code into the compressed upgrade file before sending the compressed upgrade file.

[0061] In this embodiment, when the remote device sends the data in the compressed upgrade file to the controller of the vehicle, it writes the first verification code (i.e., the remainder generated by dividing the data frame in the compressed upgrade file to be sent by the remote device by the CRC divisor) into the data in the compressed upgrade file, and sends the written first verification code to the controller.

[0062] Optionally, if the controller detects that the verification code of the compressed upgrade file (i.e., the remainder generated by the controller dividing the data frame in the received compressed upgrade file by the CRC divisor) matches the first verification code, it is determined that the compressed upgrade file verification is successful. At this time, the compressed upgrade file received by the controller is accurate and complete.

[0063] Step S333: If the verification code of the compressed upgrade file does not match the first verification code, it is determined that the verification of the compressed upgrade file has failed.

[0064] In this embodiment, if the controller detects that the verification code of the compressed upgrade file does not match the first verification code, it determines that the verification of the compressed upgrade file fails. At this time, the compressed upgrade file received by the controller has data loss or error.

[0065] Step S340: If the verification is successful, the step of decompressing the compressed upgrade file in the backup area to the running area corresponding to the controller is executed.

[0066] In this embodiment, if the compressed upgrade file is successfully verified based on the verification code, it is determined that the compressed upgrade file sent by the remote device received by the controller at this time is accurate and complete, and the step of decompressing the compressed upgrade file in the backup area to the running area corresponding to the controller is executed.

[0067] In some embodiments, if the verification fails, it is determined that the compressed upgrade file sent by the remote device received by the controller at this time has data loss or errors. Based on the fact that the compressed upgrade file at this time cannot successfully upgrade the target application, the controller returns to step S310 and re-executes the step of receiving the compressed upgrade file sent by the remote device until the verification of the compressed upgrade file sent by the remote device is successful.

[0068] Step S350: decompress the compressed upgrade file in the backup area to the running area corresponding to the controller.

[0069] In this embodiment, when the received compressed upgrade file is successfully verified, the target application jumps to the boot program in the boot area, and decompresses the compressed upgrade file in the backup area to the running area corresponding to the controller by running the boot program. Among them, the boot program is also called a boot loader or a startup loader, which is responsible for loading and initializing the hardware device, runtime environment and operating system image when the controller starts. Specifically, the main functions of the boot program include: loading the core image of the operating system into the memory so that the vehicle's controller can run normally; establishing reliable bus communication with the remote device to obtain the upgrade file corresponding to the application to be upgraded; obtaining its address, program code and data in the backup area; running the backup area driver to program the code and data of the target application into the backup area and verify its integrity.

[0070] In this embodiment, since the target device (remote device or other device connected to the remote device for communication) compresses the upgrade file using the target compression algorithm to obtain a compressed upgrade file, the boot program is used to decompress the compressed upgrade file stored in the running area to the running area, and the boot program can decompress the compressed upgrade file according to the decompression algorithm corresponding to the target compression algorithm to decompress the compressed upgrade file to the running area.

[0071] Step S360: Verify the decompressed files in the running area.

[0072] In this embodiment, since the data in the compressed upgrade file may be decompressed or lost during the process of decompressing the compressed upgrade file to the running area, the reliability and accuracy of the decompressed file formed by decompression may be affected. At this time, by verifying the decompressed file, the accuracy and integrity of the decompression process of the compressed upgrade file are detected, thereby ensuring the success rate of the program upgrade.

[0073] In some embodiments, see Figure 5 Step S360 at least includes the following steps:

[0074] Step S361: Verify the verification code of the decompressed file corresponding to the upgrade file.

[0075] In this embodiment, the method of verifying the decompressed file includes but is not limited to the above-mentioned cyclic redundancy check (CRC) verification algorithm, that is, by processing the data in the decompressed file to generate a verification code, the accuracy and integrity of the decompressed file can be quickly verified.

[0076] In this embodiment, after decompressing the compressed upgrade file to obtain the decompressed file corresponding to the upgrade file, the verification code of the decompressed file corresponding to the upgrade file is verified using a CRC verification algorithm, which can verify the accuracy and integrity of the upgrade file to ensure the success rate of program upgrade of the decompressed file corresponding to the upgrade file obtained by decompression.

[0077] Step S362: If the verification code of the decompressed file matches the second verification code, it is determined that the verification of the decompressed file is successful, and the second verification code is sent by the remote device.

[0078] In this embodiment, the target device (remote device or other device connected to the remote device in communication) writes the second check code (i.e., the remainder generated by the remote device dividing the data frame in the upgrade file by the CRC divisor) into the data in the upgrade file during the process of compressing the data in the upgrade file using the target compression algorithm to obtain the compressed upgrade file. If the target device is a remote device, the remote device sends the written second check code to the controller; if the target device is other device connected to the remote device in communication, the remote device forwards the second check code written by the target device to the controller.

[0079] Optionally, if the controller detects that the verification code of the decompressed file corresponding to the upgrade file (i.e., the remainder generated by dividing the data frame in the decompressed file obtained by the controller by the CRC divisor) matches the second verification code, it is determined that the decompressed file verification is successful. At this time, the decompressed file decompressed by the controller is accurate and complete.

[0080] Step S363: If the verification code of the decompressed file does not match the second verification code, it is determined that the verification of the decompressed file has failed.

[0081] In this embodiment, if the controller detects that the verification code of the decompressed file corresponding to the upgrade file does not match the second verification code, it determines that the decompressed file verification fails. At this time, the decompressed file corresponding to the upgrade file decompressed by the controller has data loss or error.

[0082] Step S370: If the verification is successful, the step of performing a program upgrade on the controller according to the decompressed files in the running area is executed.

[0083] In this embodiment, if the verification code of the decompressed file corresponding to the upgrade file is successful, it can be determined that the decompressed file is a complete upgrade file with no data loss, so that the step of performing a program upgrade on the target application in the controller can be executed based on the decompressed file in the running area.

[0084] In some embodiments, if the verification fails, it is determined that the decompressed file corresponding to the upgrade file decompressed by the controller at this time has data loss or error, and the target application cannot be successfully upgraded based on the decompressed file at this time. Among them, the possible reasons for the decompressed file to have data loss or error relative to the upgrade file include at least: an error in the compression process of the target device, or an error in the decompression process of the controller. At this time, the upgrade file can be recompressed and the new compressed upgrade file can be sent to the controller, or the controller can re-decompress the compressed upgrade file in the backup area until the decompressed file corresponding to the decompressed upgrade file is successfully verified.

[0085] In some embodiments, before executing the step of upgrading the program of the controller according to the decompressed file in the operation area, in order to ensure the safety of the vehicle during the program upgrade, the controller also needs to determine whether the current vehicle parameters meet the preset conditions. For example, check one or more of the vehicle speed, battery power, battery voltage, handbrake status, vehicle ignition status, vehicle gear position, and driver's seat belt status.

[0086] Optionally, since the target application in the controller may not work properly during the program upgrade, causing the controller to be unable to work, thereby affecting the functional use of the vehicle, in order to avoid driving accidents during the program upgrade, the vehicle can be limited to a parked state or an unmanned state during the program upgrade.

[0087] Step S380: upgrading the program of the controller according to the decompressed file obtained by decompressing the compressed upgrade file in the running area.

[0088] In this embodiment, after determining the integrity of the decompressed file obtained by decompressing the compressed upgrade file, the target application in the controller is upgraded according to the decompressed file decompressed into the running area.

[0089] In some embodiments, the target application in the controller is upgraded, that is, the program file of the target application is updated based on the decompressed file, and the boot program jumps to the target application, and the target application is run to complete the program upgrade. At the same time, the controller can not only feed back the program upgrade results obtained during the program running process to the human-computer interaction interface of the vehicle, but also report the final result of this upgrade (success or failure) to the remote device, so that when the back-end operator at the remote device monitors the event of update failure, it can actively contact the owner of the vehicle for corresponding processing to ensure the success rate of the program upgrade.

[0090] In this embodiment, the upgrade file is compressed using a target compression algorithm, which improves the compression rate while increasing the file compression speed, thereby greatly reducing the time required to compress the upgrade file and transmit it to the controller. In addition, the target application writes the compressed upgrade file directly to the backup area for storage, reducing the demand for storage space in the backup area. At the same time, it simplifies the process of first storing the upgrade file in the memory area and then synchronizing it to the backup area for storage, thereby reducing the time required to write the file and further improving the program upgrade speed.

[0091] Please refer to Figure 6 , Figure 6 The structure block diagram of a program upgrade device 400 provided in an embodiment of the present application is shown. In this embodiment, the program upgrade device 400 at least includes a file receiving module 410, a writing module 420, a decompression module 430 and an upgrade module 440.

[0092] The file receiving module 410 is used to receive a compressed upgrade file sent by a remote device.

[0093] The writing module 420 is used to write the compressed upgrade file into the backup area corresponding to the controller.

[0094] The decompression module 430 is used to decompress the compressed upgrade file in the backup area to the running area corresponding to the controller.

[0095] The upgrade module 440 is used to upgrade the program of the controller according to the decompressed file obtained by decompressing the compressed upgrade file in the running area.

[0096] Optionally, the writing module 420 may also be used to: verify the compressed upgrade file; if the verification is successful, execute the step of decompressing the compressed upgrade file in the backup area into the running area corresponding to the controller.

[0097] In this embodiment, the writing module 420 can be specifically used to: verify the verification code of the compressed upgrade file; if the verification code of the compressed upgrade file matches the first verification code, it is determined that the verification of the compressed upgrade file is successful, the first verification code is sent by the remote device, and the remote device writes the first verification code to the compressed upgrade file before sending the compressed upgrade file; if the verification code of the compressed upgrade file does not match the first verification code, it is determined that the verification of the compressed upgrade file has failed.

[0098] Optionally, the decompression module 430 may also be used to: verify the decompressed files in the running area; if the verification is successful, execute the step of upgrading the program of the controller according to the decompressed files in the running area.

[0099] In this embodiment, the decompression module 430 can be specifically used to: verify the verification code of the decompressed file corresponding to the upgrade file; if the verification code of the decompressed file matches the second verification code, it is determined that the decompressed file verification is successful, and the second verification code is sent by the remote device; if the verification code of the decompressed file does not match the second verification code, it is determined that the decompressed file verification has failed.

[0100] In some embodiments, the upgrade file is a file used to upgrade the target application, and the file receiving module 410 can be specifically used to: when the target application is currently running, write the compressed upgrade file to the backup area corresponding to the controller through the target application, and the target application is used to receive the compressed upgrade file sent by the remote device.

[0101] Optionally, the compressed upgrade file is obtained by compressing the upgrade file according to a target compression algorithm, and the decompression module 430 can be specifically used to: decompress the compressed upgrade file in the backup area to the running area corresponding to the controller according to the decompression algorithm corresponding to the target compression algorithm.

[0102] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described devices and modules can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here.

[0103] In several embodiments provided in the present application, the coupling between modules may be electrical, mechanical or other forms of coupling.

[0104] In addition, each functional module in each embodiment of the present application can be integrated into a processing module, or each module can exist physically separately, or two or more modules can be integrated into one module. The above integrated modules can be implemented in the form of hardware or software functional modules.

[0105] To summarize, the present application reduces the time required for file transmission by pre-compressing the upgrade file and the controller receiving the compressed upgrade file. In addition, the compressed upgrade file is directly written to the backup area corresponding to the controller for storage, thereby reducing the demand for storage space in the backup area. At the same time, it simplifies the process of first storing the upgrade file in the memory area and then synchronizing it to the backup area for storage, thereby reducing the time required for file writing and greatly improving the program upgrade speed.

[0106] Please refer to Figure 7 , Figure 7 A structural block diagram of a vehicle 110 provided in an embodiment of the present application is shown, and the above method provided in an embodiment of the present application can be executed by the vehicle 110.

[0107] The vehicle 110 in the embodiment of the present application may include one or more of the following components: a processor 112, a memory 113, and one or more applications, wherein the one or more applications may be stored in the memory 113 and configured to be executed by one or more processors 112, and the one or more programs are configured to execute the method as described in the aforementioned method embodiment.

[0108] The processor 112 may include one or more processing cores. The processor 112 uses various interfaces and lines to connect various parts of the entire vehicle 110, and executes various functions and processes data of the vehicle 110 by running or executing instructions, programs, code sets or instruction sets stored in the memory 113, and calling data stored in the memory 113. Optionally, the processor 112 can be implemented in at least one hardware form of digital signal processing (DSP), field-programmable gate array (FPGA), and programmable logic array (PLA). The processor 112 can integrate one or a combination of a central processing unit (CPU), a graphics processing unit (GPU), and a modem. Among them, the CPU mainly processes the operating system, user interface, and application programs; the GPU is responsible for rendering and drawing display content; and the modem is used to process wireless communications. It is understandable that the above-mentioned modem can also be integrated into the processor 112 and implemented separately through a communication chip.

[0109] The memory 113 may include a random access memory (RAM) or a read-only memory (ROM). The memory 113 may be used to store instructions, programs, codes, code sets or instruction sets. The memory 113 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for implementing at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the following various method embodiments, etc. The data storage area may also store data created by the vehicle 110 during use (such as the various corresponding relationships described above), etc.

[0110] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described devices and modules can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here.

[0111] In several embodiments provided in the present application, the coupling or direct coupling or communication connection between the modules shown or discussed may be an indirect coupling or communication connection through some interfaces, devices or modules, which may be electrical, mechanical or other forms.

[0112] In addition, each functional module in each embodiment of the present application can be integrated into a processing module, or each module can exist physically separately, or two or more modules can be integrated into one module. The above integrated modules can be implemented in the form of hardware or software functional modules.

[0113] Please refer to Figure 8 , Figure 8 The structure block diagram of a computer-readable storage medium 700 provided in an embodiment of the present application is shown. The computer-readable storage medium 500 stores a program code 510, and the program code 510 can be called by a processor to execute the method described in the above method embodiment.

[0114] The computer-readable storage medium 500 may be an electronic memory such as a flash memory, an EEPROM (electrically erasable programmable read-only memory), an EPROM, a hard disk, or a ROM. Optionally, the computer-readable storage medium 500 includes a non-transitory computer-readable storage medium. The computer-readable storage medium 500 has storage space for program code 510 that performs any method step of the above method. These program codes can be read from or written to one or more computer program products. The program code 510 can be compressed, for example, in an appropriate form.

[0115] In some embodiments, a computer program product or computer program is provided, the computer program product or computer program includes computer instructions, the computer instructions are stored in a computer-readable storage medium. A processor of an electronic device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the electronic device performs the steps in the above-mentioned method embodiments.

[0116] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A program upgrade method, characterized in that: A controller applied to a vehicle, the method comprising: Receive the compressed upgrade file sent by the remote device; Writing the compressed upgrade file into the backup area corresponding to the controller; Decompressing the compressed upgrade file in the backup area to the running area corresponding to the controller; The controller is program-upgraded according to the decompressed file in the running area after the compressed upgrade file is decompressed.

2. The method according to claim 1, characterized in that Before decompressing the compressed upgrade file in the backup area to the running area corresponding to the controller, the method further includes: Verifying the compressed upgrade file; If the verification is successful, the step of decompressing the compressed upgrade file in the backup area to the running area corresponding to the controller is performed.

3. The method according to claim 2, characterized in that The verifying the compressed upgrade file includes: Verify the verification code of the compressed upgrade file; If the verification code of the compressed upgrade file matches the first verification code, it is determined that the verification of the compressed upgrade file is successful, the first verification code is sent by the remote device, and the remote device writes the first verification code into the compressed upgrade file before sending the compressed upgrade file; If the verification code of the compressed upgrade file does not match the first verification code, it is determined that the verification of the compressed upgrade file has failed.

4. The method according to claim 1, characterized in that Before performing a program upgrade on the controller according to the decompressed file obtained by decompressing the compressed upgrade file in the running area, the method further includes: Verifying the decompressed files in the running area; If the verification is successful, the step of performing a program upgrade on the controller according to the decompressed file in the running area is executed.

5. The method according to claim 4, characterized in that The verifying the decompressed file in the running area includes: Verify the checksum of the decompressed file corresponding to the upgrade file; If the verification code of the decompressed file matches the second verification code, it is determined that the verification of the decompressed file is successful, and the second verification code is sent by the remote device; If the verification code of the decompressed file does not match the second verification code, it is determined that the verification of the decompressed file has failed.

6. The method according to any one of claims 1 to 5, characterized in that: The upgrade file is a file used to upgrade the target application, and the receiving of the compressed upgrade file sent by the remote device includes: In the case where the target application is currently running, the compressed upgrade file is written into the backup area corresponding to the controller through the target application, and the target application is used to receive the compressed upgrade file sent by the remote device.

7. The method according to any one of claims 1 to 5, characterized in that: The compressed upgrade file is obtained by compressing the upgrade file according to the target compression algorithm; The step of decompressing the compressed upgrade file in the backup area to the running area corresponding to the controller includes: According to the decompression algorithm corresponding to the target compression algorithm, the compressed upgrade file in the backup area is decompressed to the running area corresponding to the controller.

8. A program upgrade device, characterized in that: Applied to a controller of a vehicle, the program upgrading device comprises: A file receiving module, used to receive a compressed upgrade file sent by a remote device; A writing module, used for writing the compressed upgrade file into the backup area corresponding to the controller; A decompression module, used for decompressing the compressed upgrade file in the backup area to the running area corresponding to the controller; The upgrade module is used to upgrade the program of the controller according to the decompressed file in the running area after decompressing the compressed upgrade file.

9. A vehicle, characterized in that: The vehicle comprises: one or more processors; Memory; One or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs are configured to execute the method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores program code, which can be called by a processor to execute the method according to any one of claims 1 to 7.