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

By dividing the OTA upgrade package into multiple data blocks and combining it with P2P networks and multi-threaded downloading, the problem of slow OTA download speed for the whole vehicle was solved, achieving high-speed download and stable upgrades, thus improving the user experience.

CN119324918BActive Publication Date: 2025-11-04DONGFENG MOTOR GRP
View PDF 2 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

The limited download speed of OTA for the whole vehicle results in a long upgrade process and a poor user experience. Existing DHT and P2P technologies face challenges in terms of network latency and security.

Method used

The OTA upgrade package is divided into multiple data blocks. Combining P2P network and multi-threaded download, the main download thread collaborates with P2P nodes for download. MQTT and FTP protocols are used for communication and file sharing. A mechanism for resuming interrupted downloads is implemented to ensure download stability.

Benefits of technology

Significantly improves download speed, shortens upgrade time, reduces the burden on the central server, enhances system scalability and download stability, and ensures download accuracy and efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119324918B_ABST
    Figure CN119324918B_ABST
Patent Text Reader

Abstract

The application relates to a multi-thread vehicle OTA high-speed downloading method and device, which comprises the following steps: dividing an OTA upgrade package into multiple data blocks and storing the data blocks in an OTA cloud server; combining a P2P network to download the multiple data blocks in parallel through multiple threads, wherein one process is always connected to the OTA cloud server, other processes are connected to P2P network nodes, and the process connected to the OTA cloud server has the highest priority. The application significantly improves the downloading speed of the vehicle OTA, shortens the upgrade time, reduces the burden of the center server through the P2P technology, improves the scalability of the system, and enhances the stability and reliability of the downloading through the breakpoint resume mechanism.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application relates to the technical field of data processing, in particular to a multi-thread vehicle OTA high-speed downloading method and device. BACKGROUND

[0002] At present, the vehicle OTA technology is widely used in vehicle remote upgrading. However, due to the limitation of network bandwidth and the wide distribution of vehicles, the OTA downloading speed is often limited, resulting in a long upgrading process and poor user experience. The existing technologies include distributed hash table (DHT) technology and P2P technology. Among them, the 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 mechanism of the DHT network is complex and is easily affected by network delay and node failure; the P2P technology improves the efficiency and scalability of the network through a decentralized architecture, allowing nodes to directly communicate and transmit data. The security and stability of the P2P network is a challenge, especially under the high reliability requirement of automobile OTA. SUMMARY

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

[0004] The technical scheme adopted by the application to solve the technical problem is: a multi-thread vehicle OTA high-speed downloading method is constructed,

[0005] The OTA upgrade package is divided into multiple data blocks and stored in an OTA cloud server.

[0006] In combination with the P2P network, multiple threads are used to download multiple data blocks in parallel. 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.

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

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

[0009] The upgrade file corresponding to each part ECU in the upgrade task of the cloud is named in the manner of: identification + part Did + part software part number. When the file is divided into blocks, the file is divided according to the specified size, and the file after the block is downloaded is named in the manner of: identification + Did + part software part number + start offset address + end offset address.

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

[0011] When downloading, the vehicle terminal first starts an OTA cloud server download thread, referred to as a main download thread, and downloads from the first block according to the block order. After completing each file block, the file block information is published to the mqtt cloud server for downloading by other vehicle terminals. Then, it is detected whether the second block has been downloaded. If not, the thread downloading the file block is forcibly terminated, and the main download thread takes over to continue downloading the file block from the OTA cloud server. If the file block has been downloaded, the next file block is detected, and the downloading and detection of all blocks are completed in this manner.

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

[0013] After the file is downloaded, the vehicle terminal scans and subscribes to the mqtt cloud server for the file blocks that have not been downloaded. If a message published by another vehicle terminal is received, a new download thread is started to download the file block published by the vehicle terminal via the ftp protocol. When the total number of download threads exceeds the maximum value, no new download thread is created, and a new download thread is created after the completion of the download of another download thread.

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

[0015] When the file is downloaded, 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.

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

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

[0018] When all the file blocks are downloaded, the downloaded file blocks are first subjected to md5 checking, if the checking fails, all the problematic file blocks are marked, and after all the problematic file blocks are marked, the multi-process downloading mechanism is restarted, and the main downloading thread downloads the marked file blocks in sequence, and other threads download the remaining marked file blocks in subscription.

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

