Firmware upgrading method and device in vehicle, computer equipment and storage medium
By decompressing and differentially processing the original and target files of the vehicle firmware and determining the update files, the problem of low upgrade efficiency caused by the large target file package in OTA technology is solved, and more efficient firmware upgrades are achieved.
Patent Information
- Application Number
- CN202311008458.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-10
- Publication Date
- 2025-02-18
AI Technical Summary
When using OTA technology to upgrade the vehicle firmware, larger target file packages cause time to take download and reduce upgrade efficiency.
By obtaining the original and target files of the firmware to be upgraded, decompressing and differential processing, the update files are determined to generate the upgrade file package and improve the upgrade efficiency.
Comparing file sizes by comparing the differential file and compressed file of the target file, selecting update files with lower file sizes, significantly improving the efficiency of vehicle firmware upgrades.
Smart Images

Figure CN119473370A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the technical field of firmware upgrade, and in particular to a firmware upgrade method, apparatus, computer equipment, and storage medium in a vehicle. Background Art
[0002] Over-The-Air technology (OTA) is a technology for remotely upgrading vehicle firmware. When using OTA technology to upgrade vehicle firmware, the size of the file used will affect the efficiency of OTA upgrading.
[0003] Generally, the target file packages of each firmware required for the upgrade are downloaded to the vehicle, and then the firmware is upgraded based on the downloaded target file packages. Since the target file packages for the upgrade are generally large, the downloading takes a long time, resulting in low upgrade efficiency. Summary of the invention
[0004] The embodiments of the present disclosure at least provide a method, apparatus, computer device, and storage medium for upgrading firmware in a vehicle.
[0005] In a first aspect, an embodiment of the present disclosure provides a firmware upgrade method in a vehicle, comprising: obtaining a first original file corresponding to a firmware to be upgraded and a first target file matching the first original file; decompressing the first original file and the first target file in a compressed state to obtain a second original file and a second target file; performing differential processing on the second original file and the second target file to obtain a differential file; determining an update file of the firmware to be upgraded based on the differential file and the first target file corresponding to the differential file, wherein the update file of the firmware to be upgraded is used to generate an upgrade file package corresponding to the firmware to be upgraded.
[0006] In this way, for the first original file used for vehicle firmware upgrade and the first target file matching the first original file, a differential file determined by the first original file and the first target file can be obtained, and the differential file and the compressed file of the first target file are used to compare the file sizes, so as to obtain a file with a lower file size as an update file for vehicle firmware upgrade, thereby improving the efficiency of upgrading the vehicle firmware as much as possible. In addition, when determining the differential file, the first original file and the first target file in an uncompressed state are specifically selected for differential processing, so as to avoid the problem that when the first original file and the first target file in a compressed state are directly differentially processed, even if the first target file is less changed than the first original file, the differential file obtained is larger in file size, so that the file size corresponding to the update file that can be selected for use is as small as possible, thereby improving the efficiency of OTA upgrade.
[0007] In an optional implementation, obtaining a first original file of firmware to be upgraded and a first target file matching the first original file includes: for each of the first original files, determining a first target file matching the first original file from the at least one first target file by comparing the similarity between file identification information of at least one first target file and the file identification information of the first original file; the first target file matching the first original file is a target file determined according to the similarity sorting.
[0008] In an optional implementation, the method further includes: if there is a first target file among the first target files that cannot be matched with the first original file, generating a compressed file of the first target file, and using the compressed file as an update file of the firmware to be upgraded.
[0009] In this way, for the first target file that does not exist in the first original file during the OTA upgrade, targeted processing can also be performed by generating a compressed file, and the file size during transmission can be effectively reduced.
[0010] In an optional implementation, the first original file and the first target file in a compressed state are decompressed to obtain a second original file and a second target file, including: determining the first original file and the first target file in a compressed state, and the first original file and the first target file in an uncompressed state from the first original file and the first target file; decompressing the first original file and the first target file in a compressed state to obtain the second original file and the second target file to be differentially processed, the second original file and the second target file to be differentially processed include: the second original file and the second target file after decompression, and the first original file and the first target file in an uncompressed state.
[0011] In this way, for different types of first original files and first target files in compressed and uncompressed states, an appropriate method can be selected during processing to select differential processing after decompression or direct compression processing to ensure that when performing differential processing, the selected second original file and second target file are both in an uncompressed state, thereby avoiding the problem that when the difference between the first original file in the compressed state and the first differential file is small, the differential file becomes larger due to the change of the header file.
[0012] In an optional implementation, the update file of the firmware to be upgraded is determined based on the differential file and the first target file corresponding to the differential file, including: for each differential file, determining the first target file corresponding to the differential file and the file size comparison result between the differential file and the differential file; based on the file size comparison result, determining the update file of the firmware to be upgraded from the differential file and the first target file.
[0013] In a second aspect, an embodiment of the present disclosure provides another firmware upgrade method in a vehicle, comprising: receiving an upgrade file package corresponding to the firmware to be upgraded; extracting each differential file from the upgrade file package; generating a third target file in an uncompressed state based on the differential file and a third original file in an uncompressed state that matches the differential file; if the third original file in an uncompressed state is obtained by decompressing the third original file in a compressed state, compressing the third target file in an uncompressed state to obtain a compressed file, and using the compressed file to perform firmware upgrade processing.
[0014] In this way, the obtained upgrade file package can be used to extract each differential file, and the third target file in a reasonable state for firmware upgrade can be restored through the third original file. Compared with the method of directly obtaining the third target file, the method of transmitting the upgrade file package can be determined according to the above description. The file size will be smaller, so the efficiency will be higher. And it is also easier to operate by performing differential restoration processing in reverse through the differential file. Compared with the reduced efficiency caused by the transmission of the third target file with a larger file size, it has less impact on the efficiency during OTA upgrade.
[0015] In an optional implementation, the method further includes: if the third original file in the uncompressed state is the initial state of the third original file, performing firmware upgrade processing using the third target file in the uncompressed state.
[0016] In this way, when performing the firmware upgrade process, when the original state of the third original file is compressed, the third target file used for the firmware upgrade process can be ensured to be compressed; when the original state of the third original file is uncompressed, the third target file used for the firmware upgrade process can be ensured to be uncompressed. Since the third original file can be used for the corresponding firmware, it is more reasonable to use the third target file in the same state to upgrade the firmware, and it can also avoid abnormal situations caused by different states of files during the upgrade, or the need to re-decompress or compress the additional processing flow.
[0017] In a third aspect, an embodiment of the present disclosure further provides a firmware upgrade device in a vehicle, comprising: an acquisition module, used to acquire a first original file corresponding to the firmware to be upgraded and a first target file matching the first original file; a decompression module, used to decompress the first original file and the first target file in a compressed state, to obtain a second original file and a second target file; a differential module, used to perform differential processing on the second original file and the second target file, to obtain a differential file; a determination module, used to determine an update file of the firmware to be upgraded based on the differential file and the first target file corresponding to the differential file, wherein the update file of the firmware to be upgraded is used to generate an upgrade file package corresponding to the firmware to be upgraded.
[0018] In an optional embodiment, when acquiring the first original file of the firmware to be upgraded and the first target file matching the first original file, the acquisition module is used to: for each of the first original files, determine the first target file matching the first original file from the at least one first target file by comparing the similarity between the file identification information of at least one first target file and the file identification information of the first original file; the first target file matching the first original file is the target file determined according to the similarity sorting.
[0019] In an optional implementation, the device further includes a first generating module, which is used to: if there is a first target file among the first target files that cannot be matched with the first original file, generate a compressed file of the first target file, and use the compressed file as an update file of the firmware to be upgraded.
[0020] In an optional implementation, when the decompression module decompresses the first original file and the first target file in a compressed state to obtain the second original file and the second target file, the decompression module is used to: determine the first original file and the first target file in a compressed state, and the first original file and the first target file in an uncompressed state from the first original file and the first target file; decompress the first original file and the first target file in a compressed state to obtain the second original file and the second target file to be differentially processed, and the second original file and the second target file to be differentially processed include: the second original file and the second target file after decompression, and the first original file and the first target file in an uncompressed state.
[0021] In an optional implementation, when the determination module determines the update file of the firmware to be upgraded based on the differential file and the first target file corresponding to the differential file, it is used to: for each differential file, determine the first target file corresponding to the differential file and the file size comparison result between the differential file and the differential file; based on the file size comparison result, determine the update file of the firmware to be upgraded from the differential file and the first target file.
[0022] In a fourth aspect, an embodiment of the present disclosure further provides a firmware upgrade device in a vehicle, comprising: a receiving module for receiving an upgrade file package corresponding to the firmware to be upgraded; an extraction module for extracting each differential file from the upgrade file package; a second generating module for generating a third target file in an uncompressed state based on the differential file and a third original file in an uncompressed state matching the differential file; and a compression module for compressing the third target file in an uncompressed state to obtain a compressed file if the third original file in an uncompressed state is obtained by decompressing the third original file in a compressed state, and using the compressed file to perform firmware upgrade processing.
[0023] In an optional implementation, it further includes a processing module for: if the third original file in the uncompressed state is the initial state of the third original file, then using the third target file in the uncompressed state to perform firmware upgrade processing.
[0024] In a fifth 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 machine-readable instructions perform the steps in any possible implementation of the above-mentioned first aspect or the second aspect.
[0025] In a sixth aspect, an optional implementation of the present disclosure further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed, the steps of any possible implementation of the first aspect or the second aspect described above are executed.
[0026] The firmware upgrade method, apparatus, computer device and storage medium in a vehicle provided by the embodiments of the present disclosure can obtain a differential file determined by the first original file and the first target file for upgrading the vehicle firmware and a first target file matching the first original file, and use the differential file and the compressed file of the first target file to compare the file sizes, so as to obtain a file with a lower file size as an update file for upgrading the vehicle firmware, thereby maximizing the efficiency of upgrading the vehicle firmware.
[0027] In addition, when determining the differential file, the first original file and the first target file in an uncompressed state are specifically selected for differential processing, so as to avoid the problem that when the first original file and the first target file in a compressed state are directly differentially processed, even if the first target file is changed less than the first original file, the resulting differential file has a larger file size. This is to ensure that the file size corresponding to the update file that can be selected for use is as small as possible, thereby improving the efficiency of OTA upgrades. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] Figure 1 A flowchart of a firmware upgrade method in a vehicle provided by an embodiment of the present disclosure is shown;
[0029] Figure 2a A schematic diagram of performing differential processing on a first original file in an uncompressed state and a corresponding first target file provided by an embodiment of the present disclosure is shown;
[0030] Figure 2b A schematic diagram of performing differential processing on a first original file in a compressed state and a corresponding first target file provided by an embodiment of the present disclosure is shown;
[0031] Figure 3 A flowchart showing another method for upgrading firmware in a vehicle provided by an embodiment of the present disclosure is shown;
[0032] Figure 4a A flowchart of determining a third target file when the original state of the third original file is a compressed state provided by an embodiment of the present disclosure is shown;
[0033] Figure 4b A flowchart of determining a third target file when the original state of the third original file is a non-compressed state provided by an embodiment of the present disclosure is shown;
[0034] Figure 5 A schematic diagram of a firmware upgrade device in a vehicle provided by an embodiment of the present disclosure is shown;
[0035] Figure 6 A schematic diagram showing another firmware upgrade device in a vehicle provided by an embodiment of the present disclosure is shown;
[0036] Figure 7 A schematic diagram of a computer device provided by an embodiment of the present disclosure is shown. DETAILED DESCRIPTION
[0037] In order to make the purpose, technical solution and advantages of the embodiments of the present disclosure more clear, the technical solution 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.
[0038] When using OTA technology to upgrade the firmware in the vehicle, the size of the file used will affect the efficiency of the OTA upgrade. In order to reduce the amount of downloaded data, OTA firmware upgrades can be performed using differential files. However, after research, the inventor found that not all scenarios correspond to small file sizes. For example, there are some original files in a compressed state. Even if only minor changes are made to the code therein, the header file of the compressed file also needs to be changed. Therefore, the modified file is used to perform differential processing on the original file, and the file size corresponding to the obtained differential file will also be larger. In these possible cases, if you continue to choose to directly use differential files to upgrade the vehicle's firmware, low efficiency may occur.
[0039] Based on the above problems, the present disclosure provides a firmware upgrade method in a vehicle. The firmware upgrade method in a vehicle provided by an embodiment of the present disclosure is described below.
[0040] The execution subject of the firmware upgrade method in the vehicle provided by the embodiment of the present disclosure is generally a computer device with certain computing capabilities, and the computer device includes, for example: a terminal device or a server or other processing device, and the terminal device can be a cloud, with information processing capabilities and can make decisions. In the embodiment of the present disclosure, it is specifically used to process and issue files used when upgrading the vehicle firmware. In some possible implementations, the firmware upgrade method in the vehicle can be implemented by a processor calling a computer-readable instruction stored in a memory.
[0041] See also Figure 1 FIG. 1 is a flowchart of a firmware upgrade method in a vehicle provided by an embodiment of the present disclosure, the method comprising steps S101 to S104, wherein:
[0042] S101: Acquire a first original file corresponding to a firmware to be upgraded and a first target file matching the first original file;
[0043] S102: Decompressing the compressed first original file and the first target file to obtain a second original file and a second target file;
[0044] S103: performing differential processing on the second original file and the second target file to obtain a differential file;
[0045] S104: determining an update file of the firmware to be upgraded according to the differential file and a first target file corresponding to the differential file, wherein the update file of the firmware to be upgraded is used to generate an upgrade file package corresponding to the firmware to be upgraded.
[0046] For a first original file used for upgrading vehicle firmware and a first target file matching the first original file, a differential file determined by the first original file and the first target file can be obtained, and the differential file and the compressed file of the first target file are used to compare the file sizes, so as to obtain a file with a lower file size as an update file for upgrading the vehicle firmware, thereby maximizing the efficiency of upgrading the vehicle firmware.
[0047] In addition, when determining the differential file, the first original file and the first target file in an uncompressed state are specifically selected for differential processing, so as to avoid the problem that when the first original file and the first target file in a compressed state are directly differentially processed, even if the first target file is changed less than the first original file, the resulting differential file has a larger file size. This is to ensure that the file size corresponding to the differential file that can be selected for use is as small as possible, thereby improving the efficiency of OTA upgrades.
[0048] The above S101 to S104 are described in detail below.
[0049] With respect to the above S101, the firmware to be upgraded is first described. Since the embodiments of the present disclosure are specifically aimed at upgrading the firmware of the vehicle, the firmware to be upgraded described here specifically refers to the firmware under the vehicle. Specifically, the firmware to be upgraded can be the automatic driving firmware for the vehicle, or the environmental detection firmware for the vehicle safety, or it can be the human-computer interaction firmware related to multimedia, such as the firmware that provides voice interaction function, etc., which is not specifically limited in the embodiments of the present disclosure.
[0050] Taking one of the firmware to be upgraded as an example, for the selected firmware to be upgraded, each first original file of the firmware to be upgraded and the first target file matching each first original file can be obtained. Here, the first original file can specifically refer to the file used by the firmware to be upgraded in the current vehicle, and the first target file corresponds to the file obtained after the firmware to be upgraded is upgraded. Since different files may be called during installation and use under a firmware to be upgraded, such as different files indicating the startup function, information processing function, transmission feedback function, etc., there may be multiple first original files for the firmware to be upgraded.
[0051] For example, take the version number as an example. For example, for the voice interaction software installed in the vehicle, if the current voice interaction software in the vehicle is version 1.0, then after determining to upgrade it, it can be determined that the voice interaction software is the firmware to be upgraded, and it can be determined that it can be upgraded to version 2.0 by matching. Here, the multiple files originally used in the vehicle under version 1.0 can be used as the first original files corresponding to the firmware to be upgraded; the files corresponding to the firmware to be upgraded under the determined upgrade to version 2.0 are specifically used as the first target files matched with the first original files.
[0052] Here, under a firmware to be upgraded, each first original file does not have a matching first target file. Specifically, when upgrading the firmware to be upgraded, all the first original files under it may not be changed. For example, in the above example, if only the information processing function of the firmware to be upgraded is improved, then only the program content of the first original file indicating the information processing function will be adjusted accordingly, and the first original files indicated under other functions will not be changed. The first original files indicated under these unchanged functions may not have matching first target files, because for the unchanged functions, it is not necessary to reuse the same file for upgrade processing.
[0053] In the above embodiment, a method is provided for determining the first target file for each first original file of the firmware to be upgraded by means of a version number, specifically by determining an upgraded version number that can be searched for or specified by the user under the firmware to be upgraded, such as version 2.0 in the above example, and determining the first target file for the firmware to be upgraded under the version number, that is, the file corresponding to the firmware to be upgraded under version 2.0.
[0054] In another possible case, a first target file matching the first original file can be determined from among the files that can be used as the first target file by file identification matching. Here, when the first target file is determined by directly creating or changing the content of the first original file, the corresponding file identification information can be determined for the file by naming the file name.
[0055] In one possible case, if the selected firmware to be upgraded is a firmware that provides a voice user interface (VUI), taking the first original file corresponding to the communication function as an example, in addition to the inherent file suffixes such as ".dll" and ".apk", the file name part can be named "vui_comm", that is, it contains the abbreviations corresponding to the voice user interface and the communication function, and first declares the name of the firmware to be upgraded, and then declares the implementation function indicated by the first original file among the various functions under the firmware to be upgraded. In this way, the specific function indicated by the first original file can be expressed through the file name, and the complete file name of the first original file is, for example, "vui_comm.apk".
[0056] Correspondingly, if the above-mentioned first original file has a corresponding first target file, the same naming method can be followed when naming the first target file. However, when naming by function, in order to distinguish it from the first original file, in addition to the "vui_comm" that expresses the function, the file name may also include a declaration of changes that are different from the first original file. For example, the first target file is specifically based on the first original file, and the icon of the interface has been upgraded and modified. Then, a declaration such as the English word "icon" can be added after "comm" in the file name, so that the full file name of the first target file is determined to be "vui_comm_icon.apk".
[0057] In the above example, since the file name of the first target file is obtained by adding a declaration of the updated part on the basis of the file name of the first original file when naming the first target file, when the first original file and the first target file are matched by the file identification information determined by the file name, the first target file containing the file name corresponding to the first original file can be determined from multiple first target files and used as the first target file corresponding to the first original file.
[0058] Exemplarily, in addition to the first target file named "vui_comm_icon" listed in the above example, it may also include a first target file corresponding to the speech recognition (speech recognition, sr) function under the VUI firmware, and the corresponding file name is "vui_sr". Through character recognition and comparison, the name "vui_sr" does not contain "vui_comm" in the first original file "vui_comm.apk", indicating that the specific functional contents of the two are not the same. Under the file naming rules, it indicates that the first target file including the file name "vui_sr" is not updated based on the first original file "vui_comm.apk". Therefore, the first target file named "vui_sr" will not be recognized as the first target file of the first original file "vui_comm.apk".
[0059] The first target file named "vui_comm_icon" contains "vui_comm" in the first original file, and on this basis, "icon" is added after "vui_comm" in the file name, indicating that some functions of the first original file have been adjusted. Therefore, it can be used as the first target file of the first original file "vui_comm.apk".
[0060] In this way, the first original file and the first target file are matched through the step-by-step limitation of functions. Since there are more characters in the file name and multiple functions with a sequence are declared, if the file name is required to have an inclusion relationship during matching, the accuracy of the match can be guaranteed to the greatest extent.
[0061] The above specific selection adopts the method of determining the file name in a hierarchical naming manner of functions under a unified naming rule, and uses the file identification information as the file identification information, and then uses the method of whether the file identification information of the first target file contains the file identification information of the first original file to match the first original file and the first target file. In another possible case, the file identification information can also be determined by adding an identification to the file to determine the first target file corresponding to the first original file.
[0062] Here, the added identifier may specifically be the version number described in the above embodiment, such as "v1.0" or "v2.0". Accordingly, the file identification information expressing the version number may be obtained from the file name described in the above embodiment, such as the file name of the first original file is "vui_comm_v1.0", and the corresponding file name of the first target file is "vui_comm_v2.0". Alternatively, the file identification information may be obtained from the header file of the first original file or the first target file, such as by reading the header files of the first original file and the first target file, the declaration function describing the version number may be obtained.
[0063] In this way, the version number is easier to manage. Compared with the above-mentioned method of specifying naming rules to match file names, only short numeric symbol characters such as "1.0", "2.0" and so on need to be recognized during identification, and the logic is relatively simple.
[0064] Alternatively, the first original file and the first target file, or the file identification information of the first target file may specifically be an encrypted code. After decrypting the encrypted code, the first target file matching the first original file is determined based on the decrypted information.
[0065] For example, in one possible case, after obtaining the encrypted code segment in the first original file, it is determined that the first original file indicates that it is used to implement the communication function corresponding to the voice interaction interface under version 1.0, and after obtaining the encrypted code segment in the first target file, it is determined that the first target file indicates that it is used to implement the communication function corresponding to the voice interaction interface under version 2.0.
[0066] In a computer, such indication information can be specifically represented by a string, for example, the string "abc" represents the communication function corresponding to the voice interaction interface, "v1" represents version 1.0, and "v2" represents version 2.0. After decrypting the encrypted code segments of the first original file and the first target file, strings such as "abcv1" and "abcv2" can be obtained. By matching the indication function, that is, matching the strings "abcv1" and "abcv2", it can be determined that the first target file described in the example is the first target file matched by the first original file.
[0067] In another possible case, for any first target file, its encrypted code segment can also be used to indicate the corresponding matching first original file. Specifically, since the first target file is a file used to update the firmware to be upgraded compared to the first original file, the creation time of the first target file will be later than that of the first original file. When generating the encrypted code segment, the file identification information of the first original file, such as storage location, file name, file identifier, etc., can be encrypted to obtain the encrypted code segment of the first target file. In this way, after decompressing the encrypted code segment, the first target file corresponding to which first original file can be determined by comparison and matching.
[0068] The above two methods use encrypted code segments as file identification information. Since encryption processing technology is used, the files released after malware invades the processor will not be able to be matched as the first target file with the first original file under the vehicle firmware to be upgraded. In other words, firmware upgrades cannot be performed through abnormal files, which is more secure.
[0069] Among the above-mentioned possible methods, a specific matching method is involved, such as matching the file identification information "vui_comm_v1.0" of the first original file with the file identification information "vui_comm_v2.0" of the first target file, or performing a comparison match after decryption, such as matching the character strings "abcv1" and "abcv2".
[0070] With respect to the above-mentioned matching method, in a specific implementation, for each of the first original files, by comparing the similarity between the file identification information of at least one first target file and the file identification information of the first original file, a first target file matching the first original file is determined from the at least one first target file; the first target file matching the first original file is a target file determined according to the similarity sorting.
[0071] According to the description in the above example, when determining the similarity through file identification information, the similarity can be determined by using characters expressed by the file identification information itself, or by using information obtained after decryption processing.
[0072] The above-described limitation of screening out the highest similarity and being greater than the set similarity threshold through similarity is specifically described below. Here, an exemplary description is given by taking the method of naming the file name listed in the above embodiment as an example. For the first original file in the example, its file name is "vui_comm", and the example also includes two different first target files, and the corresponding file names are "vui_comm_icon" and "vui_sr" respectively. By comparing the similarity between the file identification information of the first target file and the file identification information of the first original file, it can be determined that the similarity between "vui_comm" and "vui_comm_icon" is higher than the similarity with "vui_sr", and the first target file that may be matched is preferred. If the similarity corresponding to the first target file is also higher than the set similarity threshold, it can be determined that the first target file with the file name "vui_comm_icon" can be used as the first target file matched by the first original file with the file name "vui_comm".
[0073] If, in the above example, there is no first target file named "vui_comm_icon", then the first target file named "vui_sr" will be preferred as the first target file that may be matched with the first original file, but this choice is actually wrong. Therefore, in the embodiment of the present disclosure, this wrong choice is avoided by setting a similarity threshold. By setting the similarity threshold to be greater than the similarity between "vui_comm_icon" and "vui_sr", the above possible wrong matching situation can be avoided.
[0074] The specific method of determining the similarity described above is described below. Taking the characters determined by the file identification information as an example, for the "vui_comm_v1.0" and "abcv1" mentioned in the above example, the character edit distance between the file identification information of each first target file and the file identification information of the first original file can be calculated; based on the character edit distance, the similarity between the file identification information of each first target file and the file identification information of the first original file is determined.
[0075] Here, it is determined that when the two compared characters are the same and the character edit distance is 0, the corresponding similarity is 100%.
[0076] Two different examples are listed below to illustrate.
[0077] In a possible example, for example, the file identification information corresponding to the first original file (denoted as O1) and the first target file (denoted as A1) described above are respectively obtained as "abcv1" and "abcv2" after decryption. If the character edit distance is determined character by character to obtain the overall character edit distance, then the character edit distance between "abcv1" and "abcv2" is also the character edit distance between character "1" and character "2". However, since character "1" and character "2" are two characters, the determined similarity is not 100%, for example, 90%.
[0078] If there is another first target file (denoted as A2), after decryption, it is not the first target file corresponding to the first original file O1 in this example, and the specific indication function is different from the first original file O1. Then the corresponding decrypted string may be "cabv2". Although the character composition is the same as "abcv2" obtained after decrypting the file identification information of the first original file O1, when determining the character edit distance character by character, it can be seen that the first three characters "cab" in the string corresponding to the file identification information of the first target file A2 are completely inconsistent with the first three characters "abc" in the string corresponding to the first original file O1, and the similarity is lower, for example, 20%. According to the above method, it can be determined by size comparison that the first target file matched by the first original file O1 is the first target file A1, not A2.
[0079] In another possible situation, a similarity of 100% may be obtained. For example, the same characters are directly marked for the first original file and the matching first target file through file identification information. Because the first target file is generated later, the first target file marked with the same characters can be distinguished from the first original file through information such as time and storage location (for example, the upgraded first target files are placed in a separate storage space). Then, when matching is performed through character editing distance, a similarity of 100% can be obtained.
[0080] For example, the file identification information of the first original file O1 is a string "abc", and the file identification information of the first target file A1 that matches it is also a string "abc", and all first target files An that may be the first original file O1 are stored separately in another storage space, and the strings corresponding to the file identification information of different first target files An are different. Then in this storage space, when the strings corresponding to the file identification information of each first target file are matched with the strings corresponding to the file identification information of the first original file, only the string "abc" corresponding to the first target file A1 is the same as the string "abc" corresponding to the first original file O1, and the corresponding determined similarity is 100%, indicating that the first target file that matches the first original file O1 is the first target file A1.
[0081] In the above possible examples, the first original file can be matched to the corresponding first target file. In actual applications, not all first target files in the firmware to be upgraded have corresponding first original files. Still taking the firmware that provides a voice interaction interface as an example, this update may include an update to the communication function, and the first original file of the communication function has a corresponding first target file; in addition, a message reminder function may be added, but the original firmware does not have this function, so it only has the first target file under the message reminder function, but not the first original file under this function.
[0082] Therefore, if there is a first target file that cannot match the first original file among the first target files, a compressed file of the first target file is generated, and the compressed file is used as the update file of the firmware to be upgraded. Here, the compression method is not limited, and the corresponding compressed file format is not limited. The update file obtained here is specifically described in the corresponding embodiment below, and will not be repeated here.
[0083] In this way, according to the above steps, the first target file with the first original file, the first target file without the first original file, and the update file corresponding to the first target file without the first original file can be determined.
[0084] With respect to the above S102, for the above-mentioned matched first original file and first target file, according to the above description, even if only a minor change is made to the code of the first original file in a compressed state, since the header file of the compressed file also needs to be changed, the modified file is used to perform differential processing with the first original file, and the file size corresponding to the obtained differential file will also be larger. Therefore, before determining whether a smaller file can be obtained by using the differential method, the first original file and the first target file in a compressed state will be selected for decompression processing to obtain the second original file and the second target file, so the second original file and the second target file are in a non-compressed state.
[0085] In the firmware, both the first original file and the first target file may contain files in compressed state and uncompressed state. Since the file in uncompressed state will be specifically selected for differential processing during differential processing, in a specific implementation, the first original file and the first target file in compressed state may be selected for decompression processing, and the first original file and the first target file in uncompressed state may be selected to be retained without processing.
[0086] Therefore, in a specific implementation, the first original file and the first target file in a compressed state, and the first original file and the first target file in an uncompressed state can be determined among the first original file and the first target file; the first original file and the first target file in a compressed state are decompressed to obtain the second original file and the second target file to be differentially processed, and the second original file and the second target file to be differentially processed include: the second original file and the second target file after decompression, and the first original file and the first target file in an uncompressed state.
[0087] That is, for each determined first original file and the first target file matching the first original file, the first original file and the first target file can be divided into a first original file in a compressed state and a first target file in a compressed state, and a first original file in an uncompressed state and a first target file in an uncompressed state according to whether they are in a compressed state.
[0088] The first original file in a compressed state and the first target file in a compressed state are decompressed to obtain a second original file in an uncompressed state and a second target file in an uncompressed state.
[0089] As for the first original file and the first target file which are classified as being in an uncompressed state, since they are already in an uncompressed state, no additional decompression processing is required.
[0090] Therefore, for the second original file and the second target file to be differentially processed, in addition to the second original file and the second target file obtained after the decompression processing as described above, it also includes the first original file and the first target file mentioned above which are in an uncompressed state and thus have not undergone additional decompression processing.
[0091] In this way, according to the steps described above, a second original file and a second target file both in an uncompressed state can be obtained.
[0092] With respect to the above S103, for each second original file in the uncompressed state determined above and the matched second target file, each differential file may be obtained by differential processing.
[0093] Here, the difference processing can be implemented by calling the diff command. When the second original file and the matching second target file are subjected to the difference processing, the different data segments of the two files can be output. Such output results indicate which data segments of the second original file need to be operated to obtain the second target file.
[0094] The following is a simple example to illustrate. If the code segment used for declaration in the second original file O1 is:
[0095] "tag": "vui_comm"; / / Communication function of the voice interaction interface
[0096] "version": "4G" / / Use 4G network
[0097] "delay_max": "2s" / / Set the maximum delay allowed to 2s
[0098] The code segment used for declaration in the matching second target file W1 is:
[0099] "tag": "vui_comm"; / / Communication function of the voice interaction interface
[0100] "version": "5G" / / Use 5G network
[0101] "delay_max": "1s" / / Set the maximum delay allowed to 1s
[0102] The difference result can be obtained as follows:
[0103] 2,3c2,3
[0104] <“version”: “4G”
[0105] < "delay_max": "2s"
[0106] ---
[0107] > "version": "5G"
[0108] > "delay_max": "1s"
[0109] Here, the second original file O1 has only been changed in the declaration statements for using the network and setting the maximum allowed delay. Therefore, in the differential result, the "c" in "2,3c2,3" indicates a change, which means that the 2nd to 3rd lines of the second original file O1 expressed by "2,3" before "c" are changed to the 2nd to 3rd lines of the second target file A1 expressed by "2,3" after "c". The part introduced by "<" is the content to be replaced in the second original file O1, the part introduced by ">" is the content used for replacement and supplement in the second target file A1, and "---" is the separator between the contents of two different files.
[0110] The difference result obtained above can be directly encapsulated into a file as a difference file obtained after the second original file O1 and the matched second target file A1 are subjected to difference processing.
[0111] The above method only provides a feasible example, and other methods of expressing differential processing are also within the protection scope of the embodiments of the present disclosure.
[0112] In this way, in the above steps, a corresponding differential file can be determined for matching the second original file and the second target file in a non-compressed state.
[0113] As for the process of determining the differential file introduced in S101-S103 above, in another embodiment of the present disclosure, two possible specific examples are provided in the form of a flowchart.
[0114] In a possible example, the selected first original file and the corresponding first target file are both in an uncompressed state, see Figure 2a As shown, it is a schematic diagram of performing differential processing on a first original file in an uncompressed state and a corresponding first target file provided by an embodiment of the present disclosure. The first original file is represented as src.apk.in in the figure (where src is the abbreviation of source, indicating "source"; ".in" indicates a decompressed state), and the first target file is represented as dst.apk.in in the figure (where dst is the abbreviation of destination, indicating "destination"). After differential processing, a differential file is obtained, which is represented as patchfile_1 in the figure.
[0115] In another possible example, the selected first original file and the corresponding first target file are both in a compressed state, see Figure 2bFIG. 1 is a schematic diagram of performing differential processing on a first original file in a compressed state and a corresponding first target file provided by an embodiment of the present disclosure. Figure 2a , since the first original file and the corresponding first target file in the initial state are compressed files, they are respectively represented as src.apk and dst.apk, that is, the compressed file does not contain the suffix ".in". According to the description of the above embodiment, the first original file and the corresponding first target file in the compressed state will first be decompressed (inflate) to obtain the second original file and the second target file in the uncompressed state, for example, represented as src.apk.in and dst.apk.in respectively. Then, the second original file and the second target file in the uncompressed state are differentially processed to obtain a differential file, which is represented as patchfile_2 in the figure.
[0116] With respect to the above S104, for the obtained differential file, the update file of the firmware to be upgraded can be determined by using the differential file and the first target file corresponding to the differential file. Here, the update file of the firmware to be upgraded is specifically used to generate an upgrade file package corresponding to the firmware to be upgraded, that is, the file specifically used when upgrading the firmware to be upgraded.
[0117] According to the above description, in some possible cases, it is not possible to directly determine which file has a smaller file size after the differential file or the first target file is directly compressed to improve the efficiency of OTA. Therefore, in the embodiment of the present disclosure, the size of the files obtained in these two different ways is selected for comparison, and according to the file size comparison result, the update file of the firmware to be upgraded is determined from the differential file and the compressed file of the first target file.
[0118] In a specific implementation, for each differential file, a file size comparison result between the first target file corresponding to the differential file and the differential file can be determined, and based on the file size comparison result, an update file of the firmware to be upgraded can be determined from the differential file and the first target file.
[0119] For example, if the file size of the differential file is smaller than the file size corresponding to the compressed file of the first target file, the differential file is selected as the update file, otherwise the compressed file of the first target file is selected as the update file. In this way, under the firmware to be upgraded, the corresponding update file under each first target file can be determined as each update file of the firmware to be upgraded.
[0120] Then, using the update files in the firmware to be upgraded obtained above, an upgrade file package corresponding to the firmware to be upgraded can be generated. Specifically, the upgrade file package can be obtained by directly packaging the update files to be sent to the vehicle. The method of using the upgrade file package to upgrade the firmware is described in detail in the following embodiment, which will not be repeated here.
[0121] In another embodiment of the present disclosure, another method for upgrading firmware in a vehicle is provided, which is applied to a terminal device in the vehicle, such as an in-vehicle device. Here, the in-vehicle device can be used to receive an upgrade file package sent from the cloud, and complete the upgrade of the firmware through the upgrade file package.
[0122] See also Figure 3 FIG. 1 is a flowchart of another method for upgrading firmware in a vehicle provided by an embodiment of the present disclosure, the method comprising steps S301 to S304, wherein:
[0123] S301: Receive an upgrade file package corresponding to the firmware to be upgraded;
[0124] S302: extracting each differential file from the upgrade file package;
[0125] S303: Generate a third target file in an uncompressed state based on the differential file and a third original file in an uncompressed state that matches the differential file;
[0126] S304: If the third original file in the uncompressed state is obtained by decompressing the third original file in the compressed state, compress the third target file in the uncompressed state to obtain a compressed file, and use the compressed file to perform firmware upgrade processing.
[0127] With respect to the above S301-S302, the upgrade file package described here is also the upgrade file package obtained in the above embodiment. According to the description in the above embodiment, it can be determined that the upgrade file package specifically includes a differential file and a compressed target file, which is referred to as a third target file in this embodiment for the sake of distinction. As for the differential file, the third target file used for upgrading the firmware can be determined by differential restoration, so each differential file can be specifically extracted from the upgrade file package.
[0128] With respect to the above S303, for the obtained differential file, when performing a firmware upgrade, a third target file for the firmware can be obtained by differential restoration. In a specific implementation, the differential file can be used to perform differential restoration on a third original file in an uncompressed state that matches the differential file, and a third target file in an uncompressed state can be obtained. The third target file obtained in this way can be used for firmware upgrade.
[0129] Regarding the above S304, for the third target file, specifically when used for firmware upgrade, you can choose to use the third target file in a compressed state or an uncompressed state. The selection of the compressed state or the uncompressed state of the third target file is specifically determined according to whether the initial state of the third original file is a compressed state or an uncompressed state.
[0130] In a possible case, if the original state of the third original file is a compressed state, the third target file used for the firmware upgrade process is also selected as a third target file in a compressed state.
[0131] Specifically, in combination with the above embodiment, it can be determined that there is a third original file in a non-compressed state used in the differential processing, which is specifically obtained by decompressing the third original file in a compressed state, so the original state of these third original files is a compressed state. In the case of selecting the third target file in a compressed state for firmware upgrade, for these third target files in the non-compressed state obtained in S303 above, a compression processing method will be selected to obtain the compressed third target files, which are represented as compressed files for easy distinction, and then these compressed files are used for firmware upgrade processing.
[0132] Here, a specific embodiment is provided to illustrate the above process. Figure 4a As shown, it is a flowchart provided by an embodiment of the present disclosure for determining a third target file in a compressed state when the original state of the third source file is a compressed state.
[0133] The third original file in the compressed state is represented as src.apk. After decompression, the third original file in the uncompressed state is represented as src.apk.in. The third original file in the uncompressed state src.apk.in and the differential file patchfile_2 can be used to perform differential restoration (patching) to obtain the third target file dst.apk.in in the uncompressed state. According to the above description, the third target file dst.apk.in in the uncompressed state will be compressed to obtain a compressed file in the compressed state, which is specifically represented as dst.apk.
[0134] Similarly, in another possible situation, if the original state of the third source file is a non-compressed state, the third target file used for the firmware upgrade process is also selected as a third target file in a non-compressed state.
[0135] Specifically, if the original state of the third source file is uncompressed, decompression will not be performed during the differential processing, but the differential processing with the matching third target file will be performed directly, that is, the uncompressed state is always maintained. Therefore, the third target file in such an uncompressed state can be directly used for firmware upgrade processing.
[0136] Here, a specific embodiment is provided to illustrate the above process. Figure 4b As shown, it is a corresponding flowchart provided by an embodiment of the present disclosure, in which, when the original state of the third original file is an uncompressed state, a third target file in an uncompressed state is directly obtained through differential restoration.
[0137] Among them, the third original file is in an uncompressed state, represented by src.apk.in, and the differential file is represented by patchfile_1. The differential file patchfile_1 is used to perform differential restoration processing on the third original file in an uncompressed state to obtain the third target file dst.apk.in in an uncompressed state, and it is directly used as the third target file for firmware upgrade processing.
[0138] 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.
[0139] Based on the same inventive concept, the embodiments of the present disclosure also provide a firmware upgrade device in a vehicle corresponding to the firmware upgrade method in a vehicle. Since the principle of solving the problem by the device in the embodiments of the present disclosure is similar to the firmware upgrade method in the vehicle in the embodiments 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.
[0140] With the above Figure 1 For the firmware upgrade method in the corresponding vehicle, refer to Figure 5 , which is a schematic diagram of a first vehicle firmware upgrade device provided by an embodiment of the present disclosure, the device comprises: an acquisition module 51, a decompression module 52, a difference module 53, and a determination module 54; wherein,
[0141] An acquisition module 51 is used to acquire a first original file corresponding to the firmware to be upgraded and a first target file matching the first original file;
[0142] A decompression module 52, configured to decompress the first original file and the first target file, which are in a compressed state, to obtain a second original file and a second target file;
[0143] A difference module 53, used for performing difference processing on the second original file and the second target file to obtain a difference file;
[0144] The determination module 54 is used to determine the update file of the firmware to be upgraded according to the differential file and the first target file corresponding to the differential file, and the update file of the firmware to be upgraded is used to generate an upgrade file package corresponding to the firmware to be upgraded.
[0145] In an optional implementation, when acquiring the first original file of the firmware to be upgraded and the first target file matching the first original file, the acquisition module 51 is used to: for each of the first original files, determine the first target file matching the first original file from the at least one first target file by comparing the similarity between the file identification information of at least one first target file and the file identification information of the first original file; the first target file matching the first original file is the target file determined according to the similarity sorting.
[0146] In an optional implementation, the device further includes a first generating module 55, which is used to: if there is a first target file among the first target files that cannot be matched with the first original file, generate a compressed file of the first target file, and use the compressed file as an update file of the firmware to be upgraded.
[0147] In an optional implementation, when the decompression module 52 decompresses the first original file and the first target file in a compressed state to obtain the second original file and the second target file, it is used to: determine the first original file and the first target file in a compressed state, and the first original file and the first target file in an uncompressed state from the first original file and the first target file; decompress the first original file and the first target file in a compressed state to obtain the second original file and the second target file to be differentially processed, and the second original file and the second target file to be differentially processed include: the second original file and the second target file after decompression, and the first original file and the first target file in an uncompressed state.
[0148] In an optional implementation, when determining the update file of the firmware to be upgraded based on the differential file and the first target file corresponding to the differential file, the determination module 54 is used to: for each differential file, determine the first target file corresponding to the differential file and the file size comparison result between the differential file and the differential file; and based on the file size comparison result, determine the update file of the firmware to be upgraded from the differential file and the first target file.
[0149] Similarly, Figure 3For the firmware upgrade method in the corresponding vehicle, refer to Figure 6 , which is a schematic diagram of a second vehicle firmware upgrade device provided by an embodiment of the present disclosure, the device comprises: a receiving module 61, an extraction module 62, a second generation module 63, and a compression module 64; wherein,
[0150] A receiving module 61, used for receiving an upgrade file package corresponding to the firmware to be upgraded;
[0151] An extraction module 62, used to extract each differential file from the upgrade file package;
[0152] A second generating module 63, configured to generate a third target file in an uncompressed state based on the differential file and a third original file in an uncompressed state matching the differential file;
[0153] The compression module 64 is used to compress the third target file in the uncompressed state to obtain a compressed file if the third original file in the uncompressed state is obtained by decompressing the third original file in the compressed state, and use the compressed file to perform firmware upgrade processing.
[0154] In an optional implementation, it further includes a processing module 65 for: if the third original file in the uncompressed state is the initial state of the third original file, then using the third target file in the uncompressed state to perform firmware upgrade processing.
[0155] 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.
[0156] The present disclosure also provides a computer device, such as Figure 7 FIG. 1 is a schematic diagram of a computer device structure provided in an embodiment of the present disclosure, including:
[0157] A processor 10 and a memory 20; the memory 20 stores machine-readable instructions executable by the processor 10, and the processor 10 is used to execute the machine-readable instructions stored in the memory 20. When the machine-readable instructions are executed by the processor 10, the processor 10 performs the following steps:
[0158] Obtain a first original file corresponding to the firmware to be upgraded and a first target file matching the first original file; decompress the first original file and the first target file in a compressed state to obtain a second original file and a second target file; perform differential processing on the second original file and the second target file to obtain a differential file; determine an update file of the firmware to be upgraded based on the differential file and the first target file corresponding to the differential file, and the update file of the firmware to be upgraded is used to generate an upgrade file package corresponding to the firmware to be upgraded.
[0159] Alternatively, the processor 10 executes the following steps:
[0160] Receive an upgrade file package corresponding to the firmware to be upgraded; extract each differential file from the upgrade file package; generate a third target file in an uncompressed state based on the differential file and a third original file in an uncompressed state that matches the differential file; if the third original file in an uncompressed state is obtained by decompressing the third original file in a compressed state, compress the third target file in an uncompressed state to obtain a compressed file, and use the compressed file to perform firmware upgrade processing.
[0161] The above-mentioned memory 20 includes an internal memory 210 and an external memory 220; the internal memory 210 here is also called an internal memory, which is used to temporarily store the calculation data in the processor 10, as well as the data exchanged with the external memory 220 such as a hard disk. The processor 10 exchanges data with the external memory 220 through the internal memory 210.
[0162] The specific execution process of the above instructions can refer to the steps of the firmware upgrade method in the vehicle described in the embodiment of the present disclosure, which will not be repeated here.
[0163] 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 vehicle firmware upgrade method described in the above method embodiment are executed. The storage medium can be a volatile or non-volatile computer-readable storage medium.
[0164] 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 firmware upgrade method in the vehicle described in the above method embodiment. Please refer to the above method embodiment for details, which will not be repeated here.
[0165] The computer program product may be implemented in hardware, software or a combination thereof. In one optional embodiment, the computer program product is implemented as a computer storage medium. In another optional embodiment, the computer program product is implemented as a software product, such as a software development kit (SDK).
[0166] 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.
[0167] 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.
[0168] 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.
[0169] 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.
[0170] 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 above-described 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 above-described 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 should be based on the protection scope of the claims.
Claims
1. A method for upgrading firmware in a vehicle, characterized in that: include: Acquire a first original file corresponding to the firmware to be upgraded and a first target file matching the first original file; Decompressing the compressed first original file and the first target file to obtain a second original file and a second target file; Performing differential processing on the second original file and the second target file to obtain a differential file; An update file of the firmware to be upgraded is determined according to the differential file and the first target file corresponding to the differential file, and the update file of the firmware to be upgraded is used to generate an upgrade file package corresponding to the firmware to be upgraded.
2. The firmware upgrade method according to claim 1, characterized in that: Acquiring a first original file of the firmware to be upgraded and a first target file matching the first original file, including: For each of the first original files, by comparing the similarity between the file identification information of at least one first target file and the file identification information of the first original file, a first target file matching the first original file is determined from the at least one first target file; the first target file matching the first original file is the target file determined according to the similarity sorting.
3. The firmware upgrade method according to claim 2, characterized in that: The method further comprises: If there is a first target file among the first target files that cannot be matched with the first original file, a compressed file of the first target file is generated, and the compressed file is used as an update file of the firmware to be upgraded.
4. The firmware upgrade method according to claim 1, characterized in that: Decompressing the compressed first original file and the first target file to obtain the second original file and the second target file includes: Determine, from the first original file and the first target file, a first original file and a first target file in a compressed state, and a first original file and a first target file in a non-compressed state; The first original file and the first target file in a compressed state are decompressed to obtain a second original file and a second target file to be differentially processed, wherein the second original file and the second target file to be differentially processed include: the second original file and the second target file after decompression, and the first original file and the first target file in an uncompressed state.
5. The method according to claim 1, characterized in that Determining the update file of the firmware to be upgraded according to the differential file and the first target file corresponding to the differential file includes: For each differential file, determine a file size comparison result between the first target file corresponding to the differential file and the differential file, and determine an update file of the firmware to be upgraded from the differential file and the first target file according to the file size comparison result.
6. A method for upgrading firmware in a vehicle, characterized in that: include: Receive an upgrade file package corresponding to the firmware to be upgraded; Extracting each differential file from the upgrade file package; Generate a third target file in an uncompressed state based on the differential file and a third original file in an uncompressed state that matches the differential file; If the third original file in the uncompressed state is obtained by decompressing the third original file in the compressed state, the third target file in the uncompressed state is compressed to obtain a compressed file, and the compressed file is used to perform firmware upgrade processing.
7. The method according to claim 6, characterized in that Also includes: If the third original file in the uncompressed state is the initial state of the third original file, the firmware upgrade process is performed using the third target file in the uncompressed state.
8. A firmware upgrade device in a vehicle, characterized in that: include: An acquisition module, used for acquiring a first original file corresponding to the firmware to be upgraded and a first target file matching the first original file; A decompression module, used for decompressing the first original file and the first target file in a compressed state to obtain a second original file and a second target file; A difference module, used for performing difference processing on the second original file and the second target file to obtain a difference file; The determination module is used to determine the update file of the firmware to be upgraded according to the differential file and the first target file corresponding to the differential file, and the update file of the firmware to be upgraded is used to generate an upgrade file package corresponding to the firmware to be upgraded.
9. A firmware upgrade device in a vehicle, characterized in that: include: A receiving module, used for receiving an upgrade file package corresponding to the firmware to be upgraded; An extraction module, used to extract each differential file from the upgrade file package; A second generating module, configured to generate a third target file in an uncompressed state based on the differential file and a third original file in an uncompressed state matching the differential file; The compression module is used to compress the third target file in the uncompressed state to obtain a compressed file if the third original file in the uncompressed state is obtained by decompressing the third original file in the compressed state, and use the compressed file to perform firmware upgrade processing.
10. 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 firmware upgrade method in a vehicle as described in any one of claims 1 to 7.
11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program. When the computer program is executed by a computer device, the computer device executes the steps of the firmware upgrade method in a vehicle as described in any one of claims 1 to 7.