Upgrading method of vehicle-mounted controller, electronic equipment and storage medium

By identifying and processing the data block operation types of the vehicle controller, the OTA upgrade process is optimized, solving the problem of low efficiency caused by the large size of the upgrade package, and realizing efficient and reliable vehicle controller upgrades.

CN121807355APending Publication Date: 2026-04-07GUANGZHOU AUTOMOBILE GROUP CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-30
Publication Date
2026-04-07

AI Technical Summary

Technical Problem

Existing OTA upgrade technology for vehicle controllers faces challenges such as large upgrade package size, resulting in long download times, high storage space requirements, and impacting upgrade efficiency and success rate.

Method used

By obtaining the identification information of the current system files to decompress the upgrade instruction file, identifying the operation types of multiple data blocks, and performing targeted operations based on these types, including skipping identical data blocks, copying, differential restoration, and duplicate data writing, the upgrade process is optimized.

Benefits of technology

It significantly reduces the network bandwidth and storage space requirements during vehicle controller upgrades, improves upgrade efficiency and success rate, shortens upgrade time, and enhances resource utilization, upgrade flexibility, and reliability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121807355A_ABST
    Figure CN121807355A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides an upgrading method of a vehicle-mounted controller, electronic equipment and a storage medium, and the method comprises the steps: obtaining first identification information of a current system file in response to a received upgrading instruction file of the vehicle-mounted controller; decompressing the upgrade instruction file based on the first identification information to obtain an upgrade system file and operation types corresponding to a plurality of data blocks in the upgrade system file, the operation types being used for representing operation types of corresponding operations on the plurality of data blocks; and upgrading the vehicle-mounted controller based on the operation types corresponding to the plurality of data blocks and the upgrading system file to obtain an upgrading result. The technical problem that the upgrading efficiency of the vehicle-mounted controller is low in the prior art is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of vehicle technology, and in particular to an upgrade method for an on-board controller, an electronic device, and a storage medium. Background Technology

[0002] With the rapid development of automotive electronics technology, especially the integration of entertainment, intelligent connectivity, and driver assistance functions, the demand for software upgrades for in-vehicle controllers is becoming increasingly frequent. Over-the-air (OTA) updates, as a remote software update method, are undeniably important. However, the main challenge currently facing OTA upgrade technology lies in the large size of the upgrade packages. This not only prolongs download time but also places high demands on the storage space of the in-vehicle controller, thus affecting the efficiency and success rate of the upgrade.

[0003] Existing technologies attempt to improve the upgrade process by using cloud-based subpackaging, distributed system control, and general differential algorithms, thereby reducing reliance on storage space and the overall upgrade package size. However, downloading the entire upgrade package or restoring it through differential methods is still time-consuming, the installation process depends on network conditions, and it is prone to failure in poor network environments, resulting in low efficiency for upgrading vehicle controllers in related technologies. Summary of the Invention

[0004] This application provides an upgrade method, electronic device, and storage medium for an on-board controller, aiming to improve the problem of low upgrade efficiency of on-board controllers in related technologies.

[0005] According to one aspect of the embodiments of this application, an upgrade method for an on-board controller is provided, applied to a vehicle, comprising: in response to receiving an upgrade instruction file for the on-board controller, obtaining first identification information of the current system file; decompressing the upgrade instruction file based on the first identification information to obtain an upgrade system file and operation types corresponding to multiple data blocks in the upgrade system file, wherein the operation type is used to indicate the operation type for performing corresponding operations on the multiple data blocks; upgrading the on-board controller based on the operation types corresponding to the multiple data blocks and the upgrade system file to obtain an upgrade result.

[0006] An upgrade method for an onboard controller, by receiving an upgrade instruction file and decompressing it using the first identification information of the current system file, can effectively distinguish the operation types of multiple data blocks, thereby performing corresponding upgrade operations in a targeted manner. This significantly reduces the demand for network bandwidth and local storage space during the upgrade of the onboard controller, and significantly improves the efficiency and success rate of the upgrade.

[0007] Furthermore, the vehicle controller is upgraded based on the operation types corresponding to multiple data blocks and the upgrade system file to obtain the upgrade result, including: determining the operation type corresponding to the first data block among the multiple data blocks as the first operation type, wherein the first operation type is used to indicate that a skip operation is performed on the first data block, and the first data block is the same data block in the upgrade system file as the current system file; performing a skip operation on the first data block based on the first operation type, and performing a corresponding operation on the second data block based on the operation type corresponding to the second data block among the multiple data blocks to obtain the upgrade result, wherein the first data block is the same data block in the upgrade system file as the current system file, and the second data block is a data block in the upgrade system file that is different from the current system file.

[0008] By skipping data blocks that are consistent with the current system, the number of data processing steps is effectively reduced, thereby significantly shortening the upgrade time, reducing data transmission costs, and improving the upgrade efficiency of the vehicle controller.

[0009] Further, based on the operation type corresponding to the second data block among multiple data blocks, corresponding operations are performed on the second data block, including: in response to the operation type corresponding to the second data block being a second operation type, copying the second data block to a preset area based on the second operation type, wherein the second operation type is used to indicate performing a copy operation on the second data block; in response to the operation type corresponding to the second data block being a third operation type, restoring the target differential instruction corresponding to the second data block to the preset area based on the third operation type, wherein the third operation type is used to indicate restoring the target differential instruction; in response to the operation type corresponding to the second data block being a fourth operation type, writing duplicate data in the target byte segment corresponding to the second data block to the preset area based on the first offset address information corresponding to the second data block according to the fourth operation type, wherein the number of consecutive identical bytes in the target byte segment is greater than a preset threshold, wherein the fourth operation type is used to indicate writing duplicate data; in response to the operation type corresponding to the second data block being a fifth operation type, determining the second offset address information adjacent to the first offset address information based on the fifth operation type, and writing the data in the preset file corresponding to the second offset address information to the preset area, wherein the fifth operation type is used to indicate writing to the preset file.

[0010] Several operation types are proposed to handle data blocks that differ from the current system, including copying, differential instruction restoration, duplicate data writing, and writing data from a preset file. This method intelligently selects operation strategies based on the characteristics of the data blocks, enabling refined management of upgraded data blocks, further improving the upgrade process, and increasing resource utilization.

[0011] Furthermore, restoring the target differential instruction corresponding to the second data block to the preset area based on the third operation type includes: restoring the target differential instruction to obtain the first target file and the second target file corresponding to the first offset address information; and writing the data in the first target file and the second target file into the preset area.

[0012] For differential instructions, a restoration mechanism is used to generate target files. Through this mechanism, the vehicle controller can process only the differences, avoiding the rewriting of the entire file, which significantly reduces the storage space and time required for upgrades and enhances the flexibility and efficiency of the upgrade system.

[0013] Furthermore, the operation type corresponding to the second data block is determined based on the first offset address information, the first file information of the upgraded system file, and the second file information of the current system file. The first offset address information is determined based on the data information of the second data block.

