Electronic control unit flashing method and device, equipment, storage medium and product

By adopting multi-threading technology and queue management in the automotive diagnostic system, the download and write process are separated, and the main thread and child thread are coordinated to synchronize, the problem of inefficient flashing of traditional ECUs is solved, and the efficiency of the whole vehicle is improved and the user's Experience.

CN119201168APending Publication Date: 2024-12-27LAUNCH TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411244811.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-05
Publication Date
2024-12-27

AI Technical Summary

Technical Problem

Traditional automotive ECU flashing methods are inefficient, resulting in a long brushing process and unfriendly user experience, especially when there are too many or too large ECU files.

Method used

Using multi-threading technology, we create the ECU flashing main thread and the flashing file download sub-thread, which is coordinated and synchronized by the main thread and the child thread, separate the download and flashing processes, and optimize resource allocation using queue management to realize parallel processing.

Benefits of technology

It significantly improves the efficiency and user experience of the entire vehicle's brushing, reduces waiting time, and ensures the accuracy and reliability of the brushing process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119201168A_ABST
    Figure CN119201168A_ABST
Patent Text Reader

Abstract

The invention discloses an electronic control unit (ECU) flashing method and device, equipment, a storage medium and a product, and relates to the technical field of automobile diagnos.The method comprises the steps that an ECU flashing main thread and a flashing file downloading sub-thread are created; in response to an ECU file flashing instruction, downloading an ECU flashing file through the flashing file downloading sub-thread; according to the method and the device, the ECU flashing is carried out according to the ECU flashing file through the ECU flashing main thread, file downloading is carried out through the flashing file sub-thread, file writing is carried out through the ECU flashing main thread, the main thread and the sub-thread are synchronously carried out in a coordinated mode, and the whole vehicle flashing efficiency and the user experience are greatly improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of automobile diagnostic technology, and in particular to an electronic control unit flashing method, device, equipment, storage medium and product. Background Art

[0002] ECU flashing is a very important function in vehicle diagnosis. OEMs can solve many problems by flashing and upgrading ECUs. With the continuous development of automotive electronics, the number of ECUs installed in vehicles is increasing and becoming more and more complex. The corresponding flashing files are also getting larger and larger. Small ECU flashing files are several M in size, and large flashing files can reach several G in size.

[0003] The traditional whole vehicle flashing is to read all the ECU software and hardware version information of the whole vehicle in sequence and upload it to the cloud. The cloud will send the flashing file information of each ECU (software and hardware version number, download address URL, etc.). At this time, the diagnostic software has two flashing methods. First, download the flashing file in sequence, and after the flashing files of all ECUs are downloaded, each ECU is upgraded one by one; second, download the flashing file of the first ECU in sequence, and then flash the first ECU. After the flashing is completed, download the file of the second ECU, flash the second ECU, and so on, until the flashing of the whole vehicle ECU is completed.

[0004] Therefore, the traditional vehicle flashing has very obvious disadvantages. When the ECU flashing files are too many and too large, the two processes of downloading the flashing files and flashing the ECU are not properly planned. When flashing, you need to wait until the flashing files are downloaded before executing. As a result, the entire flashing process is very long, the efficiency is very low, and the user experience is not friendly.

[0005] The above contents are only used to assist in understanding the technical solution of the present application and do not constitute an admission that the above contents are prior art. Summary of the invention

[0006] The main purpose of this application is to provide an electronic control unit flashing method, device, equipment, storage medium and computer program product, aiming to improve the efficiency of downloading and flashing automotive ECU flashing files.

[0007] To achieve the above objectives, the present application proposes a method for flashing an electronic control unit, the method comprising:

[0008] Create the main thread for flashing the electronic control unit ECU and the sub-thread for downloading the flashing file;

[0009] In response to the ECU file flashing instruction, downloading the ECU flashing file through the flashing file downloading subthread;

[0010] The ECU is flashed according to the ECU flash file through the ECU flash main thread.

[0011] In one embodiment, the ECU flashing main thread includes a main thread download queue, and the step of downloading the ECU flashing file through the flashing file downloading sub-thread in response to the ECU file flashing instruction includes:

[0012] In response to the ECU file flashing instruction, obtain the vehicle ECU software and hardware version information;

[0013] Upload the vehicle ECU software and hardware version information to the cloud, and receive the ECU flash file information sent by the cloud;

[0014] According to the ECU flash file information, download the ECU flash file to the main thread download queue;

[0015] The ECU flashing file in the main thread download queue is downloaded through the flashing file downloading subthread.

[0016] In one embodiment, the ECU flash file information includes vehicle ECU software and hardware version information, ECU flash file data volume and ECU flash file download address, and the step of downloading the ECU flash file to the main thread download queue according to the ECU flash file information includes:

[0017] Generate an ECU flash file download sequence table according to the data volume of the ECU flash file;

[0018] Generate corresponding ECU flash file node information according to the vehicle ECU software and hardware version information and the ECU flash file download address;

[0019] According to the ECU flash file download sequence table, the corresponding ECU flash file is associated with the ECU flash file node information and then pushed into the main thread download queue.

[0020] In one embodiment, the step of downloading the ECU flash file in the main thread download queue through the flash file download sub-thread includes:

[0021] Read the ECU flash file node information in the main thread download queue;

