Vehicle software upgrading method and device and computer readable storage medium

By acquiring differential data from the vehicle software for upgrades, the problem of excessively long upgrade times was solved, upgrade efficiency was improved, and data transmission and storage requirements were reduced.

CN120973401APending Publication Date: 2025-11-18JINGWEI HIRAIN (TIANJIN) RES&DEV CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511028832.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-24
Publication Date
2025-11-18

AI Technical Summary

Technical Problem

In existing technologies, vehicle software upgrades require downloading a complete upgrade package, which results in excessively long upgrade times, low upgrade efficiency, and increased data transmission costs and storage space usage.

Method used

By obtaining the differential data between the calibration memory segment and the application memory segment of the vehicle software from the server, and replacing the data to be upgraded with the bootloader in the bootloader memory segment, the software upgrade is achieved.

Benefits of technology

This reduces the time it takes for vehicles to download and upgrade data, improves software upgrade efficiency, reduces data transmission volume and storage space usage, and lowers data transmission costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120973401A_ABST
    Figure CN120973401A_ABST
Patent Text Reader

Abstract

The invention provides a vehicle software upgrading method and device and a computer readable storage medium, and can be applied to the field of vehicle processing. The method comprises the steps that differential data corresponding to all target memory segments in target software to be upgraded are obtained from a server side, the memory segments of the target software comprise a boot loading memory segment, an application program memory segment and a calibration memory segment, and all the target memory segments comprise the application program memory segment and the calibration memory segment; the difference data is used for indicating difference data between the data of the latest version and the data of the current version in the target memory segment; determining to-be-replaced data corresponding to the differential data in the target memory segment; and on the basis of a bootstrap program in the bootstrap loading memory segment, replacing the to-be-replaced data in each target memory segment with corresponding differential data so as to upgrade the target software. According to the method, the upgrading efficiency of the vehicle software is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of vehicle processing, and more particularly to a method, apparatus, and computer-readable storage medium for upgrading vehicle software. Background Technology

[0002] With the development of intelligent connectivity technology, vehicles are becoming increasingly intelligent, resulting in the installation of more and more software, which in turn requires software upgrades.

[0003] In this exemplary technology, the vehicle obtains a software upgrade package from the cloud and upgrades the software within the vehicle using this package. This upgrade method requires downloading the complete upgrade package, necessitating a full software upgrade, which results in excessively long upgrade times and low upgrade efficiency. Summary of the Invention

[0004] This application provides a method, apparatus, and computer-readable storage medium for upgrading vehicle software, which solves the problem of low software upgrade efficiency.

[0005] In a first aspect, this application provides a method for upgrading vehicle software, the method comprising:

[0006] Obtain differential data corresponding to each target memory segment in the target software to be upgraded from the server. The memory segments of the target software include the boot load memory segment, the application memory segment, and the calibration memory segment. Each target memory segment includes the application memory segment and the calibration memory segment. The differential data is used to indicate the difference between the latest version of the data in the target memory segment and the current version of the data.

[0007] Determine the data to be replaced corresponding to the differential data in the target memory segment;

[0008] Based on the bootloader in the bootloader memory segment, the data to be replaced in each target memory segment is replaced with the corresponding differential data to upgrade the target software.

[0009] In some embodiments, obtaining differential data corresponding to each target memory segment in the target software to be upgraded from the server includes:

[0010] The first verification instruction is obtained based on the diagnostic routine service, and the first reference verification value, the first starting address of the target software in the current version, and the first memory usage are obtained from the first verification instruction.

[0011] The first check value is determined based on the first starting address and the first memory usage.

[0012] In response to the first check value matching the first reference check value, it is determined that the target software is complete software, and differential data corresponding to each target memory segment in the target software to be upgraded is obtained from the server.

[0013] In some embodiments, determining the first check value based on the first starting address and the first memory usage includes:

[0014] The first verification field is obtained based on the first verification instruction, and the first length of the first verification field is determined.

[0015] If the first length matches the first preset length, the first starting address matches the preset address, and the first memory usage is within the usage range, then the first check value is determined based on the first starting address and the first memory usage.

[0016] In some embodiments, after replacing the data to be replaced in each target memory segment with the corresponding differential data based on the bootloader in the bootloader memory segment, the method further includes:

[0017] The second verification instruction is obtained based on the diagnostic routine service, and the second reference verification value, the second starting address of the target software in the latest version, and the second memory usage are obtained from the second verification instruction.

[0018] The second check value is determined based on the second starting address and the second memory usage.

[0019] In response to the second check value matching the second reference check value, it is determined that the target software has completed the upgrade.

[0020] In some embodiments, determining the second check value based on the second starting address and the second memory usage includes:

[0021] The second verification field is obtained based on the second verification instruction, and the second length of the second verification field is determined.

[0022] If the second length matches the second preset length, the second starting address matches the preset address, and the second memory usage is within the usage range, then the second check value is determined based on the second starting address and the second memory usage.