[0014] By analyzing the offset address information of data blocks, upgrade files, and current system file information, the system intelligently determines the operation type of the data blocks. This mechanism ensures the accuracy of data block processing, avoids erroneous operations, and improves the robustness and reliability of the entire upgrade process.

[0015] Furthermore, if the operation type corresponding to the second data block does not exist in the upgrade system file, it is determined based on the second offset address information adjacent to the first offset address information; if the operation type corresponding to the second data block exists in the upgrade system file and the second target file corresponding to the first offset address information exists in the current system file, it is determined based on the first target file and the second target file.

[0016] The operation type of data blocks is dynamically adjusted based on whether a file exists. This strategy allows the vehicle controller to utilize the integrity of existing files while efficiently processing newly added or modified files, achieving differentiated upgrade management and improving the accuracy and speed of upgrades.

[0017] Furthermore, the second operation type is used to indicate that the first target file and the second target file are the same, and the operation type corresponding to the second data block is determined by performing a difference operation on the first target file and the second target file when the first target file and the second target file are different.

[0018] The differential operation logic for the second and third operation types was clarified to determine whether the target file has changed. This ensures the effectiveness and accuracy of differential upgrades, reduces the upgrade package size through differential operations, accelerates the upgrade process, and guarantees data integrity and consistency.

[0019] Furthermore, the third operation type is to determine the target difference instruction obtained by performing a difference operation on the first target file and the second target file, wherein the target difference instruction is used to indicate the difference content between the first target file and the second target file.

[0020] Focusing on the generation and application of target differential instructions under the third operation type, by indicating the differences in the target file, the vehicle controller can accurately identify and process the changed parts, avoiding the transmission and storage of redundant data, and improving the efficiency and resource utilization of OTA upgrades.

[0021] Furthermore, the operation type corresponding to the second data block is determined by the traversal result obtained by traversing the preset file corresponding to the second offset address information based on the second offset address information. The traversal result is used to indicate whether the target byte segment exists in the preset file.

[0022] By traversing preset files to obtain traversal results, the operation type of data blocks can be determined. Utilizing file system-level information to guide the upgrade strategy effectively avoids blindly processing data blocks, enhancing the intelligence and automation level of vehicle controller upgrades.

[0023] Furthermore, the fourth operation type is used to indicate that the traversal result is that the target byte segment exists in the preset file, and the fifth operation type is used to indicate that the traversal result is that the target byte segment does not exist in the preset file.

[0024] The matching rules for operation types have been refined. Based on the differences in traversal results (the presence or absence of the target byte segment in the preset file), the fourth or fifth operation type is intelligently selected for data writing or processing. This mechanism further improves the data transmission and storage strategy during the vehicle controller upgrade process, ensuring the efficient execution of upgrade commands and enhancing overall upgrade performance and user experience.

[0025] According to another aspect of the embodiments of this application, an upgrade device for an on-board controller is provided, comprising: an acquisition module, configured to acquire first identification information of a current system file in response to receiving an upgrade instruction file for the on-board controller; a decompression module, configured to decompress the upgrade instruction file based on the first identification information to obtain an upgrade system file and operation types corresponding to multiple data blocks in the upgrade system file, wherein the operation types are used to indicate the operation types for performing corresponding operations on the multiple data blocks; and an upgrade module, configured to upgrade the on-board controller based on the operation types corresponding to the multiple data blocks and the upgrade system file to obtain an upgrade result.

[0026] According to another aspect of the embodiments of this application, an electronic device is also provided, including: a memory for storing a computer program; and a processor for executing the program stored in the memory, wherein the program executes the above-described vehicle controller upgrade method when it runs.

[0027] According to another aspect of the embodiments of this application, a computer-readable storage medium is also provided, the computer-readable storage medium including a stored executable program, wherein, when the executable program is running, it controls the device where the computer-readable storage medium is located to execute the above-described vehicle controller upgrade method. Attached Figure Description

[0028] Figure 1 This is a flowchart of an upgrade method for an on-board controller according to an embodiment of this application;

[0029] Figure 2 This is a flowchart illustrating the generation of an OTA upgrade instruction file according to an embodiment of this application;

[0030] Figure 3 This is a flowchart of an OTA upgrade process according to an embodiment of this application;

[0031] Figure 4 This is a schematic diagram of an upgrade device for an in-vehicle controller according to an embodiment of this application;

[0032] Figure 5 This is a structural diagram of the electronic device provided in the embodiments of this application. Detailed Implementation

[0033] To make the technical problems, technical solutions, and beneficial effects solved by this application clearer, the following detailed description is provided in conjunction with embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0034] Terminology Explanation

[0035] Over-the-air (OTA) updates are primarily used to automatically update the firmware or software of electronic devices (such as smartphones and connected car devices) via wireless networks, without requiring manual user intervention or a computer connection. In the automotive industry, OTA technology is widely used to remotely update the software of in-vehicle electronic control units (ECUs) to add new features, fix security vulnerabilities, or improve the performance of existing functions.

[0036] A hash value is a fixed-length result obtained by calculating data of arbitrary length using a hash function. This result is typically a string of numbers and letters. In computer science, hash values ​​are primarily used for unique data identification and data integrity verification.

[0037] This application provides an upgrade method for an on-board controller, applied to a vehicle, comprising: in response to receiving an upgrade instruction file for the on-board controller, obtaining first identification information of the current system file; decompressing the upgrade instruction file based on the first identification information to obtain an upgrade system file and operation types corresponding to multiple data blocks in the upgrade system file, wherein the operation type is used to indicate the operation type for performing corresponding operations on the multiple data blocks; upgrading the on-board controller based on the operation types corresponding to the multiple data blocks and the upgrade system file to obtain an upgrade result.

[0038] The vehicle controller upgrade method provided in this application embodiment achieves the following technical effects:

[0039] The vehicle controller upgrade method proposed in this application, when the vehicle receives the upgrade instruction file for the vehicle controller, first obtains the first identification information of the current system file. This first identification information is used to compare the upgrade content to be applied with the existing system state. Subsequently, the upgrade instruction file is decompressed based on the first identification information. This process extracts the upgrade system file and the operation types for multiple data blocks within the upgrade system file. During the upgrade process, the vehicle performs corresponding upgrade operations on the vehicle controller according to these operation types and the content of the upgrade system file, ultimately obtaining the system upgrade result. This application achieves the technical objective of minimizing data redundancy and improving resource utilization by intelligently identifying the current system state and matching it with the content of the upgrade instruction file to dynamically determine the upgrade operation type. This significantly improves the efficiency and success rate of vehicle controller upgrades, thereby solving the problem of low upgrade efficiency in related technologies.

[0040] This application provides an upgrade method for an on-board controller, applied to the vehicle end. Figure 1 This is a flowchart of an upgrade method for an on-board controller according to an embodiment of this application. Please refer to it. Figure 1 This includes the following steps:

[0041] Step S102: In response to receiving the upgrade instruction file from the vehicle controller, obtain the first identification information of the current system file.

