Multi-core microprocessor software upgrading processing method, vehicle and system

By adopting the multi-core microprocessor software upgrade method in automobiles, and using encryption compression processing and execution area switching technology, the problems of long transmission time and low security during the software upgrade process are solved, and a faster and safer upgrade process is achieved.

CN119105780APending Publication Date: 2024-12-10ZHIZI AUTOMOTIVE TECHNOLOGY CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411123610.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-15
Publication Date
2024-12-10

AI Technical Summary

Technical Problem

During the upgrade process of existing automotive software, the transmission and writing of upgrade files take a long time, and the data transmission is in plain text, which has low security problems.

Method used

Using the multi-core microprocessor software upgrade method, by downloading the encrypted and compressed drive files from the upper computer, performing integrity checksum consistency checksum consistency checksum to switch execution areas, avoid plain text transmission, reduce data transmission and write time, and ensure Security of data transmission process.

Benefits of technology

It improves the security and accuracy of software upgrades, reduces data transmission time, ensures consistency of the data transmission process, and improves the reliability of the system through a fast backup mechanism.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119105780A_ABST
    Figure CN119105780A_ABST
Patent Text Reader

Abstract

The invention provides a multi-core microprocessor software upgrading processing method, a vehicle and a system, and is applied to an electronic control unit in the vehicle. The method comprises the following steps: downloading an encrypted and compressed driver file from an upper computer; performing integrity verification on the processed driver file, if the integrity verification is passed, flashing version information of the to-be-upgraded file, and deleting a historical upgrading file in the to-be-executed area; the encrypted and compressed file to be upgraded is downloaded from the upper computer, the file to be upgraded is stored in the to-be-executed area, the to-be-executed area is switched into a new execution area, the current execution area is switched into a new to-be-executed area, and the encrypted and compressed file to be upgraded of the previous version of the file to be upgraded is stored in the current execution area; and performing consistency verification processing on the to-be-upgraded file in the new execution area, and upgrading the to-be-upgraded file in the new execution area according to a verification result. The data copying and writing time is shortened, and the upgrading efficiency and safety are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of vehicle control technology, and in particular to a multi-core microprocessor software upgrade processing method, vehicle and system. Background Art

[0002] With the rapid development of new energy vehicles in terms of electrification, networking, intelligence, and sharing, software-defined vehicles have been widely practiced in actual engineering applications. However, as software plays an increasingly important role in the automotive industry, the challenges it faces are gradually emerging. At present, the scale and overall complexity of automotive software development have increased significantly, which has put forward higher requirements on the software development capabilities of vehicle manufacturers and related parts manufacturers.

[0003] In existing software upgrades, the transmission and flashing of upgrade files takes a long time, and during the update process of conventional controller applications, data is usually transmitted in plain text on the vehicle network, which has low security. Summary of the invention

[0004] The purpose of this application is to address the deficiencies in the above-mentioned prior art and provide a multi-core microprocessor software upgrade processing method, vehicle and system to improve the security and accuracy of software upgrades.

[0005] To achieve the above purpose, the technical solution adopted in the embodiment of the present application is as follows:

[0006] In a first aspect, an embodiment of the present application provides a multi-core microprocessor software upgrade processing method, which is applied to an electronic control unit in a vehicle, and the method includes:

[0007] Download the encrypted and compressed driver file from the host computer;

[0008] Performing an integrity check on the processed driver file, and if the integrity check passes, rewriting the version information of the file to be upgraded, and deleting the historical upgrade file in the waiting area;

[0009] Downloading the encrypted and compressed file to be upgraded from the host computer and storing the file to be upgraded in the waiting execution area, switching the waiting execution area to a new execution area, and switching the current execution area to the new waiting execution area, wherein the encrypted and compressed file to be upgraded of the previous version of the file to be upgraded is stored in the current execution area;

[0010] A consistency check is performed on the files to be upgraded in the new execution area, and the files to be upgraded in the new execution area are upgraded according to the check result.

[0011] Optionally, switching the to-be-executed area to the new execution area, and switching the current execution area to the new to-be-executed area, includes:

[0012] Based on the partition address alternating mapping algorithm, the to-be-executed area is switched to the new execution area, and the current execution area is switched to the new to-be-executed area.

[0013] Optionally, the performing consistency check on the files to be upgraded in the new execution area, and upgrading the files to be upgraded in the new execution area according to the check result, comprises:

[0014] If the upgrade fails, determining whether to re-upgrade the files to be upgraded in the new execution area according to the validity of the files to be upgraded in the new execution area;

[0015] If so, the files to be upgraded in the new execution area are upgraded again; otherwise, the files to be upgraded in the new execution area are upgraded again using a rollback strategy.

[0016] Optionally, the process of the host computer encrypting and compressing the driver file includes:

[0017] The driver file is encrypted in the host computer using a preset encryption algorithm, and the encrypted driver file is compressed using a preset compression algorithm to obtain the encrypted and compressed driver file.

[0018] Optionally, the process of encrypting the driver file using a preset encryption algorithm in the host computer and compressing the encrypted driver file using a preset compression algorithm to obtain the encrypted and compressed driver file comprises:

[0019] Dividing the driver file into blocks according to the number of bytes to obtain multiple data blocks;

[0020] Generate a pseudo-random byte stream corresponding to each of the data blocks;

[0021] Encrypting each of the data blocks by using the pseudo-random byte stream to obtain an encrypted driver file;

[0022] The encrypted driver file is compressed to obtain an encrypted and compressed driver file.

[0023] Optionally, switching the to-be-executed area to a new execution area and switching the current execution area to the new to-be-executed area based on the partition address alternating mapping algorithm includes:

[0024] The to-be-upgraded file in the to-be-executed area is verified, and if the verification passes, the partition address information is updated so that the to-be-executed area is switched to a new execution area, and the current execution area is switched to a new to-be-executed area.

[0025] Optionally, updating the partition address information includes:

[0026] Determine whether the current partition is a standard mapping according to the attribute information of the current partition, and if so, set the attribute information of the execution area and the attribute information of the to-be-executed area of ​​the current partition as alternating mapping, and perform address alternating mapping on the execution area and the to-be-executed area of ​​the current partition;

[0027] If not, address alternating mapping is performed on the execution area and the to-be-executed area of ​​the current partition.

[0028] Optionally, before downloading the encrypted and compressed driver file from the host computer, the following steps are included:

[0029] determining whether the electronic control unit enters an extended session mode;

[0030] If yes, determining whether the electronic control unit meets the pre-upgrade conditions;

[0031] If yes, stop the recording function and network message function of the electronic control unit, read the current version information in the electronic control unit, and determine whether the current version information is consistent with the version information of the file to be upgraded;

[0032] If the current version information is inconsistent with the version information of the file to be upgraded, the encoding mode is entered and the file to be upgraded is upgraded.

[0033] In a second aspect, an embodiment of the present application further provides a vehicle, comprising an electronic control unit according to the first aspect, wherein the electronic control unit is used to execute the method steps described in the first aspect.

[0034] In the third aspect, an embodiment of the present application also provides a software upgrade processing system, including a host computer and a vehicle, the vehicle including an electronic control unit, the electronic control unit including a processor, a storage medium and a bus, the storage medium stores program instructions executable by the processor, when the application is running, the processor and the storage medium communicate through the bus, the processor executes the program instructions to execute the steps of the multi-core microprocessor software upgrade processing method described in the first aspect above.

[0035] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored, and the computer program is read and executes the steps of the multi-core microprocessor software upgrade processing method described in the first aspect above.

[0036] The beneficial effects of this application are:

[0037] The present application provides a multi-core microprocessor software upgrade processing method, vehicle and system, by downloading the encrypted and compressed driver file from the host computer, performing integrity check on the processed driver file, after the integrity check is passed, writing the version information of the file to be upgraded, and deleting the historical upgrade file in the execution area, downloading the encrypted and compressed file to be upgraded from the host computer and storing the file to be upgraded in the execution area, switching the execution area to a new execution area, and switching the current execution area to a new execution area; by downloading the encrypted and compressed driver file and the file to be upgraded, avoiding plain text transmission, the data transmission time and security can be reduced, the file to be upgraded in the new execution area is subjected to consistency check processing, and the file to be upgraded in the new execution area is upgraded according to the check result. The integrity check and consistency check can ensure that the data transmission process has not been tampered with, and ensure the consistency of the entire process from data transmission to storage. By switching the execution area to the new execution area and switching the current execution area to the new execution area, the data copying and writing time is reduced, and the new execution area contains the encrypted and compressed file to be upgraded of the previous version of the file to be upgraded, which plays a role of fast backup. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0039] Figure 1 A flowchart of a software upgrade processing method provided in an embodiment of the present application;