[0023] In some embodiments, after replacing the data to be replaced in each target memory segment with the corresponding differential data based on the bootloader in the bootloader memory segment, the method further includes:

[0024] Determine the termination address for data replacement in the target memory segment;

[0025] If the data corresponding to the termination address in the target memory segment is detected to have been replaced, the valid flag bit of the logical block corresponding to the target memory segment is set to a valid state.

[0026] Based on the bootloader, a soft reset operation is performed on the target software, and the status of the valid flag bits of each logic block is read.

[0027] If the valid flag bits of each logic block are in a valid state, it is determined that the target software has completed the upgrade, and the target software is controlled to run.

[0028] In some embodiments, before obtaining the differential data corresponding to each target memory segment in the target software to be upgraded from the server, the method further includes:

[0029] The security access level of the vehicle is raised from the current level to the preset level, and the current data download session mode of the vehicle is adjusted to the target data download session mode associated with the preset level.

[0030] The vehicle's fault alarm function, message receiving function, and message sending function are stopped to switch the vehicle from the operating environment to the boot loading environment.

[0031] After controlling the target software to run, the method further includes:

[0032] Adjust the security access level from the preset level to the current level, and adjust the target data download session mode to the current data download session mode;

[0033] The system controls the vehicle's fault alarm function, message receiving function, and message sending function to switch the vehicle from the boot loading environment to the operating environment.

[0034] In some embodiments, replacing the data to be replaced in each target memory segment with corresponding differential data based on the bootloader in the bootloader memory segment includes:

[0035] Download the driver and determine the location of the data to be replaced in the corresponding target memory segment;

[0036] The bootloader controls the driver to erase the data to be replaced at the specified location.

[0037] The bootloader controls the driver to write differential data to the location of the erased data.

[0038] Secondly, this application provides a vehicle, comprising:

[0039] The acquisition module is used to acquire differential data corresponding to each target memory segment in the target software to be upgraded from the server. The memory segments of the target software include a boot load memory segment, an application memory segment, and a calibration memory segment. Each target memory segment includes an application memory segment and a calibration memory segment. The differential data is used to indicate the difference between the latest version of the data in the target memory segment and the current version of the data.

[0040] The determining module is used to determine the data to be replaced corresponding to the differential data in the target memory segment;

[0041] The processing module is used to replace the data to be replaced in each of the target memory segments with the corresponding differential data based on the bootloader in the bootloader memory segment, so as to upgrade the target software.

[0042] Thirdly, this application provides an electronic device, including: a processor, and a memory and a communication interface communicatively connected to the processor;

[0043] The communication interface is used to communicate with other communication devices;

[0044] The memory is used to store computer-executed instructions;

[0045] The processor is used to execute computer execution instructions stored in the memory to implement the vehicle software upgrade method provided in the first aspect.

[0046] Fourthly, this application provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the vehicle software upgrade method provided in the first aspect.

[0047] Fifthly, this application provides a computer program product, including a computer program that, when executed by a processor, implements the vehicle software upgrade method as provided in the first aspect.

[0048] The vehicle software upgrade method, apparatus, and computer-readable storage medium provided in this application upgrade the vehicle's software by obtaining differential data of a calibrated memory segment and differential data of the application memory segment from a server. This eliminates the need to acquire the full data set for the software upgrade, reducing the time required for downloading upgrade data and improving the efficiency of vehicle software upgrades. Furthermore, since the vehicle only acquires differential data of the calibrated memory segment and the application memory segment, and not differential data of all memory segments in the software, the amount of differential data acquired is reduced, further decreasing the time required for downloading software upgrade data and improving the efficiency of vehicle software upgrades. Attached Figure Description

[0049] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0050] Figure 1 This is a schematic diagram illustrating the scenarios involved in the vehicle software upgrade method described in this application. Figure 1 ;

[0051] Figure 2 This is a flowchart illustrating the steps of the vehicle software upgrade method provided in this application embodiment. Figure 1 ;

[0052] Figure 3 This is a schematic diagram of the memory distribution of the target software in the vehicle of this application;

[0053] Figure 4 This is a schematic diagram illustrating the scenarios involved in the vehicle software upgrade method described in this application. Figure 2 ;

[0054] Figure 5 This is a flowchart illustrating the steps of the vehicle software upgrade method provided in this application embodiment. Figure 2 ;

[0055] Figure 6 This is a flowchart illustrating the steps of the vehicle software upgrade method provided in this application embodiment. Figure 3 ;

[0056] Figure 7 This is a flowchart illustrating the steps of the vehicle software upgrade method provided in this application embodiment. Figure 4 ;

[0057] Figure 8 This is a schematic diagram of the program modules of a vehicle provided in an embodiment of this application;

[0058] Figure 9 This is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of this application.

[0059] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation

[0060] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application. Furthermore, although the disclosure in this application is described according to one or several exemplary examples, it should be understood that each aspect of these disclosures can also constitute a complete implementation method on its own.