[0022] According to the ECU flash file download address in the ECU flash file node information, download the corresponding ECU flash file through the flash file download subthread;

[0023] After the ECU flash file is downloaded, a flash file download signal corresponding to the ECU flash file is generated;

[0024] Delete the ECU flash file node information associated with the ECU flash file in the main thread download queue.

[0025] In one embodiment, the ECU flashing main thread further includes a main thread flashing queue, and the step of flashing the ECU according to the ECU flashing file through the ECU flashing main thread includes:

[0026] In response to the flash file download signal, obtaining the corresponding ECU flash file in the flash file download sub-thread;

[0027] Pushing the ECU flashing file into the main thread flashing queue;

[0028] The ECU is flashed according to the ECU flashing file in the main thread flashing queue.

[0029] In one embodiment, the step of flashing the ECU according to the ECU flashing file in the main thread flashing queue includes:

[0030] Obtain the ECU node information corresponding to the ECU flash file in the main thread writing queue;

[0031] Flashing the ECU node corresponding to the ECU node information through the ECU flashing file;

[0032] After the ECU flash file is flashed, the corresponding ECU node information in the main thread flash queue is deleted;

[0033] When the main thread download queue and the main thread flash queue are both empty, the flash process is stopped.

[0034] In addition, to achieve the above-mentioned purpose, the present application also proposes an electronic control unit flashing device, the electronic control unit flashing device comprising:

[0035] Create a module for creating an electronic control unit ECU flashing main thread and a flashing file downloading sub-thread;

[0036] A download module, configured to respond to an ECU file flashing instruction and download the ECU flashing file through the flashing file downloading subthread;

[0037] The flashing module is used to flash the ECU according to the ECU flashing file through the ECU flashing main thread.

[0038] In addition, to achieve the above-mentioned purpose, the present application also proposes an electronic control unit flashing device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, and the computer program is configured to implement the steps of the electronic control unit flashing method as described above.

[0039] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by the processor, the steps of the electronic control unit flashing method described above are implemented.

[0040] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the steps of the electronic control unit flashing method described above are implemented.

[0041] One or more technical solutions proposed in the present application create an electronic control unit ECU flashing main thread and a flashing file downloading sub-thread; in response to an ECU file flashing instruction, download the ECU flashing file through the flashing file downloading sub-thread; through the ECU flashing main thread, flash the ECU according to the ECU flashing file, the flashing file sub-thread downloads the file through the above-mentioned solution, and the ECU flashing main thread writes the file, and the main thread and the sub-thread coordinate and proceed synchronously, which greatly improves the efficiency of the whole vehicle flashing and the user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0043] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0044] Figure 1 A flowchart of the first embodiment of the electronic control unit flashing method of the present application is provided;

[0045] Figure 2 A flow chart of the second embodiment of the electronic control unit flashing method of the present application;

[0046] Figure 3 This is a schematic diagram of the specific contents of the ECU flash file information in the electronic control unit flash method of this application;

[0047] Figure 4 This is an example diagram of nodes saved in two queues of the main thread of the electronic control unit flashing method of this application;

[0048] Figure 5 This is a schematic diagram of the queue status when the ECU flashing process of the electronic control unit flashing method of this application starts;

[0049] Figure 6 This is a schematic diagram of the queue status when the download of the electronic control unit flashing method of this application is completed but the flashing is not completed:

[0050] Figure 7 This is a schematic diagram of the queue status when the flashing method of the electronic control unit of this application is completed:

[0051] Figure 8 This is a schematic diagram of the module structure of the electronic control unit flashing device according to an embodiment of the present application;

[0052] Fig. 9 Schematic diagram of the device structure of the hardware operating environment involved in the electronic control unit flashing method in the embodiment of the present application.

[0053] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0054] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.

[0055] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.

[0056] The main solution of the embodiment of the present application is to propose a method for improving the efficiency of vehicle flashing based on multi-threading and dual-queue. This solution separates the two processes of downloading and flashing, and manages the task nodes of these two processes through queues to achieve parallel processing and optimize resource allocation. Specifically, the diagnostic software is the main thread, responsible for the flashing of the entire vehicle ECU, and maintains two queues internally: QueueDownload and QueueFlash. QueueDownload is used to store the node information of the ECU flashing file to be downloaded, while QueueFlash is used to store the node information of the ECU to be flashed. At the same time, a download thread ThreadDownload is set as a child thread, which is specifically responsible for downloading the flashing files of each ECU from the cloud.

[0057] During the whole vehicle flashing process, the software and hardware version information of the whole vehicle ECU is first uploaded to the cloud. The cloud sends the flashing file information of each ECU based on this information, including the software and hardware version number, file size, and download address URL. The diagnostic software sorts the ECU flashing files according to the size, and pushes the sorted node information into the QueueDownload queue in sequence. The download thread ThreadDownload extracts the node information from the QueueDownload queue and downloads the corresponding ECU flashing file according to the URL. Whenever the flashing file of an ECU is downloaded, the ThreadDownload thread sends a download completion signal to the diagnostic software and removes the node from the QueueDownload queue.