[0020] After all the file blocks are checked, the file is combined in sequence, and after the combination, the final file checking is performed, the md5 code of the total file is compared with the original md5 code on the platform, if the checking fails, the downloading process is retried for a specified number of times, and if the checking still fails after the specified number of times of downloading, the upgrading is stopped, and the platform downloading failure is reported.

[0021] The application also provides a whole vehicle OTA high-speed downloading device, comprising:

[0022] A data segmentation module is configured to segment an OTA upgrade package into multiple data blocks and store the data blocks in an OTA cloud server.

[0023] A multi-thread parallel downloading module is configured to download the multiple data blocks in parallel through multiple threads in combination with a P2P network, wherein one process is always connected to the OTA cloud server, other processes are connected to P2P network nodes, and the process connected to the OTA cloud server has the highest priority.

[0024] The application also provides a computer readable storage medium having executable instructions stored thereon, the instructions being executed by a processor to enable the processor to implement the multi-thread whole vehicle OTA high-speed downloading method.

[0025] The multi-thread whole vehicle OTA high-speed downloading method and device have the following beneficial effects:

[0026] 1. The multi-thread downloading mechanism of the application segments an OTA upgrade package into multiple data blocks, downloads the data blocks in parallel through multiple threads in combination with a P2P network, completes the downloading of other data blocks through other P2P nodes under the condition of guaranteeing the total downloading speed, thereby saving the downloading time, significantly improving the downloading speed of the whole vehicle OTA, and shortening the upgrading time.

[0027] 2. The P2P network constructed by the application utilizes the mqtt protocol to complete the communication and utilizes the ftp to provide the file service, and the P2P network can realize the resource sharing and data exchange between nodes, thereby reducing the burden of the center server and improving the scalability of the system.

[0028] 3、The node discovery mechanism provided by the application can realize the rapid discovery and network joining of new nodes by publishing and subscribing messages to the specific topic of the center server through the mqtt protocol;

[0029] 4、The data exchange protocol formulated by the application 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 formulated by the application records the download progress of each file block, supports rapid recovery after interruption, and enhances the stability and reliability of the download, which can avoid repeated download. BRIEF DESCRIPTION OF DRAWINGS

[0031] The application will be further described below in combination with the drawings and examples, and the drawings are as follows:

[0032] Figure 1 is a flow chart of the multi-thread whole vehicle OTA high-speed download method of the application;

[0033] Figure 2 is a system network topology diagram of the multi-thread whole vehicle OTA high-speed download method of the application;

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

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

[0036] In order to have a clearer understanding of the technical features, purposes and effects of the application, the specific embodiments of the application will be described in detail with reference to the drawings.

[0037] Example 1

[0038] As shown in Figures 1-3 The multi-thread whole vehicle OTA high-speed download method of the application includes:

[0039] S1, the OTA upgrade package is divided into a plurality of data blocks and stored in the OTA cloud server.

[0040] The method of dividing the OTA upgrade package into a plurality of data blocks includes:

[0041] The upgrade file corresponding to each part ECU in the upgrade task of the cloud is named in the manner of: identification + part Did + part software part number, and when the file is divided, it is divided according to the specified size, and the file after the block is named in the manner of: identification + Did + part software part number + starting offset address + ending offset address.

[0042] S2, in combination with the P2P network, a plurality of data blocks are downloaded in parallel through multiple threads, wherein one process is always connected to the OTA cloud server, and other processes are connected to P2P network nodes, and the process connected to the OTA cloud server has the highest priority.

[0043] The P2P network includes an mqtt cloud server and a plurality of vehicle terminals, the vehicle terminals and the mqtt cloud server complete communication through mqtt protocol, each vehicle terminal is a P2P network node, and the vehicle terminals complete communication through ftp protocol.

[0044] Each vehicle terminal is connected to the OTA cloud through http, and is used for querying upgrade tasks. The mqtt cloud server has a connection relationship with each vehicle terminal and the OTA cloud server, and is used for information communication. Each vehicle terminal itself is an ftp service provider, and can realize file sharing through ftp.

