Vehicle software upgrading method and device, equipment and storage medium
Through the differential upgrade method, differential data and storage addresses are used for precise erasing and writing, which solves the problem of high resource consumption in vehicle software upgrades and realizes a fast and resource-saving upgrade process.
Patent Information
- Application Number
- CN202510739119.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-04
- Publication Date
- 2025-09-26
AI Technical Summary
During the vehicle software upgrade process, the limited storage space of the embedded chip leads to high resource consumption and excessive use of network resources.
Through the differential upgrade method, differential data is received and data is erased and written according to the storage address. The differential data is transmitted using the controller LAN bus, and the upgrade accuracy and security are ensured by combining hash value verification.
It reduces the consumption of computing and network resources, increases upgrade speed and bandwidth utilization, and improves user experience.
Smart Images

Figure CN120704708A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of software development technology, and specifically, to a vehicle software upgrade method, device, equipment and storage medium. Background Art
[0002] Vehicle software generally needs to be upgraded and updated regularly. In the existing technology, a new version of vehicle software is released on the cloud, and the cloud sends the upgrade package of the new version of the software to the vehicle side. The vehicle side upgrades the corresponding vehicle software according to the upgrade package sent by the cloud.
[0003] In the prior art, when the vehicle side is an embedded chip with a small storage space, a large amount of resources are consumed when performing software upgrades on the vehicle side, and a large amount of vehicle side network resources are also occupied during data transmission. Summary of the Invention
[0004] The embodiments of the present application provide a vehicle software upgrade method, apparatus, device, and storage medium, which aim to reduce computing resource consumption and network resource consumption during the differential upgrade process.
[0005] A first aspect of an embodiment of the present application provides a vehicle software upgrade method, which is applied to an OTA master control terminal and includes: receiving differential data and differential configuration information corresponding to the vehicle software, the differential data comprising a plurality of differential data blocks, the differential data blocks being obtained based on data differences between a source data packet of the vehicle software and an upgrade packet; the differential configuration information comprising at least a storage address corresponding to each differential data block in the differential data; Erasing the data block corresponding to the vehicle software according to the storage address of the data block corresponding to the differential data; The differential data is written into a data block corresponding to the vehicle software.
[0006] Optionally, erasing the data block according to the storage address of the data block corresponding to the differential data includes: Adding the storage address to a preset erase instruction; The erasing instruction is sent to the electronic controller, so that the electronic controller erases the data according to the erasing instruction.
[0007] Optionally, writing the differential data into a data block corresponding to the vehicle software includes: Unpacking and reading the data packet corresponding to the differential data to obtain corresponding binary data; The differential data is transmitted to an electronic control unit via the controller area network bus, so that the electronic control unit writes the differential data into the data block.
[0008] Optionally, the method further includes: When the differential data is written, receiving the hash value of the upgrade package sent from the cloud; Performing hash value calculation on the data packet after the data block is updated to obtain a hash value of the data packet; Comparing the hash value of the upgrade package with the hash value of the data packet to verify the data packet; When the data packet is verified to be correct, the corresponding upgrade result is reported to the cloud.
[0009] A second aspect of an embodiment of the present application provides a vehicle software upgrade method, which is applied to the cloud and includes: Receive the source data packet of vehicle software sent by the OTA master terminal; Comparing the source data packet with the corresponding upgrade packet to obtain the differential data; Determining differential configuration information corresponding to the differential data based on pre-acquired flash memory configuration information of the vehicle software; The differential data and the differential configuration information are sent to the OTA master control end, so that the OTA master control end upgrades the vehicle software according to the differential data and the differential configuration information.
[0010] Optionally, comparing the source data packet and the upgrade data packet to obtain corresponding differential data includes: Comparing the data at each address of the source data packet and the upgrade package to determine different data at the same address; determining the capacity of a minimum unit flash memory block corresponding to the vehicle software; According to the capacity of the minimum unit flash memory block, the different data at the same address are combined into the differential data.
[0011] Optionally, determining the differential configuration information corresponding to the differential data based on pre-acquired flash memory configuration information of the vehicle software includes: Determining, based on the flash memory configuration information, an address space corresponding to the vehicle software, a capacity of a minimum block that can be erased at a single time, and an erase start address; Determining a start address and an end address of a flash memory block corresponding to the differential data according to a position of the differential data in the address space, a capacity of a minimum block for single erasure, and the erase start address; The start address, the end address, and the capacity of the flash memory block corresponding to the differential data are used as the differential configuration information.
[0012] A third aspect of an embodiment of the present application provides a vehicle software upgrade device, which is applied to an OTA master control terminal and includes: a data receiving module, configured to receive differential data and differential configuration information corresponding to the vehicle software, the differential data comprising a plurality of differential data blocks, the differential data blocks being obtained based on data differences between a source data packet of the vehicle software and an upgrade packet; the differential configuration information comprising at least a storage address corresponding to each differential data block in the differential data; a data erasing module, configured to erase the data block corresponding to the vehicle software according to the storage address of the data block corresponding to the differential data; A data writing module is used to write the differential data into a data block corresponding to the vehicle software.
[0013] Optionally, the data erasure module includes: An erase instruction generation submodule, configured to add the storage address to a preset erase instruction; The data erasing submodule is configured to send the erasing instruction to the electronic controller, so that the electronic controller erases the data according to the erasing instruction.
[0014] Optionally, the data writing module includes: A data reading submodule, configured to unpack and read the data packet corresponding to the differential data to obtain corresponding binary data; The data transmission submodule is configured to transmit the differential data to an electronic control unit via the controller area network bus, so that the electronic control unit writes the differential data into the data block.
[0015] Optionally, the device further comprises: A first hash value acquisition module is configured to receive the hash value of the upgrade package sent from the cloud when the differential data is written; a second hash value obtaining module, configured to perform hash value calculation on the data packet after the data block is updated to obtain a hash value of the data packet; A hash value comparison module, configured to compare the hash value of the upgrade package with the hash value of the data packet to verify the data packet; The upgrade result reporting module is used to report the corresponding upgrade result to the cloud when the data packet verification is correct.
[0016] A fourth aspect of an embodiment of the present application provides a readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the method described in the first aspect of the present application is implemented.
[0017] A fourth aspect of an embodiment of the present application provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps of the method described in the first aspect of the present application are implemented.
[0018] The vehicle software upgrade method provided by the present application receives differential data and differential configuration information corresponding to the vehicle software, wherein the differential data includes a plurality of differential data blocks obtained based on data differences between a source data packet of the vehicle software and an upgrade packet; the differential configuration information includes at least a storage address corresponding to each differential data block in the differential data; and erases data blocks corresponding to the vehicle software according to the storage addresses of the data blocks corresponding to the differential data; The differential data is written into a data block corresponding to the vehicle software.
[0019] In this application, by comparing the storage structure differences between the source data package and the upgrade package, corresponding differential data is generated. The differential data is binary data, which realizes incremental comparison at the binary level and accurately controls the upgrade content of the vehicle software. When performing a differential upgrade, the controller LAN bus only needs to transmit the binary differential data to the ECU (vehicle control unit) for flashing, reducing the resources consumed during the differential upgrade and saving the time consumed during the differential upgrade. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments of the present application. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0021] Figure 1 Flowchart of the proposed vehicle software upgrade method; Figure 2 This is a schematic diagram of the vehicle software upgrade process proposed in one embodiment of the present application; Figure 3 is a schematic diagram of vehicle upgrade software proposed in one embodiment of the present application; Figure 4 This is a data comparison diagram proposed in an embodiment of the present application; Figure 5 This is a schematic diagram of the S19 file format proposed in one embodiment of the present application; Figure 6 is a schematic diagram of a vehicle software upgrade device proposed in one embodiment of the present application; Figure 7 FIG. 1 is a schematic diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0022] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0023] The ECU (electronic control unit) runs software programs corresponding to various device parts on the vehicle, referred to as vehicle software. When a new vehicle software upgrade package is released on the cloud, OTA (Over-the-Air, a technology for remotely upgrading and managing devices through mobile communication networks) on the vehicle side transmits the software upgrade package to the ECU via wireless communication, directly modifying the firmware or parameters within the ECU to achieve functional optimization or defect repair.
[0024] refer to Figure 1 , Figure 1 This is a flow chart of a vehicle software upgrade method proposed in one embodiment of the present application. Figure 1 As shown, the specific steps of the method include: S11: Receive differential data and differential configuration information corresponding to the vehicle software, wherein the differential data includes multiple differential data blocks, and the differential data blocks are obtained based on different data in the source data packet and the upgrade package of the vehicle software; the differential configuration information at least includes the storage address corresponding to each differential data block in the differential data.
[0025] In this embodiment, the vehicle software refers to various software running in the vehicle ECU. The difference data block is a data block that is different between the source data packet of the vehicle software stored on the vehicle and the latest version upgrade package of the vehicle software in the cloud.
[0026] In this embodiment, Figure 2 As shown, Figure 2 This is a schematic diagram of the vehicle software upgrade process proposed in an embodiment of the present application. The vehicle-side OTAM receives differential data and differential configuration information corresponding to the vehicle software. The differential data includes the difference data blocks between the source data packet and the upgrade package of the vehicle software, which is binary data. The differential configuration information includes the starting address and ending address of the data block corresponding to the differential data, as well as the size of the data block.
[0027] For example, the vehicle-side headlight ECU needs to be updated. The cloud obtains the version number of the vehicle software for headlight control sent by the vehicle, and then obtains the source data packet of the headlight control software. At the same time, it receives the upgrade package uploaded by the developer and obtains the flash memory configuration information corresponding to the headlight control software.
[0028] S12: Erasing the data block corresponding to the vehicle software according to the storage address of the data block corresponding to the differential data.
[0029] In this embodiment, the storage address of the data block includes the start address and the end address of the data block in the storage space.
[0030] In this embodiment, after the vehicle-side OTAM determines the starting address and ending address of the data block corresponding to the differential data, it adds the address to be erased and the size of the data to be erased on the basis of the erase instruction in the original OTA flashing specification, and sends the modified erase instruction to the electronic control unit, so that the electronic control unit erases the data block corresponding to the vehicle software according to the erase instruction.
[0031] For example, the format of the modified erase instruction is “original erase instruction + start address + end address + size of the space occupied by the data block”.
[0032] In another embodiment of the present application, the specific steps of S12 include: S13: Writing the differential data into a data block corresponding to the vehicle software.
[0033] In this embodiment, the CAN bus (Controller Area Network Bus) is a distributed real-time control system bus based on the serial communication protocol, which connects ECUs, sensors, instrument panels, etc. to achieve real-time data interaction.
[0034] In this embodiment, Figure 2 As shown, during the differential upgrade process, the vehicle-side OTAM decompresses and reads the compressed differential binary package sent from the cloud, and transmits the differential data to the ECU through the controller LAN bus. After the ECU receives the differential data, it writes the received differential data to the erased address, that is, writes it into the data block corresponding to the vehicle software, and completes the vehicle software upgrade.
[0035] S21: Add the storage address to a preset erase instruction.
[0036] In this embodiment, the preset erasure instruction is an instruction in a pre-agreed service rule, through which the corresponding unit can be controlled to execute the corresponding operation of the instruction.
[0037] In this embodiment, after determining the data block storage address corresponding to the differential data, that is, determining the starting address and ending address of the data block corresponding to the differential data, the preset erase instruction is to perform an entire chip erase operation. The erase address is added to the preset erase instruction, and the size of the data block to be erased is added to form a new erase instruction.
[0038] For example, assuming the preset erase instruction is 3101FF00, the starting address of the data block is 0x010000 and the ending address is 0x021010, then the storage address is 0x010000-0x021010. The new erase instruction is 3101FF00 + the address to be erased + the data block size.
[0039] S22: Send the erasing instruction to the electronic controller, so that the electronic controller erases the data according to the erasing instruction.
[0040] In this embodiment, the flash writing end is a program running in the vehicle ECU for erasing and writing to the flash memory space.
[0041] In this embodiment, as shown in FIG. 2 , the vehicle-side OTAM sends an erase instruction to the flashing end. After receiving the erase instruction, the flashing end reads the erase address in the erase instruction and deletes the data at the address corresponding to the erase instruction in the corresponding flash memory.
[0042] For example, when the vehicle-side headlight control program needs to be upgraded, the vehicle-side OTAM sends an erase command to the flashing end. After reading the corresponding erase address, the flashing end erases the data at the corresponding address. The erase address is the location where the data in the vehicle-side headlight control program data packet needs to be modified.
[0043] In this embodiment, after obtaining the differential data and differential configuration information in the cloud, the differential data and differential configuration information are sent to the vehicle-side OTAM. The vehicle-side OTAM erases the data at the corresponding position based on the differential data and differential configuration information, thereby improving the accuracy of data erasure, and does not make changes to places that do not need to be modified, facilitating fine erasure, saving data transmission time and the execution time of the erasure operation, thereby improving the speed of vehicle software upgrades and saving resources occupied by vehicle software upgrades.
[0044] In another embodiment of the present application, the specific steps of S13 include: S31: Unpacking and reading the data packet corresponding to the differential data to obtain corresponding binary data.
[0045] In this embodiment, when the cloud sends differential data, in order to save transmission time, the data packet is compressed into a compressed packet. After receiving the differential data file, the vehicle-side OTAM unpacks and reads the data packet to obtain the corresponding binary data.
[0046] For example, the cloud sends the differential data corresponding to the headlight control program. The data file package is in zip compression format. After receiving the zip data package, the vehicle-side OTAM decompresses the data package through the corresponding decompression tool, reads the content, and obtains the differential data, which is binary data.
[0047] S32: Transmitting the differential data to an electronic control unit via the controller area network bus, so that the electronic control unit writes the differential data into the data block.
[0048] In this embodiment, after obtaining the differential data, the vehicle-side OTAM transmits the differential data to the electronic control unit through the controller local area network bus, and the electronic control unit writes the obtained differential data into the corresponding data block in the storage space.
[0049] In this embodiment, the differential data is transmitted via the controller area network bus and then written to the corresponding location, without the need to transmit the entire packet of data, thereby increasing the speed of differential upgrades and reducing the storage space occupied by differential upgrades.
[0050] In another embodiment of the present application, the method further includes: S41: When the differential data is written, receive the hash value of the upgrade package sent from the cloud.
[0051] In this embodiment, when the differential data is written, the vehicle side needs to perform data packet verification on the written data packet. The cloud stores the hash value corresponding to the upgrade package, which is the hash value obtained by performing a hash operation on the data in the upgrade package.
[0052] For example, after the headlight control software is updated, the vehicle initiates a verification routine and sends a request to the cloud to obtain the hash value of the headlight control software upgrade package. After receiving the request, the cloud sends the hash value of the latest version of the headlight control software upgrade package to the vehicle OTAM.
[0053] S42: performing hash value calculation on the data packet after the data block is updated to obtain the hash value of the data packet.
[0054] In this embodiment, after the vehicle side initiates verification and receives the hash value of the upgrade package, the electronic controller performs a hash operation on the updated data packet on the vehicle side to obtain the hash value of the data packet.
[0055] For example, the vehicle side performs a hash operation on the data packet after the headlight control software is updated to obtain a corresponding hash value.
[0056] S43: Compare the hash value of the upgrade package with the hash value of the data packet to verify the data packet.
[0057] In this embodiment, Figure 2 As shown in the figure, after obtaining the hash value of the upgrade package sent from the cloud and calculating the hash value of the vehicle-side data packet, the data packet is verified by comparing the two hash values. If the hash values are the same, it means the verification is correct and the upgrade is successful. If the hash values are incorrect, it means the verification result is incorrect and the upgrade failed.
[0058] For example, the hash value sent by the headlight control software cloud is compared with the hash value of the data packet calculated by the vehicle side. If the two are the same, it means that the data packet upgrade of the headlight control software is complete.
[0059] S44: When the data packet is verified to be correct, the corresponding upgrade result is reported to the cloud.
[0060] In this embodiment, Figure 2 As shown in the figure, if the data packet verification is correct, the vehicle-side ECU sends a verification success message to OTAM, and OTAM reports the verification result to the cloud. After receiving the verification result, the cloud confirms that the upgrade is complete.
[0061] For example, after the data packet of the headlight control program is verified to be correct, information indicating that the headlight control program upgrade is complete is reported to the cloud.
[0062] In this embodiment, the upgraded data packet needs to be reset, that is, the currently running partition is switched to the partition storing the data packet, and the currently running data packet can be used as the source data packet in the next differential upgrade.
[0063] In this embodiment, when restoring the data packet on the vehicle side, it is only necessary to transmit the binary data to the ECU via the controller area network bus. The ECU directly writes the data to complete the upgrade, saving the time of differential upgrade.
[0064] In another embodiment of the present application, at the beginning of the flash process, the vehicle-side OTAM needs to check whether the integrity of the flash space storing the upgrade package on the ECU side is damaged. If the space integrity is damaged, it means that the file is damaged, and it is impossible to add differential data to the data packet for upgrade. At this time, it is necessary to write the upgraded data packet to the corresponding storage location through the normal upgrade process. It is also necessary to confirm whether the version of the data packet stored in the vehicle-side ECU is the same as the version of the source data packet on the cloud. If the versions are different, the differential data cannot be directly written to the data packet, and the normal upgrade process is still required.
[0065] In another embodiment of the present application, a special CAN differential bus protocol is designed, and each data frame carries a segment check code, which is used to check the data to ensure the accuracy of data transmission. AES-256 encryption (Advanced Encryption Standard, symmetric encryption algorithm) can also be performed during transmission, and a 256-bit key is used to encrypt and decrypt the data. The same key is required for encryption and decryption to ensure the security of data transmission.
[0066] For example, a CRC16 (Cyclic Redundancy Check) code is generated every 512 bytes, and the transmitted data is checked using this verification method.
[0067] In another embodiment of the present application, differential upgrades across two versions are supported. For example, if the vehicle is running the second version of the data packet and the data packet in the backup partition is the first version of the data packet, the cloud compares the first version of the data packet with the third version of the data packet to obtain differential data, and then sends the differential data to the vehicle side. The vehicle side uses the differential data to upgrade the first version of the data packet in the backup partition to the third version, and then switches the running data packet from the second version of the data packet to the third version of the data packet. The second version of the data packet can be upgraded after the fourth version of the data packet is released. This ensures that the upgrade process does not affect the normal operation of the software on the vehicle. This improves the user experience.
[0068] In another embodiment of the present application, an upgrade trigger logic is established, and the cloud-side forced upgrade instruction works together with the local vehicle status detection. When the cloud releases a new version upgrade package, it notifies the vehicle-side OTAM to upgrade the vehicle software. It can also monitor the vehicle status in real time and upgrade the vehicle software when the vehicle status reaches the preset parameters.
[0069] For example, the cloud sends the server command code 0xA5 to the OTAM, notifying the vehicle to perform a software upgrade. The vehicle detects vehicle data and performs the upgrade when the vehicle speed is zero and the battery charge is greater than 30%. This allows for flexible software upgrades, ensuring timely software updates and improving the user experience.
[0070] In another embodiment of the present application, in actual application, the vehicle software upgrade method using CAN differential transmission shortens the upgrade of the headlight control program, which traditionally takes 40 minutes, to 8 minutes, and the actual bandwidth utilization is increased by 83%.
[0071] refer to Figure 3 , Figure 3 This is a flow chart of a vehicle software upgrade method proposed in an embodiment of the present application, which is applied to the cloud. Figure 3 As shown, the specific steps include: S51: Receive the source data packet of the vehicle software sent by the OTA master control terminal.
[0072] In this embodiment, the source data packet is a data packet of vehicle software that needs to be upgraded on the vehicle, and the version of the vehicle software data packet is lower than the version of the vehicle software currently running. The vehicle software upgrade package is a data packet of the latest version of the vehicle software.
[0073] In this embodiment, reference Figure 1 , Figure 1 This is a schematic diagram of the vehicle software upgrade process proposed in one embodiment of the present application. Figure 1 As shown, the cloud first obtains the source data packet and upgrade package of the vehicle software, receives the source data packet uploaded by the vehicle, and then obtains the upgrade package of the vehicle software released by the developer.
[0074] S52: Compare the source data packet with the corresponding upgrade packet to obtain the differential data.
[0075] In this embodiment, the differential data refers to the storage structure difference data points between the source data package and the upgrade package. These data points are the changed or newly added content in the upgrade package.
[0076] In this embodiment, the data at each corresponding address in the source data packet and the upgrade package are compared to determine the difference data points. When different data points exist at the same address of the two data packets, the addresses of these difference data points are recorded. It is also necessary to know the size of the minimum block where the storage block where the difference data is located is located. The minimum block is the smallest unit of erasure. The prerequisite of this solution is that the vehicle ECU and the cloud use the same flash (flash memory) configuration information for erasing and writing, so the size of the minimum block where the storage block is located is the same.
[0077] S53: Determine the differential configuration information corresponding to the differential data based on the pre-acquired flash memory configuration information of the vehicle software.
[0078] In this embodiment, the flash memory configuration information of the vehicle software is the flash memory solution of the ECU supplier obtained by the cloud when creating the ECU part, including the address space specified by the flash memory, the size of the current flash memory block, the minimum unit of a single erase, and the erase start address.
[0079] In this embodiment, after forming the differential data and determining the address of the data block where the differential data is located, the starting address and ending address of the cache block that needs to be flushed on the vehicle side are calculated based on the pre-acquired flash memory configuration information of the vehicle, and this information is determined as differential configuration information.
[0080] S54: Send the differential data and the differential configuration information to the OTA master control end, so that the OTA master control end upgrades the vehicle software according to the differential data and the differential configuration information.
[0081] In this embodiment, after the cloud generates the query data and differential configuration information corresponding to the vehicle software, it sends the differential data and differential configuration information to the OTA main control end, and the OTA main control end updates the vehicle software according to the received differential data and differential configuration information.
[0082] In another embodiment of the present application, S52 includes: S61: Compare the data at each address of the source data packet and the upgrade package to determine different data at the same address.
[0083] In this embodiment, the data of the data package and the upgrade package are compared one by one in address order, and for each data point, different data at the same address is determined.
[0084] refer to Figure 4 , Figure 4 This is a data comparison diagram proposed in an embodiment of the present application. Figure 4 As shown, the source data packet and the target packet (upgrade packet) include address 1 to address n. The source data packet and the upgrade packet are compared to determine that there is difference data 2 at address 2. Then, a differential combination is performed to obtain an adjacent block (data block) containing abnormal data. This data block is the smallest erase unit.
[0085] For example, the source data package and the upgrade package are compared based on the characteristics of the S19 file. The S19 file parsing technology converts readable ASCII data into binary code, which plays an irreplaceable role in embedded development and automotive electronics upgrades. Its core lies in accurately decoding record fields and verifying data integrity, such as Figure 5 As shown, Figure 5 This is a schematic diagram of the S19 file format proposed in an embodiment of the present application. Each data in the figure includes a corresponding address and length. The figure also includes the partition structure in the ECU, including a running partition (Running Partition) and a backup partition (Reserving partitions), as well as a data storage area.
[0086] S62: Determine the capacity of the minimum unit flash memory block corresponding to the vehicle software.
[0087] In this embodiment, a flash memory address space partition map of each vehicle software is stored in the cloud. The flash memory address space partition map is used to mark the division of the address space inside the flash memory. It is a map divided by flash memory blocks. The cloud determines the capacity of the minimum unit flash memory block corresponding to the vehicle software based on the address division in the map.
[0088] For example, the capacity of a minimum unit flash memory block is 1024 bytes.
[0089] S63: According to the capacity of the minimum unit flash memory block, the different data at the same address are combined into the differential data.
[0090] In this embodiment, the different data at the same address are the parts that need to be updated in the data block of the vehicle software. The minimum unit of flash writing is the capacity of the minimum unit flash memory block. Due to the characteristics of the S19 file, the data generally includes the address + the corresponding bytes. The bytes are generally dozens and usually do not carry the bytes of the complete data block. The minimum unit of flash writing is the capacity of the minimum unit flash memory block. Therefore, the minimum unit flash memory blocks corresponding to the addresses where the storage structure difference data are located need to be combined together to form differential data.
[0091] For example, Figure 5 As shown, data 2 is differential data, and data 1 and data 3 form a flash memory block. If there is other differential data 5, which forms a cache block with differential data 4, then the differential data is composed of these two cache blocks.
[0092] In another embodiment of the present application, S13 specifically includes: S71: Determine the address space corresponding to the vehicle software, the capacity of the minimum block for single erasure, and the erasure start address according to the flash memory configuration information.
[0093] The address space corresponding to the vehicle software refers to the address space occupied by the software's data packets. The minimum block capacity for a single erase refers to the minimum capacity allowed for a single erase. The erase start address refers to the first target storage unit address that must be specified when performing an erase operation on the flash memory block.
[0094] In this embodiment, based on the pre-acquired flash memory configuration information, the address space corresponding to the vehicle software, the capacity of the minimum block that can be erased at a single time, and the erase start address are read from the information.
[0095] For example, the address space corresponding to the vehicle software is 0x08000000 to 0x0807 FFFF, corresponding to a 512KB space. The minimum block capacity for a single erase is 1024 bytes, and the erase start address is 0x08008000.
[0096] S72: Determine the start address and end address of the flash memory block corresponding to the differential data according to the position of the differential data in the address space, the capacity of the minimum block for single erasure, and the erase start address.
[0097] In this embodiment, the position of the differential data in the address space is the address corresponding to the differential data. After determining the capacity of the minimum block for single erasure and the erase start address, the start address and end address of the flash memory block corresponding to the differential data are determined, and the size of the data block is confirmed at the same time.
[0098] For example, the address corresponding to the differential data is 0X010001-0X020010, the capacity of the minimum block for single erasure is 4kb, and the erase start address is 0X010000. At this time, the start address of the flash memory block corresponding to the differential data is 0X010000, and the end address is 0x020010 + 0x1000 = 0x021010.
[0099] S73: Using the start address, the end address, and the capacity of the flash memory block corresponding to the differential data as the differential configuration information.
[0100] In this embodiment, after determining the start address, the end address, and the capacity of the flash memory block corresponding to the differential data, these information are used as differential configuration information.
[0101] In this embodiment, Figure 2 As shown in the figure, after obtaining the differential data and differential configuration information, the cloud packages the differential data into a binary file and sends it to the vehicle-side OTAM (OTA-Master), and at the same time sends the differential configuration information to the vehicle-side OTAM.
[0102] In this embodiment, the cloud uses S19 file analysis technology for differential analysis, compares the bytes at each address between the metadata package and the upgrade package, records the different bytes, and then generates differential data. It also calculates the starting address and ending address of the data block corresponding to the differential data based on the capacity of the smallest block of minimum erasure, and reduces the granularity of the differential upgrade data comparison to the binary level, so that the vehicle side can modify the data as little as possible during the update, thereby saving storage space and computing resources consumed during differential updates.
[0103] In the above embodiment of the present application, the data points that need to be updated are accurately located through S19 file analysis feature comparison, the data packets sent are small, and differential data is transmitted through CAN. When restoring the data packet on the vehicle side, only the differential data needs to be written, which saves a lot of storage resources and data transmission time, increases bandwidth utilization, and improves the user's vehicle usage experience.
[0104] Based on the same inventive concept, an embodiment of the present application provides a vehicle software upgrade device. Figure 6 , Figure 6 FIG is a schematic diagram of a vehicle software upgrade device 600 proposed in one embodiment of the present application. Figure 6 As shown, the device includes: A data receiving module 601 is configured to receive differential data and differential configuration information corresponding to the vehicle software, wherein the differential data includes a plurality of differential data blocks obtained based on data differences between a source data packet of the vehicle software and an upgrade package; and the differential configuration information includes at least a storage address corresponding to each differential data block in the differential data. A data erasing module 602 is configured to erase the data block corresponding to the vehicle software according to the storage address of the data block corresponding to the differential data; The data writing module 603 is used to write the differential data into the data block corresponding to the vehicle software.
[0105] Optionally, the data erasure module includes: An erase instruction generation submodule, configured to add the storage address to a preset erase instruction; The data erasing submodule is configured to send the erasing instruction to the electronic controller, so that the electronic controller erases the data according to the erasing instruction.
[0106] Optionally, the data writing module includes: A data reading submodule, configured to unpack and read the data packet corresponding to the differential data to obtain corresponding binary data; The data transmission submodule is configured to transmit the differential data to an electronic control unit via the controller area network bus, so that the electronic control unit writes the differential data into the data block.
[0107] Optionally, the device further comprises: A first hash value acquisition module is configured to receive the hash value of the upgrade package sent from the cloud when the differential data is written; a second hash value obtaining module, configured to perform hash value calculation on the data packet after the data block is updated to obtain a hash value of the data packet; A hash value comparison module, configured to compare the hash value of the upgrade package with the hash value of the data packet to verify the data packet; An upgrade result reporting module is configured to report the corresponding upgrade result to the cloud if the data packet verification is correct. Based on the same inventive concept, another embodiment of the present application provides a readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the vehicle software upgrade method described in any of the above embodiments of the present application.
[0108] Based on the same inventive concept, another embodiment of the present application provides an electronic device, Figure 7 It is a schematic diagram of an electronic device 700 proposed in one embodiment of the present application, including a memory 702, a processor 701 and a computer program stored in the memory and executable on the processor, wherein the processor, when executed, implements the vehicle software upgrade method described in any of the above embodiments of the present application.
[0109] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0110] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0111] Those skilled in the art will appreciate that the embodiments of the present application can be provided as methods, devices, or computer program products. Therefore, the embodiments of the present application can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the embodiments of the present application can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0112] The embodiments of the present application are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the steps in the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0113] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.
[0114] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0115] Although preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they become aware of the basic inventive concepts. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present invention.
[0116] Finally, it should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal device that includes a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or terminal device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article, or terminal device that includes the element.
[0117] The above is a detailed introduction to the vehicle software upgrade method, device, equipment and storage medium provided by this application. Specific examples are used in this article to illustrate the principles and implementation methods of this application. The description of the above embodiments is only used to help understand the method of this application and its core idea; at the same time, for general technical personnel in this field, based on the ideas of this application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on this application.
Claims
1. A vehicle software upgrade method, characterized in that: The method is applied to the OTA master control terminal, including: receiving differential data and differential configuration information corresponding to the vehicle software, the differential data comprising a plurality of differential data blocks, the differential data blocks being obtained based on data differences between a source data packet of the vehicle software and an upgrade packet, the differential configuration information comprising at least a storage address corresponding to each differential data block in the differential data; Erasing the data block corresponding to the vehicle software according to the storage address of the data block corresponding to the differential data; The differential data is written into a data block corresponding to the vehicle software.
2. The vehicle software upgrade method according to claim 1, characterized in that: Erasing the data block according to the storage address of the data block corresponding to the differential data includes: Adding the storage address to a preset erase instruction; The erasing instruction is sent to the electronic controller, so that the electronic controller erases the data according to the erasing instruction.
3. The vehicle software upgrade method according to claim 1, characterized in that: Writing the differential data into a data block corresponding to the vehicle software includes: Unpacking and reading the data packet corresponding to the differential data to obtain corresponding binary data; The differential data is transmitted to an electronic control unit via a controller area network bus, so that the electronic control unit writes the differential data into the data block.
4. The vehicle software upgrade method according to claim 1, characterized in that: The method further comprises: When the differential data is written, receiving the hash value of the upgrade package sent from the cloud; Performing hash value calculation on the data packet after the data block is updated to obtain a hash value of the data packet; Comparing the hash value of the upgrade package with the hash value of the data packet to verify the data packet; When the data packet is verified to be correct, the corresponding upgrade result is reported to the cloud.
5. A vehicle software upgrade method, characterized in that: The method is applied in the cloud, and includes: Receive the source data packet of vehicle software sent by the OTA master terminal; Comparing the source data packet with the corresponding upgrade packet to obtain the differential data; Determining differential configuration information corresponding to the differential data based on pre-acquired flash memory configuration information of the vehicle software; The differential data and the differential configuration information are sent to the OTA master control end, so that the OTA master control end upgrades the vehicle software according to the differential data and the differential configuration information.
6. The vehicle software upgrade method according to claim 5, characterized in that: Comparing the source data packet and the upgrade data packet to obtain corresponding differential data includes: Comparing the data at each address of the source data packet and the upgrade package to determine different data at the same address; determining the capacity of a minimum unit flash memory block corresponding to the vehicle software; According to the capacity of the minimum unit flash memory block, the different data at the same address are combined into the differential data.
7. The vehicle software upgrade method according to claim 5, characterized in that: The determining, based on the pre-acquired flash memory configuration information of the vehicle software, the differential configuration information corresponding to the differential data includes: Determining, based on the flash memory configuration information, an address space corresponding to the vehicle software, a capacity of a minimum block that can be erased at a single time, and an erase start address; Determining a start address and an end address of a flash memory block corresponding to the differential data according to a position of the differential data in the address space, a capacity of a minimum block for single erasure, and the erase start address; The start address, the end address, and the capacity of the flash memory block corresponding to the differential data are used as the differential configuration information.
8. A vehicle software upgrade device, characterized in that: The device is applied to the OTA master control terminal, including: a data receiving module, configured to receive differential data and differential configuration information corresponding to the vehicle software, the differential data comprising a plurality of differential data blocks, the differential data blocks being obtained based on data differences between a source data packet of the vehicle software and an upgrade packet; the differential configuration information comprising at least a storage address corresponding to each differential data block in the differential data; a data erasing module, configured to erase the data block corresponding to the vehicle software according to the storage address of the data block corresponding to the differential data; A data writing module is used to write the differential data into a data block corresponding to the vehicle software.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the method according to any one of claims 1 to 7 is implemented.
Citation Information
Cited By
Remote firmware differential encryption upgrading method and system for automobile electronic control system
CN121900799A
Remote firmware differential encryption upgrade method and system for automobile electronic control system
CN121900799B