[0058] After receiving the download completion signal, the diagnostic software transfers the node information to the QueueFlash queue and prepares for flashing. When there is ECU node information to be flashed in the QueueFlash queue, the diagnostic software starts flashing the ECU. After the flashing is completed, the corresponding node information is deleted from the QueueFlash queue. This process continues until all node information in the two queues is cleared, marking the completion of the vehicle flashing work.

[0059] Through this solution, downloading and flashing operations can be performed in parallel, which optimizes the flashing process, reduces waiting time, improves the efficiency of flashing the entire vehicle, and also improves the user experience.

[0060] ECU flashing is a very important function in vehicle diagnosis. OEMs can solve many problems by flashing and upgrading ECUs. With the continuous development of automotive electronics, the number of ECUs installed in vehicles is increasing and becoming more and more complex. The corresponding flashing files are also getting larger and larger. Small ECU flashing files are several M in size, and large flashing files can reach several G in size.

[0061] Since the traditional whole vehicle flashing is to read all the ECU software and hardware version information of the whole vehicle in sequence and upload it to the cloud, the cloud will send the flashing file information of each ECU (software and hardware version number, download address URL, etc.). At this time, there are two flashing methods for the diagnostic software. First, download the flashing file in sequence, and after the flashing files of all ECUs are downloaded, each ECU is upgraded one by one; second, download the flashing file of the first ECU in sequence, and then flash the first ECU. After the flashing is completed, download the file of the second ECU, flash the second ECU, and so on, until the flashing of the whole vehicle ECU is completed.

[0062] Therefore, the traditional vehicle flashing has very obvious disadvantages. When the ECU flashing files are too many and too large, the two processes of downloading the flashing files and flashing the ECU are not properly planned. When flashing, you need to wait until the flashing files are downloaded before executing. As a result, the entire flashing process is very long, the efficiency is very low, and the user experience is not friendly.

[0063] The present application provides a solution, by creating an electronic control unit ECU flashing main thread and a flashing file downloading sub-thread; in response to an ECU file flashing instruction, downloading the ECU flashing file through the flashing file downloading sub-thread; flashing the ECU according to the ECU flashing file through the ECU flashing main thread, downloading the file through the flashing file sub-thread of the above scheme, and writing the file through the ECU flashing main thread, the main thread and the sub-thread coordinate and synchronize the operations, thereby greatly improving the efficiency of the whole vehicle flashing and the user experience.

[0064] It should be noted that the execution subject of this embodiment may be a computing service device with electronic control unit flashing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or an electronic device capable of realizing the above functions, an electronic control unit flashing system, etc. The following takes the electronic control unit flashing system as an example to illustrate this embodiment and the following embodiments.

[0065] Based on this, the embodiment of the present application provides a method for flashing an electronic control unit, referring to Figure 1 , Figure 1 This is a flow chart of the first embodiment of the electronic control unit flashing method of the present application.

[0066] In this embodiment, the electronic control unit flashing method includes steps S1000 to S3000:

[0067] Step S1000: creating an electronic control unit ECU flashing main thread and a flashing file downloading sub-thread;

[0068] It should be noted that in the process of creating the main thread for flashing the electronic control unit ECU and the sub-thread for downloading the flash file, the functions of the main thread and the sub-thread and the relationship between them need to be defined first. The main thread is the core executor responsible for the ECU flashing operation, while the sub-thread is specifically responsible for the downloading of the flash file. This division of labor and cooperation can significantly improve the efficiency of the flashing work. The communication between the main thread and the sub-thread is achieved through a specific signal or callback mechanism to ensure that the downloaded flash file can be passed to the main thread in time for flashing.

[0069] In addition, it should be noted that the creation of the main thread and the sub-thread is based on multi-threading technology. Multi-threading technology allows multiple tasks to be executed at the same time, thereby improving the parallel processing capability of the program. In this solution, through multi-threading technology, the download and flashing operations of the ECU flashing file can be performed simultaneously, which greatly reduces the flashing delay caused by waiting for the download to complete.

[0070] For example, in a specific implementation, the system can create a main thread and several sub-threads when initializing in the diagnostic software. The main thread is responsible for waiting for the signal that the sub-thread has completed downloading and executing the flashing task; and the sub-thread immediately starts downloading the specified ECU flashing file after receiving the flashing instruction. In this way, the two tasks of downloading the flashing file and flashing the ECU are placed in different threads. The diagnostic software is the main thread, responsible for flashing, and contains 2 queues: QueueDownload and QueueFlash. QueueDownload is used to store the node information of the ECU to download the flashing file, and QueueFlash is used to store the node information of the ECU to be flashed; the download thread ThreadDownload is a sub-thread responsible for downloading the ECU flashing file for the entire vehicle.

[0071] Step S2000: In response to the ECU file flashing instruction, downloading the ECU flashing file through the flashing file downloading subthread;

[0072] It should be noted that in the process of responding to the ECU file flashing instruction, the required ECU flashing file needs to be downloaded through the flashing file downloading sub-thread first. This step is the premise and basis of the flashing process. The downloading sub-thread starts to execute the download task according to the received instruction, which includes obtaining the software and hardware version information of the vehicle ECU, uploading this information to the cloud, and receiving the flashing file information sent by the cloud.

[0073] In addition, it should be noted that the acquisition of flash file information is a key link in the flash process. This information includes the software and hardware version information of the ECU, the data volume of the flash file, and the download address of the flash file. With this information, the system can more accurately locate the specific flash file required for each ECU, and effectively manage and schedule it according to the data volume and address information.