[0061] It should be noted that the brief descriptions of terms in this application are only for the convenience of understanding the embodiments described below, and are not intended to limit the embodiments of this application. Unless otherwise stated, these terms should be understood in their ordinary and common meaning.

[0062] Furthermore, the terms “comprising” and “having”, and any variations thereof, are intended to cover but not exclusively include, for example, a product or device that includes a series of components is not necessarily limited to those that are explicitly listed, but may include other components that are not explicitly listed or that are inherent to such product or device.

[0063] The term "module" as used in the embodiments of this application refers to any known or subsequently developed hardware, software, firmware, artificial intelligence, fuzzy logic, or combination of hardware and / or software code capable of performing the functions associated with that element.

[0064] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use and processing of the relevant data must comply with relevant laws, regulations and standards, and corresponding operation entry points are provided for users to choose to authorize or refuse.

[0065] With the development of intelligent connectivity technology, vehicles are becoming increasingly intelligent, resulting in the installation of more and more software, which in turn requires software upgrades.

[0066] The inventors of this application have discovered that vehicles obtain software upgrade packages from the cloud and upgrade the software in the vehicle using these packages. This upgrade method requires downloading the complete upgrade package, necessitating a complete software upgrade based on the package. This results in excessively long upgrade times and low upgrade efficiency.

[0067] Furthermore, each vehicle upgrade requires complete firmware data, leading to unnecessary data duplication and prolonged software upgrade times. This consumes significant amounts of vehicle storage space and bandwidth. For the server side, this also increases data transmission costs.

[0068] The inventors of this application therefore conceived of a method where the vehicle upgrades its software by obtaining differential data from a calibrated memory segment and differential data from the application memory segment via a server. This eliminates the need to acquire the full dataset for the software upgrade, reducing the time required for downloading upgrade data and improving the efficiency of the vehicle's software upgrade. Furthermore, since the vehicle only acquires differential data from the calibrated memory segment and the application memory segment, and not differential data from all memory segments within the software, the amount of differential data acquired is reduced, further decreasing the time required for the vehicle to download the software upgrade data and improving the efficiency of the vehicle's software upgrade.

[0069] Reference Figure 1 , Figure 1 This is a schematic diagram illustrating the application scenario of the vehicle software upgrade method of this application. Vehicle 100 obtains multiple differential data sets from server 200. The differential data sets refer to the differences between the latest version of the data in the memory segment and the current version. Each differential data set represents the difference data in the target memory segment of the target software to be upgraded in vehicle 100. The target memory segment includes the application memory segment and the calibration memory segment. Vehicle 100 determines the data to be replaced corresponding to the differential data in the target memory segment, and then, based on the bootloader in the bootloader memory segment, replaces the data to be replaced in each target memory segment with the corresponding differential data to upgrade the target software.

[0070] The following is passed Figure 1 The technical solutions shown in this application will be described in detail with reference to specific embodiments. It should be noted that the following embodiments may exist independently or in combination with each other, and the same or similar content will not be described again in different embodiments.

[0071] Reference Figure 2 , Figure 2 This is a flowchart illustrating the vehicle software upgrade method provided in the embodiments of this application. Figure 1 Vehicle software upgrade methods include:

[0072] Step S201: Obtain differential data corresponding to each target memory segment in the target software to be upgraded from the server. The memory segments of the target software include the boot load memory segment, the application memory segment, and the calibration memory segment. Each target memory segment includes the application memory segment and the calibration memory segment. The differential data is used to indicate the difference between the latest version of the data in the target memory segment and the current version of the data.

[0073] In this embodiment, the executing entity is a vehicle. The vehicle is equipped with multiple Electronic Control Units (ECUs), which are responsible for controlling and managing various electronic systems and devices of the vehicle, such as managing the Motor Control Unit (MCU) and the Battery Management System (BMS). The vehicle requires upgrades to its ECUs.

[0074] In this embodiment, the target software to be upgraded can be an ECU, which has a memory partitioning layout in the vehicle. (Refer to...) Figure 3 The ECU's memory segments include the Bootloader memory segment, the application valid flag segment, the application memory segment, the calibration valid flag segment, and the calibration memory segment. The Bootloader occupies the initial area of ​​memory and is responsible for the system startup and boot process; the application memory segment stores the main control software and functional modules; the calibration memory segment stores calibration data and parameters to facilitate dynamic adjustment and optimization, effectively ensuring the reasonable and safe storage of each program module in memory, thereby optimizing the system's storage utilization and operating efficiency.

