Vehicle-mounted software processing method, vehicle-mounted software upgrading method, device and system

By encrypting and compressing the original data blocks in the vehicle software upgrade, a target upgrade file that can be downloaded, decompressed and decrypted at the same time is solved, and the problems of downloading time, low success rate and high decompression resources in the existing technology are solved, and a more efficient and reliable upgrade process is achieved.

CN119847549APending Publication Date: 2025-04-18MERCEDES BENZ GRP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411963499.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-30
Publication Date
2025-04-18

AI Technical Summary

Technical Problem

When handling vehicle-mounted software upgrades, the prior art faces problems such as long download time, reduced download success rate, longer decompression process and high resource consumption.

Method used

By reading the original data block of the set size from the upgrade file, performing encryption operations to generate the encrypted data block, and compressing it into the target data block when the preset compression amount is reached, and writing it to the newly created target upgrade file. When the vehicle downloads the target upgrade file, it can download data, decompress and decrypt.

Benefits of technology

It improves the efficiency and reliability of downloading upgraded files, and overcomes the problems of downloading time, low success rate and high decompression resource consumption in existing methods.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119847549A_ABST
    Figure CN119847549A_ABST
Patent Text Reader

Abstract

The invention discloses a vehicle-mounted software processing method, and a vehicle-mounted software upgrading method, device and system, and belongs to the technical field of software. A specific embodiment of the method comprises the following steps: reading original data blocks with a set size from an upgrade file in sequence, and encrypting the original data blocks to generate encrypted data blocks; according to the method, the encrypted data block with the preset compression amount is compressed into the target data block, and the target data block is written into the newly-built target upgrading file to serve as the vehicle upgrading software package, so that when the vehicle downloads the target upgrading file, decompression and decryption can be carried out while data are downloaded, the efficiency and reliability of downloading the upgrading file are improved, and the user experience is improved. According to the method, the problems of long downloading time consumption, low downloading success rate, long time consumption in a decompression process and high resource consumption existing in an existing method for the upgrading software package with a large size are solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of software technology, and in particular to a vehicle-mounted software processing method, a vehicle-mounted software upgrading method, a device and a system. Background Art

[0002] With the popularization of smart vehicles, the software functions installed in smart vehicles are becoming more and more abundant, and the frequency of software upgrades is also getting higher and higher.

[0003] At present, OTA (Over-the-Air Technology) is usually used to download the upgrade file package of the vehicle software, and then the upgrade software package is installed after downloading. In the case where the file size of the upgrade software package is large, the upgrade frequency is high, and the vehicle driving area is not fixed, the existing method has the problem of long download time and low download success rate. In addition, in the case where the upgrade software package is a compressed package, the subsequent decompression process of the upgrade software package also has the problem of long time consumption and large resource consumption. Summary of the invention

[0004] In view of this, the present invention provides a vehicle-mounted software processing method, a vehicle-mounted software upgrading method, a device and a system, which can read original data blocks of a set size from an upgrade file in sequence, perform encryption operations on the original data blocks to generate encrypted data blocks; compress the encrypted data blocks with a preset compression amount into a target data block, and write the target data block into a newly created target upgrade file as a vehicle upgrade software package, so that when the vehicle downloads the target upgrade file, it can download data while decompressing and decrypting, thereby improving the efficiency and reliability of downloading upgrade files, and overcoming the problems of the existing methods for large-sized upgrade software packages, such as long download time, reduced download success rate, long decompression process, and large resource consumption.

[0005] In order to solve the above technical problems, the present invention provides the following technical solutions:

[0006] In a first aspect, the present invention provides a method for processing vehicle-mounted software, comprising: obtaining an upgrade file of the vehicle-mounted software, starting from the data starting position of the upgrade file, and sequentially executing the following steps until all the data of the upgrade file is processed: reading original data blocks of a set size from the upgrade file in order, performing encryption operations on the original data blocks to generate encrypted data blocks; when the number of generated encrypted data blocks reaches a preset compression amount, compressing the encrypted data blocks of the preset compression amount into a target data block, the preset compression amount being determined based on the set size; and writing the target data block into a newly created target upgrade file, so that the target upgrade file with the target data block written therein is the vehicle upgrade software package.