[0042] The aforementioned vehicle controller refers to hardware installed on a vehicle to control various electronic devices and systems within the vehicle. It typically includes one or more microprocessors, memory, and other circuitry. Types of vehicle controllers include, but are not limited to, powertrain control modules (PCMs), body control modules (BCMs), and advanced driver assistance systems (ADAS) controllers. The specific vehicle controller must be determined based on the vehicle's system design. The vehicle controller is responsible for executing software instructions to control the vehicle's driver assistance systems, entertainment systems, body control systems, etc., ensuring the normal operation of all vehicle functions.

[0043] The aforementioned upgrade instruction file refers to a special file generated based on the comparison results between the upgrade system file and the current system file, and the determined operation type. The upgrade instruction file contains specific operation instructions and related parameters to guide the vehicle controller on how to efficiently and accurately update its software to the target version. The operation instructions for each data block in the upgrade instruction file are compressed to reduce the overall file size, transmission time, and storage requirements. The upgrade instruction file is the core guide for the vehicle controller to perform software upgrades. It can tell the controller which data blocks need to be skipped (due to consistency with the current version), which need to be added (new data blocks), which need to be repeated (existing consecutively repeating data), which need to be copied (from another location in the current version), and which need differential updates (reconstructing data blocks based on the differences).

[0044] The aforementioned current system files can refer to all component files of the software version currently being used or installed on the vehicle controller. Current system files may include, but are not limited to, operating system files, applications, configuration files, and any vehicle-specific software components. The specific current system files need to be determined based on the current state of the vehicle controller. During the upgrade process, the current system files can serve as a baseline for comparison and identification of the parts of the upgrade system files that need to be updated.

[0045] The aforementioned first identification information can refer to a specific identifier of the current system file of the vehicle controller. The type of first identification information may include, but is not limited to, a file hash, version number, checksum, or other unique identifiers. The specific first identification information needs to be determined based on the security and data consistency requirements of the vehicle system. After receiving the upgrade command file sent by the OTA cloud server, the vehicle controller first verifies the first identification information of the current system file, which is a prerequisite for subsequent decompression and upgrade operations.

[0046] In one optional embodiment, when the OTA upgrade process of the vehicle controller is triggered—that is, when the vehicle receives the upgrade command file from the server—the vehicle control system immediately initiates a verification process. The first step of this process is to obtain the first identification information of the current system file of the vehicle controller. Typically, this identification information is a unique identifier for the system file version, such as a version number, hash value, or other form of checksum. These are stored in a specific area of ​​the vehicle's memory for quick retrieval and comparison. The vehicle controller accesses these storage areas and reads the first identification information. This step ensures that the controller can accurately determine its current software state, providing a basis for subsequent upgrade decisions.

[0047] Step S104: Decompress the upgrade instruction file based on the first identification information to obtain the upgrade system file and the operation types corresponding to multiple data blocks in the upgrade system file. The operation type is used to indicate the operation type for performing corresponding operations on multiple data blocks.

[0048] The aforementioned upgrade system files refer to a collection of files used to update the software system of the vehicle controller from one version to another. These upgrade system files may include, but are not limited to, new application code, configuration files, library files, image files, and digital signatures and hash values ​​used to verify integrity. Specific upgrade system files need to be designed according to the upgrade requirements. Upgrade system files are used to update the software system of the vehicle controller via Over-the-Air (OTA) upgrade technology, providing new features, fixing bugs, or improving performance.

[0049] The aforementioned data blocks can refer to independent data units segmented within the upgrade system file. These data blocks can include, but are not limited to, text data blocks, binary data blocks, image data blocks, etc., and the specific number of data blocks needs to be determined based on the file content and structure. Data blocks allow for a more precise comparison of the differences between the current system file and the upgrade system file, enabling the transmission and updating of only the actually changed portions, thereby reducing the bandwidth and time required for the upgrade.

[0050] The aforementioned operation type can refer to an instruction or identifier used to guide the vehicle controller on how to operate on specific data blocks in the upgrade system files during the upgrade process. Operation types may include, but are not limited to, Skip (S), Append (A), Repeat (R), Copy (C), and Diff (D), with the specific operation type determined based on the data block. The instruction corresponding to the operation type is represented by specific characters or codes, which can be used to guide the vehicle controller on how to optimally update its software to achieve a smooth transition from the current version to the target version.

[0051] In one optional embodiment, the upgrade instruction file is first decompressed using the first identification information to obtain the upgrade system file required for the upgrade, as well as a series of operation instructions for different data blocks in the upgrade system file, i.e., operation types corresponding to multiple data blocks. These operation types guide how to process each data block. For example, "skip" means leaving the current data block unchanged; "add" means inserting new data at a specified position; "repeat" indicates writing the same data multiple times at a certain location; the "copy" command copies data from the existing file system; and "differential" makes minor adjustments based on existing data. By parsing and executing these operation types, the controller can efficiently complete the system upgrade, reducing data transmission and speeding up the upgrade execution, significantly improving the user experience and success rate of OTA upgrades.

[0052] Step S106: Upgrade the vehicle controller based on the operation type and upgrade system file corresponding to multiple data blocks to obtain the upgrade result.

[0053] The upgrade result mentioned above refers to a new software state or system feedback information achieved after the vehicle controller upgrades the current system files. The upgrade result represents the final state of the OTA upgrade operation and may include, but is not limited to, whether the upgrade was successful, the upgraded version number, whether the system functions normally, and any potential errors or anomalies. The specific upgrade result needs to be determined based on the actual upgrade situation. The upgrade result can be used to verify whether the vehicle controller has successfully upgraded from the old version to the target version, ensuring that the software update is error-free.

[0054] In one optional embodiment, after obtaining the operation types and upgrade system files corresponding to multiple data blocks, the vehicle controller performs targeted upgrades on each data block in the system file according to the operation type. This series of instructions guides the controller to perform operations such as skipping invariant data, adding new data, repeating specific patterns, copying, or differential updates. After all instructions are executed, the controller verifies the upgrade result to ensure that the system file has been accurately updated to the target version. The upgrade result reflects the success or failure of the entire upgrade process. If the verification passes, the upgrade is successful, and the controller will enable the new software version; if the verification fails, rollback or other remedial measures must be taken to ensure that system stability and security are not affected. In summary, by accurately executing the upgrade instruction file and combining it with the actual situation of the current system file, the vehicle controller achieves efficient and secure OTA upgrades, thereby improving vehicle performance and user experience.

[0055] In this embodiment, when the vehicle receives the upgrade instruction file from the on-board controller, it first obtains the first identification information of the current system file. This first identification information is used to compare the upcoming upgrade content with the existing system state. Subsequently, the upgrade instruction file is decompressed based on the first identification information. This process extracts the upgrade system file and the operation types for multiple data blocks within the upgrade system file. During the upgrade process, the vehicle performs corresponding upgrade operations on the on-board controller according to these operation types and the content of the upgrade system file, ultimately obtaining the system upgrade result. This application achieves the technical objective of minimizing data redundancy and improving resource utilization by intelligently identifying the current system state and matching it with the content of the upgrade instruction file to dynamically determine the upgrade operation type. This significantly improves the efficiency and success rate of on-board controller upgrades, thereby solving the problem of low upgrade efficiency in related technologies.