[0040] Figure 2 A schematic diagram of a dual-zone structure provided in an embodiment of the present application;

[0041] Figure 3 A flowchart of another software upgrade processing method provided in an embodiment of the present application;

[0042] Figure 4 A flowchart of a partition address updating method provided in an embodiment of the present application;

[0043] Figure 5 A flowchart of another software upgrade processing method provided in an embodiment of the present application. DETAILED DESCRIPTION

[0044] To make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. It should be understood that the drawings in the present application only serve the purpose of explanation and description and are not used to limit the scope of protection of the present application. In addition, it should be understood that the schematic drawings are not drawn in real proportion. The flowchart used in this application shows the operations implemented according to some embodiments of the present application. It should be understood that the operations of the flowchart can be implemented out of order, and the steps without logical context can be reversed in order or implemented simultaneously. In addition, those skilled in the art can add one or more other operations to the flowchart under the guidance of the content of the present application, or remove one or more operations from the flowchart.

[0045] In addition, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. The components of the embodiments of the present application described and shown in the drawings here can be arranged and designed in various configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.

[0046] It should be noted that the term "comprising" will be used in the embodiments of the present application to indicate the existence of the features declared thereafter, but does not exclude the addition of other features.

[0047] At present, the scale and overall complexity of automotive software development have increased significantly, which has put forward higher requirements on the software development capabilities of vehicle manufacturers and related parts manufacturers. Most of the existing control units use a single partition to store software programs. When upgrading, the old program needs to be cleared before the new program is written. During the upgrade process, if a power outage or transmission failure occurs, the system may not work properly, which poses a great risk. In recent years, some manufacturers have begun to adopt a dual-zone backup strategy, which divides the FLASH storage space into two independent areas: area A and area B. Each area can store a complete program. Usually, one area is used to execute the current application, and the other area switches to the backup area when an abnormal flash or program execution occurs, ensuring that the software can continue to run. Although this A / B dual-zone strategy improves the reliability of the system, it still has some shortcomings in actual applications. For example, when the software upgrade package is large, the dual-zone flash strategy requires data copying and writing to the two FLASH areas, resulting in a long transmission and flash process, and high requirements on the working conditions of the controller, thereby reducing the upgrade efficiency. In addition, in the process of updating the application program of the traditional conventional controller, the data is usually not compressed and directly transmitted on the vehicle network, which is inefficient. The large amount of uncompressed data leads to long transmission time, which can easily cause network congestion, and may cause transmission delays in bandwidth-constrained environments, thus affecting the efficiency and stability of the update process. In the process of conventional controller application updates, data is usually transmitted in plain text on the vehicle network, which is less secure. If the data is intercepted or leaked during transmission, it may cause serious security risks. How to achieve faster and more efficient iterative upgrades is the focus of the automotive industry. At the same time, the security issues of data transmission are becoming increasingly apparent, and the contradiction between data transmission speed and data security is becoming more and more prominent.

[0048] Optionally, the software upgrade processing method provided in the embodiment of the present application is applied to an electronic control unit (ECU) in a vehicle, in which the software upgrade method provided in the embodiment of the present application can be used to perform software upgrade operations, and the software upgrade method is remotely upgraded through a unified diagnostic service protocol (UDS), and software updates or repairs can be performed on a vehicle production line or in a vehicle maintenance center.

[0049] The specific implementation process of the software upgrade provided in the embodiment of the present application is explained in detail below.

[0050] Figure 1 The flowchart of a software upgrade processing method provided in the embodiment of the present application is shown in FIG. 1 , wherein the execution subject of the method is the aforementioned electronic control unit. Figure 1As shown, the method includes:

[0051] S101, downloading the encrypted and compressed driver file from the host computer.

[0052] Optionally, the electronic control unit can be connected to the host computer through a CAN box for communication. Specifically, one end of the CAN box is connected to the terminal device running the host computer through a USB interface, and the other end of the CAN box is connected to the electronic control unit through a flash CAN interface reserved. On the host computer, the driver file can be loaded in advance, and the loaded driver file is encrypted and compressed.