[0007] In a second aspect, the present invention provides a vehicle-mounted software upgrade method implemented based on the vehicle-mounted software processing method of the first aspect, characterized in that it includes: obtaining a target upgrade file, wherein the target upgrade file includes a plurality of compressed target data blocks; determining a single download amount for the target data blocks for the target upgrade file according to the size of the target data blocks contained in the target upgrade file; starting from the starting position of the target upgrade file, sequentially downloading the target data blocks in the target upgrade file according to the single download amount, wherein the target data blocks include a plurality of encrypted data blocks; performing a decompression operation on the target data blocks, and performing a decompression operation on the encrypted data blocks obtained after the decompression; and performing an upgrade and installation operation on the vehicle-mounted software based on the original data blocks obtained by the decompression operation.

[0008] Optionally, determining a single download amount for a target data block for a target upgrade file includes: obtaining the size of the target data block obtained after a compression operation contained in the target upgrade file; and determining the single download amount to be a preset multiple of the size of the target data block based on a configured preset multiple.

[0009] Optionally, after sequentially downloading the target data blocks in the target upgrade file and before performing a decompression operation on the target data blocks, the method includes: searching for file header information from a data attribute field of the target data block; determining a data block size of the target data block and an offset address of compressed data contained in the target data block in the target upgrade file based on the found file header information; locating compressed data corresponding to the target data block based on the file header information and the offset address, and performing a decompression operation on the compressed data.

[0010] Optionally, a decryption operation is performed on the encrypted data block obtained after decompression, including: obtaining the encryption algorithm strategy corresponding to the encrypted data block; determining the data block size corresponding to the encryption algorithm strategy; for the encrypted data block, sequentially reading encrypted data blocks of the data block size, and using the decryption algorithm corresponding to the encryption algorithm strategy to perform a decryption operation on the encrypted data block.

[0011] Optionally, sequentially downloading target data blocks in the target upgrade file includes: constructing all target data blocks in the target upgrade file into multiple download data blocks with data sequence, the download data block containing multiple target data blocks with data sequence; storing the starting address and the ending address of the download data block; using multi-threading to download the multiple download data blocks, and determining the order of the multiple download data blocks according to the starting address and the ending address of the download data blocks.

[0012] Optionally, based on the original data block obtained by the decryption operation, the vehicle-mounted software is upgraded and installed, including: using the original data block obtained by the decryption operation to generate an original upgrade file; storing the original upgrade file in a local storage device, and using the original upgrade file in the local storage device to execute the upgrade and installation operation steps of the vehicle-mounted software; or, reading the data in the original data block in sequence according to the data order, and directly using the data in the original data block to execute the upgrade and installation operation of the vehicle-mounted software.

[0013] In a third aspect, the present invention provides a vehicle-mounted software processing device, comprising: a file acquisition module, which is used to acquire an upgrade file of the vehicle-mounted software, starting from the data starting position of the upgrade file, and sequentially executing the following steps until all the data of the upgrade file is processed; a file operation module, which is used to read original data blocks of a set size from the upgrade file in sequence, and perform encryption operations on the original data blocks to generate encrypted data blocks; when the number of generated encrypted data blocks reaches a preset compression amount, compressing the encrypted data blocks of the preset compression amount into a target data block, and the preset compression amount is determined based on the set size; a file generation module, which is used to write the target data block into a newly created target upgrade file, so that the target upgrade file with the target data block written into it is a vehicle upgrade software package.

[0014] In a fourth aspect, the present invention provides a vehicle-mounted software upgrade device, comprising: a file acquisition module, which is used to acquire a target upgrade file, wherein the target upgrade file includes a plurality of compressed target data blocks; determining a single download amount for the target data blocks for the target upgrade file according to the size of the target data blocks contained in the target upgrade file; a file download module, which is used to sequentially download the target data blocks in the target upgrade file starting from the starting position of the target upgrade file according to the single download amount, wherein the target data blocks include a plurality of encrypted data blocks; performing a decompression operation on the target data blocks, and performing a decompression operation on the encrypted data blocks obtained after the decompression; and a file installation module, which is used to perform an upgrade and installation operation on the vehicle-mounted software based on the original data blocks obtained by the decompression operation.

[0015] Optionally, the vehicle-mounted software processing device is used to determine the single download amount for the target data block for the target upgrade file, including: obtaining the size of the target data block obtained after the compression operation contained in the target upgrade file; based on the configured preset multiples, determining the single download amount to be a preset multiple of the size of the target data block.