[0075] The vehicle reports the current version of the target software to the server. The server compares the latest version of the target software with the current version. If they are different, the server identifies the data differences between the current and latest versions of the target software. For example, refer to... Figure 4 , Figure 4This diagram illustrates how the server acquires differential data and downloads it to the vehicle. The server compares the differences between the target software's application memory segments in the current and latest versions. For example, it compares the differences between the latest version's Block1 and the current version's Block1. Block1's starting and ending addresses are integer multiples of the minimum erase block size. Block2, on the other hand, is a remainder of an integer multiple of the current or latest version's block size; therefore, Block2's starting and ending addresses are integer multiples of the non-erasable block size. The server fills the differential data into multiple differential blocks of the vehicle's minimum erase block size, ensuring that the starting address and size of each differential block are integer multiples of the vehicle's minimum erase unit. The server merges these differential blocks into a single file that can be used for flashing and records two reference checksums for the old and new versions of the target software. It should be noted that Block2 in the differential data is the remainder of an integer multiple of the smallest erase block. Therefore, Block2 in the differential data is not necessarily the remainder of an integer multiple of the smallest erase block, while Block1 in the differential data is an integer multiple of the smallest erase block.

[0076] After the differential data is prepared on the server side, a prompt message is sent to the vehicle, causing the vehicle to download the differential data corresponding to each target memory segment in the target software to be upgraded. Each target memory segment includes an application memory segment and a calibration memory segment, and the differential data refers to the difference between the latest version of the data in the target memory segment and the current version of the data.

[0077] Step S202: Determine the data to be replaced corresponding to the differential data in the target memory segment.

[0078] After acquiring the differential data of the target memory segment, the vehicle determines the data to be replaced corresponding to the differential data within that segment. For example, when determining the differential data, the server marks the location of the difference between the current version and the latest version of the data. This location can be represented by a memory address, which is carried in the differential data. After obtaining the differential data of the target memory segment, the vehicle retrieves the memory address from it; the data corresponding to that memory address in the target memory segment is the data to be replaced.

[0079] Step S203: Based on the bootloader in the bootloader memory segment, replace the data to be replaced in each target memory segment with the corresponding differential data to upgrade the target software.

[0080] After determining the data to be replaced corresponding to the differential data, the vehicle, based on the bootloader in the bootloader memory segment, replaces the data to be replaced in each target memory segment with the corresponding differential data in order to upgrade the target software.

[0081] In one example, the bootstrap program directly replaces the data to be replaced in the target memory segment with differential data.

[0082] In another example, the vehicle downloads a driver program used for erasing and writing data. The device determines the location of the data to be replaced in a target memory segment, which is the memory address carried in the differential data. The vehicle, controlled by a bootloader, erases the data to be replaced at that location and then instructs the driver program to write the differential data to the location of the erased data.

[0083] In this embodiment, the vehicle upgrades its software by obtaining differential data from the server for the calibration memory segment and the application memory segment. This eliminates the need to acquire the full dataset for the software upgrade, reducing the time required to download the upgrade data and improving the efficiency of the vehicle's software upgrade. Furthermore, since the vehicle only acquires differential data from the calibration memory segment and the application memory segment, and not differential data from all memory segments in the software, the amount of differential data acquired is reduced, further decreasing the time required to download the software upgrade data and improving the overall efficiency of the vehicle's software upgrade.

[0084] Reference Figure 5 , Figure 5 This is a flowchart illustrating the method for upgrading the vehicle software in this application. Figure 2 ,based on Figure 2 In the embodiment shown, step S201 includes:

[0085] Step S501: Obtain the first verification instruction based on the diagnostic routine service, and obtain the first reference verification value, the first starting address of the target software in the current version, and the first memory usage from the first verification instruction.

[0086] In this embodiment, when the server generates differential data, it sets reference check values ​​for the old and new versions of the target software. The server sends the reference check values ​​to the bootloader memory segment for storage. Before upgrading the target software, the vehicle needs to perform an integrity check on the target software. To do this, the vehicle sends a check request to the bootloader through the diagnostic routine service. The bootloader obtains the first starting address and first memory usage of the target software in the current version, and generates a first check instruction based on the first reference check value, the first starting address, and the first memory usage of the current version.

[0087] The vehicle analyzes the first verification instruction to obtain the first reference verification value, the first starting address of the target software in the current version, and the first memory usage.

[0088] Step S502: Determine the first check value based on the first starting address and the first memory usage.

[0089] After obtaining the first starting address and the first memory usage, the vehicle calculates a check value based on the first starting address and the first memory usage, and this check value is defined as the first check value.

[0090] The first verification instruction consists of SID + Sub-Function + RoutineIdentifier + RCOR, where RCOR is composed of 12 bytes of data. SID represents the starting address of the target software, Sub-Function represents the memory usage of the target software, and RoutineIdentifier is the first reference verification value. The vehicle obtains the first verification field, RoutineIdentifier, based on the first verification instruction and determines the length of the first verification field, which is defined as the first length. The vehicle determines whether the data size is a specified value, that is, whether the first length matches a first preset length. For example, the first preset length is 12 bytes. If the first length is the first preset length, it is determined that the first length matches the first preset length. If the first length does not match the first preset length, a negative response code 0x13 is returned, meaning the output data is not a specified value.