[0074] For example, in a specific implementation, when the diagnostic software receives the flash command of the vehicle ECU, the download sub-thread will be activated and start to execute the task. The sub-thread will first query the vehicle's ECU software and hardware version information, and then upload this information to the cloud server. The cloud server generates and sends the corresponding flash file information based on the uploaded information, and the download sub-thread then downloads the required ECU flash file based on this information.

[0075] In a feasible implementation manner, the ECU flash main thread includes a main thread download queue, and step S2000 may include steps S2100 to S2400:

[0076] Step S2100: Responding to the ECU file flashing instruction, obtaining the vehicle ECU software and hardware version information;

[0077] Step S2200: uploading the vehicle ECU software and hardware version information to the cloud, and receiving the ECU flash file information sent by the cloud;

[0078] It should be noted that the efficiency of the entire ECU flashing process lies in its parallel processing mechanism and precise task scheduling. First, when the ECU file flashing instruction is issued, the system responds to this instruction and obtains the software and hardware version information of all ECUs on the vehicle through the main thread in the diagnostic software. This information is the basis for accurate flashing and ensures the compatibility of the flashing file with the vehicle ECU.

[0079] In addition, it should be noted that the acquired ECU software and hardware version information is then uploaded to the cloud server. The role of the cloud is crucial in this process. The cloud analyzes the uploaded information and sends the corresponding ECU flash file information, including software and hardware version information, the data volume of the flash file, and the download address of the file. This information provides clear guidance for the subsequent flashing tasks.

[0080] Step S2300: downloading the ECU flash file to the main thread download queue according to the ECU flash file information;

[0081] Step S2400: Downloading the ECU flashing file in the main thread download queue through the flashing file downloading sub-thread.

[0082] It should be noted that the system generates an ECU flash file download sequence table based on the ECU flash file information sent from the cloud. This sequence table is sorted based on the data volume of the flash file, ensuring that small files can be downloaded first, thereby speeding up the overall flash progress. At the same time, the system will generate ECU flash file node information, and associate this information with the download sequence table and push it into the download queue of the main thread to provide download tasks for the download sub-thread.

[0083] In addition, it should be noted that the flash file download sub-thread downloads the ECU flash file one by one according to the node information in the main thread download queue. This download process is automated, and the sub-thread continuously reads tasks from the queue and completes the download work according to the download address of each task. After the file download is completed, the sub-thread generates the corresponding flash file download signal and deletes the node information of the downloaded file in the main thread's download queue to prepare for subsequent flash work.

[0084] Finally, it should be noted that when the main thread receives the flash file download signal, it will obtain the corresponding ECU flash file from the download sub-thread and push it into the flash queue of the main thread. Subsequently, the main thread flashes the ECUs in sequence according to the order of the files in the flash queue. Each time the flashing of an ECU is completed, the corresponding node information is deleted from the flash queue. When both the download queue and the flash queue are empty, this indicates that the flashing of the vehicle ECU has been completed, and the flashing process stops immediately.

[0085] For example, in a feasible implementation, the entire ECU flashing process can be carried out as follows: First, after receiving the flashing instruction, the diagnostic software initializes and starts the main thread and the download sub-thread. The main thread is responsible for communicating with the vehicle ECU, collecting software and hardware version information, and sending it to the cloud to obtain the flashing file information. After the cloud processes this information, it generates a download list and node information of the flashing file, which is pushed to the download queue of the main thread. The download sub-thread monitors the download queue, downloads the flashing file of each ECU in sequence, and generates a signal to notify the main thread after the download is complete. The main thread then adds the downloaded file to the flashing queue and executes the flashing task in sequence. After the flashing is completed, the corresponding node information is removed from the flashing queue until all ECUs are flashed and the process ends. This process not only improves the efficiency of flashing, but also optimizes the user experience and ensures the accuracy and reliability of the flashing process.

[0086] In a feasible implementation manner, the ECU flash file information includes vehicle ECU software and hardware version information, ECU flash file data volume and ECU flash file download address, and step S2300 may include steps S2310 to S2330:

[0087] Step S2310: generating an ECU flash file download sequence table according to the data volume of the ECU flash file;

[0088] Step S2320: Generate corresponding ECU flash file node information according to the vehicle ECU software and hardware version information and the ECU flash file download address;

[0089] Step S2330: According to the ECU flash file download sequence table, the corresponding ECU flash file is associated with the ECU flash file node information and then pushed into the main thread download queue.

[0090] It should be noted that in order to efficiently manage and schedule the downloading tasks of the ECU flashing files, in this embodiment, a download order table can be generated according to the data volume of the ECU flashing files. This strategy allows the system to download files with smaller data volumes first, thereby shortening the waiting time for starting the flashing operation. At the same time, the ECU flashing file node information is generated according to the vehicle's ECU hardware and software version information and the file download address, ensuring that each file can accurately correspond to the corresponding ECU unit.

[0091] In addition, it should be noted that the operation of associating the ECU flash file with the node information and pushing it into the main thread download queue is to achieve orderly execution and effective monitoring of tasks. This association ensures that the download sub-thread can quickly find and execute the download task, while enabling the main thread to track the download status of each file.

