Software package upgrading method, device, intelligent terminal, system and storage medium
By compressing and decompressing the vehicle ECU software package, the problem of excessively long upgrade times for vehicle ECU software packages is solved, achieving efficient and safe software package upgrades.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- JIANGSU ZENIO NEW ENERGY BATTERY TECH CO LTD
- Filing Date
- 2022-11-15
- Publication Date
- 2026-07-31
AI Technical Summary
Upgrading vehicle ECU software packages requires stopping the vehicle, resulting in excessively long waiting times and impacting user experience. Existing technologies struggle to improve upgrade efficiency.
By compressing and transmitting the software package, and then using a bootloader to decompress the compressed package, software package upgrades can be achieved. Combined with encrypted transmission methods, data security is ensured.
It improves data transmission efficiency, shortens upgrade time, enhances software package upgrade efficiency, and ensures data security through encrypted transmission.
Smart Images

Figure CN115658117B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of vehicle networking technology, and more specifically, to a software package upgrade method, apparatus, smart terminal, system, and storage medium. Background Technology
[0002] With the rapid development of the Internet of Vehicles (IoV), vehicles are becoming increasingly automated, and the software packages of onboard ECUs (Electronic Control Units) are also growing larger. Onboard ECUs can be updated and upgraded by running a bootloader. Since software package upgrades require the vehicle to be stopped, improving the efficiency of software package upgrades is a crucial issue to address in order to avoid excessively long waiting times. Summary of the Invention
[0003] In view of this, the purpose of the present invention is to provide a software package upgrade method, apparatus, smart terminal, system and storage medium.
[0004] To achieve the above objectives, the technical solution adopted by the present invention is as follows:
[0005] In a first aspect, the present invention provides a software package upgrade method applied to a smart terminal, wherein the smart terminal is communicatively connected to an in-vehicle ECU, and the in-vehicle ECU stores a preset boot program, the method comprising:
[0006] Obtain a software package containing multiple lines of upgrade information, wherein the upgrade information includes software data;
[0007] Each line of software data is compressed to obtain compressed data for each line, thus obtaining a compressed software package.
[0008] The compressed software package is sent to the vehicle ECU, so that the vehicle ECU can run the bootloader to decompress the compressed software package and then upgrade the software package.
[0009] In an optional implementation, each row of upgrade information has a row number indicating its position;
[0010] The step of compressing each line of software data to obtain compressed data includes:
[0011] Take any one of the upgrade information lines as pending upgrade information, and take the software data in the pending upgrade information as pending software data;
[0012] If target upgrade information exists in each line of upgrade information preceding the pending upgrade information, then the pending software data is replaced to obtain compressed data; wherein, the software data in the target upgrade information is the same as the pending software data;
[0013] If the target upgrade information is not present in each line of upgrade information preceding the pending upgrade information, then the pending software data is converted to obtain compressed data.
[0014] Iterate through each line of software data to obtain the compressed data for each line.
[0015] In an optional implementation, the smart terminal stores specific symbols;
[0016] The step of replacing the undetermined software data to obtain compressed data includes:
[0017] Convert the row number of the target upgrade information into a hexadecimal number to obtain the target number;
[0018] The undetermined software data is replaced with the specific symbol and the target number to obtain the compressed data.
[0019] In an optional implementation, the smart terminal stores a mapping table, which includes the ASCII code corresponding to each hexadecimal character, and the software data is a hexadecimal number of M bytes, where M is a positive integer multiple of 16;
[0020] The step of converting the undetermined software data to obtain compressed data includes:
[0021] According to the mapping table, each hexadecimal character in the pending software data is converted into its corresponding ASCII code to obtain the compressed data.
[0022] In an optional implementation, the upgrade information may further include a storage address;
[0023] The process by which the vehicle ECU decompresses the compressed software package and then upgrades the software package by running the boot program is implemented in the following manner:
[0024] The vehicle ECU reads each line of compressed information in the compressed software package by running the boot program. The compressed information includes the compressed data and the storage address.
[0025] For each line of compressed information, the vehicle ECU decompresses the compressed data in the compressed information by running the boot program to obtain software data, and stores the software data in the storage address in the compressed information;
[0026] The vehicle ECU upgrades the software package based on all software data.
[0027] In an optional implementation, the process by which the vehicle-mounted ECU decompresses the compressed data in the compressed information to obtain software data by running the boot program is implemented in the following manner:
[0028] If the compressed data contains the specific symbol, the vehicle ECU runs the boot program to calculate the target line number based on the target number in the compressed data, and calculates the target storage address based on the storage address in the first line and the target line number. Then, it copies the software data corresponding to the target storage address to obtain the software data.
[0029] Secondly, the present invention provides a software package upgrade device for use in a smart terminal, wherein the smart terminal is communicatively connected to an in-vehicle ECU, and the in-vehicle ECU stores a preset boot program; the device includes:
[0030] An acquisition module is used to acquire a software package that includes multiple lines of upgrade information, wherein the upgrade information includes software data;
[0031] A compression module is used to compress each line of the software data to obtain compressed data for each line, thus obtaining a compressed software package.
[0032] The sending module is used to send the compressed software package to the vehicle ECU, so that the vehicle ECU can perform software package upgrade after decompressing the compressed software package by running the boot program.
[0033] Thirdly, the present invention provides a smart terminal, including a processor and a memory, wherein the memory stores a computer program, and when the processor executes the computer program, it implements the method described in any of the foregoing embodiments.
[0034] Fourthly, the present invention provides a software package upgrade system, which includes an in-vehicle ECU and the smart terminal described in the foregoing embodiments.
[0035] Fifthly, the present invention provides a storage medium storing a computer program that, when executed by a processor, implements the method described in any one of the foregoing embodiments.
[0036] This invention provides a software package upgrade method, apparatus, smart terminal, system, and storage medium. The smart terminal is communicatively connected to an on-board ECU, which stores a preset boot program. The smart terminal acquires a software package containing multiple lines of upgrade information, including software data. Each line of software data is then compressed to obtain compressed data, resulting in a compressed software package. This compressed software package is then sent to the on-board ECU, which runs the boot program to decompress the package and perform the upgrade. By compressing the software package during transmission, the package size is reduced, improving data transmission efficiency, shortening upgrade time, and increasing upgrade efficiency. Furthermore, the compression and decompression method ensures data security through encrypted transmission.
[0037] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description
[0038] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0039] Figure 1 A schematic diagram of a software package upgrade system provided in an embodiment of the present invention is shown;
[0040] Figure 2 A block diagram of a smart terminal provided in an embodiment of the present invention is shown;
[0041] Figure 3 This invention provides a schematic flowchart of a software package upgrade method according to an embodiment of the invention.
[0042] Figure 4 This illustration shows another flowchart of the software package upgrade method provided in an embodiment of the present invention;
[0043] Figure 5 This illustration shows another flowchart of the software package upgrade method provided in an embodiment of the present invention;
[0044] Figure 6 A functional block diagram of a software package upgrade device provided in an embodiment of the present invention is shown.
[0045] Icons: 110 - Bus; 120 - Processor; 130 - Memory; 150 - I / O Module; 170 - Communication Interface; 300 - Software Package Upgrade Device; 310 - Acquisition Module; 330 - Compression Module; 350 - Transmission Module. Detailed Implementation
[0046] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. The components of the embodiments of the present invention described and shown in the accompanying drawings can generally be arranged and designed in various different configurations.
[0047] Therefore, the following detailed description of the embodiments of the invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely to illustrate selected embodiments of the invention. All other embodiments obtained by those skilled in the art based on the embodiments of the invention without inventive effort are within the scope of protection of the invention.
[0048] It should be noted that relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0049] With the rapid development of the Internet of Vehicles (IoV), vehicles are becoming increasingly automated, and the software packages of onboard ECUs are also growing larger. Onboard ECUs can update and upgrade their software by running a bootloader. Since software package upgrades require the vehicle to be stopped, the size of the package determines the waiting time for the upgrade, and excessively long waiting times can negatively impact user experience. Therefore, this invention provides a software package upgrade method that reduces the amount of data transmitted by compressing the software package, thereby improving transmission efficiency and shortening the upgrade time. Furthermore, compressing the software package also ensures that data is transmitted in an encrypted form, thus guaranteeing data transmission security.
[0050] Please see Figure 1This is a schematic diagram of a software package upgrade system provided in an embodiment of the present invention, including a smart terminal and an on-board ECU that are connected by communication. Optionally, the smart terminal and the on-board ECU can be connected by communication via a CAN network.
[0051] Smart terminals can be personal computers, tablets, wearable devices, smartphones, ultra-mobile personal computers (UMPCs), netbooks, personal digital assistants (PDAs), etc. This invention does not impose any limitations on these.
[0052] An onboard ECU, also known as a vehicle computer or vehicle ECU, is used to execute programs and process data; it can be understood as a microcomputer controller for a vehicle. An onboard ECU includes a processor and memory. The processor executes programs stored in the memory to perform specific functions.
[0053] Please see Figure 2 This is a block diagram of a smart terminal provided in an embodiment of the present invention. The smart terminal includes a bus 110, a processor 120, a memory 130, an I / O module 150, and a communication interface 170.
[0054] Bus 110 may be a circuit that connects the above-mentioned components to each other and transmits information between the components.
[0055] The processor 120 can receive commands from the other components (such as memory 130, I / O module 150, communication interface 170, etc.) via bus 110, interpret the received commands, and perform calculations or data processing according to the interpreted commands.
[0056] The processor 120 can be an integrated circuit chip with signal processing capabilities. The processor 120 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), an off-the-shelf programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0057] The memory 130 may store commands or data received from the processor 120 or other components (such as I / O module 150, communication interface 170, etc.) or commands or data generated by the processor 120 or other components.
[0058] The memory 130 may be, but is not limited to, random access memory (RAM), read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), or electrically erasable programmable read-only memory (EEPROM).
[0059] The I / O module 150 can receive commands or data input by the user via input-output means (e.g., sensors, keyboard, touch screen, etc.), and can transmit the received commands or data to the processor 120 or memory 130 via the bus 110. It is also used to display various information received, stored, and processed from the aforementioned components (e.g., multimedia data, text data), and can display video, images, data, etc.
[0060] Communication interface 170 can be used to communicate with other node devices for signaling or data.
[0061] Understandable Figure 2 The structure shown is only a schematic diagram of a smart terminal; the smart terminal may also include components that are larger than those shown. Figure 2 The more or fewer components shown, or having the same Figure 2 The different configurations shown. Figure 2 The components shown can be implemented using hardware, software, or a combination thereof.
[0062] The following will use the aforementioned smart terminal as the execution subject to execute the various steps in the methods provided in the embodiments of the present invention and achieve the corresponding technical effects.
[0063] Please see Figure 3 , Figure 3 This is a flowchart illustrating a software package upgrade method provided in an embodiment of the present invention.
[0064] Step S202: Obtain a software package containing multiple lines of upgrade information, including software data;
[0065] In this embodiment, the smart terminal stores a software package, which includes executable files generated using a preset compilation tool, such as an executable file generated using a 32-byte alignment tool. These executable files consist of multiple lines of software data. The software package includes multiple lines of upgrade information, and each line of upgrade information includes software data. The smart terminal can obtain the software data from each line of upgrade information by acquiring the software package.
[0066] Step S204: Compress each line of software data to obtain compressed data for each line, thus obtaining a compressed software package;
[0067] It is understood that the time required for software package upgrades is related to the size of the software package. Therefore, this embodiment of the invention improves data transmission efficiency and shortens the time spent waiting for upgrades by compressing the software package to reduce its size.
[0068] In this embodiment, the software package can be compressed by compressing the software data, that is, each line of software data is compressed sequentially to obtain each line of compressed data, so as to obtain the compressed software package, which is the compressed software package. Optionally, the compressed software package can be in .hex format.
[0069] Step S206: The compressed software package is sent to the vehicle ECU so that the vehicle ECU can run the bootloader to decompress the compressed software package and then upgrade the software package.
[0070] In this embodiment, the vehicle ECU stores a pre-set bootloader with data analysis capabilities, which can be understood as a specific program used to guide the upgrade and update of the software package.
[0071] After compressing the software package, the smart terminal sends the compressed software to the vehicle ECU; the vehicle ECU receives the compressed software package, and decompresses and upgrades the software package by running a boot program.
[0072] It is understandable that by compressing and then decompressing the data during transmission, the software data in the software package is transmitted in an encrypted form, thereby ensuring data security.
[0073] As can be seen from the above steps, the smart terminal communicates with the vehicle ECU, which stores a preset boot program. The smart terminal obtains a software package containing multiple lines of upgrade information, including software data. Each line of software data is then compressed to obtain compressed data, resulting in a compressed software package. This compressed package is then sent to the vehicle ECU, which runs the boot program to decompress the package and perform the upgrade. By compressing the software package during transmission, the package size is reduced, improving data transmission efficiency, shortening upgrade time, and increasing upgrade efficiency. Furthermore, the compression and decompression method ensures data security through encrypted transmission.
[0074] Optionally, for step S204 above, this embodiment of the invention provides a possible implementation method, please refer to [link to relevant documentation]. Figure 4 .
[0075] Step S204-1: Take any row of upgrade information as pending upgrade information, and take the software data in the pending upgrade information as pending software data;
[0076] Step S204-3A: If target upgrade information exists in each line of upgrade information before the pending upgrade information, then perform a replacement operation on the pending software data to obtain compressed data; wherein, the software data in the target upgrade information is the same as the pending software data.
[0077] Step S204-3B: If there is no target upgrade information in each line of upgrade information before the pending upgrade information, then the pending software data is converted to obtain compressed data.
[0078] Step S204-5: Traverse each line of software data to obtain each line of compressed data.
[0079] In this embodiment, each line of upgrade information has a line number to indicate its position, that is, all upgrade information in the software package is arranged line by line in ascending order of line number.
[0080] It is understandable that the method of compressing the software data in each line of upgrade information is similar. For the sake of brevity, this embodiment of the invention uses any line of upgrade information as pending upgrade information and the software data in the pending upgrade information as pending software data for illustrative purposes.
[0081] Based on the row number of the pending upgrade information, obtain the upgrade information of each row preceding it. If there is target upgrade information among these upgrade information, which refers to upgrade information whose software data is the same as the pending software data, then perform a replacement operation on the pending software data to obtain compressed data; if there is no target upgrade information among these upgrade information, then perform a conversion operation on the pending software data to obtain compressed data.
[0082] This can be understood as follows: if a target upgrade information with identical software data exists prior to the pending upgrade information, an association can be established between the two. Based on this association, the software data in the pending upgrade information can be represented with less data, achieving data compression through replacement operations. If no target upgrade information exists, the software data in the pending upgrade information is transformed according to predefined rules to further enhance data confidentiality.
[0083] For each line of software data, the compressed data can be obtained in a similar manner to the above, thus obtaining a compressed software package.
[0084] Optionally, for the above-mentioned situation where target upgrade information exists, the present invention provides a possible implementation method, namely: converting the row number of the target upgrade information into a hexadecimal number to obtain the target number; replacing the pending software data with a specific symbol and the target number to obtain compressed data.
[0085] In this embodiment, the smart terminal stores specific symbols such as commas ",". It should be understood that the specific symbols can be set according to actual applications, and this embodiment of the invention does not impose any limitations.
[0086] If target upgrade information exists, obtain the line number of the target upgrade information and convert it to a hexadecimal number to obtain the target data; then replace the software data in the pending upgrade information with a specific symbol and the target number to obtain the compressed data.
[0087] For ease of understanding, an example is provided in this embodiment of the invention. For example, assuming that a 20-bit size is used to store the row number, 1,048,575 rows can be represented. The pending upgrade information is row 420, i.e., the upgrade information with row number 420. In the row before the pending upgrade information, i.e., rows 1 to 419, the software data in the upgrade information of row 230 is the same as the software data in the pending upgrade information. Therefore, there is a target upgrade information, i.e., the upgrade information with row number 230. Then, the row number 230 is converted into a hexadecimal number, resulting in the target number 000E6. Then, the software data in the pending upgrade information is replaced with a specific symbol and the target number, i.e., ",000E6", to obtain the compressed data ",000E6".
[0088] As can be seen, if upgrade information for the same software data exists, specific symbols and line numbers of the upgrade information can be used to represent the software data, thereby significantly compressing the software package and reducing its size to improve the efficiency of software package upgrades.
[0089] Optionally, for the case where there is no target upgrade information, this embodiment of the invention provides a possible implementation method, namely: according to the mapping table, each hexadecimal character in the pending software data is converted into its corresponding ASCII code to obtain compressed data.
[0090] It is understandable that the software data is generated by a compiler using 32-byte alignment, meaning each line of software data is a 32-byte hexadecimal number. It should also be understood that other alignment methods, such as M-byte alignment, can be used, where M is a positive multiple of 16.
[0091] According to the above example, the software package has a maximum of 1,048,575 lines, and each line of software data is 32 bytes. Therefore, 1,048,575 * 32 bytes = 31M. Thus, the implementation method provided by the present invention can compress software packages with a software data size of less than 31M.
[0092] In this embodiment, the smart terminal stores a mapping table, which includes the ASCII codes corresponding to each hexadecimal character, namely "0-9" and "A-F" (16 characters in total). For ease of understanding, this embodiment of the invention provides an example of a mapping table, as shown in the table below.
[0093]
[0094]
[0095] To facilitate understanding, the following explanation will be provided in conjunction with the mapping table mentioned above.
[0096] For example, suppose the pending upgrade information is line 420 (line number 420). Before this pending upgrade information, in lines 1 to 419, the software data in each line of upgrade information is different from the software data in the pending upgrade information. Therefore, there is no target upgrade information. Then, the software data in the pending upgrade information is obtained, which is the pending software data such as "1B081C07262174FFAE40F736D815098BACB09DA08F593BA50B6EDA207F31F928". Then, according to the mapping table, each hexadecimal character in the pending software data is converted into its corresponding ASCII code, which yields the compressed data.
[0097] Optionally, for the process described above where the vehicle ECU upgrades the software package after decompressing the compressed software package by running a bootloader, this embodiment of the invention provides a possible implementation method, please refer to [link to relevant documentation]. Figure 5 .
[0098] In step S208, the vehicle ECU reads each line of compressed information in the compressed software package by running the boot program. The compressed information includes the compressed data and the storage address.
[0099] Step S210: For each line of compressed information, the vehicle ECU decompresses the compressed data in the compressed information by running the boot program to obtain software data, and stores the software data in the storage address in the compressed information.
[0100] Step S212: The vehicle ECU upgrades the software package based on all software data.
[0101] In this embodiment, each line of upgrade information includes a storage address, that is, the storage address corresponding to the software data in that line.
[0102] The vehicle ECU receives a compressed software package sent by the smart terminal. It reads each line of compressed information from the compressed software package by running a bootloader. The compressed information includes the compressed data and the storage address. Then, the vehicle ECU decompresses each line of compressed data to obtain each line of software data by running the bootloader. It then stores each line of software data according to the storage address corresponding to each line of software data. Finally, the vehicle ECU upgrades the software package based on all the software data.
[0103] In essence, the vehicle's ECU decompresses the compressed software package by running a bootloader to extract each line of software data and stores it in the corresponding storage address for software package upgrades. This means the software package is compressed and transmitted to the vehicle's ECU via a smart terminal, and the ECU decompresses it. This compression-transmission-decompression method achieves encrypted transmission, enhancing the security of data transmission during the software package upgrade process.
[0104] Optionally, for step S210 above, the present invention provides a possible implementation method, namely: if the compressed data contains a specific symbol, the vehicle ECU calculates the target line number based on the target number in the compressed data by running the boot program, calculates the target storage address based on the storage address in the first line and the target line number, and then copies the software data corresponding to the target storage address to obtain the software data.
[0105] It is understood that the processing method for each line of compressed information is similar. For the sake of brevity, this embodiment of the invention uses one line of compressed information as an example for illustration.
[0106] The vehicle's ECU analyzes the compressed information by running a bootloader. If the compressed data contains a specific symbol, it indicates that the compressed data was obtained through a substitution operation. In this case, the compressed data also includes a target number, which is then converted from hexadecimal to decimal to obtain the target row number. The software data is then obtained based on the target row number. If the compressed data does not contain a specific symbol, it indicates that the compressed data was obtained through a conversion operation. In this case, the reverse operation is performed according to a pre-stored mapping table to obtain the software data.
[0107] Following the example above, the vehicle ECU analyzes the compressed information in line 420 by running the boot program. Assuming that the compressed data is ",000E6", which includes a specific symbol, the target number 000E6 is converted to decimal to obtain the target line number 230.
[0108] It is understandable that the storage addresses in each line of compressed information are consecutive. The target storage address, i.e., the storage address in the 230th line of compressed information, can be calculated based on the storage address in the first line and the target line number 230. The software data corresponding to the target storage address can then be copied to obtain the software data.
[0109] Assuming that the compressed data in line 420 does not contain a specific symbol, then according to the mapping table, each ASCII code in the compressed data is converted into its corresponding hexadecimal character, thus obtaining the software data.
[0110] To perform the corresponding steps in the above embodiments and various possible methods, an implementation of a software package upgrade apparatus is given below. Please refer to... Figure 6 , Figure 6 This is a functional block diagram of a software package upgrade device 300 provided in an embodiment of the present invention. It should be noted that the basic principle and technical effects of the software package upgrade device 300 provided in this embodiment are the same as those in the above embodiments. For the sake of brevity, any parts not mentioned in this embodiment can be referred to the corresponding content in the above embodiments. The software package upgrade device 300 includes:
[0111] The acquisition module 310 is used to acquire a software package that includes multiple lines of upgrade information, including software data.
[0112] Compression module 330 is used to compress each line of software data to obtain compressed data for each line, thus obtaining a compressed software package;
[0113] The sending module 350 is used to send the compressed software package to the vehicle ECU, so that the vehicle ECU can run the boot program to decompress the compressed software package and then upgrade the software package.
[0114] Optionally, the compression module 330 is further configured to: take any row of upgrade information as pending upgrade information, and take the software data in the pending upgrade information as pending software data; if there is target upgrade information in each row of upgrade information before the pending upgrade information, then perform a replacement operation on the pending software data to obtain compressed data; wherein, the software data in the target upgrade information is the same as the pending software data; if there is no target upgrade information in each row of upgrade information before the pending upgrade information, then perform a conversion operation on the pending software data to obtain compressed data; traverse each row of software data to obtain each row of compressed data.
[0115] Optionally, the compression module 330 is also used to: convert the line number of the target upgrade information into a hexadecimal number to obtain the target number; and replace the pending software data with a specific symbol and the target number to obtain compressed data.
[0116] Optionally, the compression module 330 is also used to: convert each hexadecimal character in the software data to be determined into its corresponding ASCII code according to the mapping table, so as to obtain the compressed data.
[0117] Optionally, the process of upgrading the software package after the on-board ECU decompresses the compressed software package by running a bootloader is implemented as follows: The on-board ECU reads each line of compressed information in the compressed software package by running the bootloader. The compressed information includes compressed data and storage address; for each line of compressed information, the on-board ECU decompresses the compressed data in the compressed information by running the bootloader to obtain software data, and stores the software data in the storage address in the compressed information; the on-board ECU upgrades the software package based on all the software data.
[0118] Optionally, the process by which the vehicle ECU decompresses the compressed data in the compressed information to obtain software data by running a boot program is implemented in the following way: if the compressed data contains specific symbols, the vehicle ECU calculates the target line number based on the target number in the compressed data by running the boot program, calculates the target storage address based on the storage address in the first line and the target line number, and then copies the software data corresponding to the target storage address to obtain the software data.
[0119] This invention also provides a smart terminal, including a processor and a memory. The memory stores a computer program, and when the processor executes the computer program, it implements the software package upgrade method disclosed in the above embodiments.
[0120] This invention also provides a software package upgrade system, which includes an in-vehicle ECU and a smart terminal provided in this invention.
[0121] This invention also provides a storage medium storing a computer program that, when executed by a processor, implements the software package upgrade method disclosed in this invention.
[0122] In the several embodiments provided by this invention, it should be understood that the disclosed apparatus and methods can also be implemented in other ways. The apparatus embodiments described above are merely illustrative; for example, the flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods, and computer program products according to various embodiments of the invention. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than those marked in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram and / or flowchart, and combinations of blocks in block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.
[0123] In addition, the functional modules in the various embodiments of the present invention can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.
[0124] If the aforementioned functions are implemented as software functional modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, essentially, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0125] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A software package upgrade method characterized by comprising: The method is applied to a smart terminal, which is communicatively connected to an in-vehicle ECU. The in-vehicle ECU stores a preset boot program, and the smart terminal stores specific symbols and a mapping table. The mapping table includes the ASCII code corresponding to each hexadecimal character. Obtain a software package containing multiple lines of upgrade information, the upgrade information including storage address and software data, the software data being a hexadecimal number of M bytes, where M is a positive integer multiple of 16, wherein each line of the upgrade information has a line number indicating its position; Take any one of the upgrade information lines as pending upgrade information, and take the software data in the pending upgrade information as pending software data; If there is target upgrade information in each line of upgrade information preceding the pending upgrade information, then the line number of the target upgrade information is converted into a hexadecimal number to obtain the target number; The pending software data is replaced with the specific symbol and the target number to obtain compressed data; wherein the software data in the target upgrade information is the same as the pending software data; If the target upgrade information is not present in each line of upgrade information preceding the pending upgrade information, then according to the mapping table, each hexadecimal character in the pending software data is converted to its corresponding ASCII code, and the pending software data is converted to ASCII code to obtain compressed data. By iterating through each line of software data, the compressed data for each line is obtained, thus obtaining the compressed software package; The compressed software package is transmitted to the vehicle ECU in encrypted form, so that the vehicle ECU can run the boot program to decompress the compressed software package and then upgrade the software package.
2. The method according to claim 1, characterized in that, The upgrade information also includes the storage address; The process by which the vehicle ECU decompresses the compressed software package and then upgrades the software package by running the boot program is implemented in the following manner: The vehicle ECU reads each line of compressed information in the compressed software package by running the boot program. The compressed information includes the compressed data and the storage address. For each line of compressed information, the vehicle ECU runs the boot program to decompress the compressed data in the compressed information to obtain software data, and stores the software data in the storage address in the compressed information; the vehicle ECU performs software package upgrade based on all the software data.
3. The method according to claim 2, characterized in that, The process by which the vehicle-mounted ECU decompresses the compressed data in the compressed information to obtain software data by running the boot program is implemented in the following manner: If the compressed data contains the specific symbol, the vehicle ECU runs the boot program, calculates the target line number based on the target number in the compressed data, calculates the target storage address based on the storage address in the first line and the target line number, and then copies the software data corresponding to the target storage address to obtain the software data. If the compressed data does not include the specific symbol, then according to the mapping table, each ASCII code in the compressed data is converted into its corresponding hexadecimal character to obtain the software data.
4. A software package upgrade device, characterized in that, The device is applied to a smart terminal, which is communicatively connected to an in-vehicle ECU. The in-vehicle ECU stores a preset boot program, and the smart terminal stores specific symbols and a mapping table. The mapping table includes the ASCII code corresponding to each hexadecimal character. The device includes: The acquisition module is used to acquire a software package that includes multiple lines of upgrade information. The upgrade information includes a storage address and software data. The software data is a hexadecimal number of M bytes, where M is a positive integer multiple of 16. Each line of the upgrade information has a line number to indicate its position. The compression module is used to take any line of the upgrade information as pending upgrade information and the software data in the pending upgrade information as pending software data. If there is target upgrade information in each line of upgrade information preceding the pending upgrade information, then the line number of the target upgrade information is converted into a hexadecimal number to obtain the target number; The pending software data is replaced with the specific symbol and the target number to obtain compressed data; wherein the software data in the target upgrade information is the same as the pending software data; If the target upgrade information is not present in each line of upgrade information preceding the pending upgrade information, then according to the mapping table, each hexadecimal character in the pending software data is converted to its corresponding ASCII code, and the pending software data is converted to ASCII code to obtain compressed data. By iterating through each line of software data, the compressed data for each line is obtained, thus obtaining the compressed software package; The sending module is used to transmit the compressed software package to the vehicle ECU in an encrypted form, so that the vehicle ECU can run the boot program to decompress the compressed software package and upgrade the software package.
5. A smart terminal, characterized in that, It includes a processor and a memory, the memory storing a computer program, and the processor, when executing the computer program, implements the method of any one of claims 1 to 3.
6. A software package upgrade system, characterized in that, The software upgrade system includes an on-board ECU and the smart terminal as described in claim 5.
7. A storage medium, characterized in that, The storage medium stores a computer program, which, when executed by a processor, implements the method of any one of claims 1 to 3.