[0091] If the first length matches the first preset length, determine whether the first starting address matches the preset address and whether the first memory usage is within the usage range. If the first starting address matches the preset address and the first memory usage is within the usage range, calculate the first checksum based on the first starting address and the first memory usage. If the first starting address is different from the preset address or the first memory usage is not within the usage range, output a diagnostic response 0x01 to indicate that the first starting address or the first memory usage is incorrect.

[0092] When the first length matches the first preset length, the first starting address matches the preset address, and the first memory usage is within the usage range, 0x00 is output to indicate that the verification has passed. The vehicle then calculates the first checksum based on the first starting address and the first memory usage. After obtaining the first checksum, the vehicle compares the first checksum with the first reference checksum.

[0093] Step S503: In response to the first check value matching the first reference check value, it is determined that the target software is complete software, and differential data corresponding to each target memory segment in the target software to be upgraded is obtained from the server.

[0094] When the first check value is the same as the first reference check value, it can be determined that the first check value matches the first reference check value, thus confirming that the target software is the software to be upgraded in the vehicle and that the target software is complete. The vehicle then obtains differential data from the server.

[0095] In this embodiment, before the target software is upgraded, the integrity of the target software is verified by checking the starting address and memory usage of the target software in the current version to ensure that the target software to be upgraded is intact.

[0096] Reference Figure 6 , Figure 6 This is a flowchart illustrating the method for upgrading the vehicle software in this application. Figure 3 ,based on Figure 2 or Figure 5 In the embodiment shown, after step S203, the method further includes:

[0097] Step S601: Obtain the second verification instruction based on the diagnostic routine service, and obtain the second reference verification value, the second starting address of the target software in the latest version, and the second memory usage from the second verification instruction.

[0098] In this embodiment, when the server generates differential data, it sets reference check values ​​for the old and new versions of the target software. The server sends the reference check values ​​to the bootloader memory segment for storage. When the vehicle needs to upgrade the target software, it needs to verify the target software. To do this, the vehicle sends a verification request to the bootloader through the diagnostic routine service. The bootloader obtains the second starting address and second memory usage of the target software in the latest version, and generates a second verification instruction based on the second reference check value, second starting address, and second memory usage of the latest version.

[0099] The vehicle analyzes the second verification instruction to obtain the second reference verification value, the second starting address of the target software in the current version, and the second memory usage.

[0100] Step S602: Determine the second check value based on the second starting address and the second memory usage.

[0101] After obtaining the second starting address and the second memory usage, the vehicle calculates a check value based on the second starting address and the second memory usage, and this check value is defined as the second check value.

[0102] The second verification instruction consists of SID + Sub-Function + RoutineIdentifier + RCOR, where RCOR is composed of 12 bytes of data. SID represents the starting address of the target software, Sub-Function represents the memory usage of the target software, and RoutineIdentifier is the second reference verification value. The vehicle obtains the second verification field RoutineIdentifier based on the second verification instruction and determines the length of the second verification field, which is defined as the second length. The vehicle determines whether the data size is a specified value, that is, whether the second length matches a second preset length. For example, the second preset length is 12 bytes. If the second length is the second preset length, it is determined that the second length matches the second preset length. If the second length does not match the second preset length, a negative response code 0x13 is returned, meaning the output data is not a specified value.

[0103] If the second length matches the second preset length, determine whether the second starting address matches the preset address and whether the second memory usage is within the usage range. If the second starting address matches the preset address and the second memory usage is within the usage range, calculate the second checksum based on the second starting address and the second memory usage. If the second starting address is different from the preset address or the second memory usage is not within the usage range, output a diagnostic response 0x01 to indicate that the second starting address or the second memory usage is incorrect.

[0104] When the second length matches the second preset length, the second starting address matches the preset address, and the second memory usage is within the usage range, 0x00 is output to indicate that the verification has passed. The vehicle then calculates the second check value based on the second starting address and the second memory usage. After obtaining the second check value, the vehicle compares the second check value with the second reference check value.

[0105] Step S603: In response to the second check value matching the second reference check value, it is determined that the target software has completed the upgrade.

[0106] If the second check value is the same as the second reference check value, it can be determined that the second check value matches the second reference check value, and thus the target software has completed the upgrade.

[0107] In this embodiment, when the target software is upgraded, the target software is verified by checking the starting address and memory usage of the latest version to ensure that the upgraded target software is complete.

[0108] Reference Figure 7 , Figure 7 This is a flowchart illustrating the method for upgrading the vehicle software in this application. Figure 4 ,based on Figure 2, Figure 5 or Figure 6 In the embodiment shown, after step S203, the method further includes:

[0109] Step S701: Determine the termination address of the data replacement in the target memory segment.

[0110] In this embodiment, after the data to be replaced in the target memory segment is replaced with the corresponding differential data, the vehicle needs to perform a programming dependency check. For example, the vehicle needs to detect whether each target memory segment has been updated as expected. A termination address is set in the target memory segment; if the data in the memory segment is updated to the data at the termination address, it can be determined that the memory segment has been updated. Therefore, the vehicle obtains the termination address of the data replacement in the target memory segment.