[0092] For example, in a feasible implementation, when an ECU file flash command is issued, the system first responds to the command and obtains the software and hardware version information of all ECUs on the vehicle. This information is then uploaded to the cloud, which generates and sends ECU flash file information based on this information. After receiving this information, the system starts to perform the following tasks:

[0093] The system generates a download order table based on the data volume of each ECU flash file. This table ensures that the files are sorted by size, thereby optimizing the download time.

[0094] Next, the system uses the software and hardware version information of the vehicle ECU and the download address of each file to generate the ECU flash file node information, which includes but is not limited to the file identifier, version information, download address and other key data.

[0095] Finally, the system associates each ECU flash file with the corresponding node information, and pushes it into the download queue of the main thread in the order in the download sequence table, providing a clear download task list for the download sub-thread.

[0096] Through this series of operations, the system not only ensures the effective management and scheduling of download tasks, but also lays the foundation for the subsequent ECU flashing work. When all ECU flashing files are downloaded and flashed, the system will stop the flashing process to ensure the smooth completion of the entire flashing work. This solution not only improves the efficiency of vehicle flashing, but also optimizes the user experience through precise task scheduling and orderly execution process.

[0097] Step S3000: flashing the ECU according to the ECU flashing file through the ECU flashing main thread.

[0098] It should be noted that the process of flashing the ECU through the ECU flashing main thread is the core of improving the flashing efficiency of the whole vehicle. This process involves receiving the flashing files completed by the download sub-thread and applying these files to the corresponding ECU. In this step, the main thread needs to have efficient task scheduling capabilities to ensure the smooth progress of the flashing operation.

[0099] In addition, it should be noted that the execution of the flash operation is managed by the main thread flash queue. When the download sub-thread completes the download of an ECU flash file and sends a download completion signal, the main thread will respond to this signal, obtain the corresponding flash file, and push it into the flash queue. Subsequently, the main thread will flash the ECU in sequence according to the order of the files in the flash queue.

[0100] For example, in a specific implementation, when the flash file of an ECU is downloaded, the download subthread will immediately notify the main thread, and the main thread will then add the file to the corresponding position of the flash queue. The main thread will then flash the ECUs one by one according to the order in the flash queue. After the flashing of each ECU node is completed, the main thread will remove the corresponding node information from the flash queue. When both the flash queue and the download queue are empty, this indicates that the flashing of the entire vehicle ECU has been completed, and the flashing process stops immediately.

[0101] This embodiment provides an electronic control unit flashing method, which creates an electronic control unit ECU flashing main thread and a flashing file downloading sub-thread; in response to an ECU file flashing instruction, downloads an ECU flashing file through the flashing file downloading sub-thread; flashes the ECU according to the ECU flashing file through the ECU flashing main thread, downloads the file through the flashing file sub-thread through the above scheme, and writes the file through the ECU flashing main thread, and the main thread and the sub-thread coordinate and synchronize, which greatly improves the efficiency of whole vehicle flashing and user experience.

[0102] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as those in the above-mentioned embodiment 1 can be referred to the above introduction, and will not be repeated in the following. Figure 2 The step S2400 of the electronic control unit flashing method further includes steps S2410 to S2440:

[0103] Step S2410: Reading the ECU flash file node information in the main thread download queue;

[0104] It should be noted that reading the ECU flash file node information in the main thread download queue is a prerequisite for the flash file download sub-thread to perform the download task. This step ensures that the sub-thread can accurately obtain the file information to be downloaded, including key data such as the file version, size, and download address, which is crucial for the subsequent download and flash process.

[0105] Step S2420: downloading the corresponding ECU flashing file through the flashing file downloading subthread according to the ECU flashing file download address in the ECU flashing file node information;

[0106] It should be noted that according to the download address in the ECU flash file node information, the flash file download subthread is responsible for the actual download operation. This step is the key to achieve fast and accurate download of ECU flash files. The subthread uses the provided URL address and an efficient network communication protocol to download the file from the server to the local system, preparing for the next flash operation.

[0107] Step S2430: after the ECU flash file is downloaded, generating a flash file download signal corresponding to the ECU flash file;

[0108] It should be noted that after the ECU flash file download is completed, generating the corresponding flash file download signal is an important feedback mechanism. This signal notifies the main thread that the download task has been completed and the next step can be performed. This mechanism ensures the synchronization between the main thread and the child thread, avoiding the flash delay caused by waiting for the unfinished download task.

[0109] Step S2440: deleting the ECU flash file node information associated with the ECU flash file in the main thread download queue.

[0110] It should be noted that deleting the node information associated with the ECU flash file in the main thread download queue is a necessary operation to maintain queue cleanliness and state management. Once the file download is completed and a signal is generated, the corresponding node information no longer needs to be retained in the download queue. This not only helps reduce queue redundancy, but also enables the system to track and manage remaining download tasks more clearly.

[0111] For example, in a specific implementation, the system first creates an ECU flash main thread and a flash file download sub-thread. When receiving an ECU file flash instruction, the main thread first responds and obtains the software and hardware version information of the vehicle ECU, and then uploads this information to the cloud to receive the flash file information. Based on this information, the system generates an ECU flash file download sequence table, creates corresponding node information, and pushes this node information into the main thread download queue in order.

