Multi-thread whole vehicle OTA high-speed downloading method and device

Through the combination of multi-threaded download and P2P network, the mqtt and ftp protocols are used to realize high-speed download of the entire vehicle OTA, solving the problems of slow download speed and P2P network stability in the existing technology, significantly improving the download efficiency and stability. Improved user experience.

CN119324918AActive Publication Date: 2025-01-17DONGFENG MOTOR GRP
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202411433724.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-15
Publication Date
2025-01-17
Estimated Expiration
2044-10-15

AI Technical Summary

Technical Problem

The download speed of existing vehicle OTAs is limited by the network bandwidth and node distribution, which leads to a long upgrade process and poor user experience. P2P technology has security and stability challenges under the requirements of high reliability.

Method used

Using multi-threaded download method, the OTA upgrade package is divided into multiple data blocks, combined with the P2P network to download in parallel through multiple threads, use the mqtt and ftp protocol to realize communication and file sharing between nodes, and adopt the breakpoint continuous transmission mechanism to improve downloading. Efficiency and stability.

Benefits of technology

It significantly improves the download speed of OTA in the whole vehicle, shortens the upgrade time, enhances the system scalability and download stability, reduces the burden on the central server, and ensures the accuracy and efficiency of data exchange.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119324918A_ABST
    Figure CN119324918A_ABST
Patent Text Reader

Abstract

The invention relates to a multi-thread whole vehicle OTA high-speed downloading method and device, and the method comprises the steps: segmenting an OTA upgrade package into a plurality of data blocks, and storing the data blocks in an OTA cloud server; in combination with a P2P network, a plurality of data blocks are downloaded in parallel through a plurality of threads, one process is always connected with an OTA cloud server, other processes are connected with P2P network nodes, and the priority of the process connected with the OTA cloud server is the highest. According to the method, the downloading speed of the whole vehicle OTA is remarkably increased, the upgrading time is shortened, the burden of the central server is relieved through the P2P technology, the expandability of the system is improved, and the downloading stability and reliability are enhanced through a breakpoint resume mechanism.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing technology, and more specifically, to a multi-threaded whole vehicle OTA high-speed download method and device. Background Art

[0002] Currently, vehicle OTA technology is widely used in vehicle remote upgrades. However, due to network bandwidth limitations and the wide distribution of vehicles, OTA download speeds are often limited, resulting in a long upgrade process and poor user experience. Existing technologies include distributed hash table (DHT) technology and P2P technology. Among them, distributed hash table DHT technology is a technology for distributed storage and retrieval of data, which allows nodes to locate and obtain data through hash values. The node discovery and resource discovery mechanisms of the DHT network are complex and are susceptible to network delays and node failures; P2P technology improves the efficiency and scalability of the network through a decentralized architecture, allowing nodes to communicate and transmit data directly to each other. The security and stability of the P2P network is a challenge, especially under the high reliability requirements of automotive OTA. Summary of the invention

[0003] The technical problem to be solved by the present invention is to provide a multi-threaded whole vehicle OTA high-speed download method and device, which can significantly improve the download speed of the whole vehicle OTA, optimize the download process and improve efficiency through the application of multi-threaded download, P2P technology and breakpoint resume technology.

[0004] The technical solution adopted by the present invention to solve the technical problem is: construct a multi-threaded vehicle OTA high-speed download method,

[0005] Split the OTA upgrade package into multiple data blocks and store them in the OTA cloud server;

[0006] Combined with the P2P network, multiple data blocks are downloaded in parallel through multiple threads. One process is always connected to the OTA cloud server, and other processes are connected to the P2P network nodes. The process connected to the OTA cloud server has the highest priority.

[0007] According to the above scheme, the P2P network includes an mqtt cloud server and multiple vehicle terminals. The vehicle terminals and the mqtt cloud server communicate through the mqtt protocol. Each vehicle terminal is a P2P network node, and the vehicle terminals communicate through the ftp protocol.

[0008] According to the above scheme, the method of dividing the OTA upgrade package into multiple data blocks includes:

[0009] In the upgrade task on the cloud, the upgrade file corresponding to each component ECU is named in the following manner: Identification + Component Did + Component Software Part Number. When the file is divided into blocks, it is divided according to the specified size. The files after the downloaded files are divided into blocks are named in the following manner: Identification + Did + Component Software Part Number + Starting Offset Address + Ending Offset Address.

[0010] According to the above scheme, in combination with the P2P network, the method of downloading multiple data blocks in parallel through multiple threads includes:

[0011] When downloading, the vehicle terminal first starts an OTA cloud server download thread, called the main download thread, and starts downloading from the first block in the order of file blocks. After completing each file block, the file block information is published to the mqtt cloud server for other vehicle terminals to download. Then it checks whether the second block has been downloaded. If not, it forcibly terminates other threads downloading the file block, and the main download thread takes over and continues to download the file block from the OTA cloud server. If the download is complete, skip this file block and detect the next file block. According to this mechanism, the download and detection of all blocks are completed in sequence.

[0012] According to the above scheme, in combination with the P2P network, the method for downloading multiple data blocks in parallel through multiple threads also includes:

[0013] After the file starts downloading, the vehicle terminal scans and subscribes to messages from the MQTT cloud server for the file blocks that have not been downloaded. If a message published by other vehicle terminals is received, a new download thread is started to download the file blocks published by the vehicle terminal through the FTP protocol. When the total number of download threads exceeds the maximum value, no new download threads will be added. Instead, the system will wait until other download threads have completed downloading before allowing the creation of new download threads.

[0014] According to the above scheme, in combination with the P2P network, the method for downloading multiple data blocks in parallel through multiple threads also includes:

[0015] When downloading files, the vehicle terminal records the download progress of each file block for the downloaded files, and generates a download progress file for each downloaded file;

[0016] When the file resumes downloading after an interruption, the download progress file is read and checked from the first file block in sequence until a file block is found to have a problem. The main download thread is started to continue downloading the corresponding file block from the OTA cloud server, and the file block is continued to be downloaded from the last offset. For other blocks that have not been downloaded, the file is subscribed to the mqtt cloud server. If a corresponding message is received from other vehicle terminals, a new thread is started to continue downloading the file block from the last offset of the file block provided by other vehicle terminals.

[0017] According to the above scheme, in combination with the P2P network, the method for downloading multiple data blocks in parallel through multiple threads also includes:

[0018] When all file blocks are downloaded, the downloaded file blocks are first verified by MD5. If the verification fails, they are marked uniformly. After all problematic file blocks are marked, the multi-process download mechanism is restarted. The main download thread downloads the marked file blocks in sequence, and other threads subscribe to download the remaining marked file blocks.

[0019] According to the above scheme, in combination with the P2P network, the method for downloading multiple data blocks in parallel through multiple threads also includes:

[0020] After all file blocks have been verified, the files are combined in order. After combination, the final file verification is performed to compare the MD5 code of the total file with the original MD5 code on the platform. If the verification fails, the download process is retried a specified number of times. If the verification fails after the specified number of download attempts, the upgrade is stopped and the download failure is reported to the platform.

[0021] The present invention also provides a whole vehicle OTA high-speed download device, comprising:

[0022] A data segmentation module is used to segment the OTA upgrade package into multiple data blocks and store them in the OTA cloud server;

[0023] The multi-threaded parallel download module is used to combine with the P2P network to download multiple data blocks in parallel through multiple threads. One process is always connected to the OTA cloud server, and the other processes are connected to the P2P network nodes. The process connected to the OTA cloud server has the highest priority.

[0024] The present invention also provides a computer-readable storage medium on which executable instructions are stored. When the instructions are executed by a processor, the processor implements a multi-threaded whole-vehicle OTA high-speed download method.

[0025] The multi-threaded vehicle OTA high-speed download method and device of the present invention have the following beneficial effects:

[0026] 1. The multi-threaded download mechanism provided by the present invention divides the OTA upgrade package into multiple data blocks, combines with the P2P network, and downloads them in parallel through multiple threads. When the total download speed is guaranteed, the download of other data blocks is completed through other P2P nodes, thereby saving download time, significantly improving the download speed of the whole vehicle OTA, and shortening the upgrade time;

[0027] 2. The P2P network constructed by the present invention uses the mqtt protocol to complete communication, uses ftp to provide file services, and constructs a P2P network, which can realize resource sharing and data exchange between nodes, reduce the burden of the central server, and improve the scalability of the system;

[0028] 3. The node discovery mechanism provided by the present invention publishes and subscribes to messages to a specific topic of the central server through the MQTT protocol, which can realize the rapid discovery of new nodes and network joining;

[0029] 4. The data exchange protocol formulated by the present invention defines a set of standardized data request and response protocols, which can ensure the accuracy and efficiency of data exchange;

[0030] 5. The breakpoint-resume mechanism developed by the present invention records the download progress of each file block and supports rapid recovery after download interruption. The breakpoint-resume mechanism enhances the stability and reliability of downloading and can avoid repeated downloading. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] The present invention will be further described below with reference to the accompanying drawings and embodiments, in which:

[0032] Figure 1 It is a flow chart of the multi-threaded whole vehicle OTA high-speed download method of the present invention;

[0033] Figure 2 It is a system network topology diagram of the multi-threaded vehicle OTA high-speed download method of the present invention;

[0034] Figure 3 It is a schematic diagram of the multi-process download mechanism of the present invention;

[0035] Figure 4 It is a schematic diagram of the file cache structure of the present invention. DETAILED DESCRIPTION

[0036] In order to have a clearer understanding of the technical features, purposes and effects of the present invention, specific embodiments of the present invention are now described in detail with reference to the accompanying drawings.

[0037] Embodiment 1

[0038] like Figure 1-3 As shown, the multi-threaded vehicle OTA high-speed download method of the present invention includes:

[0039] S1. Divide the OTA upgrade package into multiple data blocks and store them in the OTA cloud server.

[0040] Methods for splitting an OTA upgrade package into multiple data blocks include:

[0041] In the upgrade task on the cloud, the upgrade file corresponding to each component ECU is named in the following manner: Identification + Component Did + Component Software Part Number. When the file is divided into blocks, it is divided according to the specified size. The files after the downloaded files are divided into blocks are named in the following manner: Identification + Did + Component Software Part Number + Starting Offset Address + Ending Offset Address.

[0042] S2. Combined with the P2P network, multiple data blocks are downloaded in parallel through multiple threads. One process is always connected to the OTA cloud server, and the other processes are connected to the P2P network nodes. The process connected to the OTA cloud server has the highest priority.

[0043] The P2P network includes an mqtt cloud server and multiple vehicle terminals. The vehicle terminals and the mqtt cloud server communicate through the mqtt protocol. Each vehicle terminal is a P2P network node, and the vehicle terminals communicate with each other through the ftp protocol.

[0044] Each vehicle terminal and OTA cloud use http connection to query upgrade tasks. MQTT cloud server is connected to each vehicle terminal and OTA cloud server for information communication. Each vehicle terminal is an FTP service provider, and files can be shared between each other through FTP.

[0045] The Mqttt protocol is mainly used to share file information with other car computers after the car computer downloads a file block. The specific definition details are shown in Table 1:

[0046] Table 1 Mqttt communication protocol definition

[0047] topic ota / taskid / logo+Did+parts software part number Message body format json Parameter 1 ftpHost: vehicle IP address Parameter 2 ftpPort: Car ftp service port Parameter 3 ftpUserName: vehicle ftp service user name Parameter 4 ftpUserPassword: Car ftp service user password Parameter 5 fileStartOffset: file block starting offset address (bytes) Parameter 6 fileBlockLenth: file block length (bytes) Parameter 7 fileBlockMd5: file block md5 code (used for file block integrity verification)

[0048] Assume that when vehicle 2 completes downloading the third file block of the file src_0X770_Z800022560.zip in task 0001: vehicle 2 sends the following json string to the topic: ota / 0001 / src_0X770_Z800022560 of the mqtt server:

[0049] {

[0050] "ftpHost":"xx.xx.xx.xx",

[0051] "ftpPort":"xxxx",

[0052] "ftpUserName":"xxxx",

[0053] "ftpUserPassword":"*****",

[0054] "fileStartOffset":"2097152",

[0055] "fileBlockLenth":"1048576",

[0056] "fileBlockMd5":"xxxxxxxxxxxxx"

[0057] }

[0058] Vehicle computer 1 subscribes to topic: ota / 0001 / src_0X770_Z800022560 from the mqtt server. When receiving the download completion message sent by vehicle computer 2, vehicle computer 1 connects to vehicle computer 2 through ftp information to download file block 3.

[0059] Step S2 further comprises the following steps:

[0060] S201. During downloading, the vehicle terminal first starts an OTA cloud server download thread, called the main download thread, and starts downloading from the first block in the order of file blocks. After each file block is completed, the file block information is published to the mqtt cloud server for other vehicle terminals to download. Then it is checked whether the second block has been downloaded. If not, other threads downloading the file block are forcibly terminated, and the main download thread takes over and continues to download the file block from the OTA cloud server. If the download is complete, this file block is skipped and the next file block is detected. The download and detection of all blocks are completed in sequence according to this mechanism.

[0061] S202. After the file starts to be downloaded, the vehicle terminal scans and subscribes to messages from the MQTT cloud server for the file blocks that have not been downloaded. If a message published by other vehicle terminals is received, a new download thread is started to download the file blocks published by the vehicle terminal through the FTP protocol. When the total number of download threads exceeds the maximum value, no new download threads will be added. Instead, the download of other download threads will be allowed to be created only after the download is completed.