[0053] Optionally, when the electronic control unit enters the main programming mode, it is necessary to first download the driver file from the host computer, and the host computer uploads the encrypted and compressed driver file (Flash Driver file) to the electronic control unit.

[0054] Specifically, the electronic control unit can enter the programming mode through the 10 02 service, and download the encrypted and compressed driver file through the 34-36-37 service.

[0055] S102: Perform integrity check on the processed driver file.

[0056] Optionally, if the integrity check passes, the following S103 is executed; if the integrity check fails, the process returns to S101. Specifically, the electronic control unit may perform an integrity check on the processed driver file through 31DF02.

[0057] Optionally, the integrity verification method may include verification methods such as cyclic redundancy check (CRC32), digital signature, checksum, hash chain, parity check, etc. These integrity verification methods may be compared, and according to actual conditions, a verification algorithm that can achieve a high proportion of correction of information transmission errors, can complete the calculation of data check codes in a very short time, and quickly complete the correction, and can greatly improve the communication speed during operation by adopting the method of automatic retransmission of data packets, thereby providing a guarantee for communication rate and security, such as CRC 32, which has strong error detection capability and low detection cost, is selected to implement integrity verification.

[0058] S103, flashing the version information of the files to be upgraded, and deleting the historical upgrade files in the waiting area.

[0059] The electronic control unit includes a waiting area and an execution area. The waiting area stores a historical upgrade file, which may be a previous version of the file to be upgraded or another version of the file to be upgraded.

[0060] Optionally, the version information of the file to be upgraded can be written from the host computer to the electronic control unit, specifically, the version information of the file to be upgraded can be written through the 2E service. For example, if the version information of the file to be upgraded is V1.1, the version information of V1.1 is written to the electronic control unit. And the historical upgrade files in the pending execution area are deleted, specifically, the historical upgrade files in the pending execution area can be erased through the 31 01FF 00 service.

[0061] S104, downloading the encrypted and compressed files to be upgraded from the host computer and storing the files to be upgraded in the area to be executed, switching the area to be executed to a new execution area, and switching the current execution area to the new area to be executed.

[0062] Among them, the current execution area stores the encrypted and compressed files to be upgraded of the previous version of the files to be upgraded. The current execution area refers to the execution area before the execution area is switched. The electronic control unit can download the encrypted and compressed files to be upgraded through services 34 36 37. After downloading the files to be upgraded to the execution area, the integrity of the files to be upgraded can be verified first. After the integrity verification is passed, the execution area is switched to a new execution area, and the current execution area is switched to the new execution area, which can ensure that the files to be upgraded are not damaged during the download process.

[0063] Optionally, after the to-be-executed area is switched to a new execution area and the current execution area is switched to the new to-be-executed area, the new execution area stores the to-be-upgraded file, and the new to-be-executed area stores the encrypted and compressed to-be-upgraded file of the previous version of the to-be-upgraded file.

[0064] S105: Perform consistency check on the files to be upgraded in the new execution area, and upgrade the files to be upgraded in the new execution area according to the check result.

[0065] Specifically, the files to be upgraded in the new execution area are compared with the encrypted and compressed files to be upgraded in the host computer to determine the verification results of the files to be upgraded in the new execution area. After the consistency check of the files to be upgraded in the new execution area, the dependency can also be checked, specifically the compatibility between the host computer and the electronic control unit is verified. If both the consistency result and the dependency result are passed, the files to be upgraded in the new execution area can be upgraded.

[0066] Optionally, if any one of consistency and compatibility fails, the file to be upgraded is not upgraded, and a fault message is output.

[0067] Optionally, after the file to be upgraded is upgraded, the electronic control unit can be reset through the 11 01 service, the electronic control unit can be made to enter a default session through the 10 01 service, and then the diagnostic trouble code (DTC) can be cleared through the 14 service.

[0068] In this embodiment, by downloading the encrypted and compressed driver file from the host computer, the processed driver file is checked for integrity, and after the integrity check is passed, the version information of the file to be upgraded is written, and the historical upgrade file in the to-be-executed area is deleted, the encrypted and compressed file to be upgraded is downloaded from the host computer and stored in the to-be-executed area, the to-be-executed area is switched to a new execution area, and the current execution area is switched to a new to-be-executed area; by downloading the encrypted and compressed driver file and the to-be-upgraded file, plain text transmission is avoided, the data transmission time and security can be reduced, the file to be upgraded in the new execution area is checked for consistency, and the file to be upgraded in the new execution area is upgraded according to the check result. The integrity check and consistency check can ensure that the data transmission process is not tampered with, and ensure the consistency of the entire process from data transmission to storage. By switching the to-be-executed area to the new execution area, and switching the current execution area to the new to-be-executed area, the data copying and writing time is reduced, and the new to-be-executed area contains the encrypted and compressed file to be upgraded of the previous version of the file to be upgraded, which plays a role in rapid backup.