[0111] Step S702: If the data corresponding to the termination address in the target memory segment is detected to have been replaced, the valid flag bit of the logical block corresponding to the target memory segment is set to the valid state.

[0112] When the vehicle detects that the data corresponding to the termination address of the target memory segment has been replaced, it can determine that the target memory segment has been updated. The vehicle then needs to set the valid flag bit of the logical block corresponding to the target memory segment to a valid state. For example, refer to... Figure 3 Each application memory segment has a corresponding application valid flag segment, which is the logical block corresponding to the application memory segment. The vehicle sets the status of the application valid flag segment to valid, which in turn sets the status of the logical block corresponding to the application memory segment to valid. In this way, the vehicle completes the update detection of each target memory segment.

[0113] Step S703: Perform a soft reset operation on the target software based on the bootloader, and read the status of the valid flag bits of each logic block.

[0114] After completing the update checks of each target memory segment, the vehicle performs a soft reset operation on the target software based on the bootloader, which is essentially a restart operation, to determine whether the target software can run normally. After the soft reset operation, the vehicle reads the status of the valid flag bits of each logic block.

[0115] In step S704, if the valid flag bits of each logic block are in a valid state, it is determined that the target software has completed the upgrade, and the target software is controlled to run.

[0116] If the valid flags in each logic block are all in a valid state, then the target software has completed the upgrade, and the vehicle can then control the target software to run.

[0117] If the status of the valid flag bit of at least one logical block is not valid, the target memory segment needs to be updated again based on differential software.

[0118] In this embodiment, the vehicle detects updates to each target memory segment, thereby performing a soft reset operation on the target software, so that the target software can run normally after the upgrade.

[0119] In one embodiment, before upgrading the target software, the vehicle needs to raise its security access level, that is, raise the security access level from the current level to a preset level. Furthermore, the vehicle adjusts its current data download session mode to the target data download session mode associated with the preset level. In the target data download session mode, the vehicle can download the driver program. Additionally, the vehicle's fault alarm function (DTC), message receiving function, and message sending function are stopped to switch the vehicle from the application's runtime environment to a boot loading environment, thereby initiating the software update process. Furthermore, the controller's flashing conditions, such as power stability and communication status, can be detected. The communication interface can also be disabled to avoid interference with the software upgrade during communication. Disabling the DTC function prevents false alarms after the vehicle updates the target software; disabling the message receiving and sending functions avoids interference. In this way, a stable environment is ensured for the software upgrade.

[0120] Once the target software upgrade is confirmed and its operation is controlled, the security access level is adjusted from the preset level to the current level, and the target data download session mode is changed to the current data download session mode. The vehicle's fault alarm function, message receiving function, and message sending function are activated to switch the vehicle from the boot loading environment to the runtime environment, ensuring the target software can operate normally. Furthermore, the vehicle needs to clear previously recorded fault codes (DTCs) to prevent historical fault codes from interfering with the normal operation of the target software. Additionally, the communication interface is restarted and enabled, allowing the vehicle's various modules to resume normal data exchange, obtain and verify the latest version number, and ensure the vehicle is running the correct version of the target software.

[0121] In this embodiment, the vehicle's functions are adjusted before acquiring differential data to avoid interference with the target software during the upgrade process.

[0122] Based on the content described in the above embodiments, this application also provides a vehicle, with reference to... Figure 8 , Figure 8 This is a schematic diagram of a vehicle program module provided in an embodiment of this application. In some embodiments, the vehicle 800 includes:

[0123] The acquisition module 810 is used to acquire differential data corresponding to each target memory segment in the target software to be upgraded from the server. The memory segments of the target software include the boot loading memory segment, the application memory segment, and the calibration memory segment. Each target memory segment includes the application memory segment and the calibration memory segment. The differential data is used to indicate the difference between the latest version of the data in the target memory segment and the current version of the data.

[0124] The determination module 820 is used to determine the data to be replaced corresponding to the differential data in the target memory segment;

[0125] The processing module 830 is used to replace the data to be replaced in each target memory segment with the corresponding differential data based on the bootloader in the bootloader memory segment, so as to upgrade the target software.

[0126] In some embodiments, vehicle 800 is specifically used for:

[0127] The first verification instruction is obtained based on the diagnostic routine service, and the first reference verification value, the first starting address of the target software in the current version, and the first memory usage are obtained from the first verification instruction.

[0128] The first check value is determined based on the first starting address and the first memory usage.

[0129] In response to the first check value matching the first reference check value, it is determined that the target software is complete software, and differential data corresponding to each target memory segment in the target software to be upgraded is obtained from the server.

[0130] In some embodiments, vehicle 800 is specifically used for:

[0131] The first verification field is obtained based on the first verification instruction, and the first length of the first verification field is determined.

[0132] If the first length matches the first preset length, the first starting address matches the preset address, and the first memory usage is within the usage range, then the first check value is determined based on the first starting address and the first memory usage.