[0112] Subsequently, the flash file download subthread starts working, reads the node information from the download queue, and downloads the ECU flash file according to the download address in the node. After the download is completed, the subthread generates a flash file download signal to notify the main thread that the download task has been completed. After receiving the signal, the main thread pushes the downloaded ECU flash file into the main thread flash queue, and deletes the corresponding node information from the download queue to prepare for subsequent flash operations. When all ECU flash files are downloaded and flashed, the system checks the two queues. If both are empty, the flash process is stopped and the entire ECU flash work is completed.

[0113] In a feasible implementation manner, the ECU flash main thread further includes a main thread flash queue, and step S3000 may include steps S3100 to S3300:

[0114] Step S3100: in response to the flash file download signal, obtaining the corresponding ECU flash file in the flash file download sub-thread;

[0115] Step S3200: pushing the ECU flash file into the main thread flash queue;

[0116] Step S3300: flashing the ECU according to the ECU flashing file in the main thread flashing queue.

[0117] It should be noted that the generation of the flash file download signal marks the completion of the download task and the start of the flash task in the system. This signal is sent to the main thread by the download subthread after successfully downloading the ECU flash file, which triggers the main thread to further process the flash file.

[0118] In addition, it should be noted that obtaining the ECU flash file is the primary task of the main thread after responding to the download signal. The main thread needs to accurately obtain the corresponding ECU flash file from the download sub-thread at this time, which is the basis for ensuring that the flash process can proceed smoothly. After obtaining the file, the main thread will execute the operation of pushing the file into the flash queue, which is to queue the files in order and wait for subsequent flash instructions.

[0119] Next, it should be noted that pushing the ECU flashing files into the main thread flashing queue is an organization and scheduling process. The flashing queue manages all ECU files to be flashed, ensuring that they can be flashed to the corresponding ECU units in a predetermined order.

[0120] Finally, it should be noted that when flashing the ECU according to the ECU flashing file in the main thread flashing queue, the main thread will flash the ECUs one by one according to the order of the files in the flashing queue. Each time the flashing of an ECU is completed, the corresponding node information will be removed from the flashing queue until all ECUs have completed the flashing. At this time, if the flashing queue and the download queue are both empty, the flashing process stops, marking the end of the vehicle ECU flashing work.

[0121] For example, in a feasible implementation, when the diagnostic software receives an instruction to flash the entire vehicle ECU, the main thread and the download sub-thread begin to work together. First, the main thread uploads the software and hardware version information of the vehicle ECU to the cloud, and receives the flash file information sent from the cloud. This information is used to generate a download sequence table and node information, and then is pressed into the download queue in order of file size. The download sub-thread monitors the download queue and starts the download task. After the ECU flash file is downloaded, the download sub-thread generates and sends a flash file download signal to the main thread. After receiving the signal, the main thread obtains the flash file from the download sub-thread and adds it to the flash queue. Subsequently, the main thread flashes the ECUs one by one in the order in the flash queue. Each time an ECU is flashed, the corresponding file node information is removed from the flash queue. When all ECUs are flashed and both queues are empty, the flash process stops and the entire flash work is completed. This process not only improves the efficiency of flashing, but also optimizes the user experience and ensures the accuracy and reliability of the flashing process.

[0122] In a feasible implementation manner, step S3300 may include steps S3310 to S3340:

[0123] Step S3310: Obtaining the ECU node information corresponding to the ECU flashing file in the main thread writing queue;

[0124] Step S3320: flashing the ECU node corresponding to the ECU node information through the ECU flashing file;

[0125] Step S3330: After the ECU flash file is flashed, the corresponding ECU node information in the main thread flash queue is deleted;

[0126] Step S3340: When both the main thread download queue and the main thread flash queue are empty, stop the flash process.

[0127] It should be noted that, in this embodiment, the main thread of the system can extract the ECU node information corresponding to the ECU flash file from the flash queue. This information includes key data such as the location, model, and version of the ECU, ensuring that the flash operation can be performed on the correct ECU unit.

[0128] In addition, it should be noted that flashing the ECU node is the core of the entire process. Using the acquired ECU node information, the main thread performs the flashing operation and transfers the downloaded flashing file to the corresponding ECU unit to update the firmware or software. The accuracy of this operation is directly related to the effectiveness of the flashing result and the safety performance of the vehicle.

[0129] In addition, it should be noted that after the ECU flash file is flashed, the main thread will delete the corresponding ECU node information in the flash queue. This step is to release resources and update the status of the flash queue to ensure that the system can accurately track the progress of the current flash task.

[0130] Finally, it should be noted that when both the main thread download queue and the main thread flash queue are empty, the system will stop the flash process. The satisfaction of this condition means that all ECU flash tasks have been completed and the flash process can be safely terminated, which also marks the successful completion of the vehicle ECU flash work.