[0069] Optionally, the switching of the to-be-executed area to the new execution area and the switching of the current execution area to the new to-be-executed area in S104 may include:

[0070] Optionally, the to-be-executed area may be switched to a new execution area, and the current execution area may be switched to a new to-be-executed area based on a partition address alternating mapping algorithm. Specifically, it may be based on a SWAP A / B partition alternating mapping algorithm.

[0071] Optionally, in S105, after performing consistency check on the files to be upgraded in the new execution area and upgrading the files to be upgraded in the new execution area according to the check result, the following steps may be included:

[0072] Optionally, if the upgrade fails, it is determined whether to re-upgrade the files to be upgraded in the new execution area according to the validity of the files to be upgraded in the new execution area.

[0073] Optionally, if the file to be upgraded in the new execution area is valid, it is determined that the file to be upgraded in the new execution area needs to be re-upgraded, and the file to be upgraded in the new execution area is re-upgraded; if the file to be upgraded is initially determined to be invalid, the judgment is tried again, and when the number of repetitions reaches a preset maximum number, it means that the file to be upgraded is invalid, and it is determined not to re-upgrade the file to be upgraded in the new execution area, and a rollback strategy needs to be adopted.

[0074] Specifically, when rolling back, it is necessary to first determine whether the previous version of the to-be-upgraded file stored in the new to-be-executed area is valid. When the number of invalid determinations reaches a maximum, the rollback fails and the upgrade fails; if the previous version of the to-be-upgraded file stored in the new to-be-executed area is valid, the rollback is initiated.

[0075] During rollback, the partition alternating mapping algorithm is used to alternately map the addresses of the current new to-be-executed area and the current new execution area. If the alternating new execution area stores the previous version of the to-be-upgraded file, the previous version of the to-be-upgraded file in the alternating new execution area can be rolled back. During rollback, the addresses of the execution area and the to-be-executed area are alternately mapped according to the partition alternating mapping algorithm, so that the to-be-executed area storing the previous version of the to-be-upgraded file can be mapped to the execution area, thereby realizing the rollback function.

[0076] Optionally, the rollback strategy adopted in this embodiment is to adopt the rollback measurement of the dual-partition asynchronous startup upgrade, which can ensure that the electronic control unit can quickly switch to the backup file that can run stably for backup operation. The dual partition consists of four parts, including the Bootloader storage area, the application storage management partition, the waiting area, and the execution area. Figure 2 shown.

[0077] Optionally, the Bootloader storage area is used to store the boot program after the controller is powered on; the application storage management partition is used to store software attribute information of the execution area and the to-be-executed area; the execution area is used to store the running to-be-upgraded files; and the to-be-executed area is used to store the previous version of the to-be-upgraded files for rollback.

[0078] Among them, the application storage management partition stores software attributes, including the execution area enable bit, the pending execution area enable bit, the component number of the running file to be upgraded, the component number of the previous version of the file to be upgraded to be run, the maximum restart attempt threshold and other information.

[0079] In this embodiment, when the upgrade of the file to be upgraded fails, an automatic rollback strategy is adopted to roll back the upgrade file, thereby improving the reliability and stability of the system. Compared with the existing backup function that requires data copying, the rollback realizes the backup function through alternating mapping, without the need for additional copying operations, saving time and resources.

[0080] Optionally, the process of the host computer performing encryption and compression processing on the driver file may include:

[0081] Optionally, the driver file may be encrypted using a preset encryption algorithm in the host computer, and the encrypted driver file may be compressed using a preset compression algorithm to obtain an encrypted and compressed driver file. The preset encryption algorithm may be, for example, a chacha20 encryption algorithm, and the preset compression algorithm may be, for example, a DEFLATE compression algorithm.