[0056] Optionally, the vehicle controller is upgraded based on the operation type corresponding to multiple data blocks and the upgrade system file to obtain an upgrade result, including: determining the operation type corresponding to the first data block among the multiple data blocks as the first operation type, wherein the first operation type is used to indicate that a skip operation is performed on the first data block, and the first data block is a data block in the upgrade system file that is the same as the current system file; performing a skip operation on the first data block based on the first operation type, and performing a corresponding operation on the second data block based on the operation type corresponding to the second data block among the multiple data blocks to obtain an upgrade result, wherein the first data block is a data block in the upgrade system file that is the same as the current system file, and the second data block is a data block in the upgrade system file that is different from the current system file.

[0057] The aforementioned first data block refers to those data blocks whose content is completely identical during the comparison between the current system files and the upgraded system files. These data blocks have not changed between the old and new versions, and therefore do not need to be retransmitted or written during the upgrade process. The first data block can include, but is not limited to, any type of file content, such as binary code, text, image, or audio data, as long as it remains unchanged between the old and new versions. Identifying the first data block helps reduce the size of the OTA upgrade package, speeds up the upgrade process, and thus saves network bandwidth and storage resources.

[0058] The aforementioned second data block refers to data blocks discovered during the comparison process that are inconsistent with the current system files in the upgraded system files. These data blocks represent the modifications or additions in the new version. The second data block can also cover various file types, such as updated program code, configuration files, and user interface elements; the specific second data block needs to be determined based on the content of the software upgrade. Determining the second data block is the core of OTA upgrades, as it determines which data needs to be transmitted and processed to complete the transition from the current version to the target version.

[0059] The first operation type mentioned above can refer to a "skip" operation performed on the first data block, identified by 'S', indicating that data blocks with the same content are directly ignored during the upgrade process and do not need to be processed. The skip operation maximizes the use of existing data, reduces unnecessary data transfer and write operations, thereby significantly improving the efficiency and speed of OTA upgrades.

[0060] In one optional embodiment, by analyzing the differences between the upgrade system file and the current system file, a first operation type is determined for the first data block among multiple data blocks. This is because the first data block is consistent with the current system file in the upgrade system file. A skip operation is performed on the first data block based on the first operation type; that is, the data of the first data block is not written to the backup partition during the upgrade process, thereby saving storage space and upgrade time. Simultaneously, for the second data blocks—those that differ from the current system file in the upgrade system file—the system performs corresponding processing based on their corresponding operation type, such as adding data, writing duplicate data, copying data from the primary partition, or restoring differential data. This differentiated processing method ensures that the vehicle controller can efficiently utilize the data in the current system file during the upgrade process, avoiding unnecessary data downloads and storage, thereby significantly improving the efficiency and success rate of OTA upgrades.

[0061] Optionally, the second data block is operated on based on the operation type corresponding to the second data block among multiple data blocks, including: in response to the operation type corresponding to the second data block being a second operation type, copying the second data block to a preset area based on the second operation type, wherein the second operation type indicates that a copy operation is performed on the second data block; in response to the operation type corresponding to the second data block being a third operation type, restoring the target differential instruction corresponding to the second data block to the preset area based on the third operation type, wherein the third operation type indicates that the target differential instruction is restored; in response to the operation type corresponding to the second data block being a fourth operation type, writing duplicate data in the target byte segment corresponding to the second data block to the preset area based on the first offset address information corresponding to the second data block according to the fourth operation type, wherein the number of consecutive identical bytes in the target byte segment is greater than a preset threshold, wherein the fourth operation type indicates that duplicate data is written; in response to the operation type corresponding to the second data block being a fifth operation type, determining the second offset address information adjacent to the first offset address information based on the fifth operation type, and writing the data in the preset file corresponding to the second offset address information to the preset area, wherein the fifth operation type indicates that the preset file is written.

[0062] The second operation type mentioned above can refer to a "copy" operation, identified by 'C', which instructs the vehicle domain controller to directly copy specific data blocks from the existing image to a preset area. This second operation type significantly reduces the size of the upgrade package and the amount of network data transmitted during the upgrade process by reusing existing data within the vehicle domain controller, thereby improving OTA upgrade efficiency and success rate.

[0063] The aforementioned preset area refers to a dedicated space reserved within the vehicle controller's internal or external memory for storing specific types of data. The preset area can be a specific buffer within the controller's memory or a reserved partition on an external storage device; the specific preset area needs to be determined based on the system's architecture design and resource allocation strategy. Setting the preset area ensures orderly data management and efficient access during system upgrades, avoiding performance degradation or errors caused by disorganized data.

[0064] The aforementioned target differential instructions refer to a set of instructions used during the upgrade process to describe the specific changes of the second data block from the old version to the new version. These instructions detail which parts need to be updated, how to update them, and the content of the updated data, forming the core of differential upgrades. Target differential instructions can guide the vehicle controller to download and process only the data that needs updating during the upgrade process, rather than the entire file, thereby significantly reducing the size of the upgrade package, lowering the network transmission load, reducing the storage pressure on the vehicle controller, and saving computing resources and time.

[0065] The third operation type mentioned above can refer to the "differential restore" operation, identified by "D". This third operation type can be a command type that restores data to a preset region based on a target differential instruction. It tells the domain controller how to apply the differential data to the current image to generate a new version. By applying differential data, a rapid transition from an old version to a new version can be achieved, while minimizing data processing volume and upgrade time.

[0066] The fourth operation type mentioned above can refer to a "duplicate data write operation," identified by "R." This fourth operation type instructs the vehicle domain controller, when it detects a large amount of duplicate data in the target byte segment, to write only the length and specific value of the duplicate data, without writing the duplicate data multiple times. This fourth operation type can significantly reduce the size of the upgrade package and the complexity of parsing the instruction file by reducing the amount of data actually written, thus accelerating the upgrade process.

[0067] The aforementioned first offset address information refers to the address information used to locate the starting position of the target byte segment or data block within the primary partition. The first offset address information can be an offset within a specific file or partition, and the specific first offset address information needs to be determined based on the actual situation. The first offset address information can be used as the starting point for performing copy, differential restore, or duplicate data write operations, ensuring that upgrade commands are accurately applied to the correct data location.

[0068] The aforementioned target byte segment can refer to the data sequence identified as needing processing within the second data block. The target byte segment can include, but is not limited to, file data, image data, or any other type of data block. The specific target byte segment needs to be determined based on the actual data content. The target byte segment can serve as the target for various operation types, ensuring that upgrade commands can effectively process specific data blocks, achieving highly efficient OTA upgrades.

[0069] The aforementioned preset threshold refers to a predefined minimum limit on the number of consecutive identical bytes. When the number of consecutive identical bytes in the target byte segment exceeds this threshold, the fourth operation type (repeated data write operation) will be triggered. The preset threshold can be an integer value, such as 32 bytes, and the specific preset threshold needs to be adjusted according to the specific application requirements. The preset threshold can be used to balance the improvement of upgrade package size and upgrade instruction execution efficiency, avoiding the increase in instruction parsing overhead caused by using repeated data write operations on short data sequences.