[0045] The mqttt protocol is mainly used for sharing file information to other vehicle terminals after a vehicle terminal downloads a file block, and specific definition details are shown in Table 1:

[0046] Table 1 Definition of Mqttt Communication Protocol

[0047] topic ota / taskid / identification+did+part software part number message body format json Parameter 1 ftpHost: IP address of the car machine Parameter 2 ftpPort: FTP service port of the car machine Parameter 3 ftpUserName: FTP service user name of the car machine Parameter 4 ftpUserPassword: FTP service user password of the car machine Parameter 5 fileStartOffset: File block start offset address (bytes) Parameter 6 fileBlockLenth: File block length (bytes) Parameter 7 fileBlockMd5: File block MD5 code (used for file block integrity check)

[0048] Suppose that the vehicle terminal 2 completes the download of the third file block of the file src_0X770_Z800022560.zip in task 0001: the vehicle terminal 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] The car machine 1 subscribes to the topic: ota / 0001 / src_0X770_Z800022560 of the mqtt server, and when receiving the download completion message sent by the car machine 2, the car machine 1 connects to the car machine 2 through the ftp information to download the file block 3.

[0059] Step S2 further comprises the following steps:

[0060] S201, when downloading, the car machine terminal starts an OTA cloud server download thread, called the main download thread, and downloads from the first block according to the file block order. After completing a file block, the car machine terminal publishes the file block information to the mqtt cloud server for other car machine terminals to download. Then, the car machine terminal detects whether the second block has been downloaded. If not, the car machine terminal forcibly terminates other threads downloading the file block, takes over the file block by the main download thread, and continues to download the file block from the OTA cloud server. If the file block has been downloaded, the car machine terminal skips the file block and detects the next file block. The car machine terminal completes the download and detection of all blocks in this way.

[0061] S202, after starting to download the file, the car machine terminal scans and subscribes to the mqtt cloud server for the file blocks that have not been downloaded. If the car machine terminal receives the message published by other car machine terminals, the car machine terminal starts a new download thread to download the file block published by the car machine terminal through the ftp protocol. When the total number of download threads exceeds the maximum value, the car machine terminal does not create a new download thread, but waits for the other download threads to complete the download, and then allows the creation of a new download thread.

[0062] S203, when downloading the file, the car machine 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 resuming the download of the file after interruption, the car machine terminal reads the download progress file, checks from the first file block to the back, and starts the main download thread to continue downloading the corresponding file block from the OTA cloud server when there is a problem in the check of a file block. The car machine terminal continues to download the file block from the last offset. For other blocks that have not been downloaded, the car machine terminal subscribes to the mqtt cloud server for the file, and if the car machine terminal receives the message corresponding to the other car machine terminal, the car machine terminal starts a new thread to continue downloading the file block from the last offset of the file block provided by the other car machine terminal.

[0064] For example, Figure 4As shown, when downloading a file, the local device records the download progress of each file block for the downloaded file. For each downloaded file, a file similar to src_0X760_Z700112560.prograss is generated, referred to as a download progress file, which records the total file size and the downloaded data size of each file block in a json format. When the file is downloaded next time, the download progress file is read, and the first file block is checked in sequence until a file block is found to have a problem and is not downloaded completely. Then, the main download thread is started to continue downloading the corresponding file block from the OTA web end, and the file block is continued to be downloaded from the last offset, i.e., the offset address of the file block + the downloaded bytes. For other blocks that are not downloaded completely, the file is subscribed to the mqtt server. If a message corresponding to the file is received from other car machines, a new thread is started to continue downloading the file block from the last offset, i.e., the offset address of the file block + the downloaded bytes.

[0065] S204, when all the file blocks are downloaded completely, the downloaded file blocks are first subjected to md5 checking. If the checking fails, all the problematic file blocks are marked. After all the problematic file blocks are marked, the multi-process download mechanism is restarted to download the marked file blocks in multiple processes. The main download thread downloads the marked file blocks in sequence, and other threads download the remaining marked file blocks.

[0066] S205, after all the file blocks are checked, the file is combined in sequence. After the combination, the final file checking is performed to compare the md5 code of the total file with the original md5 code on the platform. If the checking fails, the download process is retried three times. If the checking fails after three times, the upgrade is stopped, and the platform download failure is reported.