[0016] Optionally, the on-vehicle software processing device is used to, after sequentially downloading the target data blocks in the target upgrade file and before performing a decompression operation on the target data blocks, include: searching for file header information from a data attribute field of the target data block; determining the data block size of the target data block and the offset address of the compressed data contained in the target data block in the target upgrade file based on the found file header information; locating the compressed data corresponding to the target data block based on the file header information and the offset address, and performing a decompression operation on the compressed data.

[0017] Optionally, the vehicle-mounted software processing device is used to perform a decryption operation on the encrypted data block obtained after decompression, including: obtaining the encryption algorithm strategy corresponding to the encrypted data block; determining the data block size corresponding to the encryption algorithm strategy; for the encrypted data block, sequentially reading the encrypted data blocks of the data block size, and using the decryption algorithm corresponding to the encryption algorithm strategy to perform a decryption operation on the encrypted data block.

[0018] Optionally, the vehicle-mounted software processing device is used to sequentially download target data blocks in the target upgrade file, including: constructing all target data blocks in the target upgrade file into multiple download data blocks with data sequence, the download data block containing multiple target data blocks with data sequence; storing the starting address and the ending address of the download data block; using multi-threading to download multiple download data blocks, and determining the order of the multiple download data blocks according to the starting address and the ending address of the download data blocks.

[0019] Optionally, the vehicle-mounted software processing device is used to perform an upgrade and installation operation on the vehicle-mounted software based on the original data block obtained by the decryption operation, including: generating an original upgrade file using the original data block obtained by the decryption operation; storing the original upgrade file in a local storage device, and using the original upgrade file in the local storage device to execute the upgrade and installation operation steps of the vehicle-mounted software; or, reading the data in the original data block in sequence according to the data order, and directly using the data in the original data block to execute the upgrade and installation operation of the vehicle-mounted software.

[0020] In a fifth aspect, the present invention provides a vehicle-mounted software upgrade system, comprising: a vehicle-mounted software processing device as in the third aspect and a vehicle-mounted software upgrade device as in the fourth aspect.

[0021] In a sixth aspect, an embodiment of the present invention provides an electronic device, including:

[0022] one or more processors;

[0023] a storage device for storing one or more programs,

[0024] When one or more programs are executed by one or more processors, the one or more processors implement the vehicle software processing method and the vehicle software upgrading method of the above-mentioned embodiments of the present invention.

[0025] In the seventh aspect, an embodiment of the present invention provides a computer-readable storage medium, on which a computer program for implementing the method is stored. When the computer program is executed by an on-board processor, the on-board software processing method and the on-board software upgrading method of the embodiment of the present invention are implemented.

[0026] The technical solution of the above invention has the following advantages or beneficial effects: it can read original data blocks of a set size from the upgrade file in sequence, perform encryption operations on the original data blocks to generate encrypted data blocks; compress the encrypted data blocks with a preset compression amount into a target data block, and write the target data block into a newly created target upgrade file as a vehicle upgrade software package, so that when the vehicle downloads the target upgrade file, it can download data while decompressing and decrypting, thereby improving the efficiency and reliability of downloading upgrade files, and overcoming the problems of the existing methods for large-sized upgrade software packages, such as long download time, reduced download success rate, long decompression process, and high resource consumption. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] Figure 1 is a flow chart of a vehicle software processing method provided according to an embodiment of the present invention;

[0028] Figure 2 is a flow chart of a vehicle software upgrade method provided according to an embodiment of the present invention;

[0029] Figure 3 is a main structural diagram of a vehicle-mounted software processing device provided according to an embodiment of the present invention;

[0030] Figure 4 is a main structural diagram of a vehicle software upgrade device provided according to an embodiment of the present invention;

[0031] Figure 5 It is a main structural diagram of a vehicle-mounted software processing system provided according to an embodiment of the present invention. DETAILED DESCRIPTION

[0032] The following is a description of exemplary embodiments of the present invention in conjunction with the accompanying drawings, including various details of the embodiments of the present invention to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for clarity and conciseness, the description of well-known functions and structures is omitted in the following description.

[0033] It should be pointed out that the embodiments of the present invention and the technical features therein may be combined with each other without conflict.

[0034] In addition, the terms "first", "second", "third", etc. included in the embodiments of the present invention are used to distinguish similar objects, and are not necessarily used to describe a specific number or sequence. It should be understood that the terms used in this way can be interchangeable under appropriate circumstances. This is just a way of distinguishing objects with the same attributes when describing them in the embodiments of the present invention.