[0070] The fifth operation type mentioned above can refer to a preset file data write operation, identified by "A". The fifth operation type is an instruction type used to instruct the vehicle domain controller to read data from a preset file and write it to a preset area. It performs data writing based on the second offset address information. The fifth operation type is suitable for processing unchanged data or newly added data in the preset file, used for incremental updates of the file system or image. When processing data blocks that are not fully matched or have partially changed, the fifth operation type can be used to guide the domain controller on how to update the backup area using the corresponding data in the preset file, ensuring data consistency.

[0071] The aforementioned second offset address information can refer to the address information of the next data processing point relative to the first offset address information, used to determine the end position of the data block or the start position of the next data block. The second offset address information can be an offset within a specific file or partition; the specific second offset address information needs to be determined based on the actual situation. When performing the fifth operation type, the second offset address information can be used to help the domain controller locate data in a preset file, ensuring the continuity and correctness of data write operations.

[0072] The aforementioned preset file can refer to the V1 version image stored in the primary partition of the vehicle domain controller, serving as the base data source for differential updates, data copying, or duplicate data write operations. The preset file can be any image file with or without a file system, including but not limited to operating system images, application software images, or configuration file images; the specific preset file needs to be determined based on the actual situation. The preset file can serve as a reference during the OTA upgrade process, containing the necessary raw data to support efficient and accurate differential instruction execution and data block processing.

[0073] In one optional embodiment, when the operation type corresponding to the second data block is identified as the second operation type, it indicates that a copy operation needs to be performed. The data block is then copied to a preset area, fully utilizing existing data on the controller, reducing data transmission, and improving upgrade efficiency. When the operation type corresponding to the second data block is identified as the third operation type, it indicates that the target differential instruction needs to be restored. At this time, based on the characteristics of the differential data, it can be restored to the preset area, achieving accurate updates of the differential data in the upgrade package. When the operation type of the second data block is the fourth operation type, the system will pay attention to cases where the number of consecutive identical bytes in the target byte segment exceeds a preset threshold. In this case, based on the first offset address information corresponding to the second data block, the duplicate data in the target byte segment is directly written to the preset area, avoiding redundant data transmission and saving storage resources. Finally, for the second data block of the fifth operation type, the adjacent second offset address information is determined, and the data in the preset file corresponding to the second offset address information is written to the preset area. This strategy effectively utilizes the existing file system of the domain controller, achieving efficient updates of file data. The above process, through intelligent differentiation and targeted processing of data blocks of various operation types, can not only significantly shorten the download time of the upgrade package, but also greatly reduce the processing time of image data, thereby improving the overall experience and success rate of OTA upgrades.

[0074] Optionally, restoring the target differential instruction corresponding to the second data block to a preset area based on the third operation type includes: restoring the target differential instruction to obtain the first target file and the second target file corresponding to the first offset address information; and writing the data in the first target file and the second target file into the preset area.

[0075] The aforementioned first target file can refer to a collection of one or more files in the current system files, which are identified as baseline files requiring differential processing in the upgrade system files. The first target file can be any type of file in the vehicle domain controller, including but not limited to binary executable files, configuration files, log files, or data files. Typically, these files already exist in version V1 (the current system files), but have been partially updated or modified in version V2 (the upgrade system files). The specific first target file needs to be determined based on the actual system files. The first target file can be used as input to the differential algorithm to calculate the differences with the upgrade system files and generate target differential instructions.

[0076] The aforementioned second target file can refer to the new version of the file corresponding to the first target file in the upgrade system files. During the differential algorithm process, it serves as a comparison object to determine the updated content of the first target file. The second target file can also be any type of file in the vehicle domain controller, with similar content and structure to the first target file, but containing updates or new features. The differences between them and the first target file can be calculated and expressed using the differential algorithm. During the differential instruction restoration phase, the data from the second target file is used to guide the update, ensuring that the backup area of ​​the vehicle domain controller contains the latest version of the file content.

[0077] In one optional embodiment, the target differential instruction is parsed to obtain the contents of the first target file and the second target file corresponding to the first offset address information. Subsequently, the data in the first and second target files is written to a preset area to update and upgrade the mirror data. This operation avoids the reliance on and processing of the entire packet data in traditional differential restoration processes, significantly improving data processing efficiency and speed. Especially when processing large files or complex file systems, it can greatly reduce the required time and storage resources, ensuring a more efficient and faster OTA upgrade process.

[0078] Optionally, the operation type corresponding to the second data block is determined based on the first offset address information, the first file information of the upgraded system file, and the second file information of the current system file, and the first offset address information is determined based on the data information of the second data block.

[0079] The aforementioned first file information may refer to file metadata related to the upgrade system file (V2 version) image. This first file information may include, but is not limited to, filename, file size, and file offset address. It serves as the baseline information used to compare and locate the existing file system structure during the OTA upgrade instruction file generation process. When determining the operation type of the second data block, the first file information can be used to identify file boundaries and attributes in the target version image, thereby determining whether the data block is located within a known file and what differences it has with the corresponding file in the current system file (V1 version).

[0080] The aforementioned second file information can refer to the metadata of the file corresponding to the upgrade system file image in the current system files (V1 version). It contains file attributes and physical location information of the current file system, and is used to identify file changes by comparing it with the first file information. During the generation of OTA upgrade instructions, the second file information can help the system determine which parts need to be updated, which parts are all the same, and which parts have changed and need to be differentially processed.

[0081] In one optional embodiment, the operation type corresponding to the second data block is determined based on the first offset address information, the first file information of the upgraded system file, and the second file information of the current system file, wherein the first offset address information is determined based on the data information of the second data block. The core of this design lies in intelligently identifying and utilizing the structural characteristics of the existing file system. By comparing the data at the first offset address, the system can accurately determine the current operation type, such as "skip," "add," "copy," or "differential." Specifically, during the comparison process, if it is detected that the content of a file is completely identical between the two versions, a skip instruction will be generated, indicating that the upgrade process does not need to rewrite this part of the data, but directly reuses the original data, significantly reducing the occupation of storage resources and accelerating the upgrade process. If the file content differs, the system will generate corresponding add, copy, or differential instructions based on the file information. These instructions can guide the vehicle domain controller to accurately process the differences during the upgrade, rather than blindly overwriting all data, thereby significantly saving time and storage space. This file system-aware intelligent strategy not only improves the speed and efficiency of OTA upgrades but also reduces the dependence on network bandwidth and vehicle storage, enhancing the reliability of upgrades and user experience.

[0082] In one optional embodiment, for each second data block, a first offset address is first determined based on the data information of that data block. Then, using the first and second file information, the position and status of the file corresponding to that data block in the target version and the current version are determined. Based on the file status (e.g., whether all files are identical, whether there are differences, whether there is duplicate data, etc.), the corresponding operation type (second operation type, third operation type, fourth operation type, etc.) is determined. This file-information-based upgrade instruction generation mechanism enables the OTA upgrade process to intelligently handle file system changes. By skipping unchanged data, copying identical data, processing differential data, and writing newly added or changed data, it minimizes the size of the upgrade package, reduces network transmission load, alleviates the storage pressure on the vehicle domain controller, and improves the overall efficiency of the OTA upgrade.