[0062] S203, when downloading files, the vehicle terminal records the download progress of each file block of the downloaded file, and generates a download progress file for each downloaded file;

[0063] When the file resumes downloading after an interruption, the download progress file is read and checked from the first file block in sequence until a file block is found to have a problem. The main download thread is started to continue downloading the corresponding file block from the OTA cloud server, and the file block is continued to be downloaded from the last offset. For other blocks that have not been downloaded, the file is subscribed to the mqtt cloud server. If a corresponding message is received from other vehicle terminals, a new thread is started to continue downloading the file block from the last offset of the file block provided by other vehicle terminals.

[0064] like Figure 4As shown, when the file is downloaded, the local will record the download progress of each file block for the downloaded file. For each downloaded file, a file similar to src_0X760_Z700112560.prograss will be generated, called the download progress file, whose content is in json format, recording the total file size and the data size of each file block that has been downloaded. When the file is restored to download next time, the download progress file is read and checked from the first file block in sequence until a file block is checked with a problem and has not been downloaded, then the main download thread is started, and the corresponding file block is continued to be downloaded from the OTA web end, from the last offset, that is, the offset address of the file block + the downloaded bytes, and the file block is continued to be downloaded. For other blocks that have not been downloaded, the file is subscribed to the mqtt server. If a corresponding message is received from other car computers, a new thread is started, and the file block is continued to be downloaded from the last offset of the file block provided by other car computers, that is, the offset address of the file block + the downloaded bytes.

[0065] S204. When all the file blocks are downloaded, the downloaded file blocks are first verified by MD5. If the verification fails, they are marked uniformly. After all the problematic file blocks are marked, the multi-process download mechanism is restarted to perform multi-process download on the marked file blocks. The main download thread downloads the marked file blocks in sequence, and other threads subscribe to download the remaining marked file blocks.

[0066] S205. After all file blocks have been verified, the files are combined in order. After combination, the final file verification is performed to compare the MD5 code of the total file with the original MD5 code on the platform. If the verification fails, the download process is retried three times. If the verification fails after three times, the upgrade is stopped and the download failure is reported to the platform.

[0067] Embodiment 2

[0068] The present invention also provides a multi-threaded vehicle OTA high-speed download method and device, comprising:

[0069] A data segmentation module is used to segment the OTA upgrade package into multiple data blocks and store them in the OTA cloud server;

[0070] The multi-threaded parallel download module is used to combine with the P2P network to download multiple data blocks in parallel through multiple threads. One process is always connected to the OTA cloud server, and the other processes are connected to the P2P network nodes. The process connected to the OTA cloud server has the highest priority.

[0071] Embodiment 3

[0072] The present invention also provides a car, including a multi-threaded whole-vehicle OTA high-speed downloading method device.

[0073] Embodiment 4

[0074] The present invention also provides an electronic device, comprising: a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; a computer program is stored in the memory, and when the program is executed by the processor, the processor executes the steps of the multi-threaded whole-vehicle OTA high-speed download method.

[0075] Embodiment 5

[0076] The present invention also provides a computer-readable storage medium on which executable instructions are stored. When the instructions are executed by a processor, the processor implements the multi-threaded whole-vehicle OTA high-speed download method.

[0077] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0078] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0079] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0080] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0081] The embodiments of the present invention are described above in conjunction with the accompanying drawings, but the present invention is not limited to the above-mentioned specific implementation modes, which are merely illustrative rather than restrictive. Under the guidance of the present invention, ordinary technicians in this field can also make many forms without departing from the scope of protection of the present invention and the claims, all of which are within the protection of the present invention.

Claims

1. A multi-threaded vehicle OTA high-speed download method, characterized in that: Split the OTA upgrade package into multiple data blocks and store them in the OTA cloud server; Combined with the P2P network, multiple data blocks are downloaded in parallel through multiple threads. One process is always connected to the OTA cloud server, and other processes are connected to the P2P network nodes. The process connected to the OTA cloud server has the highest priority.

2. The multi-threaded vehicle OTA high-speed download method according to claim 1 is characterized in that: The P2P network includes an mqtt cloud server and multiple vehicle terminals. The vehicle terminals and the mqtt cloud server communicate with each other through the mqtt protocol. Each vehicle terminal is a P2P network node, and the vehicle terminals communicate with each other through the ftp protocol.