[0035] Furthermore, the vehicle involved in the embodiment of the present invention may be an internal combustion engine vehicle using an engine as a power source, a hybrid vehicle using an engine and an electric motor as a power source, an electric vehicle using an electric motor as a power source, or the like.

[0036] Figure 1 A schematic diagram showing the main steps of the vehicle software processing method provided by the embodiment of the present invention is shown:

[0037] Step S101: Obtain the upgrade file of the vehicle software, and execute the following steps in sequence starting from the data start position of the upgrade file until all the data of the upgrade file is processed.

[0038] Step S102: Read original data blocks of a set size from the upgrade file in sequence, perform encryption operations on the original data blocks to generate encrypted data blocks; when the number of generated encrypted data blocks reaches a preset compression amount, compress the encrypted data blocks of the preset compression amount into a target data block, and the preset compression amount is determined based on the set size.

[0039] Step S103: writing the target data block into the newly created target upgrade file, so as to upgrade the vehicle software package through the target upgrade file into which the target data block is written.

[0040] The upgrade files of some vehicle-mounted software are relatively large in size. The embodiments of the present invention process relatively large software upgrade files so that the vehicle can decompress and decrypt the files while downloading via OTA. The flexibility and reliability of the download are improved by processing the upgrade files.

[0041] Specifically, the data in the (original upgrade file) is read from the data starting position of the upgrade file to be processed, and when the data block is of a set size, an encryption operation is performed on the data block (original data block) to generate an encrypted data block. For example, the encryption algorithm is AES256, which includes a 256-bit key. Therefore, the encryption operation is performed every 16 bytes of data until the encryption of the data contained in the entire upgrade file is completed, wherein the part of the file tail data that is less than 16 bytes can be padded to 16 bytes before the encryption operation is performed; therefore, when the encryption algorithm is AES256, the set size of the original data block can be set to 16 bytes; the present invention does not limit the specific encryption algorithm used and the specific value of the set size.

[0042] Furthermore, when the number of generated encrypted data blocks reaches a preset compression amount, the encrypted data blocks of the preset compression amount are compressed into a target data block, and the preset compression amount is determined based on the set size. Specifically, a compression operation is performed on multiple encrypted encrypted data blocks, and the encrypted data blocks of the preset compression amount can be compressed into a target data block (i.e., a compressed data block); until the compression operation of all encrypted encrypted data blocks is completed, for example: the preset compression amount is 32 bytes, wherein the preset compression amount is determined based on the set size (16 bytes); it can be understood that the preset compression amount can be an integer multiple of the set size. The present invention does not limit the specific values ​​of the set size and the preset compression amount.

[0043] Furthermore, taking the ZIP compression algorithm as an example, the formats of its compression packages include:

[0044] [local file header 1]

[0045] [filedata 1]

[0046] [data descriptor 1] ...

[0048] [local file header n]

[0049] [filedata n]

[0050] [data descriptor n]

[0051] [central directory]

[0052] [end of central directory record]

[0053] Each compressed target data block contains a file header (file header information), so that when decompressing the target data block, the compressed data can be obtained through the file header and other information.

[0054] Furthermore, the file header format has the following attributes:

[0055] local file header signature 4bytes

[0056] version needed to extract 2bytes

[0057] general purpose bit flag 2bytes

[0058] compression method 2bytes

[0059] last mod file time 2bytes

[0060] last mod filedate 2bytes

[0061] crc-32 4bytes

[0062] compressed size 4bytes

[0063] uncompressed size 4bytes

[0064] file name length 2bytes

[0065] extra field length 2bytes

[0066] file name(variable size)

[0067] extra field(variable size)

[0068] According to the attribute information contained in the file header, it can be known that the file header has a fixed part length of 30 bytes (that is, the number of bytes accumulated from the local file header signature to the extra field length), and the variable length part can be read from the file name length and the extra field length. Among them, the byte signature represented by the local file header signature can be preset data, such as 0x04034B50, which is used to identify the file header information when downloading data. Furthermore, the first variable part (variable size) is the file name, and the length of the file name can be determined from the attribute value of the file name length attribute. The length of the second variable part, the extra field (variable size), can be determined by the attribute value of the extra field length attribute. Therefore, according to the 30 bytes of the fixed part read, the length of the entire file header can be determined by the file name length and the extra field length within 30 bytes; so that when the position of the compressed data block is determined later, after determining the length of the file header and reading the file header, the position of the compressed data block can be determined, and the bytes subsequent to the file header are the data content of the compressed data. Further, the size of the encrypted data block can be determined according to the attribute value of the compressed size attribute contained in the file header.