[0083] Optionally, if the operation type corresponding to the second data block does not exist in the upgrade system file, it is determined based on the second offset address information adjacent to the first offset address information; if the operation type corresponding to the second data block exists in the upgrade system file and the second target file corresponding to the first offset address information exists in the current system file, it is determined based on the first target file and the second target file.

[0084] In one optional embodiment, when the upgrade system file does not contain a first target file associated with the second data block, the operation type is determined based on the adjacent second offset address information. This strategy ensures that even in the case of missing files, the system can infer the correct operation instructions through adjacent information, maintaining the consistency and effectiveness of the upgrade instructions. Conversely, if the current system file contains both a first target file and a second target file corresponding to the first offset address information, the operation type is determined based on a comparative analysis of these two files. This allows for more accurate identification of the differences between the files, thereby generating more efficient and concise upgrade instructions, reducing data transmission and processing, and significantly improving the efficiency and success rate of OTA upgrades. Through this method, whether a file is added, modified, or deleted, the system can accurately generate the corresponding operation instructions, ensuring the automation and intelligence of the OTA upgrade process, and thus achieving rapid and reliable updates of the vehicle domain controller software.

[0085] Optionally, the second operation type is used to indicate that the first target file and the second target file are the same, and the operation type corresponding to the second data block is determined by performing a difference operation on the first target file and the second target file when the first target file and the second target file are different.

[0086] In one optional embodiment, the second operation type is used to indicate that the first target file and the second target file are identical. This means that during the generation of the upgrade instruction file, for the largest consecutive identical data blocks appearing in the image data, the upgrade instruction will instruct the vehicle domain controller to skip these areas during the upgrade, eliminating the need to write data, thereby saving storage space and upgrade time. The operation type corresponding to the second data block is determined by performing a differential operation on the two versions of the image files when the first target file and the second target file are different. The result of the differential operation instructs the vehicle domain controller to process the difference data during the upgrade process, including writing specified data to the backup partition, writing specified duplicate data, copying data with a specified offset address and length from the primary partition to the backup partition, and restoring data from the primary partition with a specified offset address and differential data before copying it to the backup partition. This design can significantly reduce the size of the upgrade package, improve download speed, and effectively shorten the installation time and improve the overall OTA upgrade experience by skipping data that does not need to be updated and directly copying existing data during the installation phase.

[0087] Optionally, the third operation type is to determine the target difference instruction obtained by performing a difference operation on the first target file and the second target file, wherein the target difference instruction is used to indicate the difference content between the first target file and the second target file.

[0088] In one optional embodiment, the determination of the third operation type is based on the target differential instructions obtained by performing differential operations on the first target file and the second target file. This process aims to identify the differences between the two versions of the file. Through detailed analysis and comparison, the generated differential instructions can accurately indicate the specific details of the file update, including added, modified, or deleted parts. Compared to traditional full-package upgrade strategies, the method of this application significantly reduces the size of the upgrade package because it only contains differential data of file changes, rather than the complete file content. This not only speeds up the creation and download of the upgrade package but also reduces the storage space requirements of the vehicle domain controller, thereby improving the success rate of OTA upgrades and the user experience.

[0089] Optionally, the operation type corresponding to the second data block is determined by traversing the preset file corresponding to the second offset address information based on the second offset address information. The traversal result is used to indicate whether the target byte segment exists in the preset file.

[0090] The traversal results mentioned above refer to the information obtained after scanning the preset file under the guidance of the second offset address information. This information is primarily used to determine whether the target byte segment exists in the preset file. The traversal results mainly include, but are not limited to, presence and absence types. A presence type indicates that the target byte segment has been matched in the preset file, while a absence type means that this data needs to be obtained from the upgrade package. The traversal results can serve as the basis for determining the operation type. If the target byte segment exists in the preset file, instructions to skip or copy it can be used; if it does not exist, an addition or differential strategy is required.

[0091] In one optional embodiment, when processing the second data block, the preset file is first traversed based on the second offset address information. Based on the traversal results, it can be determined whether the data in the second data block already exists in the preset file, or whether it needs to be restored using differential instructions.

[0092] If the target byte segment exists in the preset file and its content has not changed, the traversal result will indicate the use of the second operation type (C), which means directly copying the data from the preset file to the backup area without additional downloading.

[0093] If the target byte segment exists but differs, the traversal result will prompt the use of the third operation type (D) to restore the data in the backup area using differential instructions.

[0094] If the target byte segment does not exist in the preset file, or is a piece of duplicate data (the number of consecutive identical bytes is greater than the preset threshold), then the traversal result points to using the fourth operation type (R) to download from the upgrade package or generate data based on the duplicate instruction and write it to the backup area.

[0095] Finally, if the target byte segment does not exist in the preset file and does not meet the duplicate data condition, the traversal result will trigger the use of the fifth operation type (A) to read data from the second offset address information located in version V1 and write it to the backup area.

[0096] Through the above process, the combination of the traversal result and the target byte segment provides a clear basis for determining the operation type corresponding to the second data block. This enables the OTA upgrade method of this application to complete the software upgrade efficiently and accurately by making full use of existing data, while reducing the size of the upgrade package and the dependence on the storage space of the vehicle domain controller during the upgrade process, thereby improving the speed and success rate of OTA upgrade.

[0097] Optionally, the fourth operation type is used to indicate that the target byte segment exists in the preset file as the traversal result, and the fifth operation type is used to indicate that the target byte segment does not exist in the preset file as the traversal result.

[0098] In one optional embodiment, the fourth and fifth operation types are used to handle the matching of the preset file and the target byte segment in the traversal results. When the target byte segment is detected in the preset file, the fourth operation type is adopted, that is, by using a skip instruction or copy instruction, the vehicle domain controller is instructed not to write or re-acquire this part of the data during the upgrade process, which significantly reduces the size of the upgrade package and the installation time. Conversely, when the target byte segment is not found in the preset file, the fifth operation type is applied, instructing the cloud to generate an instruction file containing new data or differential data, ensuring integrity and accuracy. By distinguishing between identical files and different regions within the file system, this technical solution can efficiently generate differentiated upgrade instructions, which not only accelerates the production of upgrade packages but also improves the execution process of OTA upgrades, shortens the overall upgrade time, reduces the storage capacity requirements of the vehicle controller, and improves the user experience and success rate of OTA upgrades.

[0099] In one alternative embodiment, Figure 2 This is a flowchart illustrating the generation of an OTA upgrade instruction file according to an embodiment of this application, such as... Figure 2 As shown, this process demonstrates the core steps of upgrading the vehicle domain controller software from the current system file (version V1) to version V2 (upgrade system file).

[0100] The process begins with the OTA cloud server receiving system images of versions V1 and V2. It then parses the file information of the image versions, including file paths, data offsets, and data sizes. Next, the process enters the core comparison and instruction generation phase, where the cloud server iterates through the V2 version image data and compares it with the V1 version data.

