Brushing method and device of electronic controller, electronic equipment, medium and product
By selecting a ready controller during the electronic controller flashing process and interrupting the operation when suspended, parallel flashing is achieved, solving the problem of excessive flashing time in vehicle OTA upgrades and improving flashing efficiency and user experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-30
- Publication Date
- 2026-03-10
AI Technical Summary
In existing technologies, during vehicle OTA upgrades, the overall flashing time for electronic controllers is too long, making it difficult to effectively reduce the flashing time for individual ECUs, resulting in a poor user experience.
By selecting a ready electronic controller for writing and interrupting the current operation when the target controller is suspended, the next ready controller is immediately selected for writing, avoiding waiting for the original controller to recover, thus achieving parallel writing.
It effectively shortens the overall writing time, improves the writing efficiency of the electronic controller, and enhances the user experience.
Smart Images

Figure CN121636067A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a method, apparatus, electronic device, medium and product for writing electronic controllers. Background Technology
[0002] Over-the-Air (OTA) updates for a vehicle typically employ a serial flashing process when upgrading the Electronic Control Unit (ECU) of a physical channel. This means that the flashing process for the next ECU must be completed before the next ECU can be flashed. The total flashing time for a channel is the sum of the times taken to flash each ECU sequentially. Currently, for vehicle OTA scenarios, to minimize the overall flashing time and improve user experience, the focus is usually on reducing the flashing time of individual ECUs. However, this approach is ineffective because the hardware characteristics of ECUs mean that the time required for writing, erasing, or verifying data during the flashing process generally has limitations that are difficult to overcome. Therefore, how to reduce the overall flashing time of a channel and improve the flashing efficiency of ECUs has become a pressing issue. Summary of the Invention
[0003] This invention provides a method, apparatus, electronic device, medium, and product for writing electronic controllers, in order to improve the writing efficiency of electronic controllers.
[0004] In a first aspect, embodiments of this application provide a method for flashing an electronic controller, including:
[0005] Select each ready electronic controller from the target channel in sequence as the target electronic controller, and perform a write operation on the target electronic controller.
[0006] If the target electronic controller is in a suspended state during the flashing operation, the flashing operation is interrupted, and the process returns to the steps of sequentially selecting each ready electronic controller from the target channel and performing the flashing operation on the target electronic controller.
[0007] Secondly, embodiments of this application also provide a writing device for an electronic controller, comprising:
[0008] The flashing module is used to sequentially select each ready electronic controller from the target channel as the target electronic controller and perform a flashing operation on the target electronic controller.
[0009] The interrupt module is used to interrupt the flashing operation of the target electronic controller if the target electronic controller is in a suspended state during the flashing operation, and return to the steps of sequentially selecting each ready electronic controller from the target channel and performing the flashing operation of the target electronic controller.
[0010] Thirdly, embodiments of this application provide an electronic device, including:
[0011] One or more processors;
[0012] Storage device for storing one or more programs;
[0013] When the one or more programs are executed by the one or more processors, the one or more processors implement the electronic controller flashing method as described in the first aspect.
[0014] Fourthly, embodiments of this application also provide a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the electronic controller writing method as described in the first aspect.
[0015] Fifthly, embodiments of this application also provide a computer program product, including a computer program and / or instructions, which, when executed by a processor, implement the electronic controller writing method as described in any of the above embodiments.
[0016] This application provides a method, apparatus, electronic device, medium, and product for flashing an electronic controller. The method includes: sequentially selecting each ready electronic controller from a target channel as a target electronic controller and performing a flashing operation on the target electronic controller; during the flashing operation on the target electronic controller, if the target electronic controller is in a suspended state, the flashing operation on the target electronic controller is interrupted, and the process returns to the steps of sequentially selecting each ready electronic controller from the target channel and performing the flashing operation on the target electronic controller. This technical solution, by interrupting the flashing operation on the currently flashed electronic controller when it is suspended, allows for timely flashing of another electronic controller without waiting for the original electronic controller to recover and finish flashing, thereby compressing the overall channel flashing time and improving the flashing efficiency of the electronic controller. Attached Figure Description
[0017] The above and other features, advantages, and aspects of the embodiments of this disclosure will become more apparent from the accompanying drawings and the following detailed description. Throughout the drawings, the same or similar reference numerals denote the same or similar elements. It should be understood that the drawings are schematic, and the originals and elements are not necessarily drawn to scale.
[0018] Figure 1 A flowchart illustrating a method for flashing an electronic controller, as provided in an embodiment of this application;
[0019] Figure 2 A schematic diagram of the state machine of an electronic controller provided in an embodiment of this application;
[0020] Figure 3 A schematic diagram illustrating the electronic controller writing process provided in an embodiment of this application;
[0021] Figure 4 A schematic diagram of the structure of a writing device for an electronic controller provided in an embodiment of this application;
[0022] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0023] The present application will now be described in further detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the application and not intended to limit it. Furthermore, it should be noted that, for ease of description, only the parts relevant to the present application are shown in the drawings, not the entire structure.
[0024] Before discussing the exemplary embodiments in more detail, it should be noted that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although the flowcharts describe the steps as sequential processes, many of these steps can be performed in parallel, concurrently, or simultaneously. Furthermore, the order of the steps can be rearranged. The process can be terminated when its operation is complete, but may also have additional steps not included in the figures. The process can correspond to a method, function, procedure, subroutine, subroutine, etc.
[0025] It should be noted that the concepts of "first" and "second" mentioned in the embodiments of this application are only used to distinguish different devices, modules, units or other objects, and are not used to limit the order or interdependence of the functions performed by these devices, modules, units or other objects.
[0026] Furthermore, the embodiments and features described in this application may be combined with each other, unless otherwise specified.
[0027] The acquisition, storage, use, and processing of data in this application all comply with the relevant provisions of national laws and regulations.
[0028] Currently, over-the-air (OTA) upgrades for a single physical ECU in a vehicle typically use a serial upgrade approach. The overall flashing time for one channel is the sum of the times required to flash each ECU sequentially. For example, if Cannel 1 has 5 ECUs, denoted as ECU... A ECU B ECU C ECU D ECU E The corresponding write and flash operations take time t respectively. A t B t C t D and t E The overall flushing time for this channel is t. A +t B +t C +t D +t E If any ECU flashing process encounters a problem and is suspended, subsequent ECUs will need to wait for that ECU to recover and finish flashing before they can be flashed in sequence. During the waiting period, no flashing operation is performed, resulting in a waste of time.
[0029] Considering that the flashing process for each ECU can be divided into data transmission, data writing, and logic operations, and that the time taken for data writing or logic operations is often much longer than the time taken for data transmission, this application provides a flashing method for an electronic controller to reduce overall flashing time and improve ECU flashing efficiency. When the current ECU is in a time-consuming stage such as data writing or logic operations, the next ECU can be allowed to begin flashing simultaneously by transmitting data. This allows different ECUs to execute their respective flashing processes concurrently, eliminating idle time, saving overall flashing time, improving ECU flashing efficiency, and enhancing the user experience. It should be noted that the flashing operation, flashing steps, or flashing command in this application embodiment can be understood as an upgrade operation, upgrade steps, or upgrade command.
[0030] Figure 1This is a flowchart illustrating a method for flashing an electronic controller according to an embodiment of this application. This embodiment is applicable to flashing at least two ECUs. Specifically, the flashing method can be executed by a flashing device for the electronic controller, which can be implemented through software and / or hardware and integrated into the electronic device. The electronic device can be understood as the in-vehicle OTA master terminal (Master terminal), i.e., the Controller Area Network (CAN) flashing Master terminal, mainly responsible for the overall scheduling of flashing all ECUs on a single channel. The specific functions of the Master terminal include: having the ability to monitor and record the status of a single ECU, determining the next scheduling strategy based on the ECU status, and resuming subsequent flashing steps for an interrupted ECU when it is rescheduled. The electronic device can specifically be a vehicle infotainment system, computer, in-vehicle intelligent terminal, smartphone, or cloud server, etc.
[0031] like Figure 1 As shown, the method specifically includes the following steps:
[0032] S110. Select each ready electronic controller from the target channel as the target electronic controller in sequence, and perform a write operation on the target electronic controller.
[0033] In this embodiment, the target channel can be any channel in the OTA upgrade process, and the target channel includes at least two ECUs. Each time, an ECU is selected as the target ECU for flashing. The target ECU can be understood as the ECU currently being scheduled or selected to perform the flashing operation. At any given time, there is only one target ECU. All ECUs in the target channel are flashed sequentially. After each ECU has been flashed (each ECU may flash successfully or fail), the ECU flashing operation for that target channel ends.
[0034] When an ECU is selected as a target ECU, it can also be understood as that ECU being scheduled. Each selected ECU is in a ready state, which indicates that the ECU is currently selectable, schedulable, or rewritable. For example, each ECU has a unique corresponding number. During scheduling, any ECU currently in a ready state can be selected as the target ECU; the ECU with the smallest or largest number currently in a ready state can be selected as the target ECU; the ECU that entered the ready state earliest, recovered to the ready state earliest, or was interrupted earliest among the currently ready ECUs can be selected as the target ECU, etc. Alternatively, each ECU can have a corresponding priority, and the ECU with the highest priority currently in a ready state can be selected as the target ECU, etc. The scheduling strategy can be flexibly set according to actual needs, and this embodiment does not limit it.
[0035] S120. During the process of writing the target electronic controller, if the target electronic controller is in a suspended state, the writing operation on the target electronic controller is interrupted and the process returns to S110.
[0036] Specifically, a suspended state can be understood as the flashing operation on the target electronic controller being paused, suspended, or interrupted. This can occur due to unstable signal transmission between the electronic device and the target electronic controller, signal parsing errors, or the flashing operation reaching time-consuming or complex steps. When the target electronic controller is in a suspended state, the flashing operation can be interrupted, and another ECU can be promptly selected as the new target ECU for flashing. It's understood that the ECU whose flashing operation was interrupted can be rescheduled and flashed in a subsequent process. This avoids wasting time waiting for a suspended ECU to enter the next state or perform subsequent operations. During the period when one ECU is suspended, time can be fully utilized to flash another ECU, eliminating idle time without operation, thereby reducing the overall flashing time of the channel and improving the flashing efficiency of the electronic controller.
[0037] It should be noted that the embodiments of this application mainly take a single channel as an example to describe the flashing process of the ECU in the channel. In practical applications, there can be two or more target channels. For each target channel, the ECU in each target channel can be flashed according to the method of the embodiments of this application.
[0038] In one embodiment, after interrupting the flashing operation on the target electronic controller, the method further includes: recording interruption information of the target electronic controller. The interruption information is primarily used to record information about when the flashing operation on the target electronic controller was interrupted, so that when the interrupted target electronic controller is rescheduled, flashing can continue based on the previous flashing result. The interruption information may include at least one of the following: the flashed portion (e.g., all completed flashing steps, the last completed flashing step, and / or the duration of the flashing operation), the unflashed portion (e.g., all unfinished flashing steps, the first unfinished flashing step, i.e., the flashing step to be executed, and / or the duration required for the unfinished flashing step), and the flashing progress (e.g., the proportion of completed flashing steps in the total flashing operation, and / or the proportion of the duration of completed flashing steps in the total duration of the flashing operation). In addition, the interruption information may also include the time when the target electronic controller's flashing operation was interrupted, the number of interruptions to the target electronic controller, and / or the reason for the interruption. It should be noted that, in this embodiment, the interruption of the target electronic controller's flashing operation can also be understood as the target electronic controller being put into a suspended state. The flashing steps can also be understood as flashing commands; a flashing operation typically includes multiple flashing steps, or multiple flashing commands.
[0039] Furthermore, performing a flashing operation on the target electronic controller includes: if there is an interrupt information in the target electronic controller, performing a flashing operation on the unflashed part of the target electronic controller according to the interrupt information.
[0040] Specifically, after selecting a target electronic controller, if the target electronic controller has corresponding interrupt information, it means that the target electronic controller has already performed part of the flashing steps. In this case, based on the interrupt information, the unexecuted flashing steps can be continued based on the previous flashing result, without having to start the entire flashing operation from the first flashing step again, thereby further improving flashing efficiency.
[0041] In one embodiment, it further includes: during the process of performing a write operation on the target electronic controller,
[0042] If the target electronic controller responds with a negative code, then the target electronic controller is marked as suspended.
[0043] If the target electronic controller is in a suspended state, and the target electronic controller responds positively to the flashing step of the terminal in the flashing operation, then the target electronic controller is marked as ready.
[0044] The setting of the negative code can be understood as the response information from the ECU, specifically a negative response code (NRC), such as 0x78. If the target ECU's negative response is a negative code, it indicates that the target ECU will enter a long internal processing procedure. In this case, the target ECU can be marked as suspended. After a period of time, if the target ECU responds with a positive response to the interrupted (or suspended) flashing step, the target ECU can be restored to the ready state. That is, the target ECU can be selected again in subsequent scheduling and continue flashing from after the interrupted step. Based on this, the flexibility of ECU scheduling can be improved, providing a foundation for improving ECU flashing efficiency.
[0045] In one embodiment, during the process of performing a write operation on the target electronic controller,
[0046] If the target electronic controller responds with a negative response or response timeout for any of the write steps in the write operation, or if the target electronic controller responds with a positive response for the last write step in the write operation, then the target electronic controller is marked as the target state.
[0047] Return to the steps of sequentially selecting each ready electronic controller from the target channel as the target electronic controller and performing a write operation on the target electronic controller, until all electronic controllers in the target channel are in the target state.
[0048] Specifically, if the target ECU (which can be in a normal flashing state or a suspended state) responds with a negative response or response timeout to any flashing step (which can be the last flashing step or not) during the flashing process, then the target ECU is marked as the target state (i.e., flashing end state or flashing completed state End), meaning the flashing of the target ECU is complete, and the final result of the flashing is flashing failure. If the target ECU responds with a positive response to the last flashing step, then the target ECU is marked as the target state, meaning the flashing of the target ECU is complete, and the final result of the flashing is flashing success. Based on the completion of the current target ECU flashing, if there are still ECUs in the target channel that have not been flashed, a suitable ECU can be selected as a new target ECU for flashing according to the scheduling strategy, until all ECUs in the target channel have been flashed, and the flashing of the entire target channel is complete. Therefore, by defining the target state of the target ECU and ensuring that each ECU is flashed, the reliability of the flashing process can be improved.
[0049] Optionally, after all ECUs in the target channel have been flashed, for all ECUs in the target channel that failed to flash (i.e. ECUs that responded with a negative response or exceeded the response limit for any flashing step), these ECUs that failed to flash can be regarded as ECUs in the target channel that need to be flashed, and the ECU flashing method of this application embodiment can be re-executed for each ECU in the target channel that needs to be flashed. This embodiment will not elaborate further on this.
[0050] Figure 2 This is a schematic diagram of the state machine of an electronic controller provided in an embodiment of this application. Figure 2 As shown, when starting to flash each ECU in a target channel, each ECU is first initialized, which puts each ECU into a ready state. An ECU in a ready state can be understood as an ECU that can be scheduled or flashed. If an ECU meets the scheduling conditions, that is, the ECU is selected as the target ECU according to the scheduling strategy, then the ECU enters the normal flashing state. In this state, each flashing step will be executed sequentially for the ECU.
[0051] If the target ECU in normal flashing state responds with a negative response or a response times out for any flashing step, the flashing fails and the system transitions to the target state (End). If the target ECU in normal flashing state responds with a positive response for the last flashing step of the flashing process (i.e., the flashing operation), the flashing succeeds and the system transitions to the target state. If the target ECU in normal flashing state responds with a setting negative code, the system transitions to the suspended state. At this point, a new ECU will be selected as the target ECU, while the original target ECU will remain in the suspended state if it continues to receive setting negative codes.
[0052] If an ECU in a suspended state responds with a positive response for any step other than the last one, it indicates that it has been restored to a ready state and can be rescheduled and flashed again; if an ECU in a suspended state responds with a positive response for the last step, it indicates that the flashing was successful and it has transitioned to the target state; if an ECU in a suspended state responds with a negative response or a response timeout for any step, it indicates that the flashing failed and it has transitioned to the target state.
[0053] In one embodiment, selecting each ready electronic controller from the target channel as the target electronic controller in turn includes: polling the electronic controllers in the target channel in a predetermined order of electronic controller numbers each time a target electronic controller is selected, so as to select the electronic controller in the ready state that meets the conditions as the target electronic controller.
[0054] Specifically, the sorting order can be set from smallest to largest numerical value (e.g., ECU1, ECU2, ECU3...) or from largest to smallest numerical value (e.g., ECU...). N ECU N-1 ECU N-2 ... (where N is a positive integer), or they can be arranged in alphabetical order according to the characters in the number (e.g., ECU). A ECU B ECU C ...), or in any other specified order, which is not limited in this embodiment.
[0055] During each scheduling process, each ECU can be checked sequentially according to a set order to determine whether it is in a ready state and whether it meets certain conditions, such as whether it has the smallest number, the largest number, or entered the ready state earliest. Taking the case of meeting the smallest number as an example, the ECUs are polled in ascending order of their numbers to determine whether each ECU is in a ready state, and the ECU with the smallest number in a ready state is selected as the target ECU.
[0056] In one embodiment, selecting each ready electronic controller from the target channel as the target electronic controller in sequence further includes: when selecting a target electronic controller each time, if there is an electronic controller in the target channel that is not in the target state, and no ready electronic controller is detected after polling, then after detecting a trigger event, the step of polling the electronic controllers in the target channel according to the set arrangement order of the electronic controller numbers is re-executed; wherein the trigger event includes at least one of the following: there is at least one ready electronic controller in the target channel; or the waiting time reaches a set time.
[0057] Specifically, in a single scheduling process, if polling determines that there is an electronic controller in a non-target state within the target channel but no ECU in a ready state, it means that there is currently no ECU that can be selected for flashing. Considering that an ECU temporarily in a suspended state may later return to a ready state, scheduling can be performed again when a trigger event is detected. A trigger event can be understood as an event or condition that triggers rescheduling, such as waiting for a set time (e.g., waiting 30 seconds before rescheduling), or detecting an ECU in a ready state within the target channel, specifically, an ECU returning from a suspended state to a ready state. Based on this, when an ECU returns to a ready state, it can be flashed promptly, thus ensuring that all ECUs are flashed, avoiding omissions, and improving the reliability of flashing.
[0058] The following example illustrates the ECU flashing method. For instance, there are 5 ECUs, denoted as ECU. A ECU B ECUC ECU D ECU E The polling can be based on the alphabetical order of the ECUs; the scheduling strategy can be to select the first detected ECU in a ready state as the target ECU through polling.
[0059] At time t1, the first scheduling is performed: the five ECUs are polled sequentially according to the alphabetical order to determine the ECU. A and ECU B All are target states, ECU C The system is now ready; at this point, the ECU can be... C The target ECU is flashed;
[0060] In ECU C After the flashing process is complete, a second scheduling can be performed at time t2: if there is an ECU in a non-target state, such as ECU... D and ECU E After polling, the ECU was determined D In suspended state, ECU E To be ready, the ECU can be... E The target ECU is flashed;
[0061] If ECU E If the process is suspended during the flashing process, a third scheduling can be performed at time t3: If an ECU in a non-target state exists: ECU D and ECU E After polling, the ECU was determined D Once the ECU has been restored to a ready state, it can be... D The target ECU is flashed;
[0062] In ECU D After the flashing process is complete, at time t4, a fourth scheduling can be performed: If an ECU in a non-target state exists: ECU E If the ECU is determined through polling E If the ECU is in a ready state, then... E The target ECU is used for flashing; if the ECU is determined through polling... E If it is still in a suspended state, there is no ECU that can be flashed at the moment, and you can wait for a while;
[0063] If a trigger event is detected after a period of waiting, a fifth scheduling can be performed at time t5: if the ECU is determined through polling... E The system has been restored to a ready state; in this case, the ECU can be... E The target ECU is flashed, and the final ECU is rewritten.E The flashing process is complete.
[0064] Figure 3 This is a schematic diagram illustrating an electronic controller flashing process provided in an embodiment of this application. Figure 3 As shown, the ECU flashing process mainly includes:
[0065] Flashing a target channel begins: After all ECUs within the same channel have completed initialization, the first scheduling begins, and the electronic devices can enter the scheduling state. <channelscheduling>By polling the status of all ECUs, for example, starting from the smallest ECU number (each ECU has a preset number), for the first scheduling, all ECUs are in the Ready state, and the ECU with the smallest number will definitely be executed. That is, the Ready ECU with the smallest number is selected as the target ECU for flashing, and at this time the electronic device enters the processing state. <ecuprocessing>;
[0066] exist <ecuprocessing>Status: Executing the flashing step for a single ECU. This process requires the electronic device to save the flashing progress of the target ECU in real time so that the flashing can continue from the breakpoint when the target ECU is interrupted and rescheduled.
[0067] exist <ecuprocessing>Status: If the ECU enters Supended or End, the triggering electronic devices will enter... <channelscheduling>Execute scheduling;
[0068] If, during the scheduling process, no ECU meets the scheduling conditions after polling, the electronic device can remain in the current state. <channelscheduling>The status awaits the next scheduling event, such as when an ECU enters Ready;
[0069] If all ECUs have been completed, then the flashing of all ECUs on this target channel is finished.
[0070] It should be noted that, according to the serial flashing method, the overall flashing time for a single channel is the sum of the flashing times for each ECU. The flashing time for any given ECU is the sum of the duration of the running flashing state and the duration of the suspended flashing state. However, based on the flashing method of this application embodiment, while one ECU is in the suspended state, another ECU can be flashed, and the suspended ECU can subsequently resume flashing from the point of interruption.
[0071] For example, a target channel includes two ECUs: ECU A and ECU B In the case of serial flashing, the ECU A The flash operation lasted for time t. A1 It was then suspended for a duration of t. A2 After returning to normal, it took another t days. A3 The flashing process is complete. The flashing operation of ECUB took t seconds. B The overall flushing time of the target channel is t. A1 +t A2 +t A3 +t B However, according to the method of the embodiments of this application, when the EVA is in a suspended state, t A2 During the period, ECU B It has already been overwritten, that is, t A2 and t B There is overlap, if t B ≤t A2 Then, when the EVA is in a suspended state, t A2 The flashing of the ECUB can be completed within the specified time period, therefore the overall flashing time for this target channel is only t. A1 +t A2 +t A3 If t B >t A2 Then, when the EVA is in a suspended state, t A2 During the specified time period, once the ECUB flashing is complete, the ECU can be scheduled again. A If the writing continues, the total writing time for the target channel is only t. A1 +t B +t A3 .
[0072] In summary, based on the flashing method of this application embodiment, the flashing operation time of each ECU is relatively fixed, but the actual flashing operation time of different ECUs can overlap to some extent. During the overlapping period, it is guaranteed that one ECU will perform the flashing operation without waiting for the suspended ECU to resume flashing or finish flashing, effectively eliminating idle time without operation, thereby shortening the overall flashing time of the channel and improving the ECU flashing efficiency.
[0073] Figure 4 This is a schematic diagram of a writing device for an electronic controller provided in an embodiment of this application. The writing device for the electronic controller provided in this embodiment includes:
[0074] The flashing module 210 is used to sequentially select each ready electronic controller from the target channel as the target electronic controller and perform a flashing operation on the target electronic controller.
[0075] The interrupt module 220 is used to interrupt the flashing operation of the target electronic controller if the target electronic controller is in a suspended state during the flashing operation of the target electronic controller, and return to the steps of sequentially selecting each ready electronic controller from the target channel and performing the flashing operation of the target electronic controller.
[0076] When the currently being written electronic controller is suspended, this device interrupts the writing operation on that electronic controller and promptly writes another electronic controller without waiting for the original electronic controller to resume writing or for the writing process to finish, thereby saving time and improving the writing efficiency of the electronic controller.
[0077] Optionally, the device may also include:
[0078] The recording module is used to record the interruption information of the target electronic controller after the write operation to the target electronic controller is interrupted.
[0079] The flashing module 210 is used for:
[0080] If the target electronic controller has interrupt information, then according to the interrupt information, a flashing operation is performed on the unflashed part of the target electronic controller.
[0081] Optionally, the device may also include:
[0082] The status flag module is used during the process of performing a write operation on the target electronic controller.
[0083] If the target electronic controller responds with a negative code, then the target electronic controller is marked as suspended.
[0084] If the target electronic controller is in a suspended state, and the target electronic controller responds with an affirmative response to the flashing step of the terminal during the flashing operation, then the target electronic controller is marked as ready.
[0085] Optionally, the device further includes: a status marking module, used to mark the target electronic controller as a target state if, during the process of performing a write operation on the target electronic controller, the target electronic controller responds with a negative response or response timeout for any write step of the write operation, or if the target electronic controller responds with a positive response for the last write step of the write operation.
[0086] The flashing module 210 is also used to: return to the steps of sequentially selecting each ready state electronic controller from the target channel and performing a flashing operation on the target electronic controller, until all electronic controllers in the target channel are in the target state.
[0087] In one embodiment, the step of sequentially selecting each ready state electronic controller from the target channel as the target electronic controller includes:
[0088] Each time a target electronic controller is selected, the electronic controllers in the target channel are polled in the set order of their electronic controller numbers, so that the first electronic controller in a ready state that meets the scheduling conditions is selected as the target electronic controller.
[0089] In one embodiment, the step of sequentially selecting each ready electronic controller from the target channel as the target electronic controller further includes: each time a target electronic controller is selected,
[0090] If there is an electronic controller in a non-target state in the target channel, and no electronic controller in a ready state is detected after polling, then after detecting a trigger event, the step of polling the electronic controllers in the target channel according to the preset arrangement order of the electronic controller numbers is re-executed; the trigger event includes at least one of the following:
[0091] There is at least one electronic controller in the target channel that is in a ready state; the waiting time reaches the set time.
[0092] The electronic controller writing device provided in this application embodiment can be used to execute the electronic controller writing method provided in any of the above embodiments, and has corresponding functions and beneficial effects.
[0093] Figure 5 A schematic diagram of an electronic device 10, which can be used to implement embodiments of this application, is shown. The electronic device 10 is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device 10 may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, user equipment, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the application described and / or claimed herein.
[0094] like Figure 5 As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12 or a random access memory (RAM) 13, communicatively connected to the at least one processor 11. The memory stores computer programs executable by the at least one processor. The processor 11 can perform various appropriate actions and processes based on the computer program stored in the ROM 12 or loaded from storage unit 18 into the RAM 13. The RAM 13 may also store various programs and data required for the operation of the electronic device 10. The processor 11, ROM 12, and RAM 13 are interconnected via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0095] Multiple components in electronic device 10 are connected to I / O interface 15, including: input unit 16, such as keyboard, mouse, etc.; output unit 17, such as various types of displays, speakers, etc.; storage unit 18, such as disk, optical disk, etc.; and communication unit 19, such as network card, modem, wireless transceiver, etc. Communication unit 19 allows electronic device 10 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks and wireless networks.
[0096] Processor 11 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 11 performs the various methods and processes described above.
[0097] In some embodiments, the methods described above can be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program can be loaded and / or installed on electronic device 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the methods described above can be performed. Alternatively, in other embodiments, processor 11 can be configured to perform the methods of any of the embodiments described above by any other suitable means (e.g., by means of firmware).
[0098] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0099] Computer programs used to implement the methods of this application may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0100] In the context of this application, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium can be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0101] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device 10, which includes: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device 10. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0102] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or computing systems that include middleware components (e.g., application servers), or computing systems that include frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.
[0103] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.
[0104] This application also provides a computer program product, including a computer program and / or instructions, which, when executed by a processor, implement the electronic controller writing method as described in any of the above embodiments.
[0105] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this application can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this application can be achieved, and this is not limited herein.
[0106] The specific embodiments described above do not constitute a limitation on the scope of protection of this application. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this application should be included within the scope of protection of this application.< / channelscheduling> < / channelscheduling> < / ecuprocessing> < / ecuprocessing> < / ecuprocessing> < / channelscheduling>
Claims
1. A method of flashing an electronic controller, the method comprising: The method comprises: selecting each electronic controller in a ready state from a target channel as a target electronic controller in turn, and performing a flashing operation on the target electronic controller; during the flashing operation on the target electronic controller, if the target electronic controller is in a suspended state, interrupting the flashing operation on the target electronic controller, and returning to the step of selecting each electronic controller in a ready state from the target channel as a target electronic controller in turn, and performing a flashing operation on the target electronic controller.
2. The method of claim 1, wherein, After the flashing operation on the target electronic controller is interrupted, the method further comprises: the flashing operation on the target electronic controller comprises: if the target electronic controller has interruption information, performing a flashing operation on an unflashed part of the target electronic controller according to the interruption information.
3. The method of claim 1, wherein, The method further comprises: during the flashing operation on the target electronic controller, if the target electronic controller returns a negative code, marking the target electronic controller as a suspended state; if the target electronic controller is in a suspended state, and the target electronic controller returns an affirmative acknowledgement for a flashing step interrupted in the flashing operation, marking the target electronic controller as a ready state.
4. The method of claim 1, wherein, The method further comprises: during the flashing operation on the target electronic controller, if the target electronic controller returns a negative acknowledgement or a response timeout for any flashing step in the flashing operation, or if the target electronic controller returns an affirmative acknowledgement for the last flashing step in the flashing operation, marking the target electronic controller as a target state; returning to the step of selecting each electronic controller in a ready state from the target channel as a target electronic controller in turn, and performing a flashing operation on the target electronic controller, until all electronic controllers in the target channel are in a target state.
5. The method according to any one of claims 1 to 4, characterized in that, The step of selecting each electronic controller in a ready state from the target channel as a target electronic controller in turn comprises: polling the electronic controllers in the target channel in a set arrangement order of electronic controller numbers to select an electronic controller in a ready state as a target electronic controller when selecting a target electronic controller each time.
6. The method of claim 5, wherein, The step of selecting each electronic controller in a ready state from the target channel as a target electronic controller in turn further comprises: if there is an electronic controller in a non-target state in the target channel, and no electronic controller in a ready state is detected after polling, re-performing the step of polling the electronic controllers in the target channel in a set arrangement order of electronic controller numbers after a trigger event is detected when selecting a target electronic controller each time. The trigger event comprises at least one of: there is at least one electronic controller in a ready state in the target channel; a waiting time length reaches a set time length.
7. A writing device for an electronic controller, characterized in that, The method comprises: a flashing module, configured to select each electronic controller in a ready state from a target channel as a target electronic controller in turn, and perform a flashing operation on the target electronic controller. The interrupt module is configured to interrupt the flashing operation on the target electronic controller and return to the step of sequentially selecting each ready state electronic controller from the target channel and performing the flashing operation on the target electronic controller if the target electronic controller is in the suspended state during the execution of the flashing operation on the target electronic controller.
8. An electronic device, comprising: Comprising: at least one processor; and a memory connected with the at least one processor in communication; wherein the memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor to enable the at least one processor to perform the electronic controller flashing method according to any one of claims 1-6.
9. A computer readable storage medium having stored thereon a computer program, characterized in that, The program is executed by the processor to implement the electronic controller flashing method according to any one of claims 1-6.
10. A computer program product, characterised in that, Comprising computer programs / instructions, which are executed by the processor to implement the electronic controller flashing method according to any one of claims 1-6.