Software updating method, vehicle, computer equipment and program product
By recording the index information in the system-level chip installation package and configuration files, the problem of OTA upgrading is solved after the vehicle is powered off, and the function of continuing to update after power off is realized, reducing the upgrade time and improving efficiency.
Patent Information
- Application Number
- CN202411691194.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-22
- Publication Date
- 2025-03-14
AI Technical Summary
When using OTA remote upgrade software, the vehicle needs to be upgraded again after power is cut off, resulting in an increase in the upgrade time and affecting efficiency.
By obtaining the installation package and configuration files of the system-level chip, recording the index information of the partition to be updated and the data block to be installed, and after the power is out, the update location before the power is determined based on the index information, so as to continue partition updates.
There is no need to re-update each chip partition, which effectively reduces the impact of power outage on update time and update efficiency.
Smart Images

Figure CN119621103A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to a software updating method, a vehicle, a computer device, and a program product. Background Art
[0002] As a technology that realizes remote data management of mobile terminal devices through the air interface of mobile communications, Over-the-Air Technology (OTA) has been increasingly applied to the software upgrade of vehicle controllers. Through OTA remote upgrade, software function iteration can be realized efficiently and conveniently, and software function problems can be solved.
[0003] However, when using OTA remote upgrade method for software upgrade, if the vehicle loses power during the upgrade process, no matter what the upgrade progress was before the power outage, the upgrade needs to be restarted after the power is restored, which increases the upgrade time and affects the upgrade efficiency. Summary of the invention
[0004] The embodiments of the present disclosure at least provide a software updating method, a vehicle, a computer device, and a program product.
[0005] In a first aspect, an embodiment of the present disclosure provides a software update method, including:
[0006] Obtaining an installation package and a configuration file of a system-on-chip; the installation package includes a plurality of compressed data blocks corresponding to at least one chip partition;
[0007] According to the partition update order and data block attributes in the configuration file, the partitions to be updated are determined in sequence, and the data blocks to be installed of the partitions to be updated are obtained in sequence from the multiple compressed data blocks included in the installation package;
[0008] According to the installation instruction information in the configuration file, the partition to be updated is updated using the pre-compressed data corresponding to the data block to be installed, and index information corresponding to the partition to be updated and the data block to be installed is recorded during the updating process;
[0009] In response to power failure recovery, the target partition to be updated and the target data block to be installed corresponding to the power failure before the power failure are determined according to the index information, and the partition update is continued starting from the target data block to be installed of the target partition to be updated using the configuration file and the installation package until all chip partitions are updated.
[0010] This implementation method can reduce the storage pressure on the vehicle side by obtaining an installation package including compressed data blocks, compared with directly obtaining the uncompressed data. By using the partition update order in the configuration file, the update order of each partition to be updated can be determined and the partitions to be updated can be updated in sequence according to this order. By using the data block attributes, when updating any partition to be updated, each data block to be installed can be obtained in sequence in the installation package, and the next data block can be obtained after the installation of the currently obtained data block to be installed is completed, so that only the pre-compression data corresponding to the current data block to be installed needs to be stored each time during the update process, further reducing the storage pressure during the update process. By recording the index information of the currently updated partition to be updated and the index information of the currently updated data block to be installed in the partition to be updated during the update process, it can be achieved that after the vehicle power is restored, the update position before the power outage can be determined by using the index information, and the update can be continued from the update position without re-updating each chip partition, effectively reducing the impact of power outage on the update time and update efficiency.
[0011] In a possible implementation manner, recording the index information corresponding to the partition to be updated and the data block to be installed respectively during the update process includes:
[0012] Recording the partition index of the partition to be updated and the data block index of the data block to be installed;
[0013] In response to the completion of installation of the pre-compressed data corresponding to the data block to be installed, updating the data block index;
[0014] In response to the fact that the pre-compression data corresponding to each compressed data block corresponding to the partition to be updated is installed completely, the partition index is updated, and the data block index is reset.
[0015] This implementation method can accurately identify the chip partition currently updated by recording the partition index; for any partition to be updated, after the installation of the corresponding data block to be installed is completed, the data block index is updated to accurately identify the compressed data block currently updated in the partition. After the update of the partition to be updated is completed, the data block index is reset to avoid the problem of ignoring some compressed data blocks in the next partition to be updated due to the unreset data block index when updating the next partition to be updated.
[0016] In a possible implementation, in response to the pre-compression data corresponding to each compressed data block corresponding to the partition to be updated being installed, updating the partition index and resetting the data block index include:
[0017] In response to the pre-compression data corresponding to each of the compressed data blocks corresponding to the partition to be updated being installed, determining a content hash value of the installed data in the partition to be updated;
[0018] When the content hash value is consistent with the partition hash value in the installation instruction information corresponding to the partition to be updated, the partition index is updated and the data block index is reset.
[0019] In this implementation, by comparing the content hash value and the partition hash value, it is possible to determine whether the data content updated to the chip partition is correct, thereby avoiding update errors.
[0020] In a possible implementation, the method further includes:
[0021] When the content hash value is inconsistent with the partition hash value corresponding to the partition to be updated, the data block index is reset, and the step of sequentially acquiring the data blocks to be installed of the partition to be updated from the multiple compressed data blocks included in the installation package is returned.
[0022] In this implementation, when the content hash value and the partition hash value are inconsistent, it indicates that there may be a problem with the data content updated in the chip partition. Therefore, by re-updating the partition to be updated, the update success rate of the partition to be updated can be improved.
[0023] In a possible implementation, determining the partitions to be updated in sequence according to the partition update order and data block attributes in the configuration file and obtaining the data blocks to be installed of the partitions to be updated in sequence from the multiple compressed data blocks included in the installation package includes:
[0024] According to the partition update order in the configuration file, sequentially determine the partition to be updated from at least one of the chip partitions;
[0025] For any partition to be updated, the data blocks to be installed of the partition to be updated are sequentially obtained from multiple compressed data blocks included in the installation package according to the data block size in the data block attribute and the position offset information of the data block in the installation package.
[0026] In this implementation, the data block size can indicate the size of the compressed data block, and the position offset information can indicate the offset of the compressed data block relative to the starting position of the installation package. By using the data block size and position offset information, each complete data block to be installed can be obtained from the installation package in sequence.
[0027] In a possible implementation manner, after obtaining the installation package and configuration file of the system-on-chip, the method further includes:
[0028] Persistently storing the installation package and the configuration file, and persisting the state of the system-on-chip as an updated state;
[0029] After all chip partitions are updated, it also includes:
[0030] The installation package and the configuration file are deleted, and the update status is canceled.
[0031] This implementation method can avoid the problem of needing to re-obtain the installation package and configuration file from the cloud after the vehicle is powered off by persistently storing the installation package and configuration file; by persisting the update status, it can be determined in time after the vehicle is powered off and restored that the update was in progress before the power outage, thereby continuing the update. After all chip partitions have been updated, the installation package and configuration file can be deleted and the update status can be canceled to avoid the impact of this information on the next software update.
[0032] In a possible implementation manner, updating the partition to be updated using the pre-compressed data corresponding to the data block to be installed according to the installation instruction information in the configuration file includes:
[0033] In a case where the current data block to be installed is the first data block among the multiple compressed data blocks corresponding to the partition to be updated, determining a first starting installation address in the disk according to the disk mount point corresponding to the partition to be updated indicated by the installation instruction information and the installation offset of the starting installation position of the partition to be updated relative to the disk mount point, and installing the pre-compression data corresponding to the current data block to be installed according to the first starting installation address;
[0034] When the current data block to be installed is not the first data block among the multiple compressed data blocks corresponding to the partition to be updated, the fourth starting installation address of the current data block to be installed is determined according to the end address of the previous data block to be installed, and the pre-compression data corresponding to the current data block to be installed is installed according to the fourth starting installation address.
[0035] In this implementation, when installing the first data block of the partition to be updated, the disk mount point and the installation offset can be used to determine the starting installation address of the first data block in the disk, thereby achieving accurate installation of the first data block; when installing a data block other than the first data block of the partition to be updated, the installation continues according to the end address of the last installed data block, thereby ensuring the continuity of the data corresponding to the two adjacent data blocks.
[0036] In a possible implementation manner, the multiple compressed data blocks corresponding to the chip partition are obtained by segmenting and compressing the original data in the original update file corresponding to the chip partition according to a fixed segmentation size, and the relative order of the multiple compressed data blocks in the installation package is consistent with the order of the original data in the original update file;
[0037] The using the configuration file and the installation package to continue partition updating starting from the target to-be-installed data block of the target to-be-updated partition until all chip partitions are updated, includes:
[0038] Determine the number of installed compressed data blocks corresponding to the partition to be updated according to the index information of the target data block to be installed;
[0039] Determine a second starting installation address in the disk according to the disk mount point corresponding to the target partition to be updated indicated by the installation instruction information and the installation offset of the starting installation position of the partition to be updated relative to the disk mount point;
[0040] A third starting installation address is determined according to the second starting installation address, the quantity and the fixed segmentation size, and partition update is continued starting from the target data block to be installed according to the third starting installation address using the configuration file and the installation package until all chip partitions are updated.
[0041] This implementation can determine the total length of the data content corresponding to the installed compressed data blocks based on the number of installed compressed data blocks and the fixed segmentation size. Based on the total length and the second starting installation address, the interruption address before power failure (i.e., the third starting installation address) can be accurately determined, and then the update can be continued according to the third starting installation address, which can improve the accuracy of the update position when continuing to update after the interruption.
[0042] In a possible implementation, the obtaining of the installation package and configuration file of the system-on-chip includes:
[0043] Get the update file sent from the cloud;
[0044] Separating the initial configuration file and the installation package from the update file according to the order of the configuration file and the installation package in the update file and the size of the setting file corresponding to the configuration file;
[0045] The invalid padding information at the end of the initial configuration file is deleted to obtain the configuration file; the amount of the invalid padding information is determined according to the difference between the original file size of the configuration file and the set file size.
[0046] In this implementation, the configuration file is modified to a set file size by filling in invalid information and then sent to the vehicle. The vehicle side can quickly determine the configuration file directly by the sequence and the set file size without parsing the content in the update file, thereby saving the computing resources required for file parsing.
[0047] In a second aspect, an embodiment of the present disclosure further provides a software updating device, including:
[0048] An acquisition module, used to acquire an installation package and a configuration file of a system-level chip; the installation package includes a plurality of compressed data blocks corresponding to at least one chip partition;
[0049] A determination module, configured to sequentially determine the partitions to be updated according to the partition update order and data block attributes in the configuration file, and sequentially obtain the data blocks to be installed of the partitions to be updated from the multiple compressed data blocks included in the installation package;
[0050] an update module, configured to update the partition to be updated using the pre-compressed data corresponding to the data block to be installed according to the installation instruction information in the configuration file, and to record index information corresponding to the partition to be updated and the data block to be installed respectively during the update process; and
[0051] In response to power failure recovery, the target partition to be updated and the target data block to be installed corresponding to the power failure before the power failure are determined according to the index information, and the partition update is continued starting from the target data block to be installed of the target partition to be updated using the configuration file and the installation package until all chip partitions are updated.
[0052] In a third aspect, an embodiment of the present disclosure further provides a vehicle, including a controller, wherein the controller includes:
[0053] a memory for storing machine-readable instructions; and
[0054] The processor is used to call and execute the machine-readable instructions stored in the memory to implement the above-mentioned software updating method, or the steps in any possible implementation of the above-mentioned software updating method.
[0055] In a fourth aspect, an optional implementation of the present disclosure further provides a computer device, a processor, and a memory, wherein the memory stores machine-readable instructions executable by the processor, and the processor is used to execute the machine-readable instructions stored in the memory, and when the machine-readable instructions are executed by the processor, the steps of the above-mentioned first aspect, or any possible implementation of the first aspect are performed.
[0056] In a fifth aspect, an optional implementation of the present disclosure further provides a computer program product, including a computer program, which, when executed, implements the above-mentioned first aspect, or the steps in any possible implementation of the first aspect.
[0057] For a description of the effects of the above-mentioned software updating apparatus, computer device, and computer program product, please refer to the description of the above-mentioned software updating method, which will not be repeated here.
[0058] In order to make the above-mentioned objectives, features and advantages of the present disclosure more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0059] In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the following is a brief introduction to the drawings required for use in the embodiments. The drawings herein are incorporated into the specification and constitute a part of the specification. These drawings illustrate embodiments consistent with the present disclosure and are used together with the specification to illustrate the technical solutions of the present disclosure. It should be understood that the following drawings only illustrate certain embodiments of the present disclosure and should not be regarded as limiting the scope. For ordinary technicians in this field, other relevant drawings can also be obtained based on these drawings without creative work.
[0060] Figure 1 A flowchart of a software update method provided by an embodiment of the present disclosure is shown;
[0061] Figure 2 A specific implementation flow chart of a software update method provided by an embodiment of the present disclosure is shown;
[0062] Figure 3 A schematic diagram of a software updating device provided by an embodiment of the present disclosure is shown;
[0063] Figure 4 A schematic diagram of the structure of a computer device provided by an embodiment of the present disclosure is shown. DETAILED DESCRIPTION
[0064] In order to make the purpose, technical scheme and advantages of the embodiments of the present disclosure clearer, the technical scheme in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only part of the embodiments of the present disclosure, rather than all of the embodiments. The components of the embodiments of the present disclosure generally described and shown here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present disclosure is not intended to limit the scope of the present disclosure claimed for protection, but merely represents the selected embodiments of the present disclosure. Based on the embodiments of the present disclosure, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present disclosure.
[0065] In addition, the terms "first", "second", etc. in the description and claims of the embodiments of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the terms used in this way can be interchangeable where appropriate, so that the embodiments described herein can be implemented in an order other than that illustrated or described herein.
[0066] The "multiple or several" mentioned in this article refers to two or more. "And / or" describes the association relationship of the associated objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the associated objects are in an "or" relationship.
[0067] According to research, under the service-oriented architecture (SOA), vehicle functions can be divided into multiple vehicle domains, and each vehicle domain is controlled by a corresponding domain controller. For example, the AD Control Unit (ACU) corresponding to the autonomous driving domain, the cockpit domain controller (CDC) corresponding to the cockpit domain, and the body gateway module (BGM) corresponding to the body domain. For each domain controller, a system-on-chip (SoC) is deployed on it to realize function control. SoC is usually divided into multiple different chip partitions, and different chip partitions are used to realize different functions, such as system partitions for realizing system functions, application partitions for managing application software, etc. When OTA upgrading the SoC, it can usually be realized by using the update installation package set for the chip partition that needs to be updated. However, in the traditional OTA upgrade method, if the vehicle is powered off during the software upgrade of the SoC, then after the vehicle is powered on again, the update installation package of each chip partition needs to be reinstalled, which will increase the upgrade time and reduce the upgrade efficiency, which has great disadvantages.
[0068] Based on the above research, the present disclosure provides a software update method, a vehicle, a computer device and a program product. By obtaining an installation package including a compressed data block, the storage pressure on the vehicle side can be reduced compared to directly obtaining the data before compression. By using the partition update order in the configuration file, the update order of each partition to be updated can be determined and the partitions to be updated can be updated in sequence according to the order. By using the data block attribute, when updating any partition to be updated, each data block to be installed can be obtained in sequence in the installation package, and the next data block can be obtained after the installation of the currently obtained data block to be installed is completed, so that only the pre-compression data corresponding to the current data block to be installed needs to be stored each time during the update process, further reducing the storage pressure during the update process. By recording the index information of the currently updated partition to be updated and the index information of the data block to be installed currently being updated in the partition to be updated during the update process, it can be realized that after the vehicle is powered off and restored, the update position before the power outage can be determined by using the index information, and the update can be continued from the update position without re-updating each chip partition, effectively reducing the impact of power outage on the update time and update efficiency.
[0069] The defects existing in the above solutions are the results obtained by the inventor after practice and careful research. Therefore, the discovery process of the above problems and the solutions proposed by the present disclosure for the above problems below should be the contributions made by the inventor to the present disclosure during the disclosure process.
[0070] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.
[0071] It is understandable that before using the technical solutions disclosed in the embodiments of the present disclosure, the types, scope of use, usage scenarios, etc. of the personal information involved in the present disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.
[0072] To facilitate understanding of the present embodiment, a software update method disclosed in the embodiment of the present disclosure is first introduced in detail. The execution subject of the software update method provided in the embodiment of the present disclosure is generally a terminal device or other processing device with certain computing capabilities, wherein the terminal device may be a user equipment (UE), a mobile device, a user terminal, a terminal, a personal digital assistant (PDA), a handheld device, a computer device, a vehicle equipment, etc.; in some possible implementations, the software update method may be implemented by a processor calling computer-readable instructions stored in a memory.
[0073] The software update method provided by the embodiment of the present disclosure is described below by taking a vehicle as an example.
[0074] like Figure 1 As shown, it is a flowchart of a software updating method provided by an embodiment of the present disclosure, which may include S101 to S104:
[0075] S101: Acquire an installation package and a configuration file of a system-on-chip; the installation package includes a plurality of compressed data blocks corresponding to at least one chip partition.
[0076] Here, the installation package may be a software update package for one or more chip partitions that need to be updated in the SoC, which may include partition compression packages corresponding to each chip partition that needs to be updated, and the partition compression package includes multiple compressed data blocks corresponding to the chip partition. The chip partition update may specifically be to update the software or functions in the chip partition. The installation package and configuration file may be generated by the cloud, and the multiple compressed data blocks in the partition compression package corresponding to any chip partition may be obtained by data segmentation and compression of the original update file corresponding to the chip partition in the cloud. The original update file is the update file written by the developer, which includes the original data.
[0077] As for the chip partitions included in the installation package, they may be different in different updates. For example, in a certain update, the chip partition 1 and chip partition 2 in the SoC may be updated, and the installation package may include the partition compression packages corresponding to the chip partition 1 and chip partition 2 respectively. In the next update, the chip partition 1, chip partition 3, and chip partition 4 in the SoC may be updated, and the installation package may include the partition compression packages corresponding to the chip partition 1, chip partition 3, and chip partition 4 respectively.
[0078] In the installation package, the multiple compressed data blocks corresponding to each chip partition that needs to be updated are arranged in the partition compression package according to the order of the original data corresponding to the compressed data blocks in the original update file; the order between the partition compression packages corresponding to different chip partitions is arranged according to the order of the chip partitions in the installation package. For example, the first compressed data block of the first chip partition is stored at the starting position of the installation package. That is, from the starting position to the end position of the installation package, the first compressed data block of the first chip partition, the second compressed data block of the first chip partition, ... the last compressed data block of the first chip partition, the first compressed data block of the second chip partition, the second compressed data block of the second chip partition, ... the last compressed data block of the second chip partition, the first compressed data block of the third chip partition, ..., the last compressed data block of the last chip partition are stored in sequence.
[0079] The configuration file is used to indicate the partition update order of each chip partition in the installation package, as well as the installation instruction information and data block attributes of each chip partition. Among them, the partition update order is used to indicate the update order of each chip partition, and the partition update order is consistent with the arrangement order of the chip partitions in the installation package. The installation instruction information is used to indicate the installation location of the chip partition in the vehicle disk, the identification of the chip partition, the content hash value of the original update file corresponding to the chip partition, and other information. The content hash value is obtained by hashing the file content of the original update file. The data block attributes are used to indicate the size, installation location, and other information of each data block in the chip partition.
[0080] During specific implementation, when it is determined that an OTA upgrade is required for the SoC, the cloud can obtain the original update files for each chip partition that needs to be updated in the SoC. Then, for each chip partition, the original data in the original update file corresponding to the chip partition can be divided and compressed in sequence according to a fixed segmentation size, and the compressed data blocks corresponding to the chip partition can be obtained in sequence. According to the generation order of each compressed data block, each compressed data block is combined into a partition compression package corresponding to the chip partition. Then, the partition compression packages corresponding to each chip partition can be combined according to the target order to obtain the installation package corresponding to the SoC. Among them, the target order can be any order, and it can also be determined according to the priority set in advance for the chip partition, or it can be determined according to the update coverage of each chip partition. The embodiment of the present disclosure does not specifically limit the target order. Among them, the update coverage is used to characterize the proportion of the updated content of the chip partition to the overall content of the chip. At the same time, the cloud can use the combination order of the partition compression packages of the chip partitions as the partition update order of each chip partition, and determine the installation instructions and data block attributes of the partition compression packages of each chip partition, and encapsulate the partition update order, the installation instructions and data block information of each chip partition into the configuration file corresponding to the installation package, and the installation instructions and data block information of each chip partition are stored in the configuration file according to the partition update order. Then, the cloud can send the installation package and configuration file to the vehicle. In this way, the vehicle can obtain the installation package and configuration file corresponding to the SoC.
[0081] S102: According to the partition update sequence and data block attributes in the configuration file, the partitions to be updated are determined in sequence, and the data blocks to be installed of the partitions to be updated are obtained in sequence from the multiple compressed data blocks included in the installation package.
[0082] Here, the data block attribute is used to indicate the size of the compressed data block and the position offset information of the compressed data block in the installation package, and the position of the compressed data block in the installation package can be determined by the position offset information. The storage order of the data block attributes of each compressed data block is consistent with the arrangement order of the compressed data blocks in the partition compression package.
[0083] The partition to be updated is the chip partition that is determined to be currently updated. In a complete update process, the chip partitions corresponding to the partition compression packages included in the installation package will be updated in sequence as the partition to be updated. The data block to be installed is the data block that currently needs to be updated among the multiple compressed data blocks corresponding to the partition to be updated. In a complete update process corresponding to the partition to be updated, the compressed data blocks corresponding to the partition to be updated will be installed in sequence as the data blocks to be installed.
[0084] In specific implementation, the current partition to be updated can be determined from each chip partition in sequence according to the partition update order in the configuration file. For each partition to be updated, the data block attributes in the configuration file can be read in sequence according to the storage order of the data block attributes of each compressed data block, and the data blocks to be installed can be determined from the installation package in sequence according to the read data block attributes. After the data blocks to be installed in the current partition to be updated are determined in sequence and installed, the next partition to be updated can be determined until all chip partitions are updated.
[0085] For example, the chip partitions corresponding to the installation package include chip partitions 1 to 3, chip partition 1 includes compressed data blocks 1 to 5, chip partition 2 includes compressed data blocks 6 to 9, and chip partition 3 includes compressed data blocks 10 to 15, and the partition update order is chip partition 1, chip partition 3, and chip partition 2. When updating, according to the partition update order, chip partition 1 can be first determined as the partition to be updated. Then, compressed data block 1 is used as the data block to be installed and compressed data block 1 is obtained according to the data block attributes; after the compressed data block 1 is installed, compressed data block 2 can be used as the data block to be installed and compressed data block 2 can be obtained according to the data block attributes; after the compressed data block 2 is installed, compressed data block 3 can be used as the data block to be installed and compressed data block 3 can be obtained according to the data block attributes, ..., and so on. After the compressed data block 5 is updated, chip partition 3 can be used as the partition to be updated. Then, compressed data block 10 is used as the data block to be installed and compressed data block 10 is obtained according to the data block attribute; after compressed data block 10 is installed, compressed data block 11 can be used as the data block to be installed and compressed data block 11 can be obtained according to the data block attribute, ..., and so on. After compressed data block 15 is updated, chip partition 2 can be used as the partition to be updated. Then, compressed data block 6 is used as the data block to be installed and compressed data block 6 is obtained according to the data block attribute; after compressed data block 6 is installed, compressed data block 7 can be used as the data block to be installed and compressed data block 7 can be obtained according to the data block attribute, ..., and so on. After compressed data block 9 is updated, it can be determined that all chip partitions have been updated.
[0086] S103: According to the installation instruction information in the configuration file, the partition to be updated is updated using the pre-compression data corresponding to the data block to be installed, and index information corresponding to the partition to be updated and the data block to be installed are recorded during the updating process.
[0087] Here, the installation instruction information can be used to indicate the installation location of the partition compression package of the partition to be updated in the disk. The pre-compression data corresponding to the data block to be installed can be obtained by decompressing the data block to be installed.
[0088] The index information may include the partition index of the partition to be updated and the data block index of the data block to be installed. The partition index may be the partition identifier of the partition to be updated, or may be incremented from an initial value. The data block index may be incremented from an initial value. For example, the initial value may be 0. In each update, the partition index of the first partition to be updated is 0, the partition index of the second partition to be updated is 1, and the partition index of the third partition to be updated is 2. For any partition to be updated, the data block index of the first data block to be installed corresponding to the partition is 0, the data block index of the second data block to be installed is 1, and the data block index of the third data block to be installed is 2.
[0089] In specific implementation, after obtaining the installation package, each partition to be updated can be determined in turn according to the partition update order, and the data block to be installed of the partition to be updated can be determined according to the data block attribute. When updating any partition to be updated, the partition index of the partition to be updated can be recorded, and when installing the pre-compression data of any data block to be installed in any partition to be updated, the data block index of the data block to be installed can be recorded. Until the last chip partition is updated, the update of the system-level chip is realized.
[0090] Optionally, the installation instruction information of the configuration file may also include the partition identifier of the chip partition. When installing the data block to be installed of any partition to be updated, it is also possible to determine whether the data block to be installed belongs to the partition to be updated based on the partition identifier in the installation instruction information of the partition to be updated and the partition identifier carried by the data block to be installed. If so, the pre-compression data corresponding to the data block to be installed is installed. If not, an error prompt message is generated and the next data block to be installed is updated.
[0091] S104: In response to power failure recovery, determine the target partition to be updated and the target data block to be installed corresponding to the power failure according to the index information, and use the configuration file and the installation package to continue the partition update starting from the target data block to be installed of the target partition to be updated until all chip partitions are updated.
[0092] Here, when updating the SoC, whether using A / B side update or single-side update, the vehicle may lose power during the update process, resulting in an interruption in the update. In the prior art, when the update is interrupted due to a vehicle power outage, if the vehicle is powered on again, it is necessary to use the installation package to update the SoC from the beginning. In other words, no matter what the update progress was before the power outage, it is necessary to update from the beginning after the power outage is restored, which greatly increases the update time. However, the embodiment of the present disclosure records index information, so that there is no need to update from the beginning after the power outage is restored, but the update can continue from the position before the power outage, thereby reducing the update time.
[0093] The target partition to be updated is the chip partition updated before power failure, and the target data block to be installed is the compressed data block updated by the target partition to be updated before power failure.
[0094] In specific implementation, if the vehicle is powered on throughout the entire update process, the chip partitions in the SoC chip can be updated in sequence according to the above steps S101 to S103 until all chip partitions are updated. However, if the vehicle is detected to be powered off during the update process and then restored, it is necessary to determine the chip partition updated before the power outage based on the recorded partition index, and use the chip partition as the target partition to be updated. The compressed data block updated before the power outage is determined based on the recorded data block index, and use the compressed data block as the target data block to be installed. Then, the configuration file and installation package can be used to continue updating the chip partitions in the SoC chip according to the above steps S101 to S103, starting from the target data block to be installed of the target partition to be updated, until all chip partitions are updated.
[0095] For example, after determining the target partition to be updated and the target data block to be installed according to the index information, the data block attributes in the configuration file can be used to obtain the target data block to be installed from the installation package and decompress it to obtain the pre-compression data, and install the pre-compression data. After the installation is completed, the next data block to be installed can be determined according to the data block attributes, and the data block index can be updated. After the pre-compression data corresponding to the next data block to be installed is installed, the next data block to be installed can continue to be installed until all compressed data blocks corresponding to the target partition to be updated are installed, determine the next partition to be updated, and update the partition index and data block index. According to the update steps described above, the next partition to be updated is updated, and so on, until all chip partitions are updated and the OTA update of the SoC is completed.
[0096] In this way, by obtaining an installation package including compressed data blocks, the storage pressure on the vehicle side can be reduced compared to directly obtaining the uncompressed data. By using the partition update order in the configuration file, the update order of each partition to be updated can be determined and the partitions to be updated can be updated in sequence according to this order. By using the data block attributes, when updating any partition to be updated, each data block to be installed can be obtained in sequence in the installation package, and the next data block can be obtained after the installation of the currently obtained data block to be installed is completed, so that only the pre-compression data corresponding to the current data block to be installed needs to be stored each time during the update process, further reducing the storage pressure during the update process. By recording the index information of the currently updated partition to be updated and the index information of the currently updated data block to be installed in the partition to be updated during the update process, it can be realized that after the vehicle power is restored, the update position before the power outage can be determined by using the index information, and the update can be continued from the update position without re-updating each chip partition, effectively reducing the impact of power outage on the update time and update efficiency.
[0097] In one embodiment, the step of “recording index information” in S103 above may be implemented according to the following steps A1 to A3:
[0098] A1: Record the partition index of the partition to be updated and the data block index of the data block to be installed.
[0099] Here, the partition index is used to indicate the chip partition currently updated, and the data block index is used to indicate the compressed data block currently updated in the chip partition currently updated.
[0100] In specific implementation, after obtaining the installation package, the partition index and the data block index can be initialized. For the currently determined partition to be updated and the data block to be installed, the partition index of the partition to be updated and the data block index of the data block to be installed can be recorded, and the partition index and the data block index can be updated in time whenever a new partition to be updated and / or a new data block to be installed is determined.
[0101] A2: In response to the completion of installation of the pre-compression data corresponding to the data block to be installed, update the data block index.
[0102] In specific implementation, for any partition to be updated, after the pre-compression data corresponding to a data block to be installed of the partition to be updated is installed, it can be determined whether there is a new data block to be installed in the partition to be updated. If so, the new data block to be installed can be obtained from the installation package according to the data block attribute in the configuration file, and the data block index is updated. If not, it means that a new partition to be updated needs to be updated, the partition index is updated, and the data block index is reset.
[0103] Optionally, after the installation of the pre-compression data corresponding to any data block to be installed is completed, the decompressed pre-compression data may be deleted, thereby releasing the storage space.
[0104] A3: In response to the fact that the pre-compression data corresponding to each compressed data block corresponding to the partition to be updated is installed, the partition index is updated and the data block index is reset.
[0105] In specific implementation, for any partition to be updated, if the pre-compression data corresponding to each compressed data block corresponding to the partition to be updated is installed, it can be said that the partition to be updated has been updated. At this time, it can be determined whether there is a new partition to be updated. If so, the partition index can be updated and the data block index can be reset. For example, the partition index is increased by 1 and the data block index is reset to the initial value. If not, it can be said that all chip partitions corresponding to the installation package have been updated and the update is completed.
[0106] Exemplarily, after obtaining the installation package, the partition index and the data block index can be initialized, and then the first partition to be updated and the first data block to be installed in the partition to be updated can be determined according to the partition update order and the data block attributes, and the first data block to be installed can be decompressed to obtain the pre-compression data and installed; after the installation is complete, the second data block to be installed can be determined, and the second data block to be installed can be decompressed to obtain the pre-compression data and installed, and the data block index can be increased by 1; after the installation is complete, the third data block to be installed can be determined, and the third data block to be installed can be decompressed to obtain the pre-compression data and installed, and the data block index can be increased by 1 again, and so on, until the last compressed data block in the first partition to be updated is installed. Then, the partition index can be increased by 1 and the data block index can be initialized. At the same time, the second partition to be updated and the first data block to be installed in the second partition to be updated can be determined. The first data block to be installed can be decompressed to obtain the pre-compression data and installed. After the installation is completed, the second data block to be installed can be determined, and the second data block to be installed can be decompressed to obtain the pre-compression data and installed. At the same time, the data block index can be increased by 2. And so on, until the last compressed data block in the second partition to be updated is installed. Then the partition index can be increased by 1 and the data block index can be initialized. At the same time, the third partition to be updated and the first data block to be installed in the third partition to be updated can be determined. According to the steps of updating the first partition to be updated, the third partition to be updated is updated. And so on, until the last chip partition is updated, the system-level chip is updated.
[0107] In one embodiment, in order to improve the update accuracy of each chip partition, the above A3 may also be implemented according to the following steps:
[0108] A3-1: In response to the fact that the pre-compression data corresponding to each compressed data block corresponding to the partition to be updated are all installed, a content hash value of the installed data in the partition to be updated is determined.
[0109] Here, the installed data in the partition to be updated refers to the data content installed in the disk based on each data block to be installed corresponding to the partition to be updated.
[0110] During specific implementation, for any partition to be updated, after the pre-compression data corresponding to each compressed data block corresponding to the partition to be updated are installed, all the data corresponding to the partition to be updated (the data is the installed data in the partition to be updated) can also be determined, and the data can be hashed to obtain the content hash value of the partition to be updated.
[0111] A3-2: When the content hash value is consistent with the partition hash value in the installation instruction information corresponding to the partition to be updated, the partition index is updated and the data block index is reset.
[0112] Here, the installation instruction information of the configuration file may also store a partition hash value of each chip partition, where the partition hash value is obtained by performing hash processing on the original update file corresponding to the chip partition.
[0113] In specific implementation, for any partition to be updated, after the pre-compression data corresponding to each compressed data block of the partition to be updated is flushed to the disk, the partition hash value of the partition to be updated can be obtained from the installation instruction information. Then, it is determined whether the content hash value and the partition hash value of the partition to be updated are consistent. If so, it can be said that the original update file corresponding to the partition to be updated has been completely flushed, and the update of the partition to be updated has been completed. At this time, the next partition to be updated can be determined and the partition index can be updated, and the data block index can be reset at the same time.
[0114] In another embodiment, when the content hash value is inconsistent with the partition hash value corresponding to the partition to be updated, the data block index is reset, and the step of sequentially obtaining the data blocks to be installed of the partition to be updated from the multiple compressed data blocks included in the installation package is returned.
[0115] In the specific implementation, when the content hash value of the partition to be updated is inconsistent with the partition hash value, it can be explained that the data written to the disk is inconsistent with the data in the original update file corresponding to the partition to be updated, and the update of the partition to be updated is abnormal. In order to ensure the accurate update of the partition to be updated, the partition to be updated can be re-updated. Specifically, the partition index of the current record can be kept unchanged, and the data block index of the current record can be reset to the initial value. Then, according to the configuration file, the various data blocks to be installed corresponding to the partition to be updated are re-obtained from the installation package in sequence, and the pre-compression data corresponding to each data block to be installed are re-installed in sequence. In the process of reinstalling each data block to be installed, the data block index can be updated as the data blocks to be installed are changed. That is, when the content hash value corresponding to the partition to be updated is inconsistent with the partition hash value corresponding to the partition to be updated, the data block index can be reset, and the step of sequentially obtaining the data blocks to be installed of the partition to be updated from the multiple compressed data blocks included in the installation package is returned to achieve the re-update of the partition to be updated. After the re-update is completed, the content hash value corresponding to the re-updated data can be compared with the partition hash value of the partition to be updated again. If the two are consistent, it can be said that the update of the partition to be updated is complete, and the next partition to be updated can be updated. If the two are inconsistent, the partition to be updated can be updated again until the update is successful or the number of repeated updates reaches the preset number, and then the next partition to be updated can be updated. Among them, if the content hash value and the partition hash value corresponding to the partition to be updated are still inconsistent when the number of repeated updates reaches the preset number, the information of the update failure of the partition to be updated can be recorded and fed back, so that the developer can make targeted updates to the partition to be updated based on the information.
[0116] In one embodiment, the above S102 may be implemented according to the following steps:
[0117] S102-1: According to the partition update order in the configuration file, sequentially determine the partitions to be updated from at least one chip partition.
[0118] Exemplarily, the configuration file includes configuration information of each chip partition. The configuration information includes the partition update order, installation instruction information and data block attributes of the chip partition. The partition update order in the configuration file is the record order of the configuration information of the partition compression package of each chip partition. During installation, the configuration information in the configuration file can be read sequentially. When the first configuration information is read, the chip partition corresponding to the first configuration information is used as the partition to be updated, and the partition is updated based on the configuration information. After the update is completed, the chip partition corresponding to the second configuration information read is used as the partition to be updated, and the partition is updated based on the configuration information, and so on, until the update of each chip partition is completed.
[0119] S102-2: For any partition to be updated, based on the data block size in the data block attribute and the position offset information of the data block in the installation package, sequentially obtain the data blocks to be installed of the partition to be updated from multiple compressed data blocks included in the installation package.
[0120] Here, a compressed data block corresponds to a data block attribute, and the position offset information is used to indicate the offset of the compressed data packet relative to the starting position of the installation package. According to the position offset information, the position of the compressed data packet in the installation package can be located, and then according to the data block size of the compressed data block, the corresponding compressed data block can be accurately obtained from the installation package.
[0121] For any chip partition, the data block attributes of each compressed data block can be recorded in sequence in the configuration information of the chip partition. In specific implementation, for any partition to be updated, the data block attributes of each compressed data block corresponding to the partition to be updated can be obtained in sequence by sequentially reading the contents in the configuration information of the partition to be updated. For example, for any partition to be updated, the data block attributes of the first compressed data block can be first read from the configuration information, and the first data block to be installed can be obtained from the installation package according to the data block size and position offset information in the data block attributes. Then, after the pre-compression data corresponding to the first data block to be installed is installed, the data block attributes of the second compressed data block can be read from the configuration information, and the second data block to be installed can be obtained from the installation package according to the data block size and position offset information in the data block attributes. And so on, the last compressed data packet of the partition to be updated can be obtained.
[0122] In one embodiment, in order to prevent the installation package and configuration file from being lost after the vehicle is powered off, after obtaining the installation package and configuration file of the system-level chip, the installation package and configuration file can also be persistently stored, and the state of the system-level chip can be persisted as an updated state.
[0123] Here, after obtaining the installation package and configuration file, both can be persistently stored in the vehicle's local storage to prevent loss after the vehicle is powered off. In addition, by persistently storing the installation package and configuration file, it is also possible to save the resource consumption caused by the need to re-acquire them from the cloud after they are lost. Among them, the step of persistently storing the configuration file can specifically be to parse the configuration file, obtain the configuration information of each chip partition, and persistently store the configuration information of each chip partition.
[0124] By changing the state of the SoC to an update state and persisting it locally, it is possible to avoid the problem that after power is restored, the vehicle is unable to obtain information about the SoC update that was in progress before the power outage, which in turn causes the inability to continue the update.
[0125] Furthermore, after all chip partitions of the SoC are updated, the installation package and the configuration file may be deleted, and the update status may be canceled.
[0126] For example, after all chip partitions of the SoC are updated, the locally stored installation package and configuration file can be deleted to avoid affecting the next SoC. In addition, by changing the update status to the not installed status (i.e. canceling the update status), the problem of incorrectly identifying the SoC status can be avoided.
[0127] In one embodiment, the step of "updating the partition to be updated" in S103 above may be updated in the following manner:
[0128] Method 1: When the current data block to be installed is the first data block among multiple compressed data blocks corresponding to the partition to be updated, determine the first starting installation address on the disk according to the disk mount point corresponding to the partition to be updated indicated by the installation instruction information and the installation offset of the starting installation position of the partition to be updated relative to the disk mount point, and install the pre-compression data corresponding to the current data block to be installed according to the first starting installation address.
[0129] Here, the installation instruction information may also include the disk mount point of the partition to be updated, and the installation offset of the starting installation position of the partition to be updated on the disk relative to the disk mount point. In the case where one chip partition corresponds to one disk mount point, and the disk mount points of each chip partition are different, the installation position of each chip partition can start from the disk mount point, that is, the installation offset can be 0. In the case where multiple chip partitions correspond to the same disk mount point, the installation offsets corresponding to the multiple chip partitions will be inconsistent, otherwise it will cause the problem of compressed data blocks of different chip partitions being written at the same address, causing update errors. The first starting installation address is the starting installation address of the original update file corresponding to the partition to be updated on the disk.
[0130] In specific implementation, for any partition to be updated, when the data block to be installed corresponding to the partition to be updated is obtained from the installation package, it can be determined whether the data block to be installed is the first compressed data block of the partition to be updated. If so, the disk mount point and installation offset of the partition to be updated can be determined according to the installation instruction information of the partition to be updated, and the first starting installation address of the partition to be updated in the disk can be determined according to the disk mount point and installation offset. Then, the first compressed data block is decompressed to obtain the pre-compression data, and the pre-compression data is flashed from the first starting installation address to achieve the installation of the first compressed data block.
[0131] Method 2: When the current data block to be installed is not the first data block among the multiple compressed data blocks corresponding to the partition to be updated, the fourth starting installation address of the current data block to be installed is determined according to the end address of the previous data block to be installed, and the pre-compression data corresponding to the current data block to be installed is installed according to the fourth starting installation address.
[0132] Exemplarily, for any partition to be updated, when the data block to be installed corresponding to the partition to be updated is obtained from the installation package, if the data block to be installed is not the first compressed data block of the partition to be updated, the end address of the last data block to be installed of the partition to be updated can be determined. The end address is used to indicate the end address of the data corresponding to the last data block to be installed on the disk. Then, the next free address of the end address can be used as the starting installation address of the current data block to be installed (this address is the fourth starting installation address). Then, the current compressed data block can be decompressed to obtain the pre-compression data, and the pre-compression data can be written starting from the fourth starting installation address to achieve the installation of the current compressed data block.
[0133] Optionally, when the current data block to be installed is not the first data block, the number of installed compressed data blocks corresponding to the current partition to be updated can be determined based on the data block index of the current data block to be installed, and the occupied address length of the installed compressed data blocks can be determined based on the number and the fixed segmentation size of the pre-compression data corresponding to each compressed data block. Then, the fourth starting installation address of the current data block to be installed can be determined based on the occupied address length and the first starting installation address, and the pre-compression data corresponding to the current data block to be installed can be installed starting from this address.
[0134] In one embodiment, the multiple compressed data blocks corresponding to the chip partitions are obtained by segmenting and compressing the original data in the original update file corresponding to the chip partition according to a fixed segmentation size, and the relative order of the multiple compressed data blocks in the installation package is consistent with the order of the original data in the original update file. Exemplarily, the relative order of the multiple compressed data blocks corresponding to the same chip partition in the installation package is consistent with the order of the original data corresponding to the multiple compressed data blocks in the original update file, and the relative order of the partition compressed packages of different chip partitions in the installation package is consistent with the partition update order. The fixed segmentation size can be, for example, 4 megabytes (MB), 8MB, etc.
[0135] The step of "using the configuration file and the installation package to continue partition update starting from the target data block to be installed of the target partition to be updated" in S104 can also be implemented according to C1 to C3 as follows:
[0136] C1: Determine the number of installed compressed data blocks corresponding to the partition to be updated according to the index information of the target data block to be installed.
[0137] Taking the example that both the partition index and the data block index are numerical values, after the vehicle power is restored, if the state of the system-level chip is the update state, the target partition to be updated and the target data block to be installed can be determined. Then, the number of compressed data blocks installed on the disk corresponding to the partition to be updated can be determined based on the data block index of the target data block to be installed. For example, the data block index increases from 0. If the data block index of the target data block to be installed is 5, the installed compressed data blocks are compressed data blocks 1 to 5, and the number of installed compressed data blocks is 5. Among them, the target data block to be installed is an installed compressed data block.
[0138] C2: Determine a second starting installation address in the disk according to the disk mount point corresponding to the target partition to be updated indicated by the installation instruction information and the installation offset of the starting installation position of the partition to be updated relative to the disk mount point.
[0139] Exemplarily, the disk mount point corresponding to the target partition to be updated and the installation offset of the starting installation position of the partition to be updated relative to the disk mount point are added to obtain the starting installation address corresponding to the target partition to be updated, and the starting installation address is used as the second starting installation address.
[0140] C3: Determine the third starting installation address according to the second starting installation address, quantity and fixed segmentation size, and continue to update the partitions starting from the target data block to be installed according to the third starting installation address using the configuration file and the installation package until all chip partitions are updated.
[0141] Exemplarily, the occupied address length of the installed compressed data block can be determined according to the product of the number and the fixed segmentation size, and then the third starting installation address can be determined according to the sum of the second starting installation address and the occupied address length. Using the configuration file and the installation package, the target data block to be installed is obtained and decompressed to obtain the pre-compression data, and then the pre-compression data is flashed from the third starting installation address. After the flashing is completed, the next data block to be installed of the target partition to be updated is continued to be installed. After all the compressed data blocks of the target partition to be updated are installed, the next partition to be updated is updated until all chip partitions are updated. Regarding the specific process of continuing to update from the target data block to be installed of the target partition to be updated, reference can be made to the above embodiments, which will not be repeated here.
[0142] In one embodiment, S101 may be implemented according to the following steps:
[0143] S101-1: Obtain update files sent from the cloud.
[0144] Exemplarily, after obtaining the configuration file and the installation package, the cloud can determine whether the file size of the configuration file is the set file size. If so, the configuration file and the installation package can be combined into an update file and sent to the vehicle in a preset order. Alternatively, the vehicle can actively download the update file from the cloud. The preset order of precedence can be, for example, the installation package first and the configuration file second, or the configuration file first and the installation package second. If not, invalid fill information can be added to the end of the configuration file, where the amount of invalid fill information to be added is determined according to the configuration file size and the set file size. Invalid fill information can be, for example, one or more preset values 0.
[0145] S101 - 2 : Separate the initial configuration file and the installation package from the update file according to the sequence of the configuration file and the installation package in the update file and the size of the setting file corresponding to the configuration file.
[0146] Exemplarily, when the preset sequence is that the installation package comes first and the configuration file comes later, the content of setting the file size can be searched from the end of the update file to the front, and the content is used as the initial configuration file, and the content other than the initial configuration file is used as the installation package. Conversely, when the preset sequence is that the configuration file comes first and the installation package comes later, the content of setting the file size can be searched from the beginning of the update file to the back, and the content is used as the initial configuration file, and the content other than the initial configuration file is used as the installation package.
[0147] S101 - 3 : Delete the invalid padding information at the end of the initial configuration file to obtain the configuration file; the amount of invalid padding information is determined according to the difference between the original file size of the configuration file and the set file size.
[0148] Exemplarily, after obtaining the initial configuration file, it can be determined whether there is invalid padding information at the end of the initial configuration file. If not, the initial configuration file can be used as the final configuration file. If so, the invalid padding information can be deleted to obtain the configuration file. The configuration file and the installation package are both one, that is, the configuration information of each chip partition is stored in the same configuration file.
[0149] In this way, by setting the configuration file to a fixed size for distribution, the vehicle does not need to perform unnecessary decompression and other processing on the update file, and can quickly obtain the configuration file and installation package from the update file, reducing resource consumption when obtaining the file.
[0150] like Figure 2 As shown, a specific implementation flow chart of a software update method provided by an embodiment of the present disclosure may include the following steps:
[0151] S201: The cloud splits and compresses the original update file of the chip partition to obtain multiple compressed data blocks corresponding to the chip partition, splices the multiple compressed data blocks into a partition compression package, and then splices each partition compression package into an installation package; at the same time, generates a configuration file corresponding to the installation package.
[0152] S202: The vehicle obtains an installation package and a configuration file.
[0153] S203: Read and parse the configuration file, store the configuration information of each chip partition in the configuration file into a local persistent file, and store the installation package into the local persistent file.
[0154] S204: Determine the current partition to be updated and record the partition index.
[0155] S205: Determine the current data block to be installed and record the data block index.
[0156] S206: Write the pre-compression data corresponding to the data block to be installed into the disk position corresponding to the partition to be updated. If the writing is successful, return to the step of determining the current data block to be installed and recording the data block index until the last compressed data block of the current partition to be updated is written successfully.
[0157] S207: Calculate the content hash value of the installed data corresponding to the current partition to be updated, and determine whether the content hash value of the current partition to be updated is consistent with the partition hash value. If so, reset the data block index and return to the step of determining the current partition to be updated and recording the partition index until all chip partitions are updated. If not, reset the data block index and rewrite the compressed data blocks of the current partition to be updated until the current partition to be updated is updated successfully or the number of repeated updates reaches a preset number, reset the data block index, and return to the step of determining the current partition to be updated and recording the partition index.
[0158] S208: In response to power failure recovery, determine the target partition to be updated and the target data block to be installed corresponding to the power failure according to the index information, and use the configuration file and the installation package to continue the partition update starting from the target data block to be installed of the target partition to be updated until all chip partitions are updated.
[0159] Regarding the specific implementation process of the above S201 to S208, reference may be made to the above embodiments, which will not be described again here.
[0160] In the software update method corresponding to the above-mentioned embodiments, the installation package is fully compressed. After being downloaded to the local vehicle, it is not necessary to decompress all the update data of all chip partitions. It is only necessary to decompress the content of the data block to be installed of the partition to be updated that is currently written. Therefore, during the entire download and installation process, only the size of a compressed installation package, the size of a configuration file, and a fixed memory space corresponding to a data block (i.e., a fixed segmentation size) need to be occupied. Compared with the prior art that requires the simultaneous storage of the compressed installation package and all the update data after the chip partition is decompressed, the required memory size is smaller, which effectively reduces the memory usage during the upgrade process. In addition, during the use of the car, whether it is upgrading a SoC system with A / B surfaces or a single-sided SoC system, if the user turns on and off the power in the middle of the update, there is no need to restart the installation of the entire SoC after the power is restored. On the contrary, it can continue the installation from the interrupted position more finely, thereby improving the stability and efficiency of the upgrade process.
[0161] Those skilled in the art will appreciate that, in the above method of specific implementation, the order in which the steps are written does not imply a strict execution order and does not constitute any limitation on the implementation process. The specific execution order of the steps should be determined by their functions and possible internal logic.
[0162] In addition, an embodiment of the present disclosure further provides a vehicle, wherein the vehicle includes a controller, wherein the controller includes:
[0163] a memory for storing machine-readable instructions; and
[0164] The processor is used to call and execute the machine-readable instructions stored in the memory to implement the steps of the software updating method as described in the above embodiments.
[0165] Based on the same inventive concept, a software update device corresponding to the software update method is also provided in the embodiment of the present disclosure. Since the principle of solving the problem by the device in the embodiment of the present disclosure is similar to the above-mentioned software update method in the embodiment of the present disclosure, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be repeated.
[0166] like Figure 3 FIG. 1 is a schematic diagram of a software updating device provided by an embodiment of the present disclosure, comprising:
[0167] The acquisition module 301 is used to acquire an installation package and a configuration file of a system-on-chip; the installation package includes a plurality of compressed data blocks corresponding to at least one chip partition;
[0168] A determination module 302, configured to sequentially determine the partitions to be updated according to the partition update order and data block attributes in the configuration file, and sequentially obtain the data blocks to be installed of the partitions to be updated from the multiple compressed data blocks included in the installation package;
[0169] An updating module 303 is used to update the partition to be updated using the pre-compression data corresponding to the data block to be installed according to the installation instruction information in the configuration file, and record the index information corresponding to the partition to be updated and the data block to be installed respectively during the updating process; and
[0170] In response to power failure recovery, the target partition to be updated and the target data block to be installed corresponding to the power failure before the power failure are determined according to the index information, and the partition update is continued starting from the target data block to be installed of the target partition to be updated using the configuration file and the installation package until all chip partitions are updated.
[0171] In a possible implementation manner, the updating module 303, when recording the index information respectively corresponding to the partition to be updated and the data block to be installed during the updating process, is used to:
[0172] Recording the partition index of the partition to be updated and the data block index of the data block to be installed;
[0173] In response to the completion of installation of the pre-compressed data corresponding to the data block to be installed, updating the data block index;
[0174] In response to the fact that the pre-compression data corresponding to each compressed data block corresponding to the partition to be updated is installed completely, the partition index is updated, and the data block index is reset.
[0175] In a possible implementation, the update module 303, in response to the pre-compression data corresponding to each compressed data block corresponding to the partition to be updated being installed, updates the partition index, and resets the data block index, is used to:
[0176] In response to the pre-compression data corresponding to each of the compressed data blocks corresponding to the partition to be updated being installed, determining a content hash value of the installed data in the partition to be updated;
[0177] When the content hash value is consistent with the partition hash value in the installation instruction information corresponding to the partition to be updated, the partition index is updated and the data block index is reset.
[0178] In a possible implementation manner, the updating module 303 is further configured to:
[0179] When the content hash value is inconsistent with the partition hash value corresponding to the partition to be updated, the data block index is reset, and the step of sequentially acquiring the data blocks to be installed of the partition to be updated from the multiple compressed data blocks included in the installation package is returned.
[0180] In a possible implementation, the determination module 302, when determining the partitions to be updated in sequence according to the partition update order and the data block attributes in the configuration file and sequentially acquiring the data blocks to be installed of the partitions to be updated from the multiple compressed data blocks included in the installation package, is used to:
[0181] According to the partition update order in the configuration file, sequentially determine the partition to be updated from at least one of the chip partitions;
[0182] For any partition to be updated, the data blocks to be installed of the partition to be updated are sequentially obtained from multiple compressed data blocks included in the installation package according to the data block size in the data block attribute and the position offset information of the data block in the installation package.
[0183] In a possible implementation, the device further includes:
[0184] The storage module 304, after obtaining the installation package and configuration file of the system-on-chip, is used to:
[0185] Persistently storing the installation package and the configuration file, and persisting the state of the system-on-chip as an updated state;
[0186] And after each chip partition is updated, it is also used to:
[0187] Delete the installation package and the configuration files mentioned above, and cancel the update status.
[0188] In a possible implementation manner, the update module 303, when updating the partition to be updated using the pre-compressed data corresponding to the data block to be installed according to the installation instruction information in the configuration file, is configured to:
[0189] In a case where the current data block to be installed is the first data block among the multiple compressed data blocks corresponding to the partition to be updated, determining a first starting installation address in the disk according to the disk mount point corresponding to the partition to be updated indicated by the installation instruction information and the installation offset of the starting installation position of the partition to be updated relative to the disk mount point, and installing the pre-compression data corresponding to the current data block to be installed according to the first starting installation address;
[0190] When the current data block to be installed is not the first data block among the multiple compressed data blocks corresponding to the partition to be updated, the fourth starting installation address of the current data block to be installed is determined according to the end address of the previous data block to be installed, and the pre-compression data corresponding to the current data block to be installed is installed according to the fourth starting installation address.
[0191] In a possible implementation manner, the multiple compressed data blocks corresponding to the chip partition are obtained by segmenting and compressing the original data in the original update file corresponding to the chip partition according to a fixed segmentation size, and the relative order of the multiple compressed data blocks in the installation package is consistent with the order of the original data in the original update file;
[0192] The update module 303, in the step of using the configuration file and the installation package to continue partition update starting from the target to-be-installed data block of the target to-be-updated partition until all chip partitions are updated, is used to:
[0193] Determine the number of installed compressed data blocks corresponding to the partition to be updated according to the index information of the target data block to be installed;
[0194] Determine a second starting installation address in the disk according to the disk mount point corresponding to the target partition to be updated indicated by the installation instruction information and the installation offset of the starting installation position of the partition to be updated relative to the disk mount point;
[0195] A third starting installation address is determined according to the second starting installation address, the quantity and the fixed segmentation size, and partition update is continued starting from the target data block to be installed according to the third starting installation address using the configuration file and the installation package until all chip partitions are updated.
[0196] In a possible implementation, the acquisition module 301, when acquiring the installation package and configuration file of the system-on-chip, is used to:
[0197] Get the update file sent from the cloud;
[0198] Separating the initial configuration file and the installation package from the update file according to the order of the configuration file and the installation package in the update file and the size of the setting file corresponding to the configuration file;
[0199] The invalid padding information at the end of the initial configuration file is deleted to obtain the configuration file; the amount of the invalid padding information is determined according to the difference between the original file size of the configuration file and the set file size.
[0200] For descriptions of the processing flow of each module in the device and the interaction flow between each module, reference may be made to the relevant descriptions in the above method embodiment, which will not be described in detail here.
[0201] Based on the same technical concept, the embodiment of the present application also provides a computer device. Figure 4 FIG. 1 is a schematic diagram of a computer device provided in an embodiment of the present application, including:
[0202] Processor 401 , memory 402 and bus 403 . Among them, the memory 402 stores machine-readable instructions executable by the processor 401, and the processor 401 is used to execute the machine-readable instructions stored in the memory 402. When the machine-readable instructions are executed by the processor 401, the processor 401 performs the following steps: S101: obtaining an installation package and a configuration file of the system-level chip; the installation package includes multiple compressed data blocks corresponding to at least one chip partition; S102: according to the partition update order and data block attributes in the configuration file, determining the partition to be updated in sequence and obtaining the data blocks to be installed of the partition to be updated in sequence from the multiple compressed data blocks included in the installation package; S103: according to the installation instruction information in the configuration file, using the pre-compression data corresponding to the data block to be installed to update the partition to be updated, and recording the index information corresponding to the partition to be updated and the data block to be installed during the update process; and S104: in response to power failure recovery, determining the target partition to be updated and the target data block to be installed corresponding before the power failure according to the index information, and using the configuration file and the installation package, continuing the partition update starting from the target data block to be installed of the target partition to be updated, until all chip partitions are updated.
[0203] The above-mentioned memory 402 includes internal memory 4021 and external memory 4022; the memory 4021 here is also called internal memory, which is used to temporarily store the calculation data in the processor 401, as well as the data exchanged with the external memory 4022 such as the hard disk. The processor 401 exchanges data with the external memory 4022 through the internal memory 4021. When the computer device is running, the processor 401 communicates with the memory 402 through the bus 403, so that the processor 401 executes the execution instructions mentioned in the above-mentioned method embodiment.
[0204] The embodiment of the present disclosure also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the software update method described in the above method embodiment are executed. The storage medium can be a volatile or non-volatile computer-readable storage medium.
[0205] The embodiments of the present disclosure also provide a computer program product, which carries a program code. The instructions included in the program code can be used to execute the steps of the software update method described in the above method embodiment. For details, please refer to the above method embodiment, which will not be repeated here.
[0206] The computer program product may be implemented in hardware, software or a combination thereof. In one optional embodiment, the computer program product is embodied as a computer storage medium, and in another optional embodiment, the computer program product is embodied as a software product, such as a software development kit (SDK) and the like.
[0207] 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 aforementioned method embodiment, and will not be repeated here. In the several embodiments provided in the present disclosure, 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 units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units 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, and the indirect coupling or communication connection of the device or unit can be electrical, mechanical or other forms.
[0208] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0209] In addition, each functional unit in each embodiment of the present disclosure may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0210] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that is executable by a processor. Based on this understanding, the technical solution of the present disclosure, 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, which is stored in a storage medium and includes several instructions for 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 disclosure. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0211] If the technical solution of this application involves personal information, the product using the technical solution of this application has clearly informed the personal information processing rules and obtained the individual's voluntary consent before processing the personal information. If the technical solution of this application involves sensitive personal information, the product using the technical solution of this application has obtained the individual's separate consent before processing the sensitive personal information, and at the same time meets the "explicit consent" requirement. For example, on personal information collection devices such as cameras, clear and prominent signs are set to inform that the personal information collection scope has been entered and personal information will be collected. If the individual voluntarily enters the collection scope, it is deemed that he or she agrees to the collection of his or her personal information; or on the device that processes personal information, the personal information processing rules are notified by obvious signs / information, and the individual's authorization is obtained through pop-up information or by asking the individual to upload his or her personal information; among them, the personal information processing rules may include information such as the personal information processor, the purpose of personal information processing, the processing method, and the type of personal information processed.
[0212] Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present disclosure, which are used to illustrate the technical solutions of the present disclosure, rather than to limit them. The protection scope of the present disclosure is not limited thereto. Although the present disclosure is described in detail with reference to the aforementioned embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the aforementioned embodiments within the technical scope disclosed in the present disclosure, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present disclosure, and should be included in the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure shall be based on the protection scope of the claims.
Claims
1. A software updating method, characterized in that: include: Obtaining an installation package and a configuration file of a system-on-chip; the installation package includes a plurality of compressed data blocks corresponding to at least one chip partition; According to the partition update order and data block attributes in the configuration file, the partitions to be updated are determined in sequence, and the data blocks to be installed of the partitions to be updated are obtained in sequence from the multiple compressed data blocks included in the installation package; According to the installation instruction information in the configuration file, the partition to be updated is updated using the pre-compressed data corresponding to the data block to be installed, and index information corresponding to the partition to be updated and the data block to be installed is recorded during the updating process; In response to power failure recovery, the target partition to be updated and the target data block to be installed corresponding to the power failure before the power failure are determined according to the index information, and the partition update is continued starting from the target data block to be installed of the target partition to be updated using the configuration file and the installation package until all chip partitions are updated.
2. The method according to claim 1, characterized in that: The recording of index information corresponding to the partition to be updated and the data block to be installed respectively during the updating process includes: Recording the partition index of the partition to be updated and the data block index of the data block to be installed; In response to the completion of installation of the pre-compressed data corresponding to the data block to be installed, updating the data block index; In response to the fact that the pre-compression data corresponding to each compressed data block corresponding to the partition to be updated is installed completely, the partition index is updated, and the data block index is reset.
3. The method according to claim 2, characterized in that In response to the pre-compression data corresponding to each compressed data block corresponding to the partition to be updated being installed, updating the partition index and resetting the data block index include: In response to the pre-compression data corresponding to each of the compressed data blocks corresponding to the partition to be updated being installed, determining a content hash value of the installed data in the partition to be updated; When the content hash value is consistent with the partition hash value in the installation instruction information corresponding to the partition to be updated, the partition index is updated and the data block index is reset.
4. The method according to claim 3, characterized in that The method further comprises: When the content hash value is inconsistent with the partition hash value corresponding to the partition to be updated, the data block index is reset, and the step of sequentially acquiring the data blocks to be installed of the partition to be updated from the multiple compressed data blocks included in the installation package is returned.
5. The method according to claim 1, characterized in that The step of determining the partitions to be updated in sequence according to the partition update order and the data block attributes in the configuration file and obtaining the data blocks to be installed of the partitions to be updated in sequence from the multiple compressed data blocks included in the installation package includes: According to the partition update order in the configuration file, sequentially determine the partition to be updated from at least one of the chip partitions; For any partition to be updated, the data blocks to be installed of the partition to be updated are sequentially obtained from multiple compressed data blocks included in the installation package according to the data block size in the data block attribute and the position offset information of the data block in the installation package.
6. The method according to claim 1, characterized in that After obtaining the installation package and configuration file of the system-level chip, it also includes: Persistently storing the installation package and the configuration file, and persisting the state of the system-on-chip as an updated state; After all chip partitions are updated, it also includes: The installation package and the configuration file are deleted, and the update status is canceled.
7. The method according to claim 1, characterized in that The updating of the partition to be updated using the pre-compression data corresponding to the data block to be installed according to the installation instruction information in the configuration file includes: In a case where the current data block to be installed is the first data block among the multiple compressed data blocks corresponding to the partition to be updated, determining a first starting installation address in the disk according to the disk mount point corresponding to the partition to be updated indicated by the installation instruction information and the installation offset of the starting installation position of the partition to be updated relative to the disk mount point, and installing the pre-compression data corresponding to the current data block to be installed according to the first starting installation address; When the current data block to be installed is not the first data block among the multiple compressed data blocks corresponding to the partition to be updated, the fourth starting installation address of the current data block to be installed is determined according to the end address of the previous data block to be installed, and the pre-compression data corresponding to the current data block to be installed is installed according to the fourth starting installation address.
8. The method according to claim 1, characterized in that The multiple compressed data blocks corresponding to the chip partition are obtained by segmenting and compressing the original data in the original update file corresponding to the chip partition according to a fixed segmentation size, and the relative order of the multiple compressed data blocks in the installation package is consistent with the order of the original data in the original update file; The using the configuration file and the installation package to continue partition updating starting from the target to-be-installed data block of the target to-be-updated partition until all chip partitions are updated, includes: Determine the number of installed compressed data blocks corresponding to the partition to be updated according to the index information of the target data block to be installed; Determine a second starting installation address in the disk according to the disk mount point corresponding to the target partition to be updated indicated by the installation instruction information and the installation offset of the starting installation position of the partition to be updated relative to the disk mount point; A third starting installation address is determined according to the second starting installation address, the quantity and the fixed segmentation size, and partition update is continued starting from the target data block to be installed according to the third starting installation address using the configuration file and the installation package until all chip partitions are updated.
9. The method according to claim 1, characterized in that: The step of obtaining the installation package and configuration file of the system-on-chip includes: Get the update file sent from the cloud; Separating the initial configuration file and the installation package from the update file according to the order of the configuration file and the installation package in the update file and the size of the setting file corresponding to the configuration file; The invalid padding information at the end of the initial configuration file is deleted to obtain the configuration file; the amount of the invalid padding information is determined according to the difference between the original file size of the configuration file and the set file size.
10. A vehicle, characterized in that: A controller is included, the controller comprising: a memory for storing machine-readable instructions; and A processor, configured to call and execute the machine-readable instructions stored in the memory to implement the steps of the software updating method according to any one of claims 1 to 9.
11. A computer device, characterized in that: include: A processor and a memory, wherein the memory stores machine-readable instructions executable by the processor, and the processor is used to execute the machine-readable instructions stored in the memory. When the machine-readable instructions are executed by the processor, the processor executes the steps of the software update method according to any one of claims 1 to 9.
12. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a computer device, the steps of the software updating method according to any one of claims 1 to 9 are executed.