[0101] During the comparison process, the system performs a detailed analysis of each data block: when it finds that the V2 version and the V1 version have the same data block, the system generates data: namely, a "skip" instruction (marked as 'S' + length), which instructs the vehicle controller not to read or write the data of the corresponding length during the upgrade process, but to skip it directly, thereby saving upgrade time and space resources;

[0102] When it is found that there is no identical data block between version V2 and version V1, it is determined whether the current offset O1 (first offset address) is in a file in version V2. If not, the search continues to the nearest file at offset O2 (second offset address). Then, the data from O1 to O2 is traversed to determine whether it contains a character that is repeated more than 32 times consecutively. If it exists, data is generated: i.e., a "repeat" instruction (marked as 'R' + length + character). Only the length of the repeated character and the character itself need to be transmitted, greatly reducing the amount of data. Conversely, if the data is not repeated, data is generated: i.e., an "add" instruction (marked as 'A' + length + data). The data is written completely.

[0103] The system checks if the current offset O1 (first offset address) is within a file in version V2. If so, it checks if the file in the V2 image also exists and is completely identical in version V1. If so, the system generates a "copy" instruction (marked as 'C' + length + V1 offset), instructing the vehicle controller to directly copy data from the current version to the upgraded backup partition without re-downloading. If there are differences between the files, a differential algorithm is executed between the V2 and V1 files to generate a differential instruction ('D' + length + V1 offset + differential data), calculating and transmitting only the changed data to further reduce the upgrade package size. At the end of the process, all generated instructions, along with the hash values ​​of versions V1 and V2, are compressed and packaged into an upgrade package, converted into an OTA upgrade instruction file for the vehicle controller to download and execute during the upgrade, ensuring the efficiency and reliability of the upgrade process.

[0104] In one alternative embodiment, Figure 3 This is an OTA upgrade flowchart according to an embodiment of this application, such as... Figure 3 As shown, this process clearly describes the entire process of OTA upgrades for the vehicle domain controller.

[0105] First, the upgrade package is unzipped. Then, the V1 / V2 version HASH value and upgrade instruction file are obtained. Next, it is determined whether the primary partition HASH is consistent with the V1 version. If they are inconsistent, a normal full upgrade task is performed again. If they are consistent, the upgrade instruction file is parsed. Instruction S is used to skip a specified length, instruction A is used to write specified data to the backup partition, instruction R is used to write specified duplicate data to the backup partition, instruction C is used to copy data with a specified offset address and length from the primary partition to the backup partition, and instruction D is used to restore data from the primary partition with a specified offset address and differential data and then copy it to the backup partition. Further, it is determined whether the backup partition HASH is consistent with the V2 version. If they are inconsistent, the upgrade fails and is retried or an error is reported. If they are consistent, the system switches to the backup partition and restarts. At this point, the upgrade is successful.

[0106] Specifically, the above process begins with the vehicle controller receiving an upgrade command file from the OTA cloud server, which includes system image information for versions V1 and V2. The diagram then emphasizes the crucial verification steps the vehicle controller performs before the upgrade: obtaining the first identifier information of the current system file and comparing it with preset identifier information. This preset identifier information confirms that the vehicle controller is in a suitable upgrade state, meaning the currently running software version matches the preset V1 version in the upgrade command file.

[0107] If the verification is successful, the vehicle controller continues to decompress the upgrade instruction file, extracting operation type information containing the upgrade system files and their multiple data blocks. These operation types include, but are not limited to, Skip, Copy, Append, and Diff, which guide the vehicle controller on how to efficiently upgrade from version V1 to version V2.

[0108] Next, the diagram details how the vehicle controller performs specific upgrade actions based on the operation type and upgrade system files obtained after decompression. For data marked as skipped, the vehicle controller skips it directly without performing any write operations; for copy commands, the vehicle controller copies data with a specified offset address and length from the current primary partition to the backup partition; add commands prompt the vehicle controller to write specific new data to the backup partition; differential commands require the vehicle controller to restore and copy data to the backup partition based on the specified offset address and differential data of the primary partition.

[0109] After completing the upgrade of all data blocks, the vehicle controller performs a comprehensive hash check on the backup partition to ensure that the upgraded system files are consistent with version V2. If the check result matches, the vehicle controller will switch to the backup partition and restart, indicating a successful upgrade; otherwise, if the check fails, the system will automatically execute a rollback process, synchronizing the data from the backup partition to the primary partition, restoring it to the state before the upgrade, ensuring that the normal operation of the vehicle controller is not affected.

[0110] According to an embodiment of this application, an embodiment of an upgrade device for an on-board controller is provided. It should be noted that this device can be used to execute the above-described upgrade method for the on-board controller. The specific implementation method and preferred application scenarios are the same as those in the above embodiment, and will not be repeated here.

[0111] Figure 4 This is a schematic diagram of an upgrade device for an on-board controller according to an embodiment of this application, as shown below. Figure 4 As shown, the device includes: an acquisition module 402, a decompression module 404, and an upgrade module 406.

[0112] The acquisition module 402 is used to acquire the first identification information of the current system file in response to receiving the upgrade instruction file from the vehicle controller; the decompression module 404 is used to decompress the upgrade instruction file based on the first identification information to obtain the upgrade system file and the operation types corresponding to multiple data blocks in the upgrade system file, wherein the operation type is used to indicate the operation type for performing corresponding operations on multiple data blocks; the upgrade module 406 is used to upgrade the vehicle controller based on the operation types corresponding to multiple data blocks and the upgrade system file to obtain the upgrade result.

[0113] Optionally, the upgrade module is used to determine the operation type corresponding to the first data block among multiple data blocks as the first operation type, wherein the first operation type is used to indicate that a skip operation is performed on the first data block, and the first data block is a data block in the upgrade system file that is the same as the current system file; the skip operation is performed on the first data block based on the first operation type, and the corresponding operation is performed on the second data block based on the operation type corresponding to the second data block among multiple data blocks to obtain the upgrade result, wherein the first data block is a data block in the upgrade system file that is the same as the current system file, and the second data block is a data block in the upgrade system file that is different from the current system file.

[0114] Optionally, the upgrade module is further configured to: In response to the operation type corresponding to the second data block being a second operation type, copy the second data block to a preset area based on the second operation type, wherein the second operation type indicates that a copy operation is performed on the second data block; In response to the operation type corresponding to the second data block being a third operation type, restore the target differential instruction corresponding to the second data block to the preset area based on the third operation type, wherein the third operation type indicates that the target differential instruction is restored; In response to the operation type corresponding to the second data block being a fourth operation type, write duplicate data in the target byte segment corresponding to the second data block to the preset area based on the first offset address information corresponding to the second data block, wherein the number of consecutive identical bytes in the target byte segment is greater than a preset threshold, wherein the fourth operation type indicates that duplicate data is written; In response to the operation type corresponding to the second data block being a fifth operation type, determine the second offset address information adjacent to the first offset address information based on the fifth operation type, and write the data in the preset file corresponding to the second offset address information to the preset area, wherein the fifth operation type indicates that the preset file is written.