[0131] For example, in a feasible implementation, the whole process can be carried out as follows: First, the diagnostic software downloads the required ECU flash file through the download sub-thread according to the received ECU file flash instruction, and stores the downloaded file information in the download queue of the main thread. After the download is completed, the download sub-thread generates a flash file download signal, the main thread receives the signal and extracts the corresponding ECU flash file from the download queue, and then pushes it into the flash queue. Next, the main thread obtains the ECU node information in sequence according to the order in the flash queue and performs the flash operation. Each time an ECU node is successfully flashed, the main thread deletes the corresponding node information from the flash queue. When all ECU nodes are flashed and the download queue and the flash queue become empty, the main thread determines that the flash process is over, and then stops the flash process to complete the entire ECU flash task. This process not only improves the efficiency of flashing, but also ensures the accuracy of the flash operation and the stability of the vehicle system.

[0132] The present embodiment provides an electronic control unit flashing method, which comprises reading the ECU flashing file node information in the main thread download queue; downloading the corresponding ECU flashing file through the flashing file download sub-thread according to the ECU flashing file download address in the ECU flashing file node information; generating a flashing file download signal corresponding to the ECU flashing file after the ECU flashing file download is completed; and deleting the ECU flashing file node information associated with the ECU flashing file in the main thread download queue, thereby improving the flashing efficiency and ensuring the accuracy of the flashing operation and the stability of the vehicle system.

[0133] For example, in order to help understand the implementation process of the electronic control unit flashing method obtained by combining this embodiment with the above-mentioned embodiment 1, please refer to Figure 3 - Figure 7 , Figure 3-Figure 7 This is a schematic diagram of the various steps in the specific implementation of the electronic control unit flashing method of this application, specifically:

[0134] Downloading the flash file and flashing the ECU are placed in different threads. The diagnostic software is the main thread, responsible for flashing, and contains two queues: QueueDownload and QueueFlash. QueueDownload is used to store the node information of the ECU to download the flash file, and QueueFlash is used to store the node information of the ECU to be flashed; the download thread ThreadDownload is a child thread, responsible for downloading the flash file of the whole vehicle ECU.

[0135] When performing vehicle flashing, upload the vehicle's ECU software and hardware version information to the cloud, and the cloud will send the flash file information of each ECU (refer to Figure 3 , Figure 3 This is a schematic diagram of the specific content of the ECU flash file information in the electronic control unit flash method of this application, including software and hardware version numbers, flash file size, download address URL, etc.).

[0136] Reference Figure 4 , Figure 4 This is an example diagram of nodes saved in two queues of the main thread of the electronic control unit flashing method of this application. The diagnostic software sorts the flashing files of each ECU from small to large and presses them into the download queue QueueDownload. In addition, refer to Figure 5 , Figure 5 This is a queue status diagram at the beginning of the ECU flashing process of the electronic control unit flashing method of this application. At this time, the diagnostic software starts the download thread ThreadDownload, extracts the node information from QueueDownload in sequence, and downloads the ECU flashing file according to the URL in the node information.

[0137] Reference Figure 6 , Figure 6This is a queue status diagram for the electronic control unit flashing method of this application when downloading is completed but flashing is not completed. Each time a flashing file for an ECU is downloaded, the download thread ThreadDownload will send a flashing file download signal for the node ECU to the diagnostic software, and delete the node in the queue QueueDownload. After receiving the signal, the diagnostic software pushes the node information into the flashing queue QueueFlash. When QueueFlash has ECU node information that needs to be flashed, the diagnostic software will flash the ECU. After the flashing is successful, the node information will be deleted from QueueFlash. Refer to Figure 7 , Figure 7 This is a schematic diagram of the queue status when the flashing method of the electronic control unit of this application is completed. When all the node elements in the two queues are empty, the flashing of the entire vehicle is completed.

[0138] Through the above process, the two processes of downloading and flashing can be separated, and with the help of the data structure characteristics of the queue, the order of downloading and flashing can be reasonably sorted. The flashing files are downloaded from small to large, and delivered to the main thread for flashing after downloading. During the flashing process, the download thread continues to download the subsequent flashing files, and the processes are coordinated and carried out synchronously, which greatly improves the efficiency of flashing the entire vehicle and the user experience.

[0139] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the electronic control unit flashing method of the present application. More simple transformations based on this technical concept are all within the scope of protection of the present application.

[0140] Please refer to Figure 8 The present application also provides an electronic control unit flashing device 80, the electronic control unit flashing device comprising:

[0141] A creation module 81 is used to create an electronic control unit ECU flashing main thread and a flashing file downloading sub-thread;

[0142] A download module 82, configured to respond to an ECU file flashing instruction and download the ECU flashing file through the flashing file downloading subthread;

[0143] The flashing module 83 is used to flash the ECU according to the ECU flashing file through the ECU flashing main thread.

[0144] The electronic control unit flashing device provided by the present application adopts the electronic control unit flashing method in the above embodiment, which can solve the technical problem of electronic control unit flashing. Compared with the prior art, the beneficial effects of the electronic control unit flashing device provided by the present application are the same as the beneficial effects of the electronic control unit flashing method provided by the above embodiment, and the other technical features in the electronic control unit flashing device are the same as the features disclosed in the above embodiment method, which will not be repeated here.

[0145] The present application provides an electronic control unit flashing device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the electronic control unit flashing method in the above-mentioned embodiment one.