[0082] Figure 3 A flowchart of another software upgrade processing method provided in an embodiment of the present application is shown as follows: Figure 3 As shown, the above-mentioned process of encrypting the driver file using a preset encryption algorithm in the host computer and compressing the encrypted driver file using a preset compression algorithm to obtain the encrypted and compressed driver file may include:

[0083] S201, dividing the driver file into blocks according to the number of bytes to obtain multiple data blocks.

[0084] Exemplarily, the binary data in the driver file may be divided into 64-byte blocks to obtain a plurality of data blocks, wherein each data block includes a plurality of bytes.

[0085] S202: Generate a pseudo-random byte stream corresponding to each data block.

[0086] Specifically, for each data block, the initial state matrix and the transformed state matrix are obtained by adding the constant, the key, the counter and the initial vector.

[0087] Among them, the key can be a 256-bit key, which is randomly generated and kept confidential; the counter is a 32-bit counter, usually starting from 0, the purpose of the counter is to make each data block have a unique input state; the initial vector is a 96-bit initial vector, and a different initial vector is used each time encryption to ensure security. The initial state matrix is ​​a state matrix composed of constants, keys, counters and initial vectors, and is a 512-bit state matrix. Perform multiple rounds of transformation on the initial state matrix, perform odd and even rounds of Quarter Round operations, and obtain the transformed state matrix.

[0088] S203, encrypting each data block by using a pseudo-random byte stream to obtain an encrypted driver file.

[0089] Specifically, for each data block, a pseudo-random byte stream corresponding to the data block is used to perform an XOR operation byte by byte to encrypt the data in the data block.

[0090] S204: compress the encrypted driver file to obtain an encrypted and compressed driver file.

[0091] Specifically, the encrypted drive file is compressed using the DEFLATE data compression algorithm. The DEFLATE algorithm combines the LZ77 sliding window algorithm with Huffman coding to effectively reduce data redundancy and improve transmission efficiency. The compressed drive file is smaller and the transmission time is reduced.

[0092] It is worth noting that the encryption and compression process is similar to the encryption and compression process of the drive files, which will not be described in detail here.

[0093] Exemplarily, the file to be upgraded is APPV1.1. After the file to be upgraded is encrypted and compressed, APPV1.1 is downloaded to the to-be-executed area in the electronic control unit. If APPV1.1 passes the consistency check and the dependency check and is determined to be a valid file, the to-be-executed area and the execution area are alternately mapped based on the SWAP partition address alternating mapping algorithm. Specifically, the to-be-executed area is switched to a new execution area, and the current execution area is switched to a new to-be-executed area. Then, APPV1.1 is stored in the new execution area, and APPV1.0 is stored in the new to-be-executed area. Then, the APPV1.1 in the new execution area is upgraded.

[0094] Optionally, when an exception is encountered during the upgrade operation of APPV1.1 or the validity of the file fails, an automatic rollback strategy is triggered. The automatic rollback strategy alternately maps the waiting area and the execution area based on the SWAP partition alternate mapping technology.

[0095] Optionally, in S104, switching the to-be-executed area to the new execution area and switching the current execution area to the new to-be-executed area based on the partition address alternating mapping algorithm may include:

[0096] Optionally, the files to be upgraded in the to-be-executed area are verified, and if the verification passes, the partition address information is updated so that the to-be-executed area is switched to a new execution area, and the current execution area is switched to the new to-be-executed area.

[0097] Specifically, after the file to be upgraded is downloaded to the execution area of ​​the electronic control unit, the validity of the file to be upgraded in the execution area can be checked. If the validity of the file to be upgraded in the execution area is passed, the partition address information is updated.

[0098] Figure 4 A flow chart of a partition address updating method provided in an embodiment of the present application is shown as follows: Figure 4As shown, the specific process of updating the partition address information may include:

[0099] S301. Determine whether the current partition is a standard mapping according to the attribute information of the current partition.

[0100] Optionally, before determining whether the current partition is a standard mapping, it is also necessary to determine whether the string swap function (SWAP) of the current partition is enabled. If enabled, determine whether the current partition is a standard mapping according to the attribute information of the current partition; if not enabled, end. The current partition contains a waiting area and an execution area. At this time, the waiting area already contains files to be upgraded.

[0101] Optionally, if it is determined that the current partition is a standard mapping, the following S302 is executed; otherwise, the following S303 is executed.