[0115] Optionally, the upgrade module is also used to restore the target differential instruction to obtain the first target file and the second target file corresponding to the first offset address information; and to write the data in the first target file and the second target file into a preset area.

[0116] Optionally, the operation type corresponding to the second data block is determined based on the first offset address information, the first file information of the upgraded system file, and the second file information of the current system file, and the first offset address information is determined based on the data information of the second data block.

[0117] Optionally, if the operation type corresponding to the second data block does not exist in the upgrade system file, it is determined based on the second offset address information adjacent to the first offset address information; if the operation type corresponding to the second data block exists in the upgrade system file and the second target file corresponding to the first offset address information exists in the current system file, it is determined based on the first target file and the second target file.

[0118] Optionally, the second operation type is used to indicate that the first target file and the second target file are the same, and the operation type corresponding to the second data block is determined by performing a difference operation on the first target file and the second target file when the first target file and the second target file are different.

[0119] Optionally, the third operation type is to determine the target difference instruction obtained by performing a difference operation on the first target file and the second target file, wherein the target difference instruction is used to indicate the difference content between the first target file and the second target file.

[0120] Optionally, the operation type corresponding to the second data block is determined by traversing the preset file corresponding to the second offset address information based on the second offset address information. The traversal result is used to indicate whether the target byte segment exists in the preset file.

[0121] Optionally, the fourth operation type is used to indicate that the target byte segment exists in the preset file as the traversal result, and the fifth operation type is used to indicate that the target byte segment does not exist in the preset file as the traversal result.

[0122] This application also provides an electronic device 50, please refer to... Figure 5 It includes a processor 510 and a memory 520, wherein the memory 510 is used to store computer programs; the processor 520 is used to execute the programs stored in the memory 510 to implement the vehicle controller upgrade method described in any embodiment of this application.

[0123] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the vehicle controller upgrade method described in any embodiment of this application.

[0124] In this application, "multiple" refers to two or more.

[0125] In this application, unless otherwise expressly defined, the terms "installation," "connection," and "linking" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a physical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal connection between two components. Those skilled in the art can understand the specific meaning of the above terms in this application based on the specific circumstances.

[0126] The terms “first,” “second,” “third,” “fourth,” etc., in this application (if present) are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence.

[0127] In this application, the term "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. Additionally, in this application, the character " / " generally indicates that the preceding and following related objects have an "or" relationship.

[0128] Unless otherwise specified, all steps in this application may be performed sequentially or randomly. For example, the method includes steps A and B, indicating that the method may include steps A and B performed sequentially, or steps B and A performed sequentially. For example, the method may also include step C, indicating that step C may be added to the method in any order. For example, the method may include steps A, B, and C, or steps A, C, and B, or steps C, A, and B, etc.

[0129] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this application should be included within the protection scope of this application.

Claims

1. A method for upgrading an on-board controller, characterized in that, Applications in vehicles include: In response to receiving the upgrade instruction file from the vehicle controller, obtain the first identification information of the current system file; The upgrade instruction file is decompressed based on the first identification information to obtain the upgrade system file and the operation types corresponding to multiple data blocks in the upgrade system file, wherein the operation type is used to indicate the operation type for performing corresponding operations on the multiple data blocks; The vehicle controller is upgraded based on the operation type corresponding to the multiple data blocks and the upgrade system file to obtain the upgrade result.

2. The method according to claim 1, characterized in that, The vehicle controller is upgraded based on the operation type corresponding to the multiple data blocks and the upgrade system file to obtain the upgrade result, including: The operation type corresponding to the first data block among the plurality of data blocks is determined to be the first operation type, wherein the first operation type is used to indicate that a skip operation is performed on the first data block, and the first data block is the same data block in the upgrade system file as the current system file; A skip operation is performed on the first data block based on the first operation type, and a corresponding operation is performed on the second data block based on the operation type corresponding to the second data block among the plurality of data blocks to obtain the upgrade result. The first data block is a data block in the upgrade system file that is the same as the current system file, and the second data block is a data block in the upgrade system file that is different from the current system file.

3. The method according to claim 2, characterized in that, Based on the operation type corresponding to the second data block among the plurality of data blocks, perform corresponding operations on the second data block, including: In response to the second data block corresponding to the second operation type being the second operation type, the second data block is copied to a preset area based on the second operation type, wherein the second operation type is used to indicate that a copy operation is performed on the second data block; In response to the operation type corresponding to the second data block being a third operation type, the target differential instruction corresponding to the second data block is restored to the preset area based on the third operation type, wherein the third operation type is used to indicate that the target differential instruction is restored; In response to the operation type corresponding to the second data block being the fourth operation type, based on the fourth operation type and according to the first offset address information corresponding to the second data block, the duplicate data in the target byte segment corresponding to the second data block is written to the preset area, wherein the number of consecutive identical bytes in the target byte segment is greater than a preset threshold, wherein the fourth operation type is used to indicate that the duplicate data is written; In response to the operation type corresponding to the second data block being the fifth operation type, a second offset address information adjacent to the first offset address information is determined based on the fifth operation type, and data in the preset file corresponding to the second offset address information is written into the preset area, wherein the fifth operation type is used to indicate writing to the preset file.

4. The method according to claim 3, characterized in that, Based on the third operation type, restoring the target differential instruction corresponding to the second data block to the preset region includes: The target differential instruction is restored to obtain the first target file and the second target file corresponding to the first offset address information; The data from the first target file and the second target file are written into the preset area.

5. The method according to claim 3, characterized in that, The operation type corresponding to the second data block is determined based on the first offset address information, the first file information of the upgrade system file, and the second file information of the current system file. The first offset address information is determined based on the data information of the second data block.

6. The method according to claim 4, characterized in that, If the operation type corresponding to the second data block does not exist in the upgrade system file, it is determined based on the second offset address information adjacent to the first offset address information; if the operation type corresponding to the second data block exists in the upgrade system file and the second target file corresponding to the first offset address information exists in the current system file, it is determined based on the first target file and the second target file.

7. The method according to claim 4, characterized in that, The second operation type is used to indicate that the first target file and the second target file are the same. The operation type corresponding to the second data block is determined by performing a difference operation on the first target file and the second target file when the first target file and the second target file are different.

8. The method according to claim 7, characterized in that, The third operation type is to determine the target difference instruction obtained by performing a difference operation on the first target file and the second target file, wherein the target difference instruction is used to indicate the difference content between the first target file and the second target file.

9. The method according to claim 4, characterized in that, The operation type corresponding to the second data block is determined by traversing the preset file corresponding to the second offset address information based on the second offset address information. The traversal result is used to indicate whether the target byte segment exists in the preset file.

10. The method according to claim 9, characterized in that, The fourth operation type is used to indicate that the traversal result is that the target byte segment exists in the preset file, and the fifth operation type is used to indicate that the traversal result is that the target byte segment does not exist in the preset file.

11. An electronic device, characterized in that, Includes processor and memory, of which: Memory, used to store computer programs; A processor for executing a program stored in memory to implement the method described in any one of claims 1 to 10.

12. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the method described in any one of claims 1 to 10.