[0069] Further, the target data blocks obtained after compression are written into the newly created target upgrade file, so that the target upgrade file with the target data blocks written therein is the vehicle upgrade software package. It can be understood that when all the compressed target data blocks obtained through the processing of step S102 are written into the target upgrade file, the target upgrade file is the downloadable vehicle upgrade software package.

[0070] The embodiment of the present invention encrypts and compresses the original upgrade file through steps S101 to S103 to obtain a target upgrade file, so that when the target upgrade file is subsequently downloaded, it can be decompressed and decrypted while downloading, thereby improving the efficiency and reliability of the vehicle downloading the upgrade software package.

[0071] Figure 2 A schematic diagram showing the main steps of the vehicle software upgrade method implemented based on the vehicle software processing method of steps S101 to S103 is shown:

[0072] Step S201: obtaining a target upgrade file, wherein the target upgrade file includes a plurality of compressed target data blocks; and determining a single download amount for the target data blocks for the target upgrade file according to the size of the target data blocks included in the target upgrade file.

[0073] Specifically, the target upgrade file is a plurality of target data blocks containing compressed data; the description of generating encrypted data blocks and compressed data blocks is consistent with the description of step S101 to step S103, and will not be repeated here. Further, according to the size of the target data block, the single download amount for the target data block is determined for the target upgrade file; it can be understood that the amount of data downloaded at one time (i.e., the single download amount) can be an integer multiple of the size of the target data block; by setting a reasonable single download amount, the download efficiency can be improved while improving the download flexibility. That is, determining the single download amount for the target data block for the target upgrade file includes: obtaining the size of the target data block obtained after the compression operation contained in the target upgrade file; based on the configured preset multiples, determining the single download amount as a preset multiple of the size of the target data block. For example: the size of the target data block is 32 bytes, and the obtained preset multiple of the configuration is 8 times, then the single download amount is 256 bytes obtained by 32*8; it can be understood that the preset multiple of the configuration is 8 times is only an example, and can be set to any integer according to the actual application scenario. The present invention does not limit the preset multiple and the specific data amount of the single download amount.

[0074] Step S202: starting from the starting position of the target upgrade file, sequentially download the target data blocks in the target upgrade file according to the single download amount, wherein the target data blocks include multiple encrypted data blocks; decompress the target data blocks, and decrypt the encrypted data blocks obtained after decompression.

[0075] Specifically, data is read from the starting position of the target upgrade file, and the target data blocks (i.e., compressed data blocks) in the target upgrade file are downloaded sequentially according to the single download amount, and a decompression operation is further performed on the target data blocks, and a decryption operation is performed on the encrypted data blocks obtained after decompression.

[0076] Further, after sequentially downloading the target data blocks in the target upgrade file, before performing the decompression operation on the target data blocks, the process includes: searching for file header information from the data attribute field of the target data block; determining the data block size of the target data block and the offset address of the compressed data contained in the target data block in the target upgrade file according to the found file header information; locating the compressed data corresponding to the target data block according to the file header information and the offset address, and performing the decompression operation on the compressed data. Specifically, the description of the file header information (file header) is consistent with the description of steps S101 to S103, and the length of the entire file header is determined by the file name length and extra field length within 30 bytes contained in the file header; so that when determining the position of the compressed data block later, after determining the length of the file header and reading the file header, the position of the compressed data block (i.e., the offset address) can be determined, that is, the compressed data corresponding to the target data block can be located, and further, the data content of the compressed data can be obtained according to the subsequent bytes (filedata) of the file header, and further, the size of the encrypted data block can be determined according to the attribute value of the compressed size attribute contained in the file header.

[0077] Further, a decryption operation is performed on the decompressed data; a decryption operation is performed on the encrypted data block obtained after decompression, including: obtaining the encryption algorithm strategy corresponding to the encrypted data block; determining the data block size corresponding to the encryption algorithm strategy; for the encrypted data block, sequentially reading the encrypted data block of the data block size, and using the decryption algorithm corresponding to the encryption algorithm strategy to perform a decryption operation on the encrypted data block. Specifically, before decryption, the encryption algorithm strategy is determined according to the encryption identifier of the data, such as the AES256 encryption algorithm strategy, and further, the data block size corresponding to the encryption algorithm strategy (for example, 16 bytes) is determined, and then the encrypted data block of the data block size (16 bytes) is read in sequence, and the decryption algorithm corresponding to the encryption algorithm strategy is used to perform a decryption operation on the encrypted data block.