[0067] Embodiment two

[0068] The application further provides a multi-thread whole-vehicle OTA high-speed download method device, comprising:

[0069] A data segmentation module is configured to segment an OTA upgrade package into multiple data blocks and store the data blocks in an OTA cloud server.

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

[0071] Embodiment three

[0072] The application further provides an automobile comprising the multi-thread whole-vehicle OTA high-speed download method device.

[0073] Embodiment four

[0074] The application further 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; the memory stores a computer program, and when the program is executed by the processor, the processor executes the steps of the multi-threaded whole vehicle OTA high-speed downloading method.

[0075] Embodiment five

[0076] The application further provides a computer readable storage medium, which stores executable instructions, and the instructions make the processor implement the multi-threaded whole vehicle OTA high-speed downloading method when executed by the processor.

[0077] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system or a computer program product. Therefore, the present application can take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Moreover, the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage etc.) containing computer-usable program code.

[0078] The present application is described with reference to the flowcharts and / or block diagrams according to the embodiments of the present application. It should be understood that each flow and / or block in the flowcharts and / or block diagrams, and the combination of the flows and / or blocks in the flowcharts and / or block diagrams can be implemented by computer program instructions. These computer program instructions can be provided to a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing devices to produce a machine, so that the instructions executed by the computer or other programmable data processing devices produce a device implemented in the flowcharts and / or block diagrams. Figure 1 The function specified in one flow or multiple flows and / or blocks Figure 1 The device that implements the function specified in one block or multiple blocks.

[0079] These computer program instructions can also be stored in a computer readable memory to guide the computer or other programmable data processing devices to work in a specific way, so that the instructions stored in the computer readable memory produce a product including instruction devices, which implement the flowcharts and / or block diagrams. Figure 1 The function specified in one flow or multiple flows and / or blocks Figure 1 The device that implements the function specified in one block or multiple blocks.

[0080] These computer program instructions can also be loaded into a computer or other programmable data processing devices, so that a series of operational steps are generated to realize the computer-implemented processes, and the instructions executed on the computer or other programmable devices provide a process for implementing the functions specified in the flowchart Figure 1 one flow or multiple flows and / or the functions specified in the block Figure 1 one flow or multiple flows and / or the functions specified in the block

[0081] The embodiments of the present application are described above with reference to the accompanying drawings, but the present application is not limited to the specific embodiments described above, and the specific embodiments described above are merely illustrative, but not restrictive, and those of ordinary skill in the art can make many forms under the inspiration of the present application without departing from the purpose of the present application and the scope protected by the claims, which are all within the protection of the present application.

Claims

1. A multi-threaded vehicle OTA high-speed download method, characterized in that, the OTA upgrade package is divided into multiple data blocks and stored 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 node, and the process connected to the OTA cloud server has the highest priority; the P2P network includes an mqtt cloud server and multiple vehicle terminal ends, communication between the vehicle terminal end and the mqtt cloud server is completed through the mqtt protocol, each vehicle terminal end is a P2P network node, and communication between the vehicle terminal ends is completed through the ftp protocol; the method of downloading multiple data blocks in parallel through multiple threads combined with the P2P network includes: when downloading, the vehicle terminal end starts an OTA cloud server download thread, called the main download thread, and downloads from the first block according to the file block order, after completing the download of each file block, the file block information is published to the mqtt cloud server for other vehicle terminal ends to download, then it is detected whether the second block has been downloaded, if not, the thread downloading the file block is forcibly terminated, and the main download thread takes over and continues to download the file block from the OTA cloud server, if it has been downloaded, the next file block is detected, and the download and detection of all blocks are completed in this way. The method of downloading multiple data blocks in parallel through multiple threads combined with the P2P network further includes: after the file starts to be downloaded, the vehicle terminal end scans and subscribes to the mqtt cloud server for the file blocks that have not been downloaded, if a message published by other vehicle terminal ends is received, a new download thread is started to download the file block published by the vehicle terminal through the ftp protocol, and when the total number of download threads exceeds the maximum value, no new download thread is created, but a new download thread is allowed to be created after the download of other download threads is completed.