[0133] In some embodiments, vehicle 800 is specifically used for:

[0134] The second verification instruction is obtained based on the diagnostic routine service, and the second reference verification value, the second starting address of the target software in the latest version, and the second memory usage are obtained from the second verification instruction.

[0135] The second check value is determined based on the second starting address and the second memory usage.

[0136] In response to the second check value matching the second reference check value, it is determined that the target software has completed the upgrade.

[0137] In some embodiments, vehicle 800 is specifically used for:

[0138] The second verification field is obtained based on the second verification instruction, and the second length of the second verification field is determined.

[0139] If the second length matches the second preset length, the second starting address matches the preset address, and the second memory usage is within the usage range, then the second check value is determined based on the second starting address and the second memory usage.

[0140] In some embodiments, vehicle 800 is specifically used for:

[0141] Determine the termination address for data replacement in the target memory segment;

[0142] If the data corresponding to the termination address in the target memory segment has been replaced, the valid flag bit of the logical block corresponding to the target memory segment is set to the valid state.

[0143] The target software is soft reset based on the bootloader, and the status of the valid flag bits of each logic block is read.

[0144] With all valid flag bits in each logic block in a valid state, the target software upgrade is confirmed, and the target software operation is controlled.

[0145] In some embodiments, vehicle 800 is specifically used for:

[0146] The vehicle's security access level is raised from the current level to the preset level, and the vehicle's current data download session mode is adjusted to the target data download session mode associated with the preset level.

[0147] The vehicle's fault alarm function, message receiving function, and message sending function are stopped to switch the vehicle from the operating environment to the boot loading environment;

[0148] After controlling the target software to run, it also includes:

[0149] Adjust the security access level from the preset level to the current level, and adjust the target data download session mode to the current data download session mode;

[0150] The system controls the vehicle's fault alarm function, message receiving function, and message sending function to switch the vehicle from the boot loading environment to the operating environment.

[0151] In some embodiments, vehicle 800 is specifically used for:

[0152] Download the driver and determine the location of the data to be replaced in the corresponding target memory segment;

[0153] The bootloader controls the driver to erase the data to be replaced in the location;

[0154] The bootloader controls the driver to write differential data to the location of the erased data.

[0155] It should be noted that the specific steps in the vehicle software upgrade method are as described in the above embodiments, and will not be repeated here.

[0156] Furthermore, based on the content described in the above embodiments, this application also provides an electronic device, which includes at least one processor, a communication interface and a memory communicatively connected to the processor; wherein the communication interface is used to communicate with other communication devices, and the memory stores computer-executed instructions; the at least one processor executes the computer-executed instructions stored in the memory to implement the various steps in the vehicle software upgrade method described in the above embodiments.

[0157] To better understand the embodiments of this application, please refer to... Figure 9 , Figure 9 This is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of this application.

[0158] like Figure 9 As shown, the electronic device 900 of this embodiment includes: a processor 901, a memory 902, and a communication interface 904; wherein:

[0159] Memory 902 is used to store instructions executed by the computer;

[0160] Communication interface 904 is used to communicate with other communication devices;

[0161] The processor 901 is configured to execute computer execution instructions stored in memory to implement the various steps in the query optimization method described in the above embodiments.

[0162] Alternatively, the memory 902 can be either standalone or integrated with the processor 901.

[0163] When the memory 902 is set up independently, the device also includes a bus 903 for connecting the memory 902, the communication interface 904, and the processor 901.

[0164] This application provides a computer-readable storage medium storing computer-executable instructions. When a processor executes these instructions, it implements the various steps of the vehicle software upgrade method described in the above embodiments.

[0165] This application provides a computer program product, including a computer program that, when executed by a processor, implements the various steps of the vehicle software upgrade method described in the above embodiments.

[0166] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative; for instance, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple modules may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be indirect coupling or communication connection through some interfaces, devices, or modules, and may be electrical, mechanical, or other forms.

[0167] The modules described as separate components may or may not be physically separate. The components shown as modules may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.

[0168] Furthermore, the functional modules in the various embodiments of this application can be integrated into one processing unit, or each module can exist physically separately, or two or more modules can be integrated into one unit. The unit composed of the above modules can be implemented in hardware or in the form of hardware plus software functional units.

[0169] The integrated modules described above, implemented as software functional modules, can be stored in a computer-readable storage medium. These software functional modules, stored in a storage medium, include several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute some steps of the methods of the various embodiments of this application.

[0170] It should be understood that the aforementioned processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), etc. A general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in the application can be directly manifested as being executed by a hardware processor, or executed by a combination of hardware and software modules within the processor.

[0171] The memory may include high-speed memory, and may also include non-volatile memory, such as at least one disk storage device, and may also be a USB flash drive, portable hard drive, read-only memory, disk or optical disc, etc.

[0172] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of illustration, the buses shown in the accompanying drawings are not limited to a single bus or a single type of bus.