[0102] S302: Set the attribute information of the execution area of ​​the current partition and the attribute information of the to-be-executed area to alternate mapping, and perform alternate address mapping on the execution area and the to-be-executed area of ​​the current partition.

[0103] Specifically, the attribute information of the execution area of ​​the current partition and the attribute information of the to-be-executed area are configured from standard mapping to alternating mapping. This means that the to-be-executed area and the execution area of ​​the current partition can be alternately mapped by exchanging addresses, that is, the address of the to-be-executed area of ​​the current partition is mapped to the address of the execution area, and the address of the execution area of ​​the current partition is mapped to the address of the to-be-executed area, and then the address of the execution area of ​​the current partition and the address of the to-be-executed area are alternately mapped.

[0104] For example, if the address of the execution area of ​​the current partition is 0x80600000, and V1.0 is stored in the execution area at this time, the address of the to-be-executed area is 0x80200000, and V1.1 is stored in the to-be-executed area at this time, after the addresses are alternately mapped, the address of the new to-be-executed area is 0x80600000, and V1.0 is stored in the new to-be-executed area at this time, and the address of the new execution area is 0x80200000, and V1.1 is stored in the new execution area at this time.

[0105] S303: Alternately map addresses of the execution area and the to-be-executed area of ​​the current partition.

[0106] Optionally, if the attribute information of the execution area of ​​the current partition and the attribute information of the area to be executed are not standard mappings, it means that the attribute information of the execution area of ​​the current partition and the attribute information of the area to be executed are alternately mapped at this time. Then, the addresses of the execution area and the area to be executed of the current partition can be directly alternately mapped without the need to configure the attribute information.

[0107] In this embodiment, by configuring the attribute information of the to-be-executed area and the execution area in the current partition, by configuring for alternating mapping, it can be ensured that the partition alternating mapping is mapped according to the configured attribute information, thereby ensuring the accuracy and speed of the partition alternating mapping.

[0108] Figure 5 A flowchart of another software upgrade processing method provided in an embodiment of the present application is shown as follows: Figure 5 As shown, before downloading the encrypted and compressed driver file from the host computer, the following may be included:

[0109] S401: Determine whether the electronic control unit enters an extended session mode.

[0110] Optionally, when the electronic control unit enters the extended session mode, it means that the electronic control unit can enter the network preparation condition before upgrading the file to be upgraded, and the following S402 is executed. When the electronic control unit does not enter the extended session mode, it means that the network accurate condition before upgrading has not yet been entered, and the process ends.

[0111] S402: Determine whether the electronic control unit meets the pre-upgrade prerequisites.

[0112] The precondition before upgrading refers to checking whether the vehicle speed and other information of the vehicle in which the electronic control unit is installed meet the upgrading conditions. If the precondition before upgrading is met, the following S403 is executed. Otherwise, the process ends.

[0113] S403, stopping the recording function and the network message function of the electronic control unit, and reading the current version information of the electronic control unit.

[0114] S404: Determine whether the current version information is consistent with the version information of the file to be upgraded.

[0115] If they are not consistent, the following S405 is executed. If they are consistent, the process ends.

[0116] S405: Enter the encoding mode and upgrade the file to be upgraded.

[0117] A vehicle is also provided in an embodiment of the present application. The vehicle includes an electronic control unit, which can be used to execute the method steps in the aforementioned specific implementation manner.

[0118] An embodiment of the present application also provides a software upgrade processing system, which may include a host computer and a vehicle, wherein the vehicle includes an electronic control unit.

[0119] The embodiment of the present application also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the method steps in the embodiment of the multi-core microprocessor software upgrade processing method are executed.

[0120] Those skilled in the art can clearly understand that, for the convenience and simplicity of description, the specific working process of the system and device described above can refer to the corresponding process in the method embodiment, and will not be repeated in this application. In the several embodiments provided in this application, it should be understood that the disclosed system, device and method can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the modules is only a logical function division. There may be other division methods in actual implementation. For example, multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, indirect coupling or communication connection of devices or modules, which can be electrical, mechanical or other forms.

[0121] In addition, each functional unit in each embodiment of the present application can be integrated into a processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, RandomAccess Memory), disk or optical disk and other media that can store program code.

[0122] The above are only specific implementation methods of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be covered by the protection scope of the present application.

Claims