[0078] Furthermore, an embodiment of the present invention provides a method for downloading target data blocks using multiple threads, that is, sequentially downloading target data blocks in a target upgrade file, including: constructing all target data blocks in the target upgrade file into multiple download data blocks with data order, the download data blocks containing multiple target data blocks with data order; storing the start address and end address of the download data blocks; downloading multiple download data blocks using multiple threads, and determining the order of multiple download data blocks according to the start address and end address of the download data blocks. The operation of downloading target data blocks (and subsequent decompression and decryption operations for the downloaded target data blocks) is performed in a multi-threaded parallel manner. Before the download starts, the length and position (i.e., the start address and end address) of the download data blocks to be processed by each thread are evenly distributed according to the size of the target upgrade file, and file information and upgrade progress are shared through inter-thread communication, so that the original single-thread processing process can be performed in parallel, further reducing the upgrade time of the vehicle-mounted software.

[0079] Step S203: Based on the original data block obtained by the decryption operation, the vehicle-mounted software is upgraded and installed.

[0080] Specifically, after the original data block is obtained through the decryption operation, the original data required for the vehicle software upgrade is obtained.

[0081] Based on the original data block obtained by the decryption operation, there are two ways to upgrade and install the vehicle software:

[0082] The first method: Generate an original upgrade file using the original data block obtained by the decryption operation; store the original upgrade file in a local storage device, and use the original upgrade file in the local storage device to perform the upgrade and installation operation steps of the vehicle-mounted software. Specifically, the decrypted original database is written into the original upgrade file, and an original upgrade file that can be used for installation is generated and stored in the local storage. Then, the upgrade and installation operation steps of the vehicle-mounted software are performed by using the original upgrade file in the local storage device. The upgrade and installation is performed by locally storing the original upgrade file, which can support subsequent file rollback, verification and other operations.

[0083] The second method is to read the data in the original data block in sequence according to the data order, and directly use the data in the original data block to perform the upgrade and installation operation of the vehicle-mounted software. Specifically, this method does not need to generate the original upgrade file or store the data in the local storage (reducing the consumption of storage resources). The original data block (for example, 16 bytes) can be installed in an asynchronous manner, and the upgrade package can be directly installed according to the data information and data address of the original data block. Furthermore, after the installation of the original data block is completed, a separate thread can be used to verify the signature and check the data of the original data block to further determine the completion of the subsequent upgrade installation. By performing the verification process of the original data block and the installation process of other original data blocks at the same time, the upgrade time is further compressed, and the original data block in the memory is read out and verified, which improves the correctness of data writing.

[0084] That is, based on the original data block obtained by the decryption operation, the vehicle-mounted software is upgraded and installed, including: using the original data block obtained by the decryption operation to generate an original upgrade file; storing the original upgrade file in a local storage device, and using the original upgrade file in the local storage device to execute the upgrade and installation operation steps of the vehicle-mounted software; or, reading the data in the original data block in sequence according to the data order, and directly using the data in the original data block to execute the upgrade and installation operation of the vehicle-mounted software.

[0085] Through the process of downloading, decompressing, decrypting and installing the target upgrade file (upgrade package) in steps S201 to S203, the efficiency and reliability of vehicle software downloading and installation are improved, and the problems of long downloading time and reduced download success rate for upgrade files with larger sizes in the existing methods are overcome. In addition, when the upgrade software package is a compressed package, the subsequent decompression process of the upgrade software package is also time-consuming and consumes a lot of resources.

[0086] like Figure 3 As shown, an in-vehicle software processing device 300 provided by an embodiment of the present invention includes:

[0087] The file acquisition module 301 is used to acquire the upgrade file of the vehicle-mounted software, starting from the data start position of the upgrade file, and sequentially executes the following steps until all the data of the upgrade file is processed;

[0088] The file operation module 302 is used to read original data blocks of a set size from the upgrade file in sequence, perform encryption operations on the original data blocks to generate encrypted data blocks; when the number of generated encrypted data blocks reaches a preset compression amount, compress the encrypted data blocks of the preset compression amount into a target data block, and the preset compression amount is determined based on the set size;