[0146] Reference below Fig. 9 , which shows a schematic diagram of the structure of an electronic control unit flashing device suitable for implementing the embodiment of the present application. The electronic control unit flashing device in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Fig. 9 The electronic control unit flashing device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0147] like Fig. 9As shown, the electronic control unit flashing device may include a processing device 1001 (such as a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the electronic control unit flashing device are also stored. The processing device 1001, ROM1002 and RAM1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the electronic control unit flashing device to communicate with other devices wirelessly or by wire to exchange data. Although the electronic control unit flashing device with various systems is shown in the figure, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or have alternatively.

[0148] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.

[0149] The electronic control unit flashing device provided in the present application adopts the electronic control unit flashing method in the above-mentioned embodiment. Compared with the prior art, the beneficial effects of the electronic control unit flashing device provided in the present application are the same as the beneficial effects of the electronic control unit flashing method provided in the above-mentioned embodiment, and other technical features in the electronic control unit flashing device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.

[0150] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.

[0151] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

[0152] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, and the computer-readable program instructions are used to execute the electronic control unit flashing method in the above-mentioned embodiment.

[0153] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination of the above.

[0154] The computer-readable storage medium may be included in the electronic control unit flashing device; or may exist independently without being assembled into the electronic control unit flashing device.

[0155] Computer program code for performing the operations of the present application may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0156] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0157] The modules involved in the embodiments of the present application may be implemented by software or hardware, wherein the name of the module does not limit the unit itself in some cases.

[0158] The readable storage medium provided in the present application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned electronic control unit flashing method, and can solve the technical problem of electronic control unit flashing. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in the present application are the same as the beneficial effects of the electronic control unit flashing method provided in the above-mentioned embodiment, and will not be repeated here.

[0159] The present application also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the steps of the electronic control unit flashing method as described above are implemented.

[0160] The computer program product provided by this application can solve the technical problem of flashing an electronic control unit. Compared with the prior art, the beneficial effects of the computer program product provided by this application are the same as the beneficial effects of the flashing method of the electronic control unit provided by the above embodiment, which will not be repeated here.

[0161] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.

Claims

1. A flashing method for an electronic control unit, characterized in that: The method comprises: Create the main thread for flashing the electronic control unit ECU and the sub-thread for downloading the flashing file; In response to the ECU file flashing instruction, downloading the ECU flashing file through the flashing file downloading subthread; The ECU is flashed according to the ECU flash file through the ECU flash main thread.

2. The method according to claim 1, characterized in that The ECU flashing main thread includes a main thread download queue, and the step of downloading the ECU flashing file through the flashing file downloading sub-thread in response to the ECU file flashing instruction includes: In response to the ECU file flashing instruction, obtain the vehicle ECU software and hardware version information; Upload the vehicle ECU software and hardware version information to the cloud, and receive the ECU flash file information sent by the cloud; According to the ECU flash file information, download the ECU flash file to the main thread download queue; The ECU flashing file in the main thread download queue is downloaded through the flashing file downloading subthread.

3. The method according to claim 2, characterized in that The ECU flash file information includes vehicle ECU software and hardware version information, ECU flash file data volume and ECU flash file download address. The step of downloading the ECU flash file to the main thread download queue according to the ECU flash file information includes: Generate an ECU flash file download sequence table according to the data volume of the ECU flash file; Generate corresponding ECU flash file node information according to the vehicle ECU software and hardware version information and the ECU flash file download address; According to the ECU flash file download sequence table, the corresponding ECU flash file is associated with the ECU flash file node information and then pushed into the main thread download queue.

4. The method according to claim 2, characterized in that The step of downloading the ECU flash file in the main thread download queue through the flash file download sub-thread includes: Read the ECU flash file node information in the main thread download queue; According to the ECU flash file download address in the ECU flash file node information, download the corresponding ECU flash file through the flash file download subthread; After the ECU flash file is downloaded, a flash file download signal corresponding to the ECU flash file is generated; Delete the ECU flash file node information associated with the ECU flash file in the main thread download queue.

5. The method according to claim 4, characterized in that The ECU flashing main thread also includes a main thread flashing queue, and the step of flashing the ECU according to the ECU flashing file through the ECU flashing main thread includes: In response to the flash file download signal, obtaining the corresponding ECU flash file in the flash file download sub-thread; Pushing the ECU flashing file into the main thread flashing queue; The ECU is flashed according to the ECU flashing file in the main thread flashing queue.

6. The method according to claim 5, characterized in that The step of flashing the ECU according to the ECU flashing file in the main thread flashing queue includes: Obtain the ECU node information corresponding to the ECU flash file in the main thread writing queue; Flashing the ECU node corresponding to the ECU node information through the ECU flashing file; After the ECU flash file is flashed, the corresponding ECU node information in the main thread flash queue is deleted; When the main thread download queue and the main thread flash queue are both empty, the flash process is stopped.

7. An electronic control unit flashing device, characterized in that: The device comprises: Create a module for creating an electronic control unit ECU flashing main thread and a flashing file downloading sub-thread; A download module, configured to respond to an ECU file flashing instruction and download the ECU flashing file through the flashing file downloading subthread; The flashing module is used to flash the ECU according to the ECU flashing file through the ECU flashing main thread.

8. An electronic control unit flashing device, characterized in that: The device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the electronic control unit flashing method according to any one of claims 1 to 6.

9. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the electronic control unit flashing method according to any one of claims 1 to 6 are implemented.

10. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the steps of the electronic control unit flashing method according to any one of claims 1 to 6 are implemented.