1. A method for upgrading software of a multi-core microprocessor, It is characterized in that Applied to an electronic control unit in a vehicle, the method comprises: Download the encrypted and compressed driver file from the host computer; Performing an integrity check on the processed driver file, and if the integrity check passes, rewriting the version information of the file to be upgraded, and deleting the historical upgrade file in the waiting area; Downloading the encrypted and compressed file to be upgraded from the host computer and storing the file to be upgraded in the waiting execution area, switching the waiting execution area to a new execution area, and switching the current execution area to the new waiting execution area, wherein the encrypted and compressed file to be upgraded of the previous version of the file to be upgraded is stored in the current execution area; A consistency check is performed on the files to be upgraded in the new execution area, and the files to be upgraded in the new execution area are upgraded according to the check result.

2. The multi-core microprocessor software upgrade processing method according to claim 1, It is characterized in that The step of switching the waiting area to be executed to a new execution area, and switching the current execution area to the new waiting area to be executed, includes: Based on the partition address alternating mapping algorithm, the to-be-executed area is switched to the new execution area, and the current execution area is switched to the new to-be-executed area.

3. The multi-core microprocessor software upgrade processing method according to claim 1, It is characterized in that The method of performing consistency check on the files to be upgraded in the new execution area and upgrading the files to be upgraded in the new execution area according to the check result includes: If the upgrade fails, determining whether to re-upgrade the files to be upgraded in the new execution area according to the validity of the files to be upgraded in the new execution area; If so, the files to be upgraded in the new execution area are upgraded again; otherwise, the files to be upgraded in the new execution area are upgraded again using a rollback strategy.

4. The multi-core microprocessor software upgrade processing method according to claim 1, It is characterized in that The process of the host computer encrypting and compressing the driver file includes: The driver file is encrypted in the host computer using a preset encryption algorithm, and the encrypted driver file is compressed using a preset compression algorithm to obtain the encrypted and compressed driver file.

5. The multi-core microprocessor software upgrade processing method according to claim 3, It is characterized in that The process of encrypting the driver file in the host computer using a preset encryption algorithm and compressing the encrypted driver file using a preset compression algorithm to obtain the encrypted and compressed driver file includes: Dividing the driver file into blocks according to the number of bytes to obtain multiple data blocks; Generate a pseudo-random byte stream corresponding to each of the data blocks; Encrypting each of the data blocks by using the pseudo-random byte stream to obtain an encrypted driver file; The encrypted driver file is compressed to obtain an encrypted and compressed driver file.

6. The multi-core microprocessor software upgrade processing method according to claim 2, It is characterized in that The method of switching the waiting area to a new execution area and the current execution area to a new waiting area based on the partition address alternating mapping algorithm includes: The to-be-upgraded file in the to-be-executed area is verified, and if the verification passes, the partition address information is updated so that the to-be-executed area is switched to a new execution area, and the current execution area is switched to a new to-be-executed area.

7. The multi-core microprocessor software upgrade processing method according to claim 6, It is characterized in that The updating of the partition address information includes: Determine whether the current partition is a standard mapping according to the attribute information of the current partition, and if so, set the attribute information of the execution area and the attribute information of the to-be-executed area of ​​the current partition as alternating mapping, and perform address alternating mapping on the execution area and the to-be-executed area of ​​the current partition; If not, address alternating mapping is performed on the execution area and the to-be-executed area of ​​the current partition.

8. The multi-core microprocessor software upgrade processing method according to claim 1, It is characterized in that Before downloading the encrypted and compressed driver file from the host computer, the method includes: determining whether the electronic control unit enters an extended session mode; If yes, determining whether the electronic control unit meets the pre-upgrade conditions; If yes, stop the recording function and network message function of the electronic control unit, read the current version information in the electronic control unit, and determine whether the current version information is consistent with the version information of the file to be upgraded; If the current version information is inconsistent with the version information of the file to be upgraded, the encoding mode is entered and the file to be upgraded is upgraded.

9. A vehicle, It is characterized in that It comprises an electronic control unit, which is used to execute the method steps described in any one of claims 1-8.

10. A software upgrade processing system, It is characterized in that include: The host computer and the vehicle in claim 9, wherein the vehicle includes an electronic control unit.

Citation Information

Cited By

  • Software upgrade processing method for multi-core microprocessor, vehicle, and system

    WO2026037357A1