[0089] The file generation module 303 is used to write the target data block into the newly created target upgrade file, so that the target upgrade file written with the target data block is a vehicle upgrade software package.

[0090] like Figure 4 As shown, an embodiment of the present invention provides a vehicle software upgrade device 400, comprising:

[0091] The file acquisition module 401 is used to acquire a target upgrade file, wherein the target upgrade file includes a plurality of compressed target data blocks; and determine a single download amount for the target data blocks for the target upgrade file according to the size of the target data blocks included in the target upgrade file;

[0092] The file download module 402 is used to sequentially download target data blocks in the target upgrade file starting from the start position of the target upgrade file according to the single download amount, wherein the target data blocks include multiple encrypted data blocks; decompress the target data blocks, and decrypt the encrypted data blocks obtained after decompression;

[0093] The file installation module 403 is used to perform an upgrade and installation operation on the vehicle-mounted software based on the original data block obtained by the decryption operation.

[0094] Figure 5 1 is an architecture diagram of a vehicle software upgrade provided by an embodiment of the present invention. Figure 5 As shown, it includes: a vehicle-mounted software processing device 501 and a vehicle-mounted software upgrading device 502.

[0095] The vehicle-mounted software processing device 501 and the vehicle-mounted software upgrading device 502 can exchange software upgrading data via the network.

[0096] The vehicle-mounted software processing device 501 may be arranged on a server or platform that provides software upgrade downloads, and the vehicle-mounted software upgrade device 502 may be respectively assigned to a vehicle (eg, vehicle V1, vehicle V2, ... vehicle Vn).

[0097] The vehicle-mounted software processing device 501 is used to obtain the upgrade file of the vehicle-mounted software, starting from the data starting position of the upgrade file, and sequentially executing the following steps until all the data of the upgrade file is processed: reading original data blocks of a set size from the upgrade file in order, performing encryption operations on the original data blocks to generate encrypted data blocks; when the number of generated encrypted data blocks reaches a preset compression amount, compressing the encrypted data blocks of the preset compression amount into a target data block, and the preset compression amount is determined based on the set size; writing the target data block into a newly created target upgrade file, so that the target upgrade file with the target data block written is the vehicle upgrade software package.

[0098] The vehicle-mounted software upgrading device 502 implemented based on the vehicle-mounted software processing method is used to obtain a target upgrade file, wherein the target upgrade file includes a plurality of compressed target data blocks; determine a single download amount for the target data blocks for the target upgrade file according to the size of the target data blocks contained in the target upgrade file; start from the starting position of the target upgrade file, and sequentially download the target data blocks in the target upgrade file according to the single download amount, wherein the target data blocks include a plurality of encrypted data blocks; perform a decompression operation on the target data blocks, and perform a decryption operation on the encrypted data blocks obtained after the decompression; and perform an upgrade and installation operation on the vehicle-mounted software based on the original data blocks obtained by the decompression operation.

[0099] The vehicle software upgrade method, vehicle software download method, device and system provided by the embodiments of the present invention can read original data blocks of a set size from the upgrade file in sequence, perform encryption operations on the original data blocks to generate encrypted data blocks; compress the encrypted data blocks with a preset compression amount into a target data block, and write the target data block into a newly created target upgrade file as a vehicle upgrade software package, so that when the vehicle downloads the target upgrade file, it can download data while decompressing and decrypting, thereby improving the efficiency and reliability of downloading the upgrade file, and overcoming the problems of the existing methods for large-sized upgrade software packages, such as long download time, reduced download success rate, long decompression process time and large resource consumption.

Claims

1. A vehicle software processing method, characterized in that: include: Obtain the upgrade file of the vehicle software, and start from the data starting position of the upgrade file, and perform the following steps in sequence until all the data of the upgrade file is processed: Reading original data blocks of a set size from the upgrade file in sequence, performing encryption operations on the original data blocks to generate encrypted data blocks; When the number of the generated encrypted data blocks reaches a preset compression amount, compressing the encrypted data blocks of the preset compression amount into a target data block, wherein the preset compression amount is determined based on the set size; The target data block is written into a newly created target upgrade file, so that the target upgrade file into which the target data block is written is used as a vehicle upgrade software package.