[0173] The aforementioned storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory, electrically erasable programmable read-only memory, erasable programmable read-only memory, programmable read-only memory, read-only memory, magnetic storage, flash memory, magnetic disk, or optical disk. The storage medium can be any available medium that can be accessed by a general-purpose or special-purpose computer.

[0174] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.

Claims

1. A method for upgrading vehicle software, characterized in that, include: Obtain differential data corresponding to each target memory segment in the target software to be upgraded from the server. The memory segments of the target software include the boot load memory segment, the application memory segment, and the calibration memory segment. Each target memory segment includes the application memory segment and the calibration memory segment. The differential data is used to indicate the difference between the latest version of the data in the target memory segment and the current version of the data. Determine the data to be replaced corresponding to the differential data in the target memory segment; Based on the bootloader in the bootloader memory segment, the data to be replaced in each target memory segment is replaced with the corresponding differential data to upgrade the target software.

2. The method according to claim 1, characterized in that, The step of obtaining differential data corresponding to each target memory segment in the target software to be upgraded from the server includes: The first verification instruction is obtained based on the diagnostic routine service, and the first reference verification value, the first starting address of the target software in the current version, and the first memory usage are obtained from the first verification instruction. The first check value is determined based on the first starting address and the first memory usage. In response to the first check value matching the first reference check value, it is determined that the target software is complete software, and differential data corresponding to each target memory segment in the target software to be upgraded is obtained from the server.

3. The method according to claim 2, characterized in that, Determining the first checksum based on the first starting address and the first memory usage includes: The first verification field is obtained based on the first verification instruction, and the first length of the first verification field is determined. If the first length matches the first preset length, the first starting address matches the preset address, and the first memory usage is within the usage range, then the first check value is determined based on the first starting address and the first memory usage.

4. The method according to claim 1, characterized in that, After the bootloader in the bootloader memory segment replaces the data to be replaced in each target memory segment with the corresponding differential data, the process further includes: The second verification instruction is obtained based on the diagnostic routine service, and the second reference verification value, the second starting address of the target software in the latest version, and the second memory usage are obtained from the second verification instruction. The second check value is determined based on the second starting address and the second memory usage. In response to the second check value matching the second reference check value, it is determined that the target software has completed the upgrade.

5. The method according to claim 4, characterized in that, The step of determining the second check value based on the second starting address and the second memory usage includes: The second verification field is obtained based on the second verification instruction, and the second length of the second verification field is determined. If the second length matches the second preset length, the second starting address matches the preset address, and the second memory usage is within the usage range, then the second check value is determined based on the second starting address and the second memory usage.

6. The method according to claim 1, characterized in that, After the bootloader in the bootloader memory segment replaces the data to be replaced in each target memory segment with the corresponding differential data, the process further includes: Determine the termination address for data replacement in the target memory segment; If the data corresponding to the termination address in the target memory segment is detected to have been replaced, the valid flag bit of the logical block corresponding to the target memory segment is set to a valid state. Based on the bootloader, a soft reset operation is performed on the target software, and the status of the valid flag bits of each logic block is read. If the valid flag bits of each logic block are in a valid state, it is determined that the target software has completed the upgrade, and the target software is controlled to run.

7. The method according to claim 6, characterized in that, Before obtaining the differential data corresponding to each target memory segment in the target software to be upgraded from the server, the process also includes: The security access level of the vehicle is raised from the current level to the preset level, and the current data download session mode of the vehicle is adjusted to the target data download session mode associated with the preset level. The vehicle's fault alarm function, message receiving function, and message sending function are stopped to switch the vehicle from the operating environment to the boot loading environment. After controlling the target software to run, the method further includes: Adjust the security access level from the preset level to the current level, and adjust the target data download session mode to the current data download session mode; The system controls the vehicle's fault alarm function, message receiving function, and message sending function to switch the vehicle from the boot loading environment to the operating environment.

8. The method according to any one of claims 1-7, characterized in that, The step of replacing the data to be replaced in each target memory segment with corresponding differential data based on the bootloader in the bootloader memory segment includes: Download the driver and determine the location of the data to be replaced in the corresponding target memory segment; The bootloader controls the driver to erase the data to be replaced at the specified location. The bootloader controls the driver to write differential data to the location of the erased data.

9. A vehicle, characterized in that, include: The acquisition module is used to acquire differential data corresponding to each target memory segment in the target software to be upgraded from the server. The memory segments of the target software include a boot load memory segment, an application memory segment, and a calibration memory segment. Each target memory segment includes an application memory segment and a calibration memory segment. The differential data is used to indicate the difference between the latest version of the data in the target memory segment and the current version of the data. The determining module is used to determine the data to be replaced corresponding to the differential data in the target memory segment; The processing module is used to replace the data to be replaced in each of the target memory segments with the corresponding differential data based on the bootloader in the bootloader memory segment, so as to upgrade the target software.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, implement the vehicle software upgrade method as described in any one of claims 1-8.