2. The multi-threaded vehicle-wide OTA high-speed download method of claim 1, wherein, The method of dividing the OTA upgrade package into multiple data blocks includes: the upgrade files corresponding to each part ECU in the cloud upgrade task are named in the manner of: identification + part Did + part software part number, when the files are divided, they are divided according to the specified size, and after the to-be-downloaded files are divided, the files are named in the manner of: identification + Did + part software part number + starting offset address + ending offset address.

3. The multi-threaded vehicle-wide OTA high-speed download method of claim 1, wherein, The method of downloading multiple data blocks in parallel through multiple threads combined with the P2P network further includes: when downloading the file, the vehicle terminal end records the download progress of each file block of the downloaded file, and generates a download progress file for each downloaded file. When the file is resumed after interruption, the download progress file is read, and the first file block is checked in sequence until there is a problem in the check of a certain file block, the main download thread is started to continue downloading the corresponding file block from the OTA cloud server from the last offset, and the file block is downloaded; for other blocks that have not been downloaded, the file is subscribed to the mqtt cloud server, and if a message corresponding to the other car terminal is received, a new thread is started to continue downloading the file block from the last offset of the file block provided by the other car terminal.

4. The multi-threaded vehicle-wide OTA high-speed download method of claim 1, wherein, The method of downloading multiple data blocks in parallel through multiple threads in combination with a P2P network further includes: After all the file blocks are downloaded, the downloaded file blocks are first subjected to md5 verification, if the verification fails, they are uniformly marked, and after all the problematic file blocks are marked, the multi-process download mechanism is restarted, and the marked file blocks are downloaded in sequence by the main download thread, and the remaining marked file blocks are downloaded by subscription by other threads.

5. The multi-threaded vehicle-wide OTA high-speed download method of claim 4, wherein, The method of downloading multiple data blocks in parallel through multiple threads in combination with a P2P network further includes: After all the file blocks are verified, the file is combined in sequence, and after the combination, the final file verification is performed, and the md5 code of the total file is compared with the original md5 code on the platform; if the verification fails, the download process is retried for a specified number of times, and if the verification fails after the specified number of attempts, the upgrade is stopped, and the platform download failure is reported.

6. A vehicle whole OTA high-speed downloading device, characterized in that, It includes: A data segmentation module for segmenting an OTA upgrade package into multiple data blocks and storing them in an OTA cloud server; A multi-thread parallel download module for downloading multiple data blocks in parallel through multiple threads in combination with a P2P network, wherein one process is always connected to the OTA cloud server, and other processes are connected to P2P network nodes, and the process connected to the OTA cloud server has the highest priority; The P2P network includes an mqtt cloud server and multiple car terminals, the car terminals and the mqtt cloud server communicate through the mqtt protocol, each car terminal is a P2P network node, and the car terminals communicate through the ftp protocol; The method of downloading multiple data blocks in parallel through multiple threads in combination with a P2P network includes: When downloading, the car terminal first starts an OTA cloud server download thread, called the main download thread, and downloads from the first block in sequence, after completing the download of each file block, publishes the file block information to the mqtt cloud server for other car terminals to download, then detects whether the second block has been downloaded, if not, forcibly terminates other threads downloading the file block, and the main download thread continues to download the file block from the OTA cloud server, if it has been downloaded, skips this file block and detects the next file block, and the mechanism is repeated to complete the download and detection of all blocks. The method of downloading multiple data blocks in parallel through multiple threads in combination with a P2P network further includes: After the file starts to be downloaded, the vehicle terminal scans and subscribes to the MQTT cloud server for the file blocks that have not been downloaded, and if a message published by another vehicle terminal is received, a new download thread is started to download the file block published by the vehicle terminal through the FTP protocol.

7. A computer-readable storage medium having stored thereon executable instructions that cause a processor-based system to perform steps comprising: The instruction, when executed by the processor, causes the processor to implement the OTA high-speed download method of any one of claims 1-5. The instruction, when executed by the processor, causes the processor to implement the OTA high-speed download method of any one of claims 1-5.

Citation Information

Patent Citations

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

    CN115665703A

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

    WO2017035786A1