2. A vehicle software upgrade method implemented based on the vehicle software processing method of claim 1, characterized in that: include: Acquire a target upgrade file, wherein the target upgrade file includes a plurality of compressed target data blocks; Determining a single download amount for the target data block for the target upgrade file according to the size of the target data block included in the target upgrade file; Starting from the starting position of the target upgrade file, sequentially downloading target data blocks in the target upgrade file according to a single download amount, wherein the target data blocks include multiple encrypted data blocks; Performing a decompression operation on the target data block, and performing a decryption operation on the encrypted data block obtained after decompression; Based on the original data block obtained by the decryption operation, the vehicle-mounted software is upgraded and installed.

3. The vehicle software upgrade method according to claim 2, characterized in that: The step of determining a single download amount for the target data block for the target upgrade file includes: Obtaining the size of a target data block obtained after a compression operation contained in the target upgrade file; Based on a configured preset multiple, the single download amount is determined to be a preset multiple of the size of the target data block.

4. The vehicle software upgrade method according to claim 2, characterized in that: After sequentially downloading the target data blocks in the target upgrade file and before performing a decompression operation on the target data blocks, the method includes: Searching for file header information from a data attribute field of the target data block; Determine the data block size of the target data block and the offset address of the compressed data contained in the target data block in the target upgrade file according to the found file header information; The compressed data corresponding to the target data block is located according to the file header information and the offset address, and a decompression operation is performed on the compressed data.

5. The vehicle software upgrade method according to claim 2, characterized in that: The performing a decryption operation on the encrypted data block obtained after decompression includes: Obtaining the encryption algorithm strategy corresponding to the encrypted data block; Determine the data block size corresponding to the encryption algorithm strategy; For the encrypted data block, the encrypted data blocks of the data block size are read in sequence, and a decryption operation is performed on the encrypted data block using a decryption algorithm corresponding to the encryption algorithm strategy.

6. The vehicle software upgrade method according to claim 2, characterized in that: The sequential downloading of target data blocks in the target upgrade file comprises: constructing all target data blocks in the target upgrade file into a plurality of download data blocks with a data sequence, wherein the download data block contains a plurality of target data blocks with a data sequence; storing a start address and an end address of the download data block; The plurality of download data blocks are downloaded by using multithreading, and the sequence of the plurality of download data blocks is determined according to the start address and the end address of the download data block.

7. The vehicle software upgrade method according to claim 2, characterized in that: The upgrading and installing operation of the vehicle software based on the original data block obtained by the decryption operation includes: Generate an original upgrade file using the original data block obtained by the decryption operation; The original upgrade file is stored in a local storage device, and the upgrade and installation operation steps of the vehicle software are performed using the original upgrade file in the local storage device; or, The data in the original data block are read in sequence according to the data order, and the upgrade and installation operation of the vehicle-mounted software is performed directly using the data in the original data block.

8. A vehicle-mounted software processing device, characterized in that: include: A file acquisition module, which is used to acquire the upgrade file of the vehicle-mounted software, starting from the data start position of the upgrade file, and sequentially performing the following steps until all the data of the upgrade file is processed; A file operation module, which is used to read original data blocks of a set size from the upgrade file in sequence, and perform encryption operations on the original data blocks to generate encrypted data blocks; When the number of the generated encrypted data blocks reaches a preset compression amount, compressing the encrypted data blocks of the preset compression amount into a target data block, wherein the preset compression amount is determined based on the set size; The file generation module is used to write the target data block into a newly created target upgrade file, so that the target upgrade file written with the target data block is a vehicle upgrade software package.

9. A vehicle software upgrade device, characterized in that: include: A file acquisition module, which is used to acquire a target upgrade file, wherein the target upgrade file includes a plurality of compressed target data blocks; and determine a single download amount for the target data block for the target upgrade file according to the size of the target data block included in the target upgrade file; A file download module, which is used to start from the starting position of the target upgrade file and sequentially download the target data blocks in the target upgrade file according to the single download amount, wherein the target data blocks include multiple encrypted data blocks; perform a decompression operation on the target data blocks, and perform a decryption operation on the encrypted data blocks obtained after decompression; The file installation module is used to perform an upgrade and installation operation on the vehicle-mounted software based on the original data block obtained by the decryption operation.

10. A vehicle software upgrade system, characterized in that: include: The vehicle-mounted software processing device as claimed in claim 8 and the vehicle-mounted software upgrading device as claimed in claim 9.