Remote upgrading method of vehicle-mounted system, computing equipment and vehicle
Optimizing the differential restoration technology of the vehicle system through dynamic monitoring of hardware parameters and multi-thread parallelism solves the problems of long upgrade time and ineffective resource utilization, achieving a more efficient system upgrade.
Patent Information
- Application Number
- CN202310203198.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-06
- Publication Date
- 2024-09-06
AI Technical Summary
Existing differential restoration technology cannot effectively utilize hardware computing power and memory resources in vehicle system upgrades, resulting in long upgrade times and inability to optimize CPU occupancy, which may cause other application abnormalities or waste of performance.
By dynamically monitoring hardware parameters, adaptively adjusting the amount of data read and written at a time, combined with multi-thread parallelism and one-time compression algorithm, the CPU occupancy rate and memory resource utilization are optimized, and the system upgrade time is shortened.
It significantly shortens the upgrade time of the vehicle system, prevents abnormalities caused by excessively high or low CPU usage, makes full use of hardware resources, and improves upgrade efficiency.
Smart Images

Figure CN118605918A
Abstract
Description
Technical Field
[0001] The present disclosure relates to the technical field of vehicle networking, and in particular to a remote upgrade method, apparatus, computing device, computer-readable storage medium, computer program product, and vehicle for an in-vehicle system. Background Art
[0002] With the increasing frequency of vehicle-side firmware updates and the prevalence of vehicle recalls through software upgrades, Over-the-Air (OTA) technology has been widely used in the field of Internet of Vehicles. That is, the upgrade package is downloaded to the vehicle side through a mobile communication network (such as 4G / 5G / WIFI), and the vehicle side upgrades and manages the firmware, data, and applications on automotive components.
[0003] At present, most firmware system upgrades are completed by downloading complete upgrade files. However, for the increasingly rich navigation and entertainment systems, complete upgrades will greatly consume the manufacturer's traffic and increase the user's download time. Therefore, for components with too large system size (system deployment space occupied is greater than 1G), manufacturers gradually embed differential restoration technology to reduce download time and traffic loss.
[0004] However, in the existing differential restoration technology, although the transmission traffic is reduced to a certain extent, the restoration time of the differential file on the vehicle side is longer than the restoration time of the complete upgrade file. In addition, the existing differential restoration technology uses a fixed configuration of memory consumption size, which cannot effectively utilize the computing power and memory resources of existing chips. Summary of the invention
[0005] The purpose of the present disclosure is to overcome the above-mentioned defects and provide a remote upgrade method, apparatus, computing device, computer-readable storage medium, computer program product and vehicle for an in-vehicle system.
[0006] The first aspect of the present disclosure proposes a remote upgrade method for a vehicle-mounted system, comprising: obtaining a differential file, the differential file including difference information between an upgrade file of the vehicle-mounted system and an original file; obtaining current hardware parameters and determining a single read and write data volume based on the current hardware parameters; and upgrading the vehicle-mounted system based on the differential file and the single read and write data volume.
[0007] The second aspect of the present disclosure proposes a remote upgrade device for a vehicle-mounted system, comprising: a file acquisition unit, configured to acquire a differential file, wherein the differential file includes difference information between an upgrade file of the vehicle-mounted system and an original file; a data amount determination unit, configured to acquire current hardware parameters and determine a single read and write data amount based on the current hardware parameters; and a system upgrade unit, configured to upgrade the vehicle-mounted system based on the differential file and the single read and write data amount.
[0008] The third aspect of the present disclosure proposes a computing device, which includes: a processor; and a memory, which is used to store computer-executable instructions, which, when executed, enable the processor to execute the remote upgrade method of the vehicle system according to the first aspect described above.
[0009] A fourth aspect of the present disclosure provides a vehicle, which includes a remote upgrade device for an in-vehicle system according to the second aspect or a computing device according to the third aspect.
[0010] A fifth aspect of the present disclosure proposes a computer-readable storage medium having computer-executable instructions stored thereon, wherein the computer-executable instructions are used to execute the remote upgrade method of the vehicle-mounted system according to the first aspect described above.
[0011] The sixth aspect of the present disclosure proposes a computer program product, which is tangibly stored on a computer-readable storage medium and includes computer-executable instructions, which, when executed, enable at least one processor to execute the remote upgrade method of the vehicle-mounted system described in the first aspect above.
[0012] The present invention determines the single read and write data volume during the vehicle system upgrade by dynamically monitoring hardware parameters, and can adaptively adjust the CPU occupancy rate to prevent excessive CPU occupancy from causing abnormalities in other applications and excessively low CPU occupancy from causing performance waste, effectively utilize hardware computing power and memory resources, and significantly shorten the system upgrade time. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] The features, advantages and other aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings, in which several embodiments of the present disclosure are shown in an exemplary and non-limiting manner. In the accompanying drawings:
[0014] Figure 1 An exemplary application scenario of the remote upgrade system according to an embodiment of the present disclosure is shown;
[0015] Figure 2 A flow chart of a differential file generation method according to an embodiment of the present disclosure is shown;
[0016] Figure 3 A schematic diagram of data comparison between an upgraded file and an original file according to an embodiment of the present disclosure is shown;
[0017] Figure 4 An architectural diagram of a vehicle central cockpit system according to an embodiment of the present disclosure is shown;
[0018] Figure 5An architecture diagram of a vehicle central domain control system according to an embodiment of the present disclosure is shown;
[0019] Figure 6 shows an architecture diagram of a vehicle TBOX system according to an embodiment of the present disclosure;
[0020] Figure 7 A flowchart of a remote upgrade method for a vehicle system according to an embodiment of the present disclosure is shown;
[0021] Figure 8 A schematic diagram of version verification management according to an embodiment of the present disclosure is shown;
[0022] Fig. 9 A flow chart of a method for determining the amount of data read or written at a single time according to an embodiment of the present disclosure is shown;
[0023] Fig.10 A schematic diagram of restore and write management according to an embodiment of the present disclosure is shown;
[0024] Fig.11 A schematic diagram showing restoration and writing of displacement segment information according to an embodiment of the present disclosure is shown;
[0025] Fig.12 A schematic diagram of restoring and writing incremental segment information according to an embodiment of the present disclosure is shown;
[0026] Fig.13 A schematic diagram showing restoration and writing of difference segment information according to an embodiment of the present disclosure is shown;
[0027] Fig.14 A block diagram of a remote upgrade device for a vehicle-mounted system according to an embodiment of the present disclosure is shown;
[0028] Fig.15 A block diagram of an exemplary computing device according to an embodiment of the present disclosure is shown. DETAILED DESCRIPTION
[0029] The various exemplary embodiments of the present disclosure are described in detail below with reference to the accompanying drawings. Although the exemplary methods and devices described below include software and / or firmware executed on hardware among other components, it should be noted that these examples are merely illustrative and should not be regarded as restrictive. For example, it is considered that any or all hardware, software, and firmware components can be implemented exclusively in hardware, exclusively in software, or in any combination of hardware and software. Therefore, although exemplary methods and devices have been described below, it should be readily understood by those skilled in the art that the examples provided are not intended to limit the manner in which these methods and devices are implemented.
[0030] In addition, the flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions and operations of the methods and systems according to the various embodiments of the present disclosure. It should be noted that the functions marked in the boxes may also occur in an order different from that marked in the accompanying drawings. For example, two boxes represented in succession may actually be executed substantially in parallel, or they may sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the flowchart and / or block diagram, and the combination of boxes in the flowchart and / or block diagram, may be implemented using a dedicated hardware-based system that performs a specified function or operation, or may be implemented using a combination of dedicated hardware and computer instructions.
[0031] The terms "including", "comprising" and similar terms used herein are open terms, i.e., "including / including but not limited to", indicating that other contents may also be included. The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one other embodiment", etc.
[0032] The vehicle described in this specification may be a concept including motor vehicles (e.g., cars, trucks, taxis, buses, motorcycles, shared cars, etc.), non-motor vehicles (e.g., mopeds, bicycles, shared bikes, etc.), or any other type of transportation vehicle (e.g., scooters, balance bikes, mobility scooters for the elderly, sport utility vehicles, armored vehicles, etc.).
[0033] In the existing differential restoration technology, although the transmission traffic is reduced to a certain extent, the restoration time of the differential file on the vehicle side is longer than the restoration time of the complete upgrade file. In addition, the existing differential restoration technology uses a fixed configuration of memory consumption size, which cannot effectively utilize the computing power and memory resources of the existing chips.
[0034] In view of this, the present invention proposes a remote upgrade method for an in-vehicle system, which determines the single read and write data volume during the upgrade of the in-vehicle system by dynamically monitoring hardware parameters, and can adaptively adjust the CPU occupancy rate to prevent excessive CPU occupancy from causing abnormalities in other applications and excessively low CPU occupancy from causing performance waste, effectively utilize hardware computing power and memory resources, and significantly shorten the system upgrade time. The content of the present invention is explained below based on several embodiments.
[0035] First reference Figure 1 An exemplary application scenario of the present invention is described. Figure 1An exemplary application scenario of a remote upgrade system according to an embodiment of the present disclosure is shown. A differential compression tool 111 is deployed on the server side 110, and an upgrade system 121 is deployed in the vehicle-mounted system 120 on the vehicle side. The vehicle-mounted system 120 can be, for example, a central cockpit system, a central domain control system, a central supercomputing system, a central intelligent driving system or a TBOX system, and so on. When the vehicle-mounted system 120 needs to be upgraded, the engineer inputs the upgrade file of the vehicle-mounted system 120 (i.e., the system file to be upgraded, such as version 2.0 of the system file) on the server side 110, and the differential compression tool 111 generates a differential file based on the original file of the vehicle-mounted system (i.e., the current system file, such as version 1.0 of the system file) and the upgrade file. The vehicle-mounted system 120 downloads the upgrade file from the server side 110, and after obtaining the differential file, the upgrade system 121 completes the system upgrade (i.e., version update) by reading the data in the differential file and the current hardware parameters. The server 110 can communicate with the vehicle system 120 through the TBOX on the vehicle side through a mobile communication network (such as 4G / 5G / WIFI). In the case where the vehicle system 120 has a communication module, the server 110 can also communicate with the vehicle system 120 directly through the mobile communication network.
[0036] Reference below Figure 2 and Figure 3 To illustrate the process of generating differential files. Figure 2 A flowchart of a differential file generation method according to an embodiment of the present disclosure is shown. Figure 3 A schematic diagram of data comparison between an upgraded file and an original file according to an embodiment of the present disclosure is shown.
[0037] In method 200, step 210 includes comparing the partition data of the upgraded file with the original file to obtain difference information. The difference information includes displacement segment information, difference segment information and increment segment information.
[0038] exist Figure 3 The original file part 310 and the upgrade file part 320 are schematically shown in FIG. The data of the upgrade file and the original file correspond to each partition of the disk (such as ROM). The data is in blocks, and one partition includes several data blocks. Figure 3As shown, the data of the original file part 310 and the upgraded file part 320 correspond to the partition 1 and partition 2 of the disk respectively. In the data comparison process, the parts that are compared to be the same are used as the displacement segment 350 (i.e., the same data segment), the parts that are compared to have a similarity greater than or equal to a preset threshold (such as 30%) are used as the difference segment 340 (i.e., the similar data segment), and the parts that are compared to have a similarity less than the preset threshold are used as the incremental segment 330 (i.e., the incremental data segment). The incremental segment 330, the difference segment 340, and the displacement segment 350 may include one or more data blocks. The original address of the displacement segment 350 (i.e., the disk address corresponding to the data segment in the original file), the target address (i.e., the disk address corresponding to the data segment in the upgraded file), and the length of the displacement segment 350 are used as the displacement segment information. The original address of the difference segment 340 (i.e., the disk address corresponding to the data segment in the original file), the target address (i.e., the disk address corresponding to the data segment in the upgraded file), the length of the difference segment 340, and the difference data are used as the difference segment information. The target address of the incremental segment 330 (ie, the disk address corresponding to the data segment in the upgrade file), the length of the incremental segment 330 and the overall data are used as the incremental segment information. The original address and the target address can be the starting address or the ending address.
[0039] For example, the data of the i-th block in the upgrade file part 320 and the data of the n-th block in the original file part 310 are respectively:
[0040] Block_i:DCCAEFAEFAF8987AC9F9E8
[0041] Block_n:DCCAEFAEFAF8987AC9F9E8
[0042] After comparison, if the data of the i-th block in the upgraded file part 320 is the same as the data of the n-th block in the original file part 310, then the i-th block is determined to be a displacement segment, and the original address of the segment (i.e., the address of the n-th block in the original file), the target address (i.e., the address of the i-th block in the upgraded file) and the length of the segment are used as the displacement segment information.
[0043] For example, the data of the i-th block in the upgrade file part 320 and the data of the n-th block in the original file part 310 are respectively:
[0044] Block_i:ABCDDCBFBEACCEFF5F7D55
[0045] Block_n:ECDADCBFBEADDEFF5F7D55
[0046] After comparison, if the similarity between the data of the i-th block in the upgraded file part 320 and the data of the n-th block in the original file part 310 is greater than 30%, the i-th block is determined to be a difference segment, and the difference data of the two blocks is calculated to be ABCD0000000CC000000000, and the original address of the segment (that is, the address of the n-th block in the original file), the target address (that is, the address of the i-th block in the upgraded file), the length of the segment and the difference data are used as the difference segment information.
[0047] For example, the data of the i-th block in the upgrade file part 320 and the data of the n-th block in the original file part 310 are respectively:
[0048] Block_i:AOBUQVNPVMAOHGUAODN
[0049] Block_n:BAEJ0AFJP9REHGADJDPG9A
[0050] After comparison, if the similarity between the data of the i-th block in the upgrade file part 320 and the data of the n-th block in the original file part 310 is less than 30%, then the i-th block is determined to be an incremental segment, and the target address of the segment (that is, the address of the i-th block in the upgrade file), the length of the segment and the overall data (that is, the data of the i-th block) are used as the incremental segment information.
[0051] Next, step 220 includes generating verification information and identification information. Specifically, verification information (such as hash values) of each partition data of the original file and each partition data of the upgraded file are generated respectively, and identification information of each partition in the differential file (such as the start bit and data length of each partition data) and identification information of the displacement segment information, difference segment information and incremental segment information in the differential file are generated to identify the data in the differential file. The verification information and identification information can be used as the file header of the differential file.
[0052] Afterwards, step 230 includes using a primary compression algorithm to compress the displacement segment information, the difference segment information and the increment segment information to generate a differential file.
[0053] For example, a one-time compression algorithm can compress multiple zeros in the difference data to achieve a better compression rate and a balance between the compression rate and the decompression time. Compared with the two-time Huffman compression in the prior art, by adopting a simple compression algorithm, a better compression rate can be achieved while stream writing (i.e., writing while decompressing) can be achieved during vehicle-side decompression, shortening the decompression time and system upgrade time, and also reducing the memory resource usage.
[0054] refer to Figure 4 , Figure 4 An architectural diagram of a vehicle central cockpit system according to an embodiment of the present disclosure is shown. Figure 4The arrows in the figure indicate the direction of data flow. Figure 4 Only some modules of the central cockpit system and the data flows between them are shown. The central cockpit system 140 includes a QNX system 122 and an Android system 123. A remote upgrade system 121 is deployed in the QNX system 122, and the Android system 123 includes an OTA module 124, in which a state manager 125 and a downloader 126 are deployed. The disk (such as a ROM) includes six partitions 130-135, the first to fifth partitions 130-134 store system files, and the sixth partition 135 stores differential files.
[0055] When the central cockpit system 120 needs to be updated, the server 110 communicates with the central cockpit system 140 via TBOX or directly to notify the state manager 125 that the current system version can be updated. The state manager 125 communicates with the central cockpit system 140 via the user interaction module ( Figure 4 The state manager 125 sends a reminder to the user (such as a sound reminder or a reminder message on the display screen) as shown in the figure. The user can agree to the system update or refuse the system update as needed. If the state manager 125 receives the user's confirmation update instruction via the user interaction module, it notifies the downloader 126 to download the differential file for system upgrade. The downloader 126 downloads the differential file from the server 110 through a communication network (such as the HTTPS protocol). After the download is completed, the downloader 126 stores the differential file in the fifth partition 135 and sends a notification of the download completion to the state manager 125. The state manager 125 asks the user whether to install immediately via the user interaction module. If the state manager 125 receives the user's confirmation installation instruction via the user interaction module or the installation time specified by the user has arrived, it notifies the remote upgrade system 121 to perform the system upgrade. The remote upgrade system 121 reads the differential file from the sixth partition 135, restores the data in the differential file and writes it into the first to fifth partitions 130-134 to perform the system upgrade. During the system upgrade process and at the end of the upgrade, the remote upgrade system 121 sends the upgrade progress and upgrade results to the state manager 125. The state manager 125 may send the upgrade progress and upgrade result to the server 110 and to the user via the user interaction module.
[0056] refer to Figure 5 , Figure 5 An architectural diagram of a vehicle central domain control system according to an embodiment of the present disclosure is shown. Figure 5 The arrows in the figure indicate the direction of data flow. Figure 5Only some modules of the central domain control system and the data flow between them are shown. The central domain control system 150 includes an AP Autosar system 127 and a CP Autosar system 128. The remote upgrade system 121, the state manager 125 and the downloader 126 are deployed in the AP Autosar system 127, and the remote upgrade system 121' is deployed in the CP Autosar system 128. The disk (such as ROM) includes 6 partitions 130-135, the first to fifth partitions 130-134 store system files, and the sixth partition 135 stores differential files. In addition, the remote upgrade system 121' can read and write the on-chip memory 136.
[0057] When the central domain control system 150 needs to be updated, the server 110 communicates with the central domain control system 150 via TBOX or directly to notify the state manager 125 that the current system version can be updated. The state manager 125 communicates with the central cockpit system via the user interaction module ( Figure 5 The state manager 125 sends a reminder to the user (such as a sound reminder or a reminder message on the display screen) via the user interaction module of the central cockpit system. The user can agree to the system update or refuse the system update as needed. If the state manager 125 receives the user's confirmation update instruction via the user interaction module of the central cockpit system, it notifies the downloader 126 to download the differential file for system upgrade. The downloader 126 downloads the differential file from the server 110 through a communication network (such as the HTTPS protocol). After the download is complete, the downloader 126 stores the differential file in the fifth partition 135 and sends a notification of the download completion to the state manager 125. The state manager 125 asks the user whether to install it immediately via the user interaction module of the central cockpit system. If the state manager 125 receives the user's confirmation installation instruction via the user interaction module of the central cockpit system or the installation time specified by the user has arrived, it notifies the remote upgrade system 121 to perform the system upgrade. The remote upgrade system 121 reads the differential file from the sixth partition 135, restores the data in the differential file and writes it into the first to fifth partitions 130-134 to perform the system upgrade. In addition, the remote upgrade system 121 can also send the restored differential file to the remote upgrade system 121' of the CPAutosar system 128. The remote upgrade system 121' performs on-chip flashing according to the restored differential file and writes the data into the on-chip memory 136. During the system upgrade process and at the end of the upgrade, the remote upgrade system 121 sends the upgrade progress and upgrade results to the state manager 125. The state manager 125 can send the upgrade progress and upgrade results to the server 110 and to the user via the user interaction module.
[0058] refer to Figure 6 , Figure 6 FIG. 4 shows an architecture diagram of a vehicle TBOX system according to an embodiment of the present disclosure. Figure 6 The arrows in the figure indicate the direction of data flow. Figure 6 Only some modules of the TBOX system and the data flows between them are shown. The TBOX system 160 includes a Linux system 129. A remote upgrade system 121, a state manager 125 and a downloader 126 are deployed in the Linux system 129. The disk (such as a ROM) includes six partitions 130-135, the first to fifth partitions 130-134 store system files, and the sixth partition 135 stores differential files.
[0059] When the TBOX system 160 needs to be updated, the server 110 communicates with the TBOX system 160 to notify the state manager 125 that the current system version can be updated. The state manager 125 communicates with the central cockpit system via the user interaction module ( Figure 6 The state manager 125 sends a reminder to the user (such as a sound reminder or a reminder message on the display screen) via the user interaction module of the central cockpit system. The user can agree to the system update or refuse the system update as needed. If the state manager 125 receives the user's confirmation update instruction via the user interaction module of the central cockpit system, it notifies the downloader 126 to download the differential file for system upgrade. The downloader 126 downloads the differential file from the server 110 through a communication network (such as the HTTPS protocol). After the download is complete, the downloader 126 stores the differential file in the fifth partition 135 and sends a notification of the download completion to the state manager 125. The state manager 125 asks the user whether to install it immediately via the user interaction module of the central cockpit system. If the state manager 125 receives the user's confirmation installation instruction via the user interaction module of the central cockpit system or the installation time specified by the user has arrived, it notifies the remote upgrade system 121 to perform the system upgrade. The remote upgrade system 121 reads the differential file from the sixth partition 135, restores the data in the differential file and writes it into the first to fifth partitions 130-134 to perform the system upgrade. During the system upgrade process and at the end of the upgrade, the remote upgrade system 121 sends the upgrade progress and upgrade results to the state manager 125. The state manager 125 can send the upgrade progress and upgrade results to the server 110 and to the user via the user interaction module.
[0060] refer to Figure 7 , Figure 7 400 is a flowchart of a remote upgrade method for a vehicle-mounted system according to an embodiment of the present disclosure. Figure 1 , Figure 4-Figure 6 The remote upgrade system 121 on the CRRC side is executed.
[0061] In step 410, a differential file is obtained. The differential file includes the difference information between the upgrade file of the vehicle system and the original file. As mentioned above, the server generates the differential file and sends it to the vehicle. The difference information may include displacement segment information, difference segment information and increment segment information.
[0062] In step 420, the current hardware parameters are obtained and the single read and write data volume is determined based on the current hardware parameters. The current hardware parameters may include at least one of the disk (such as ROM) hardware attributes, the total memory size, the remaining memory size, the CPU occupancy rate, the CPU main frequency, and the disk read and write speed. This step may be performed at a preset time interval (such as 10ms) to obtain the single read and write data volume in the next time interval, or the step may be performed at an irregular time interval to obtain the single read and write data volume in the next time period, or the step may be performed according to a preset number of read and write times to obtain the single read and write data volume of subsequent read and write times, and so on. The single read and write data volume may be in units of data blocks.
[0063] In step 430, the vehicle system is upgraded based on the differential file and the single read and write data volume. After obtaining the differential file and determining the single read and write data volume, the differential file is restored and written to the corresponding disk partition.
[0064] In some embodiments, the original data verification is performed in a multi-threaded parallel manner. As described above, the differential file may include verification information of each partition data of the original file. In these embodiments, the remote upgrade method 400 also includes: dividing each partition of the disk into a first group of partitions and a second group of partitions according to size, the first group of partitions including multiple partitions whose sizes are equal to or exceed a preset threshold, and the second group of partitions including multiple partitions whose sizes are less than a preset threshold; and based on the verification information of each partition data in the original file, respectively verifying the original data of each partition in the first group of partitions and the original data of each partition in the second group of partitions. The verification of the original data of each partition in the second group of partitions is performed in a serial manner, and is performed in a multi-threaded parallel manner with the verification of the original data of each partition in the first group of partitions. The preset threshold may be, for example, 1G. By performing the original data verification in a multi-threaded parallel manner, the hardware computing power can be fully utilized and the system upgrade time can be shortened.
[0065] refer to Figure 8 , Figure 8A schematic diagram of version verification management according to an embodiment of the present disclosure is shown. In this embodiment, the disk has five partitions, two of which are larger than 1G in size, serving as the first group of partitions, and three of which are smaller than 1G in size, serving as the second group of partitions. When executing version verification 510, verification steps 513, 514, and 515 of the original data of the three partitions in the second group of partitions are executed in a serial manner, and verification steps 511, 512 of the original data of the two partitions in the first group of partitions and verification steps 513-515 of the second group of partitions are executed in a multi-threaded parallel manner. For example, thread 1 executes verification step 511, thread 2 executes verification step 512, and thread 3 executes verification steps 513-515. The verification step may include calculating verification information (such as a hash value) of the original data in the partition and comparing the verification information with the verification information of the corresponding partition in the differential file.
[0066] In some embodiments, the remote upgrade method 400 also includes: after step 410, decompressing the differential file. As mentioned above, the server side uses a one-time compression algorithm to compress the differential file. After obtaining the differential file, the file header of the differential file can be decompressed first to obtain the verification information of each partition data of the original file and each partition data of the upgraded file, the identification information of each partition in the differential file, and the displacement segment information, difference segment information and incremental segment information in the differential file. For the remaining part of the differential file, the data can be flushed after the decompression is completed once, or it can be flushed while decompressing. By adopting a one-time compression algorithm, streaming flushing can be achieved when decompressing on the vehicle side, shortening the decompression time and system upgrade time, and also reducing the occupation of memory resources.
[0067] In some embodiments, the single read and write data amount is calculated in different ways according to different disk hardware properties. Fig. 9 FIG. 4 is a flow chart showing a method for determining the amount of data to be read and written at a single time according to an embodiment of the present disclosure. Fig. 9As shown in, in step 421, the current hardware parameters are obtained. The current hardware parameters include disk (such as ROM) hardware attributes, total memory size, remaining memory size, CPU occupancy, CPU main frequency and disk read and write speed. In step 422, it is determined whether the disk hardware attributes indicate that the disk is of UFS type. If the disk hardware attributes indicate that the disk is of UFS type, then in step 423, the single read and write data volume is determined by the following formula: B = P × (P / T × 0.35) × (1-Y) × logNK; otherwise, in step 424, the single read and write data volume is determined by the following formula: B = P × (P / T × 0.25) × (1-Y), where B is the single read and write data volume, T is the total memory size, P is the remaining memory size, Y is the CPU occupancy, N is the CPU main frequency, and K is the disk read and write speed. By calculating the single read and write data volume in different ways according to different disk hardware attributes, the hardware characteristics can be effectively utilized to improve the read and write efficiency and shorten the system upgrade time.
[0068] In some embodiments, different read and write modes are determined according to different disk hardware attributes. In these embodiments, the remote upgrade method further includes: if the disk hardware attribute indicates that the disk is of UFS type, the disk read and write mode is determined as a parallel read and write mode; otherwise, the disk read and write mode is determined as a parallel read and serial write mode. By determining different read and write modes according to different disk hardware attributes, the hardware characteristics can be effectively utilized to improve the read and write efficiency and shorten the system upgrade time.
[0069] In some embodiments, the difference information includes displacement segment information, difference segment information and incremental segment information of each partition of the disk, as described above, which are generated on the server side and included in the differential file. The displacement segment information includes the original address, target address and length of the same data segment of the upgraded file compared to the original file in the same partition. The difference segment information includes the original address, target address, length of the similar data segment and difference data of the similar data segment of the upgraded file compared to the original file in the same partition. The incremental segment information includes the target address, length and overall data of the incremental data segment of the upgraded file compared to the original file in the same partition.
[0070] In some embodiments, step 430 further includes: based on the single read and write data volume, respectively restoring the displacement segment information, difference segment information and incremental segment information of each partition of the disk to obtain restored data, and writing the restored data to the target address of the corresponding partition. For restoring the same amount of data, the restoration of the difference segment information requires reading the original data from the original address, adding the difference data and then writing it to the target address, so the memory occupied is twice that of the displacement segment information and the incremental segment information, and the restoration and writing time is also longer than the restoration and writing of the displacement segment information and the incremental segment information. Therefore, the restoration and writing of the displacement segment information and the difference segment information can be performed in a serial manner, and executed in a multi-threaded parallel manner with the restoration and writing of the difference segment information. By performing restoration and writing in a multi-threaded parallel manner, the hardware computing power can be fully utilized and the system upgrade time can be shortened.
[0071] refer to Fig.10 , Fig.10 A schematic diagram of restore and write management according to an embodiment of the present disclosure is shown. When performing restore and write 610, restore and write 611 and 612 of incremental segment information and displacement segment information are performed in a serial manner, and restore and write 613 of difference segment information and restore and write 611 and 612 of incremental segment information and displacement segment information are performed in a multi-threaded serial manner. For example, thread 1 performs restore and write 611 and 612 of incremental segment information and displacement segment information, and thread 2 performs restore and write 613 of difference segment information.
[0072] Next reference Figure 11-13 Describes the restore and write process. Fig.11 The schematic diagram of restoring and writing displacement segment information according to an embodiment of the present disclosure is shown. The displacement segment information includes the original address of the displacement segment, the target address and the length of the displacement segment. Fig.11 In the example, the original address is 0x3000 and the target address is 0x2000, both of which are starting addresses, and the length of the displacement segment is 0x1000. When restoring, the original data is read according to the original address and the length of the displacement segment, and written to the target address.
[0073] Fig.12 The figure shows a schematic diagram of restoring and writing incremental segment information according to an embodiment of the present disclosure. The incremental segment information includes the target address of the incremental segment, the length of the incremental segment and the overall data. Fig.12 In the example, the target address is 0x1000, which is the starting address, and the length of the incremental segment is 0x1000. When restoring, the entire data of the incremental segment is written to the target address.
[0074] Fig.13 The schematic diagram of restoring and writing difference segment information according to an embodiment of the present disclosure is shown. The difference segment information includes the original address of the difference segment, the target address, the length of the difference segment and the difference data. Fig.13 In the example, the original address is 0x3000, the target address is 0x2000, and the length of the difference segment is 0x1000. When restoring, the original data is read according to the original address and the length of the difference segment, and then added to the difference data to obtain the restored data, and the restored data is written to the target address.
[0075] In some embodiments, after the system upgrade is completed, the upgrade data verification is performed in a multi-threaded parallel manner. As previously mentioned, the upgrade file may include verification information for the data of each partition of the upgrade file. In these embodiments, after the vehicle-mounted system is upgraded, the remote upgrade method further includes: dividing the partitions of the disk into a first group of partitions and a second group of partitions according to size, the first group of partitions including a plurality of partitions whose sizes are equal to or exceed a preset threshold, and the second group of partitions including a plurality of partitions whose sizes are less than a preset threshold; and based on the verification information of the data of each partition in the upgrade file, respectively verifying the upgrade data of each partition in the first group of partitions and the upgrade data of each partition in the second group of partitions. The verification of the upgrade data of each partition in the second group of partitions is performed in serial, and is performed in a multi-threaded parallel manner with the verification of the upgrade data of each partition in the first group of partitions. The preset threshold may be, for example, 1G. By performing the upgrade data verification in a multi-threaded parallel manner, the hardware computing power can be fully utilized and the system upgrade time can be shortened. The verification of the upgrade data is similar to the verification of the original data, and can also be referred to. Figure 8 Examples shown.
[0076] refer to Fig.14 , Fig.14 700 shows a block diagram of a remote upgrade device for a vehicle-mounted system according to an embodiment of the present disclosure. Each module of the device 700 can be implemented by software, hardware (eg, integrated circuit, FPGA, etc.) or a combination of software and hardware. Fig.14 As shown, the device 700 includes a file acquisition unit 710, a data volume determination unit 720, and a system upgrade unit 730. The file acquisition unit 710 is configured to acquire a differential file, which includes difference information between the upgrade file of the vehicle-mounted system and the original file. The data volume determination unit 720 is configured to acquire current hardware parameters and determine a single read and write data volume based on the current hardware parameters. The system upgrade unit 730 is configured to upgrade the vehicle-mounted system based on the differential file and the single read and write data volume.
[0077] In some embodiments, the current hardware parameters include at least one of disk hardware attributes, total memory size, remaining memory size, CPU occupancy, CPU main frequency, and disk read and write speed.
[0078] In some embodiments, the data volume determination unit 1320 is further configured to determine the single read and write data volume by the following formula if the disk hardware attributes indicate that the disk is of UFS type: B = P × (P / T × 0.35) × (1-Y) × logNK; otherwise, the single read and write data volume is determined by the following formula: B = P × (P / T × 0.25) × (1-Y), wherein B is the single read and write data volume, T is the total memory size, P is the remaining memory size, Y is the CPU occupancy, N is the CPU main frequency, and K is the disk read and write speed.
[0079] In some embodiments, the data volume determination unit 720 is further configured to obtain current hardware parameters at preset time intervals and determine a single read / write data volume in a next time interval based on the current hardware parameters.
[0080] In some embodiments, the difference information includes displacement segment information, difference segment information and incremental segment information of each partition of the disk. The displacement segment information includes the original address, target address and length of the same data segment of the upgraded file compared to the original file in the same partition. The difference segment information includes the original address, target address, length of similar data segment and difference data of similar data segments of the upgraded file compared to the original file in the same partition. The incremental segment information includes the target address, length and overall data of the incremental data segment of the upgraded file compared to the original file in the same partition.
[0081] In some embodiments, the system upgrade unit 730 is further configured to restore the displacement segment information, difference segment information and incremental segment information of each partition of the disk based on the amount of data read and written in a single time, obtain restored data, and write the restored data to the target address of the corresponding partition, wherein the restoration and writing of the displacement segment information and the difference segment information are performed in serial manner, and are executed in multi-threaded parallel manner with the restoration and writing of the difference segment information.
[0082] In some embodiments, the current hardware parameter includes a disk hardware attribute. The device 700 further includes a read / write mode determination module, which is configured to determine the disk read / write mode as a parallel read / write mode if the disk hardware attribute indicates that the memory is of UFS type; otherwise, determine the disk read / write mode as a parallel read / serial write mode.
[0083] In some embodiments, the differential file includes verification information of each partition data in the original file. The device 700 also includes an information verification unit, which is configured to: divide each partition of the disk into a first group of partitions and a second group of partitions according to size, the first group of partitions includes multiple partitions whose sizes are equal to or exceed a preset threshold, and the second group of partitions includes multiple partitions whose sizes are less than the preset threshold; and based on the verification information of each partition data in the original file, respectively verify the original data of each partition in the first group of partitions and the original data of each partition in the second group of partitions, wherein the verification of the original data of each partition in the second group of partitions is performed in a serial manner, and is performed in a multi-threaded parallel manner with the verification of the original data of each partition in the first group of partitions.
[0084] In some embodiments, the differential file includes verification information of each partition data in the upgrade file. The device 700 also includes an information verification unit, which is configured to: divide each partition of the disk into a first group of partitions and a second group of partitions according to size, the first group of partitions includes multiple partitions whose sizes are equal to or exceed a preset threshold, and the second group of partitions includes multiple partitions whose sizes are less than the preset threshold; and based on the verification information of each partition data in the upgrade file, respectively verify the upgrade data of each partition in the first group of partitions and the upgrade data of each partition in the second group of partitions, wherein the verification of the upgrade data of each partition in the second group of partitions is performed in a serial manner, and is performed in a multi-threaded parallel manner with the verification of the upgrade data of each partition in the first group of partitions.
[0085] In some embodiments, the differential file is a compressed file after one compression. The apparatus 700 further includes a decompression unit configured to decompress the differential file.
[0086] refer to Fig.15 , a block diagram of an exemplary computing device 800 according to an embodiment of the present disclosure is shown. The computing device 800 includes at least one processor 810 and a memory 820 coupled to the at least one processor 810. The memory 820 is used to store machine-readable instructions, and when the machine-readable instructions are executed by at least one processor 810, the processor 810 executes the method in the above embodiment (for example, any one or more steps in the aforementioned method 400). For example, the processor 810 can be a controller of a vehicle (for example, an electronic processing unit (ECU) etc.).
[0087] The present disclosure further provides a vehicle, which may include, for example Fig.14 Remote upgrade device 700, Fig.15 A computing device 800 is provided to implement the method in the above embodiment (eg, any one or more steps in the aforementioned method 400).
[0088] In addition, alternatively, the above method can be implemented by a computer-readable storage medium. Computer-readable storage media are loaded with computer-readable program instructions for executing various embodiments of the present disclosure. Computer-readable storage media can be a tangible device that can hold and store instructions used by an instruction execution device. Computer-readable storage media can be, for example, but not limited to, electrical storage devices, magnetic storage devices, optical storage devices, electromagnetic storage devices, semiconductor storage devices, or any suitable combination of the above. More specific examples (non-exhaustive lists) of computer-readable storage media include: portable computer disks, hard disks, random access memories (RAM), read-only memories (ROM), erasable programmable read-only memories (EPROM or flash memory), static random access memories (SRAM), portable compact disk read-only memories (CD-ROM), digital versatile disks (DVD), memory sticks, floppy disks, mechanical encoding devices, such as punch cards or protruding structures in grooves on which instructions are stored, and any suitable combination of the above. The computer-readable storage medium used herein is not to be construed as a transient signal per se, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagating through a waveguide or other transmission medium (e.g., light pulses through a fiber optic cable), or an electrical signal transmitted through wires.
[0089] Therefore, in another embodiment, the present disclosure proposes a computer-readable storage medium having computer-executable instructions stored thereon, and the computer-executable instructions are used to execute the remote upgrade method in various embodiments of the present disclosure.
[0090] In another embodiment, the present disclosure proposes a computer program product, which is tangibly stored on a computer-readable storage medium and includes computer-executable instructions. When the computer-executable instructions are executed, at least one processor performs the remote upgrade method in various embodiments of the present disclosure.
[0091] In general, various example embodiments of the present disclosure may be implemented in hardware or dedicated circuits, software, firmware, logic, or any combination thereof. Certain aspects may be implemented in hardware, while other aspects may be implemented in firmware or software that may be executed by a controller, microprocessor, or other computing device. When various aspects of the embodiments of the present disclosure are illustrated or described as block diagrams, flow charts, or using some other graphical representation, it will be understood that the blocks, devices, systems, techniques, or methods described herein may be implemented in hardware, software, firmware, dedicated circuits or logic, general hardware or controllers or other computing devices, or some combination thereof as non-limiting examples.
[0092] As discussed above, although the remote upgrade of the vehicle system is discussed in this application, the remote upgrade method, apparatus, computing device, non-transitory computer readable medium and computer program product disclosed in the present invention are also applicable to other scenarios where the system needs to be remotely upgraded.
[0093] Computer-readable program instructions or computer program products for executing the various embodiments of the present disclosure can also be stored in the cloud. When needed, users can access the computer-readable program instructions for executing an embodiment of the present disclosure stored in the cloud through mobile Internet, fixed network or other networks, thereby implementing the technical solutions disclosed in accordance with the various embodiments of the present disclosure.
[0094] Although the embodiments of the present disclosure have been described with reference to several specific embodiments, it should be understood that the embodiments of the present disclosure are not limited to the specific embodiments disclosed. The embodiments of the present disclosure are intended to cover various modifications and equivalent arrangements included in the spirit and scope of the appended claims. The scope of the claims is consistent with the broadest interpretation, thereby including all such modifications and equivalent structures and functions.
Claims
1. A remote upgrade method for a vehicle system, include: Acquire a differential file, wherein the differential file includes difference information between the upgrade file of the vehicle-mounted system and the original file; Acquiring current hardware parameters and determining a single read / write data amount based on the current hardware parameters; and The vehicle-mounted system is upgraded based on the differential file and the single read and write data volume.
2. The remote upgrade method according to claim 1, in, The current hardware parameters include at least one of disk hardware attributes, total memory size, remaining memory size, CPU occupancy, CPU main frequency, and disk read and write speed.
3. The remote upgrade method according to claim 2, in, Determining the single read / write data amount based on the current hardware parameters further includes: If the disk hardware attribute indicates that the disk is of UFS type, the single read and write data amount is determined by the following formula: B=P×(P / T×0.35)×(1-Y)×logNK; Otherwise, the single read / write data amount is determined by the following formula: B=P×(P / T×0.25)×(1-Y), where: B is the single read and write data volume, T is the total memory size, P is the remaining memory size, Y is the CPU occupancy rate, N is the CPU main frequency, and K is the disk read and write speed.
4. The remote upgrade method according to claim 1, in, Acquiring current hardware parameters and determining a single read / write data amount based on the current hardware parameters further includes: According to the preset time interval, the current hardware parameters are obtained and the single read and write data amount in the next time interval is determined based on the current hardware parameters.
5. The remote upgrade method according to claim 1, in, The difference information includes the displacement segment information, difference segment information and incremental segment information of each partition of the disk. The displacement segment information includes the original address, target address and length of the same data segment of the upgraded file compared with the original file in the same partition. The difference segment information includes the original address, target address, length of the similar data segment and difference data of the similar data segment of the upgraded file compared with the original file in the same partition. The incremental segment information includes the target address, length and overall data of the incremental data segment of the upgraded file compared with the original file in the same partition.
6. The remote upgrade method according to claim 5, in, Upgrading the vehicle-mounted system based on the differential file and the single read-write data volume further includes: Based on the single read and write data volume, the displacement segment information, the difference segment information and the incremental segment information of each partition of the disk are restored respectively to obtain restored data, and the restored data is written to the target address of the corresponding partition, wherein: The restoration and writing of the displacement segment information and the difference segment information are performed in a serial manner, and are performed in a multi-threaded parallel manner with the restoration and writing of the difference segment information.
7. The remote upgrade method according to claim 1, in, The current hardware parameters include disk hardware attributes, and the method further includes: If the disk hardware attribute indicates that the disk is of UFS type, determining the read / write mode of the disk to be a concurrent read / write mode; Otherwise, the read-write mode of the disk is determined as a parallel-read and serial-write mode.
8. The remote upgrade method according to claim 1, in, The differential file includes verification information of each partition data in the original file, and before upgrading the vehicle-mounted system, the method further includes: Dividing the partitions of the disk into a first group of partitions and a second group of partitions according to size, wherein the first group of partitions includes a plurality of partitions whose sizes are equal to or exceed a preset threshold, and the second group of partitions includes a plurality of partitions whose sizes are less than the preset threshold; and Based on the verification information of each partition data in the original file, the original data of each partition in the first group of partitions and the original data of each partition in the second group of partitions are verified respectively, wherein: The verification of the original data of each partition in the second group of partitions is performed in a serial manner, and is performed in a multi-threaded parallel manner with the verification of the original data of each partition in the first group of partitions.
9. The remote upgrade method according to claim 1, in, The differential file includes verification information of each partition data in the upgrade file, and after the vehicle system is upgraded, the method further includes: Dividing the partitions of the disk into a first group of partitions and a second group of partitions according to size, wherein the first group of partitions includes a plurality of partitions whose sizes are equal to or exceed a preset threshold, and the second group of partitions includes a plurality of partitions whose sizes are less than the preset threshold; and Based on the verification information of each partition data in the upgrade file, the upgrade data of each partition in the first group of partitions and the upgrade data of each partition in the second group of partitions are verified respectively, wherein: The verification of the upgraded data of each partition in the second group of partitions is performed in a serial manner, and is performed in a multi-threaded parallel manner with the verification of the upgraded data of each partition in the first group of partitions.
10. The remote upgrade method according to claim 1, in, The differential file is a compressed file after one compression, and after obtaining the differential file, the method further comprises: The differential file is decompressed.
11. A remote upgrade device for a vehicle system, include: A file acquisition unit is configured to acquire a differential file, wherein the differential file includes difference information between the upgrade file of the vehicle-mounted system and the original file; a data volume determination unit configured to obtain current hardware parameters and determine a single read / write data volume based on the current hardware parameters; and The system upgrade unit is configured to upgrade the vehicle-mounted system based on the differential file and the single read and write data volume.
12. A computing device, include: processor; as well as A memory, which is used to store computer executable instructions, which, when executed, enables the processor to execute the remote upgrade method of the vehicle-mounted system according to any one of claims 1-10. 13 . A vehicle, comprising the remote upgrade device for an in-vehicle system according to claim 11 or the computing device according to claim 12 .
14. A computer-readable storage medium having computer-executable instructions stored thereon, wherein the computer-executable instructions are used to execute the remote upgrade method of the vehicle-mounted system according to any one of claims 1 to 10.
15. A computer program product, the computer program product being tangibly stored on a computer-readable storage medium and comprising computer-executable instructions, which when executed, cause at least one processor to perform the remote upgrade method of the in-vehicle system according to any one of claims 1-10.