3. The multi-threaded vehicle OTA high-speed download method according to claim 1 is characterized in that: Methods for splitting an OTA upgrade package into multiple data blocks include: In the upgrade task on the cloud, the upgrade file corresponding to each component ECU is named in the following manner: Identification + Component Did + Component Software Part Number. When the file is divided into blocks, it is divided according to the specified size. The files after the downloaded files are divided into blocks are named in the following manner: Identification + Did + Component Software Part Number + Starting Offset Address + Ending Offset Address.

4. The multi-threaded vehicle OTA high-speed download method according to claim 2 is characterized in that: In combination with a P2P network, methods for downloading multiple data blocks in parallel through multiple threads include: When downloading, the vehicle terminal first starts an OTA cloud server download thread, called the main download thread, and starts downloading from the first block in the order of file blocks. After completing each file block, the file block information is published to the mqtt cloud server for other vehicle terminals to download. Then it checks whether the second block has been downloaded. If not, it forcibly terminates other threads downloading the file block, and the main download thread takes over and continues to download the file block from the OTA cloud server. If the download is complete, skip this file block and detect the next file block. According to this mechanism, the download and detection of all blocks are completed in sequence.

5. The multi-threaded vehicle OTA high-speed download method according to claim 4 is characterized in that: In combination with the P2P network, the method of downloading multiple data blocks in parallel through multiple threads also includes: After the file starts downloading, the vehicle terminal scans and subscribes to messages from the MQTT cloud server for the file blocks that have not been downloaded. If a message published by other vehicle terminals is received, a new download thread is started to download the file blocks published by the vehicle terminal through the FTP protocol. When the total number of download threads exceeds the maximum value, no new download threads will be added. Instead, the system will wait until other download threads have completed downloading before allowing the creation of new download threads.

6. The multi-threaded vehicle OTA high-speed download method according to claim 4 is characterized in that: In combination with the P2P network, the method of downloading multiple data blocks in parallel through multiple threads also includes: When downloading files, the vehicle terminal records the download progress of each file block for the downloaded files, and generates a download progress file for each downloaded file; When the file resumes downloading after an interruption, the download progress file is read and checked from the first file block in sequence until a file block is found to have a problem. The main download thread is started to continue downloading the corresponding file block from the OTA cloud server, and the file block is continued to be downloaded from the last offset. For other blocks that have not been downloaded, the file is subscribed to the mqtt cloud server. If a corresponding message is received from other vehicle terminals, a new thread is started to continue downloading the file block from the last offset of the file block provided by other vehicle terminals.

7. The multi-threaded vehicle OTA high-speed download method according to claim 4 is characterized in that: In combination with the P2P network, the method of downloading multiple data blocks in parallel through multiple threads also includes: When all file blocks are downloaded, the downloaded file blocks are first verified by MD5. If the verification fails, they are marked uniformly. After all problematic file blocks are marked, the multi-process download mechanism is restarted. The main download thread downloads the marked file blocks in sequence, and other threads subscribe to download the remaining marked file blocks.

8. The multi-threaded vehicle OTA high-speed download method according to claim 7, characterized in that: In combination with the P2P network, the method of downloading multiple data blocks in parallel through multiple threads also includes: After all file blocks have been verified, the files are combined in order. After combination, the final file verification is performed to compare the MD5 code of the total file with the original MD5 code on the platform. If the verification fails, the download process is retried a specified number of times. If the verification fails after the specified number of download attempts, the upgrade is stopped and the download failure is reported to the platform.

9. A vehicle OTA high-speed download device, characterized in that: include: A data segmentation module is used to segment the OTA upgrade package into multiple data blocks and store them in the OTA cloud server; The multi-threaded parallel download module is used to combine with the P2P network to download multiple data blocks in parallel through multiple threads. One process is always connected to the OTA cloud server, and the other processes are connected to the P2P network nodes. The process connected to the OTA cloud server has the highest priority.

10. A computer-readable storage medium having executable instructions stored thereon, characterized in that: When the instruction is executed by the processor, the processor implements the OTA high-speed download method described in any one of claims 1 to 8.

Citation Information

Patent Citations

  • OTA upgrading method and device of vehicle-mounted terminal and storage medium

    CN115665703A

  • P2P-based firmware upgrading method and system, electronic equipment and storage medium

    CN115705197A

  • Communication method, program product and communication device for vehicle-mounted software upgrading

    CN118018404A

  • Method and apparatus for processing upgrade package of vehicle

    US20220276855A1

  • Method, device, and system for playing and checking streaming media file

    WO2017035786A1