Vehicle flashing method, storage medium and computer program product
By creating a task queue and an initial task queue in vehicle flashing and sending flashing sub-tasks in parallel, the problem of inefficient flashing in the existing technology is solved, efficient utilization of bus bandwidth is achieved, and the efficiency of the entire vehicle flashing is improved.
Patent Information
- Application Number
- CN202411832846.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-11
- Publication Date
- 2025-03-14
AI Technical Summary
The existing Ethernet brushing method is limited by the sub-network bandwidth, resulting in low write-through efficiency of the whole vehicle and idle bandwidth of the main network bus.
By obtaining the electronic control unit information and flashing files issued by the server, creating a task queue and splitting the flashing process into multiple subtasks, creating an initial task queue to optimize the task execution order, and sending the initial flashing subtask to the electronic control unit in parallel to make full use of the bus bandwidth.
It improves the efficiency of the entire vehicle's brushing, maximizes the use of bus bandwidth, avoids idle bandwidth, and ensures efficient execution of brushing tasks.
Smart Images

Figure CN119621343A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of automotive electronic control technology, and in particular to a vehicle flashing method, a storage medium, and a computer program product. Background Art
[0002] To meet the growing bus demand, the vehicle area controller architecture + Ethernet bus technology is applied to the vehicle architecture. The current mainstream Ethernet flashing method is: after the diagnostic device downloads the flashing file of the ECU that needs to be upgraded for the whole vehicle, it sends the flashing data of each ECU one by one through the Ethernet format and the vehicle gateway communication. The gateway routes the flashing data sent by the diagnostic device to the sub-network, and the sub-network gateway routes the data to the ECU node to be flashed. Since the sub-network is generally connected to each ECU node through the CAN bus, when flashing in this way, the flashing rate is limited by the bandwidth of the sub-network to be flashed, and other sub-networks do not receive the flashing data request. The Ethernet bandwidth of the main network bus is largely idle, which seriously affects the efficiency of the whole vehicle flashing.
[0003] Therefore, how to maximize the use of bus bandwidth advantages to improve the flash writing efficiency of the entire vehicle becomes an urgent problem to be solved in this application.
[0004] 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
[0005] The main purpose of this application is to provide a vehicle flashing method, storage medium and computer program product, aiming to solve the technical problem of how to maximize the use of bus bandwidth advantages to improve the flashing efficiency of the entire vehicle.
[0006] To achieve the above purpose, the present application proposes a vehicle flashing method, the method comprising:
[0007] Obtain the electronic control unit information and electronic control unit flashing file sent by the server;
[0008] Creating a task queue based on the electronic control unit information and the electronic control unit flash file and storing the flash subtask in the task queue;
[0009] Creating an initial task queue to store the first element of the task queue;
[0010] The initial flashing subtasks are sent in parallel to the electronic control unit according to the initial task queue to execute vehicle flashing.
[0011] In one embodiment, the step of obtaining the electronic control unit information and the electronic control unit flash file sent by the server includes:
[0012] Connecting to a vehicle gateway to read a vehicle identification code, and uploading the vehicle identification code to a server so that the server can determine and send down electronic control unit information and an electronic control unit flash file according to the vehicle identification code;
[0013] The electronic control unit information and the electronic control unit flashing file sent by the server are obtained.
[0014] In one embodiment, the electronic control unit information includes a subdomain address, and the step of creating a task queue based on the electronic control unit information and the electronic control unit flash file and storing the flash subtask in the task queue includes:
[0015] Based on the electronic control unit information and the electronic control unit flashing file, dividing the electronic control unit flashing process into a plurality of flashing subtasks;
[0016] A task queue is created according to the subdomain address and the flash subtask is stored in the task queue.
[0017] In one embodiment, the initial flash subtask includes a target routing address, and the step of sending the initial flash subtask to the electronic control unit in parallel according to the initial task queue to execute vehicle flash includes:
[0018] Sending the initial flash subtask in parallel to the vehicle gateway according to the initial task queue so that the vehicle gateway can send the initial flash subtask to the target sub-network gateway according to the target routing address;
[0019] The initial flashing subtask is forwarded to the electronic control unit through the target subnetwork gateway and the CAN bus so that the electronic control unit executes the initial flashing subtask.
[0020] In one embodiment, after the step of forwarding the initial flashing subtask to the electronic control unit through the target subnetwork gateway and the CAN bus so that the electronic control unit performs the initial flashing subtask, the step further includes:
[0021] The flashing result of the initial flashing subtask is obtained through the target sub-network gateway and the vehicle gateway.
[0022] In one embodiment, after the step of sending the initial flash subtasks to the electronic control unit in parallel according to the initial task queue to execute vehicle flash, the step further includes:
[0023] When the initial flashing subtask is completed, automatically identifying the next flashing subtask of the electronic control unit until all the flashing subtasks of the electronic control unit are completed;
[0024] A new electronic control unit is selected from the task queue for flashing to ensure that different subdomain addresses have at least one electronic control unit to perform the flashing task.
[0025] In one embodiment, after the initial flashing subtask is executed, the step of automatically identifying the next flashing subtask of the electronic control unit until all flashing subtasks of the electronic control unit are completed includes:
[0026] When the initial flashing subtask is completed, automatically identifying the next flashing subtask of the electronic control unit;
[0027] The initial task queue is updated according to the next flashing subtask, and the updated initial task queue is used to distribute tasks until all the flashing subtasks of the electronic control unit are completed.
[0028] In addition, to achieve the above purpose, the present application also proposes a vehicle flashing method, which is applied to a server, and the method includes:
[0029] Send the electronic control unit information and the electronic control unit flash file to the diagnostic device, so that the diagnostic device can create a task queue based on the electronic control unit information and the electronic control unit flash file and store the flash subtasks in the task queue, create an initial task queue to store the first element of the task queue, and send the initial flash subtasks to the electronic control unit in parallel according to the initial task queue to execute vehicle flashing.
[0030] 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 a processor, the steps of the vehicle flashing method described above are implemented.
[0031] 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 vehicle flashing method described above are implemented.
[0032] One or more technical solutions proposed in this application have at least the following technical effects:
[0033] The electronic control unit information and electronic control unit flashing file sent by the server are obtained, and a task queue is created according to the obtained electronic control unit information and electronic control unit flashing file, and the flashing subtasks are stored in the task queue. Storing the flashing subtasks in the task queue means dividing the flashing process of each electronic control unit into different subtasks. Reasonable task splitting and task queue management lay the foundation for subsequent efficient flashing; an initial task queue is created to store the first element in the task queue. The first element refers to the electronic control unit flashing task that needs to be executed first. By creating the initial task queue, the task execution order is further optimized to ensure that the flashing task can be quickly distributed to each subdomain at the beginning of the flashing task, so as to make full use of the bus bandwidth; according to the initial task queue, the initial flashing subtask is sent to the target electronic control unit to execute the flashing subtask. Multiple flashing subtasks are sent in parallel through the initial task queue. Parallel sending does not need to wait for the electronic control unit to reply before sending the flashing subtasks one by one, thereby maximizing the use of the bus bandwidth advantage and improving the flashing efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] 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.
[0035] In order to more clearly illustrate the embodiments of the present application or the technical solutions in 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.
[0036] Figure 1 This is a flow chart of the first embodiment of the vehicle flashing method of the present application;
[0037] Figure 2 A schematic diagram of an example of flashing the topology of vehicle electronic appliances provided in this application;
[0038] Figure 3 A schematic flow chart of a second embodiment of the vehicle flashing method provided in the present application;
[0039] Figure 4 A schematic diagram of the initial state of the task queue provided for the vehicle flashing method of this application;
[0040] Figure 5 A schematic flow chart of a third embodiment of the vehicle flashing method provided in the present application;
[0041] Figure 6 A schematic diagram of the intermediate state of flashing provided for the flashing of the vehicle in this application;
[0042] Figure 7This is a schematic diagram of the module structure of the vehicle flash writing device according to an embodiment of the present application;
[0043] Figure 8 Schematic diagram of the device structure of the hardware operating environment involved in the vehicle flashing method in the embodiment of the present application.
[0044] 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
[0045] 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.
[0046] 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.
[0047] The main solution of the embodiment of the present application is: obtain the electronic control unit information and the electronic control unit flash file sent by the server; create a task queue according to the electronic control unit information and the electronic control unit flash file, and the task queue stores the flash subtasks of the ECU in the subdomain; after creating the task queues of each subdomain, create an initial task queue to store the first element of each task queue, that is, the initial flash subtask that needs to be executed first in each subdomain; according to the initial task queue, the initial flash subtask that needs to be executed first is sent to the corresponding target electronic control unit to execute vehicle flashing.
[0048] In this embodiment, for the convenience of description, the following description is made by taking the identification diagnosis device as the execution subject.
[0049] The embodiments of the present application take into account that: in order to meet the growing bus demand, the vehicle area controller architecture + Ethernet bus technology is applied to the automobile architecture. The current mainstream Ethernet flashing method is: after the diagnostic device downloads the flashing file of the ECU that needs to be upgraded for the entire vehicle, it sends the flashing data of each ECU one by one through the Ethernet format and the vehicle gateway communication. The gateway routes the flashing data sent by the diagnostic device to the sub-network, and the sub-network gateway then routes the data to the ECU node to be flashed. Since the sub-network is generally connected to each ECU node through the CAN bus, when flashing in this way, the flashing rate is limited by the bandwidth of the sub-network to be flashed, and other sub-networks do not receive the flashing data request, and the Ethernet bandwidth of the main network bus is largely idle, which seriously affects the efficiency of the whole vehicle flashing.
[0050] Therefore, the present application provides a solution, which is to obtain the electronic control unit information and the electronic control unit flash file issued by the server, create a task queue according to the obtained electronic control unit information and the electronic control unit flash file, and store the flash subtasks in the task queue. Storing the flash subtasks in the task queue means dividing the flash process of each electronic control unit into different subtasks. Reasonable task splitting and task queue management lay the foundation for subsequent efficient flashing; create an initial task queue to store the first element in the task queue, the first element refers to the electronic control unit flash task that needs to be executed first, and further optimize the task execution order by creating an initial task queue to ensure that the flash task can be quickly distributed to each subdomain at the beginning of the flash task, so as to make full use of the bus bandwidth; send the initial flash subtask to the target electronic control unit according to the initial task queue to execute the flash subtask. Send multiple flash subtasks in parallel through the initial task queue, and the parallel sending does not need to wait for the electronic control unit to reply before sending the flash subtasks one by one, thereby maximizing the use of the bus bandwidth advantage and improving the flash efficiency.
[0051] It should be noted that the execution subject of this embodiment may be a computing service device with data processing, 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, a diagnostic device, etc. The following takes the diagnostic device as an example to illustrate this embodiment and the following embodiments.
[0052] Based on this, the embodiment of the present application provides a vehicle flashing method, which is applied to a diagnostic device, referring to Figure 1 , Figure 1 This is a flow chart of the first embodiment of the vehicle flashing method of the present application.
[0053] In this embodiment, the vehicle flashing method includes steps S10 to S40:
[0054] Step S10, obtaining the electronic control unit information and the electronic control unit flashing file sent by the server;
[0055] The diagnostic device is connected to the vehicle through the OBD-II interface or other dedicated interfaces to read the vehicle's VIN code, which is used as the vehicle's unique identifier to ensure that the flash file issued later matches the vehicle. The diagnostic device obtains the electronic control unit information corresponding to the vehicle based on the VIN code. The electronic control unit information includes the ECU model, serial number, software version, and the subnet (or subdomain) address to which it belongs.
[0056] Electronic Control Unit (ECU) flash files are files used to update or modify the internal software or data of the ECU. These files usually contain new versions of ECU software, configuration files, calibration data or other necessary information, which are designed to improve the performance of the vehicle, fix known software problems, add new functions or adjust the operating parameters of the vehicle. Electronic Control Unit flash files are stored in the database of the server, waiting for the request of the diagnostic device. After obtaining the electronic control unit information, the diagnostic device will send a request to the server to obtain the electronic control unit flash file that matches the vehicle.
[0057] After receiving the electronic control unit flash file, the diagnostic device will verify and check the electronic control unit flash file through verification or other forms of verification algorithms to ensure the integrity and correctness of the file.
[0058] Step S20, creating a task queue based on the electronic control unit information and the electronic control unit flash file and storing the flash subtask in the task queue;
[0059] The task queue is a data structure used to store and manage a series of tasks to be executed. During the vehicle flashing process, the task queue is used to store the flashing subtasks of each ECU. Based on the ECU information and ECU flashing files obtained from the server, the number and type of ECUs that need to be flashed, as well as the flashing steps and data required for each ECU can be determined. This information is the basis for creating a task queue.
[0060] Specifically, first, according to the number and type of ECUs, multiple subtask queues can be created, each of which corresponds to one ECU or a group of ECUs with similar flashing requirements. Then, according to the content of the ECU flashing file, the flashing process of each ECU is decomposed into a series of subtasks, and these subtasks are added to the corresponding subtask queues in sequence.
[0061] The flash subtask is a specific step or operation in the ECU flash process, such as reading the current ECU data, writing new data, verifying data integrity, etc. The flash subtask is stored in the task queue in the form of data items. Each data item contains the specific information of a subtask, such as task type, target ECU, operation data, etc.
[0062] It should be noted that the order in which the flashing subtasks are stored should be determined based on the flashing requirements of the ECU and the actual situation of the vehicle system. For example, it may be necessary to flash the key ECUs that affect vehicle startup first to ensure that the vehicle can maintain normal operation during the flashing process. In addition, the dependencies and flashing order between different ECUs need to be considered to avoid vehicle failure or data corruption caused by improper flashing order.
[0063] Step S30, creating an initial task queue to store the first element of the task queue;
[0064] The initial task queue is a special task queue used to store the first element in each subdomain (or subnetwork) task queue, that is, the initial flash subtask. These first elements are usually the flash subtasks that need to be executed first in each subdomain. The initial task queue can be named QueueRriginal. By creating the initial task queue, it can be ensured that each subdomain has tasks to execute, thereby making full use of the bus bandwidth and improving the flash efficiency of the entire vehicle.
[0065] Step S40 , sending the initial flashing subtasks to the electronic control unit in parallel according to the initial task queue to execute vehicle flashing.
[0066] The initial task queue stores the initial flash subtasks that need to be executed first in each subdomain. The initial flash subtasks are sent to the corresponding electronic control units in parallel according to the initial task queue. After sending the flash subtask of an ECU, the subtask of the next ECU can be sent without waiting for the ECU to reply. The ECUs of each subdomain network can execute the flash tasks simultaneously or alternately, maximizing the use of the bus bandwidth advantage, thereby significantly improving the flash efficiency of the entire vehicle.
[0067] This embodiment provides a vehicle flashing method, which is applied to diagnostic equipment, obtains electronic control unit information and electronic control unit flashing files issued by a server, creates a task queue based on the obtained electronic control unit information and electronic control unit flashing files, and stores flashing subtasks in the task queue. Storing flashing subtasks in the task queue means dividing the flashing process of each electronic control unit into different subtasks. Reasonable task splitting and task queue management lay the foundation for subsequent efficient flashing; creating an initial task queue to store the first element in the task queue, the first element refers to the electronic control unit flashing task that needs to be executed first, and further optimizes the task execution order by creating an initial task queue to ensure that the flashing task can be quickly distributed to each subdomain at the beginning of the flashing task, so as to make full use of the bus bandwidth; according to the initial task queue, the initial flashing subtask is sent to the target electronic control unit to execute the flashing subtask. Multiple flashing subtasks are sent in parallel through the initial task queue, and the parallel sending does not need to wait for the electronic control unit to reply before sending the flashing subtasks one by one, thereby maximizing the bus bandwidth advantage and improving the flashing efficiency.
[0068] In a feasible implementation, step S10 may include steps S11 to S12:
[0069] Step S11, connecting to the vehicle gateway to read the vehicle identification code, and uploading the vehicle identification code to the server so that the server can determine and issue the electronic control unit information and the electronic control unit flashing file according to the vehicle identification code;
[0070] The vehicle gateway is a bridge between the vehicle's internal network and the external network. It is responsible for collecting data from various subsystems of the vehicle (such as the engine, chassis, body, etc.), processing and format conversion. The vehicle gateway connects to the external network through an internal network module (such as Wi-Fi, Bluetooth, 4G / 5G, etc.) to achieve the transmission and reception of vehicle information.
[0071] The Vehicle Identification Number (VIN) is a set of codes assigned by vehicle manufacturers to identify their vehicles. VIN contains information such as the vehicle's manufacturer, year, model, body type and code, engine code, and assembly location, and is the vehicle's identity certificate.
[0072] Compared with the traditional CAN bus 500Kb / s, the Ethernet bandwidth can reach 100Mbit / s. This improvement provides fast and efficient conditions for ECU flashing. Figure 2 , Figure 2 A schematic diagram of an example of vehicle electronic and electrical topology flashing provided in this application, such as Figure 2 As shown, the diagnostic device is connected to the vehicle gateway via the Ethernet bus, and the vehicle gateway is also connected to each sub-domain gateway via the Ethernet bus. Therefore, the diagnostic device establishes a communication connection with the gateway via the Ethernet bus and according to the communication protocol and interface specifications provided by the vehicle manufacturer.
[0073] After the diagnostic device connects to the vehicle gateway to read the vehicle identification code, it uploads the vehicle identification code to the server. The server queries the database for ECU information corresponding to the VIN based on the received vehicle identification code. Based on the queried ECU information, the server selects the appropriate ECU flash file from the database and finally sends the flash file and ECU information to the diagnostic device.
[0074] Step S12, obtaining the electronic control unit information and the electronic control unit flashing file sent by the server.
[0075] The Ethernet bus ensures stable network connection and supports high-speed, reliable data transmission. The diagnostic equipment obtains the electronic control unit information and electronic control unit flash files sent by the server through the Ethernet bus, providing a basis for improving the efficiency of vehicle flashing.
[0076] In a feasible implementation manner, the electronic control unit information includes a subdomain address, and step S20 includes steps S21 to S22:
[0077] Step S21, dividing the flashing process of the electronic control unit into a plurality of flashing subtasks based on the electronic control unit information and the electronic control unit flashing file;
[0078] Based on the ECU information and flash files, the diagnostic device divides the complete flash process of each ECU into multiple subtasks. These subtasks are divided based on different parts of the flash file, different functional modules of the ECU, or other reasonable division criteria.
[0079] By splitting the tasks, the complex flashing process is refined into multiple subtasks, making each subtask more specific and controllable, which helps to achieve refined management of the flashing process. The flashing tasks of multiple ECUs can be carried out in parallel instead of the traditional serial method, thereby making full use of the bus bandwidth and improving the flashing efficiency.
[0080] Step S22, creating a task queue according to the subdomain address and storing the flash subtask in the task queue.
[0081] In automotive electronic systems, ECUs are divided into several subnetworks (subdomains) according to their functions. Each subnetwork has a unique subdomain address, which is used for identification and routing in the vehicle network. The electronic control unit information includes the subdomain address to which each ECU belongs. Based on the subdomain address, a dedicated task queue is created for each subnetwork (subdomain). The task queue is named QueueChildNet and is used to store the flashing tasks of the ECU in the subdomain.
[0082] By creating a task queue, the flashing tasks of the ECU in each subdomain can be managed in an orderly manner, avoiding confusion and conflicts during the flashing process and improving the reliability and stability of the flashing.
[0083] Based on the first embodiment of the present application, the second embodiment of the present application is proposed. In the second embodiment of the present application, the same or similar contents as those of the above-mentioned first embodiment can be referred to the above introduction, and will not be repeated in the following.
[0084] On this basis, please refer to Figure 3 , Figure 3 A schematic flow chart of a second embodiment of the vehicle flashing method provided in the present application.
[0085] In this embodiment, the initial flash subtask includes a target routing address, and the step S40 of sending the initial flash subtask to the electronic control unit in parallel according to the initial task queue to execute vehicle flash may include steps S41-S42:
[0086] Step S41, sending the initial flash subtask in parallel to the vehicle gateway according to the initial task queue so that the vehicle gateway can send the initial flash subtask to the target sub-network gateway according to the target routing address;
[0087] Name the initial task queue QueueRriginal and the task queue QueueChildNet, refer to Figure 4 , Figure 4 This is a schematic diagram of the initial state of the task queue provided by the vehicle flashing method of this application. Figure 4 As shown, QueueRriginal contains the initial flashing subtask of the first ECU to be flashed in all subdomains.
[0088] When the whole vehicle flashing starts, the diagnostic device reads the initial flashing subtask from the QueueRriginal in sequence, and sends the initial flashing subtask in the QueueRriginal to the vehicle gateway in parallel. The vehicle gateway is the communication hub in the whole vehicle network, responsible for data forwarding between different subnetworks. After the vehicle gateway receives the initial flashing subtask sent by the diagnostic device, it parses the target address in the initial flashing subtask (that is, the address of the target subnetwork gateway). According to the target routing address, the vehicle gateway routes and forwards the initial flashing subtask to the corresponding target subnetwork gateway. The target subnetwork gateway receives the initial flashing subtask forwarded by the vehicle gateway and prepares for the next step of data forwarding.
[0089] Step S42: forwarding the initial flashing subtask to the electronic control unit through the target subnetwork gateway and the CAN bus so that the electronic control unit can execute the initial flashing subtask.
[0090] After the target subnetwork gateway receives the initial flash subtask forwarded by the vehicle gateway, it forwards the initial flash subtask to the specific ECU node through the CAN network (Controller Area Network). The CAN network is a commonly used communication protocol in automotive electronic systems, used to connect and control various ECUs. After the ECU node receives the flash data forwarded through the CAN network, it starts to execute the flash subtask. This usually includes steps such as data verification, storage and update.
[0091] In this embodiment, the diagnostic device uses the routing and forwarding functions of the vehicle gateway and the target sub-network gateway, as well as the communication capabilities of the CAN network, so that the initial flashing subtask is efficiently sent to the target ECU and executed, ensuring the orderly and efficient completion of the flashing of the entire vehicle.
[0092] Based on the first embodiment and / or the second embodiment of the present application, the third embodiment of the present application is proposed. In the third embodiment of the present application, the same or similar contents as those of the above-mentioned first embodiment and / or the second embodiment can be referred to the above introduction, and will not be repeated in the following.
[0093] On this basis, please refer to Figure 5 , Figure 5 A schematic flow chart of a third embodiment of the vehicle flashing method provided in the present application.
[0094] In this embodiment, after the step S40 of sending the initial flashing subtasks to the electronic control unit in parallel according to the initial task queue to execute the vehicle flashing, the steps S50 to S60 are also included:
[0095] Step S50, when the initial flashing subtask is completed, automatically identifying the next flashing subtask of the electronic control unit until all the flashing subtasks of the electronic control unit are completed;
[0096] When the initial flash subtask is completed, regardless of whether the flash result of the initial flash subtask is failure or success, after confirming that the current initial flash subtask of an electronic control unit in the initial task queue is completed, the diagnostic device will automatically identify the next flash subtask of the electronic control unit according to the task queue QueueChildNet.
[0097] Once the next flash subtask is identified, the diagnostic device will add the next flash subtask to the initial task queue, replacing the position of the original initial flash subtask, and then route forwarding according to the updated initial task queue. The target ECU receives and executes the new flash subtask. This process will be repeated until all flash subtasks of the ECU are executed.
[0098] When all flashing subtasks of an ECU are completed, the diagnostic device will update the status information of the ECU, including removing it from the list of ECUs being flashed, or marking it as having completed flashing.
[0099] Step S60: Select a new electronic control unit from the task queue for flashing to ensure that different subdomain addresses have at least one electronic control unit to perform the flashing task.
[0100] During the entire vehicle flashing process, the diagnostic device will continuously monitor the status of all task queues (including QueueRriginal and QueueChildNet). This includes checking which ECUs' flashing tasks have been completed, which ECUs' flashing tasks are still in progress, and which ECUs have not yet started flashing.
[0101] refer to Figure 6 , Figure 6A schematic diagram of the intermediate state of flashing provided for the vehicle flashing of this application. When the diagnostic device detects that a certain electronic control unit has completed all the flashing subtasks, the diagnostic device will automatically select a new ECU from the task queue for flashing. This selection process may be based on a variety of factors, such as the priority of the ECU, the urgency of the flashing task, the load of the vehicle gateway and the CAN bus, etc.
[0102] Once a new ECU is selected, the diagnostic device will split the flashing process of the new ECU into multiple subtasks, and select the initial subtask from the multiple subtasks to add to the initial task queue, which will be forwarded by the vehicle gateway.
[0103] During the entire flashing process, the task queue and subdomain flashing progress are continuously monitored, and the flashing strategy is dynamically adjusted according to the actual situation. If the flashing progress of a subdomain is significantly lagging behind, the flashing priority of the ECU in the subdomain can be increased, or the flashing plan of other subdomains can be adjusted to balance the load.
[0104] In this embodiment, when the initial flash subtask is completed, the next flash subtask of the electronic control unit is automatically identified until all the flash subtasks of the electronic control unit are completed; a new electronic control unit is selected from the task queue for flashing to ensure that different subdomain addresses have at least one electronic control unit to perform the flash task. When the ECU in a subdomain completes the flash task, a new ECU is immediately selected from the task queue for flashing, which can ensure that there is always data being transmitted on the bus, avoiding idle Ethernet bandwidth. This method of dynamically allocating flash tasks maximizes the use of bus resources and further improves the flash efficiency.
[0105] Based on this, an embodiment of the present application provides a vehicle flashing method, which is applied to a server. The method includes step A10:
[0106] Step A10, sending the electronic control unit information and the electronic control unit flash file to the diagnostic device, so that the diagnostic device creates a task queue based on the electronic control unit information and the electronic control unit flash file and stores the flash subtasks in the task queue, creates an initial task queue to store the first element of the task queue, and sends the initial flash subtasks to the electronic control unit in parallel according to the initial task queue to execute vehicle flashing.
[0107] The server stores a database of detailed information of all supported ECUs. When the diagnostic device needs to communicate or diagnose a specific ECU, it requests the server for detailed information of the ECU. Based on the request of the diagnostic device, the server retrieves the corresponding ECU information from the database and sends it to the diagnostic device.
[0108] The server stores a database of flash files for different ECUs and versions. When the diagnostic device needs to perform a software upgrade or configuration modification on the ECU, it requests the corresponding flash file from the server. Based on the request of the diagnostic device and the current status of the ECU, the server retrieves and sends the appropriate flash file from the database to the diagnostic device.
[0109] This embodiment provides a vehicle flashing method, which is applied to a server, and the server sends accurate electronic control unit information and electronic control unit flashing files. Accurate ECU information and flashing files help reduce the occurrence of errors, thereby improving the efficiency of vehicle flashing.
[0110] In order to better illustrate the overall implementation process of the vehicle flashing method of the present application, the overall implementation process of the vehicle flashing method is described below.
[0111] First, the diagnostic device connects to the vehicle gateway to read the vehicle VIN code and upload it to the server. The server sends the ECU information that needs to be flashed (the ID of each ECU and the subdomain address to which it belongs) and the ECU flashing file.
[0112] Furthermore, the diagnostic instrument divides the flashing process of each ECU into different subtasks, and creates a task queue QueueChildNet for each subdomain, which stores the flashing tasks of the ECU in the subdomain. Create an initial task queue QueueRriginal to store the first element in each QueueChildNet. When the whole vehicle flashing starts, the diagnostic software sends the ECU flashing subtasks stored in QueueRriginal to the vehicle gateway in sequence. The vehicle gateway then forwards it to the corresponding subdomain network according to the target address of the command in the target subtask, and the subnetwork gateway then forwards it to the specific ECU through the CAN network.
[0113] Furthermore, the ECU replies to the diagnostic software through sub-gateway->gateway->diagnostic instrument. The diagnostic software does not need to wait for the current ECU to reply before executing the next step like the traditional flashing process. Instead, after sending the flashing subtask of the previous ECU1, it continues to send the subtask of the next ECU2 until each ECU in the sub-domain network has a flashing task executing.
[0114] Finally, when the subtask of a certain ECU is completed, the diagnostic software automatically identifies the next subtask of the ECU until all the flashing subtasks of this ECU have been completed or the flashing fails. At this time, the diagnostic software will select an ECU from the same subdomain queue QueueChildNet and add it to the flashing queue for flashing, ensuring that at the same time, there is always an ECU in different subdomain networks on the bus executing the flashing task, so as not to waste the bus network bandwidth.
[0115] This application also provides a vehicle flash writing device, please refer to Figure 7 , the vehicle flash writing device comprises:
[0116] The information acquisition module 10 is used to acquire the electronic control unit information and the electronic control unit flash file sent by the server;
[0117] A task queue module 20, used to create a task queue based on the electronic control unit information and the electronic control unit flash file and store the flash subtasks in the task queue;
[0118] An initial task queue module 30, used to create an initial task queue to store the first element of the task queue;
[0119] The vehicle flashing module 40 is used to send the initial flashing subtasks to the electronic control unit in parallel according to the initial task queue to execute the vehicle flashing.
[0120] The vehicle flashing device provided by the present application adopts the vehicle flashing method in the above embodiment, which can solve the technical problem of vehicle flashing. Compared with the prior art, the beneficial effects of the vehicle flashing device provided by the present application are the same as the beneficial effects of the vehicle flashing method provided by the above embodiment, and the other technical features in the vehicle flashing device are the same as the features disclosed in the above embodiment method, which will not be repeated here.
[0121] The present application provides a vehicle 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 vehicle flashing method in the above-mentioned embodiment one.
[0122] Reference below Figure 8 , which shows a schematic diagram of the structure of a vehicle flashing device suitable for implementing the embodiment of the present application. The vehicle 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. Figure 8 The vehicle 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.
[0123] like Figure 8 As shown, the vehicle flashing device may include a processing device 1001 (e.g., 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 vehicle 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 vehicle flashing device to communicate with other devices wirelessly or by wire to exchange data. Although the figure shows a vehicle flashing device with various systems, 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.
[0124] 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.
[0125] The vehicle flashing device provided by the present application adopts the vehicle flashing method in the above embodiment to solve the technical problem of vehicle flashing. Compared with the prior art, the beneficial effects of the vehicle flashing device provided by the present application are the same as the beneficial effects of the vehicle flashing method provided by the above embodiment, and the other technical features in the vehicle flashing device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.
[0126] 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.
[0127] 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.
[0128] 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 vehicle flashing method in the above-mentioned embodiment.
[0129] 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.
[0130] The computer-readable storage medium may be included in the vehicle flashing device; or may exist independently without being assembled into the vehicle flashing device.
[0131] The above-mentioned computer-readable storage medium carries one or more programs. When the above-mentioned one or more programs are executed by the vehicle flashing device, the vehicle flashing device: obtains the electronic control unit information and the electronic control unit flashing file issued by the server; creates a task queue based on the electronic control unit information and the electronic control unit flashing file and stores the flashing subtasks in the task queue; creates an initial task queue to store the first element of the task queue; and sends the initial flashing subtasks to the electronic control unit in parallel according to the initial task queue to execute vehicle flashing.
[0132] 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).
[0133] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the 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 square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square 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 square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart 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.
[0134] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.
[0135] 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 vehicle flashing method, and can solve the technical problems of vehicle 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 vehicle flashing method provided in the above-mentioned embodiment, and will not be repeated here.
[0136] The present application also provides a computer program product, including a computer program, which implements the steps of the vehicle flashing method as described above when executed by a processor.
[0137] The computer program product provided by this application can solve the technical problem of vehicle flashing. 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 vehicle flashing method provided by the above embodiment, which will not be repeated here.
[0138] 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 vehicle flashing method, characterized in that: Applied to diagnostic equipment, the method comprises: Obtain the electronic control unit information and electronic control unit flashing file sent by the server; Creating a task queue based on the electronic control unit information and the electronic control unit flash file and storing the flash subtask in the task queue; Creating an initial task queue to store the first element of the task queue; The initial flashing subtasks are sent in parallel to the electronic control unit according to the initial task queue to execute vehicle flashing.
2. The method according to claim 1, characterized in that The step of obtaining the electronic control unit information and the electronic control unit flash file sent by the server includes: Connecting to a vehicle gateway to read a vehicle identification code, and uploading the vehicle identification code to a server so that the server can determine and send down electronic control unit information and an electronic control unit flash file according to the vehicle identification code; The electronic control unit information and the electronic control unit flashing file sent by the server are obtained.
3. The method according to claim 1, characterized in that The electronic control unit information includes a subdomain address, and the step of creating a task queue based on the electronic control unit information and the electronic control unit flash file and storing the flash subtask in the task queue includes: Based on the electronic control unit information and the electronic control unit flashing file, dividing the electronic control unit flashing process into a plurality of flashing subtasks; A task queue is created according to the subdomain address and the flash subtask is stored in the task queue.
4. The method according to claim 1, characterized in that The initial flash subtask includes a target routing address, and the step of sending the initial flash subtask to the electronic control unit in parallel according to the initial task queue to execute vehicle flashing includes: Sending the initial flash subtask in parallel to the vehicle gateway according to the initial task queue so that the vehicle gateway can send the initial flash subtask to the target sub-network gateway according to the target routing address; The initial flashing subtask is forwarded to the electronic control unit through the target subnetwork gateway and the CAN bus so that the electronic control unit executes the initial flashing subtask.
5. The method according to claim 4, characterized in that After the step of forwarding the initial flashing subtask to the electronic control unit through the target subnetwork gateway and the CAN bus so that the electronic control unit can perform the initial flashing subtask, the following step is further included: The flashing result of the initial flashing subtask is obtained through the target sub-network gateway and the vehicle gateway.
6. The method according to claim 1, characterized in that After the step of sending the initial flash subtasks to the electronic control unit in parallel according to the initial task queue to execute vehicle flash, the following step is further included: When the initial flashing subtask is completed, automatically identifying the next flashing subtask of the electronic control unit until all the flashing subtasks of the electronic control unit are completed; A new electronic control unit is selected from the task queue for flashing to ensure that different subdomain addresses have at least one electronic control unit to perform the flashing task.
7. The method according to claim 6, characterized in that After the initial flashing subtask is completed, the step of automatically identifying the next flashing subtask of the electronic control unit until all the flashing subtasks of the electronic control unit are completed includes: When the initial flashing subtask is completed, automatically identifying the next flashing subtask of the electronic control unit; The initial task queue is updated according to the next flashing subtask, and the updated initial task queue is used to distribute tasks until all the flashing subtasks of the electronic control unit are completed.
8. A vehicle flashing method, characterized in that: Applied to a server, the method comprises: Send the electronic control unit information and the electronic control unit flash file to the diagnostic device, so that the diagnostic device can create a task queue based on the electronic control unit information and the electronic control unit flash file and store the flash subtasks in the task queue, create an initial task queue to store the first element of the task queue, and send the initial flash subtasks to the electronic control unit in parallel according to the initial task queue to execute vehicle flashing.
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 vehicle flashing method according to any one of claims 1 to 8 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 vehicle flashing method according to any one of claims 1 to 8 are implemented.