Vehicle part parallel flashing method and device, electronic equipment and storage medium

CN122963589APending Publication Date: 2026-10-23BEIJING AUTOMOBILE RES GENERAL INST
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611304223.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-26
Publication Date
2026-10-23

AI Technical Summary

Technical Problem

[0003]本申请提供一种车辆零件并行刷写方法、装置、电子设备及存储介质,以解决相关技术中,由于相关技术未综合考虑实际整车总线能力与零件刷写实际长度之间的匹配关系,容易导致并行任务之间的总线资源竞争,使部分并行刷写线程处于等待状态,从而造成总线资源利用率不高、刷写调度效率较低、整体升级时长较长的问题

Benefits of technology

[0013]通过以上技术手段,根据车辆的网络拓扑信息确定实际刷写资源信息,可以识别各域控、总线及车辆零件之间的连接关系,获取各域控对应的车辆零件数量、所属总线以及总线的并行通信能力等信息,从而准确确定车辆当前可用的并行刷写资源,为后续配置域控及总线的并行刷写线程数量和车辆零件分组提供依据。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122963589A_ABST
    Figure CN122963589A_ABST
Patent Text Reader

Abstract

The application relates to the technical field of data processing, in particular to a vehicle part parallel flashing method and device, electronic equipment and a storage medium, wherein the method comprises the following steps: determining actual information of vehicle bus capacity; based on the actual information, configuring the number of parallel flashing threads of each domain control and bus; generating an optimized sorting with the shortest whole vehicle flashing duration according to the number of parallel flashing threads and the single part flashing duration, and performing vehicle part parallel flashing according to the optimized sorting. Therefore, the matching relationship between the actual whole vehicle bus capacity and the actual part flashing length is not comprehensively considered in the related art, which easily leads to bus resource competition among parallel tasks, thereby causing problems such as low bus resource utilization, low flashing scheduling efficiency, long overall upgrading duration and the like.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data processing technology, and in particular to a method, apparatus, electronic device and storage medium for parallel writing of vehicle parts. Background Technology

[0002] In related technologies, parallel flashing methods typically group vehicle parts into fixed groups based on a preset number of parallel flashing threads, and perform simultaneous flashing of multiple vehicle parts in a fixed order. However, because the relevant technologies do not comprehensively consider the matching relationship between the actual vehicle bus capabilities and the actual length of the parts to be flashed, bus resource competition between parallel tasks is likely to occur, causing some parallel flashing threads to be in a waiting state, resulting in low bus resource utilization, low flashing scheduling efficiency, and long overall upgrade time. Summary of the Invention

[0003] This application provides a method, apparatus, electronic device, and storage medium for parallel flashing of vehicle parts, in order to solve the problems in related technologies, which, due to the lack of comprehensive consideration of the matching relationship between the actual vehicle bus capability and the actual length of part flashing, are prone to bus resource competition between parallel tasks, causing some parallel flashing threads to be in a waiting state, resulting in low bus resource utilization, low flashing scheduling efficiency, and long overall upgrade time.

[0004] The first aspect of this application provides a method for parallel flashing of vehicle parts, comprising the following steps: determining the actual information of the vehicle bus capability; configuring the number of parallel flashing threads for each domain controller and bus based on the actual information; generating an optimized sort with the shortest overall vehicle flashing time based on the number of parallel flashing threads and the flashing time of a single part, and performing parallel flashing of vehicle parts based on the optimized sort.

[0005] By employing the above technical means, matching the number of parallel flashing threads with the actual communication capacity of the vehicle bus, and optimizing task sorting based on the single-piece flashing time, bus congestion, thread idleness, and task waiting can be reduced. This fully utilizes the parallel processing resources of the domain controller and the bus, shortening the total vehicle flashing time while ensuring flashing stability, and improving vehicle flashing efficiency and resource utilization.

[0006] Optionally, in one embodiment of this application, configuring the number of parallel flashing threads for each domain controller and bus based on actual information includes: determining the number of parallel flashing threads that a domain controller can support and the maximum number of parallel flashing threads for the bus based on actual information; determining the first number of parallel flashing threads for the domain controller based on the number of parallel flashing threads that can be supported, and determining the second number of parallel flashing threads for the bus based on the maximum number of parallel flashing threads.

[0007] By using the above technical means, the number of parallel flashing threads for each domain controller and bus can be configured according to the actual communication capabilities of the vehicle bus. This can match the number of flashing tasks with the processing capabilities of the domain controller and the carrying capacity of the bus, avoiding communication congestion, resource contention or flashing anomalies caused by too many parallel tasks. At the same time, it can make full use of available flashing resources and provide a stable resource configuration foundation for the dynamic task scheduling and parallel flashing of subsequent vehicle parts.

[0008] Optionally, in one embodiment of this application, generating an optimized ranking with the shortest overall vehicle flashing time based on the number of parallel flashing threads and the flashing time of a single part includes: grouping vehicle parts according to the number of second parallel flashing threads to obtain a first group and a corresponding flashing time; allocating the flashing time in the first group according to the number of first parallel flashing threads to obtain a second group; and generating an optimized ranking with the shortest overall vehicle flashing time based on the second group.

[0009] By using the above technical means, vehicle parts are grouped twice according to the number of parallel writing threads of the bus and domain controller. This allows for the establishment of writing task allocation relationships from both the perspectives of bus communication resources and domain controller processing resources. This ensures that each group of vehicle parts is matched with the corresponding available parallel resources, reducing thread idleness, bus congestion, and task waiting caused by uneven resource allocation.

[0010] Optionally, in one embodiment of this application, the brushing duration in the first group is allocated according to the number of first parallel brushing threads to obtain the second group, including: sorting the brushing durations in descending order to obtain a sequence of brushing durations, and calculating the average value of the sequence; based on the average value, with the goal of minimizing the difference between the sums of the brushing durations, traversing each duration in the sequence in turn until the traversal is completed to obtain the second group.

[0011] By using the above technical means, vehicle parts can be traversed and grouped by sorting and average values. The vehicle parts can be sorted according to the single-part writing time, and the average writing time of each group can be used as the basis for load balancing. The vehicle parts to be grouped are then assigned to the groups with the smaller current cumulative writing time to determine the final grouping result. This makes the writing load of each parallel group more balanced, reduces the waiting time between different groups, improves the utilization rate of parallel writing resources, and shortens the total writing time of the whole vehicle.

[0012] Optionally, in one embodiment of this application, determining the actual information of the vehicle bus capability includes: determining the communication path of the vehicle bus based on the vehicle's network topology information; determining the parallel task processing capability of the domain controller and the bus based on the communication path; and determining the actual information based on the parallel task processing capability.

[0013] By using the above technical means, the actual flashing resource information can be determined based on the vehicle's network topology information. This allows for the identification of the connection relationships between various domain controllers, buses, and vehicle parts, as well as the acquisition of information such as the number of vehicle parts corresponding to each domain controller, the bus to which it belongs, and the parallel communication capability of the bus. This enables the accurate determination of the currently available parallel flashing resources for the vehicle, providing a basis for the subsequent configuration of the number of parallel flashing threads for domain controllers and buses, and the grouping of vehicle parts.

[0014] Optionally, in one embodiment of this application, parallel flashing of vehicle parts according to optimized sorting includes: transmitting flashing data to the corresponding vehicle parts according to optimized sorting, and obtaining the flashing status of each vehicle part and the communication load of the corresponding bus in real time; after detecting that the vehicle part has completed flashing, releasing the parallel flashing thread occupied by the vehicle part, and allocating the subsequent vehicle parts to be flashed to the parallel flashing thread according to the available flashing resources of the current domain controller and bus, so as to execute the parallel flashing of vehicle parts.

[0015] By using the above technical means, the parallel flashing threads occupied by vehicle parts can be released in a timely manner, which can prevent completed flashing tasks from continuously occupying domain controller and bus resources. This allows the released parallel flashing resources to be allocated to subsequent vehicle parts to be flashed in a timely manner, reducing thread idle time and task waiting time, thereby improving the utilization rate of parallel flashing resources and shortening the whole vehicle flashing time.

[0016] Optionally, in one embodiment of this application, before performing parallel flashing of vehicle parts according to the optimized sorting, the method further includes: detecting whether the target vehicle parts meet the preset flashing conditions; if the target vehicle parts meet the preset flashing conditions, controlling the target vehicle parts to enter the flashing mode, and allowing parallel flashing to begin until all target vehicles are in the flashing mode.

[0017] By using the above technical means, based on the flashing conditions, flashing mode and current communication status of the target vehicle parts, it is determined whether the target vehicle parts are qualified for flashing. If the preset flashing conditions are met and the flashing mode has been entered, it is determined that the flashing task can be executed. This ensures that the flashing task is executed when the vehicle parts are in normal condition and the flashing environment meets the requirements, reducing the risk of flashing failure due to parts not being ready or abnormal communication status.

[0018] A second aspect of this application provides a parallel flashing device for vehicle parts, comprising: a determination module for determining actual information about the vehicle bus capability; a configuration module for configuring the number of parallel flashing threads for each domain controller and bus based on the actual information; and a flashing module for generating an optimized sort with the shortest overall vehicle flashing time based on the number of parallel flashing threads and the flashing time of a single part, and performing parallel flashing of vehicle parts based on the optimized sort.

[0019] Optionally, in one embodiment of this application, the configuration module includes: a first determining unit, configured to determine the number of parallel write threads that the domain controller can support and the maximum number of parallel write threads on the bus based on actual information; and a second determining unit, configured to determine the first number of parallel write threads of the domain controller based on the number of parallel write threads that can be supported, and to determine the second number of parallel write threads on the bus based on the maximum number of parallel write threads.

[0020] Optionally, in one embodiment of this application, the flashing module includes: a grouping unit, configured to group vehicle parts according to the number of second parallel flashing threads to obtain a first group and a corresponding flashing duration; an allocation unit, configured to allocate the flashing duration in the first group according to the number of first parallel flashing threads to obtain a second group; and a generation unit, configured to generate an optimized sorting of the shortest flashing duration for the entire vehicle according to the second group.

[0021] Optionally, in one embodiment of this application, the generation unit includes: a sorting subunit, used to sort the brushing durations in descending order to obtain a sequence of brushing durations and calculate the average value of the sequence; and a traversal subunit, used to traverse each duration in the sequence sequentially based on the average value, with the goal of minimizing the difference between the sums of the brushing durations, until the traversal is completed to obtain a second group.

[0022] Optionally, in one embodiment of this application, the determining module includes: a third determining unit, configured to determine the communication path of the vehicle bus based on the vehicle's network topology information; a fourth determining unit, configured to determine the parallel task processing capability of the domain controller and the bus based on the communication path; and a fifth determining unit, configured to determine actual information based on the parallel task processing capability.

[0023] Optionally, in one embodiment of this application, the flashing module includes: a transmission unit, configured to transmit flashing data to the corresponding vehicle parts according to the optimized sorting, and to obtain the flashing status of each vehicle part and the communication load of the corresponding bus in real time; and a release unit, configured to release the parallel flashing thread occupied by the vehicle part after detecting that the vehicle part has completed the flashing, and to allocate the subsequent vehicle parts to be flashed to the parallel flashing thread according to the available flashing resources of the current domain controller and bus, so as to perform parallel flashing of the vehicle parts.

[0024] Optionally, in one embodiment of this application, the parallel writing device for vehicle parts further includes: a detection module for detecting whether the target vehicle parts meet the preset writing conditions; and a control module for controlling the target vehicle parts to enter the writing mode when the target vehicle parts are detected to meet the preset writing conditions, and allowing parallel writing to begin when all target vehicles are in the writing mode.

[0025] A third aspect of this application provides an electronic device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor. The processor executes the program to implement the parallel writing method for vehicle parts as described in the above embodiments.

[0026] A fourth aspect of this application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described parallel brushing method for vehicle parts.

[0027] The fifth aspect of this application provides a vehicle including the above-described vehicle parts parallel writing device, or electronic device, or computer-readable storage medium, for implementing the above-described vehicle parts parallel writing method.

[0028] Additional aspects and advantages of this application will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of this application. Attached Figure Description

[0029] The above and / or additional aspects and advantages of this application will become apparent and readily understood from the following description of the embodiments taken in conjunction with the accompanying drawings, wherein: Figure 1 This is a flowchart of a parallel brushing method for vehicle parts according to an embodiment of this application; Figure 2 This is a schematic diagram illustrating the allocation of parallel brushing for vehicle parts according to one embodiment of this application; Figure 3 This is a schematic diagram illustrating the allocation of parallel brushing for vehicle parts according to another embodiment of this application; Figure 4 A schematic diagram illustrating the allocation of parallel brushing for vehicle parts according to yet another embodiment of this application; Figure 5 This is a block diagram of a parallel brushing device for vehicle parts according to an embodiment of this application; Figure 6 This is a schematic diagram of the structure of an electronic device according to an embodiment of this application.

[0030] Figure label: 10-Parallel writing device for vehicle parts; 100-Determining module, 200-Configuration module, 300-Writing module; 601-Memory, 602-Processor, 603-Communication interface. Detailed Implementation

[0031] The embodiments of this application are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain this application, and should not be construed as limiting this application.

[0032] The following description, with reference to the accompanying drawings, outlines a method, apparatus, electronic device, and storage medium for parallel flashing of vehicle parts according to embodiments of this application. Addressing the technical problems mentioned in the background art, where related technologies fail to comprehensively consider the matching relationship between the actual vehicle bus capabilities and the actual length of part flashing, easily leading to bus resource contention between parallel tasks and causing some parallel flashing threads to be in a waiting state, resulting in low bus resource utilization, low flashing scheduling efficiency, and long overall upgrade time, this application provides a method for parallel flashing of vehicle parts. This method aims to dynamically group and schedule vehicle part flashing tasks in parallel based on domain control processing capabilities and bus communication capabilities, rationally allocate parallel flashing resources, and reduce bus congestion, thread idleness, and task waiting by timely release of threads after flashing completion and dynamic task replacement, thereby shortening the overall vehicle flashing time and improving vehicle flashing efficiency and the stability of the flashing process.

[0033] Specifically, Figure 1 This is a flowchart illustrating a parallel flashing method for vehicle parts provided in an embodiment of this application.

[0034] like Figure 1 As shown, the parallel flashing method for vehicle parts includes the following steps: In step S101, the actual information of the vehicle bus capability is determined.

[0035] The actual information of vehicle bus capabilities may include, but is not limited to, basic bus communication capabilities, real-time bus communication capabilities, parallel bus flashing capabilities, master control / domain control data forwarding capabilities, bus network topology capabilities, and flashing data carrying capabilities; its actual information includes, but is not limited to, actual communication rate, actual bus load rate, actual available communication bandwidth, actual number of available parallel flashing threads, actual data forwarding rate, actual number of concurrent forwardings, and actual bus connection relationships.

[0036] This application embodiment, by determining the actual information of the vehicle bus in the current flashing state, can avoid resource allocation deviations caused by determining the number of parallel flashes solely based on the bus's rated parameters. This provides an accurate basis for subsequent task sorting and parallel task grouping based on the actual length of vehicle parts flashing, thereby improving bus resource utilization and parallel flashing efficiency, and shortening the vehicle software upgrade time.

[0037] Optionally, in one embodiment of this application, determining the actual information of the vehicle bus capability includes: determining the communication path of the vehicle bus based on the vehicle's network topology information; determining the parallel task processing capability of the domain controller and the bus based on the communication path; and determining the actual information based on the parallel task processing capability.

[0038] Domain control refers to electronic control equipment used for centralized communication, data processing, task scheduling and control of multiple electronic control units within a specific functional domain of a vehicle, including body domain control, powertrain domain control, chassis domain control, cockpit domain control and central computing unit, etc.

[0039] A vehicle bus is an onboard communication channel that connects the domain controller to one or more ECUs (Electronic Control Units) to be flashed, and is used to transmit flashing data, diagnostic messages, and control information between the domain controller and the ECUs. For example, a vehicle bus can be a CAN (Controller Area Network) communication channel, a CANFD (Controller Area Network with Flexible Data-Rate) communication channel, a FlexRay communication channel, or an onboard Ethernet communication channel, etc.

[0040] Vehicle components include ECUs such as engine controller, transmission controller, body control module, chassis controller, brake controller, steering controller, power battery management system, motor controller, on-board charger, thermal management controller, and body domain controller.

[0041] This application embodiment can identify the connection relationships between the central control unit, each domain controller, each bus, and the parts to be flashed based on the vehicle network topology information, and determine the specific communication path through which the flashing data is transmitted from the central control unit / domain controller to the target part along the connection relationship; then, for each communication path, it analyzes the data processing and forwarding capabilities of the domain controller in the path, as well as the communication rate, available bandwidth, and real-time load rate of the corresponding bus, and thus determines the number of flashing tasks that the domain controller and bus can simultaneously carry in the current flashing state, i.e., the parallel task processing capability; finally, this application embodiment summarizes the parallel task processing capabilities corresponding to each domain controller and bus to form actual information on the vehicle bus capabilities, including the number of domain controllers that can process in parallel, the number of buses that can carry in parallel, the available communication bandwidth, and the communication resource usage capability, providing a basis for subsequently determining the grouping of parallel flashing tasks for vehicle parts.

[0042] In step S102, the number of parallel write threads for each domain controller and bus is configured based on actual information.

[0043] In the embodiments of this application, the goal of the parallel flashing design for vehicle parts is to minimize the total flashing time while complying with the parallel flashing rules. The main controller / domain controller supports multi-channel parallel flashing of add-ins, and the number of parallel flashing processes can be configured based on the domain controller and actual circuit testing conditions to determine the number of parallel threads on the domain controller. Specific requirements may include: 1) Domain controllers with the same power requirements can be flashed in parallel. The buses under the domain controllers can be flashed in parallel. The controllers in the buses are divided into two types: controllers that support serial flashing and controllers that support parallel flashing. 2) The serial flashing controller prioritizes the flashing order and executes them sequentially in the same process. After the flashing is completed, the parallel controller is started for flashing. 3) The number of parallel threads that a domain controller can support needs to be tested and verified in advance, and the number of parallel write threads that each domain controller can support needs to be confirmed. 4) The bus has a maximum limit on the number of concurrent writes. The number of controllers that can be written to simultaneously on the bus must not exceed the maximum concurrent write limit set on the bus. 5) Group the controllers in the domain controller according to the number of threads in the domain controller. When grouping, the total duration of each group should be as close as possible while meeting the above conditions.

[0044] According to the specific requirements and the previously determined parallel flashing task capacity that the domain controller and bus can currently bear, the embodiments of this application can set the number of flashing task threads allowed to run simultaneously for each domain controller and each bus, so that the number of threads matches the actual processing capacity, communication bandwidth and load capacity, avoiding bus congestion or insufficient domain controller resources due to too many threads, thereby reducing resource competition and waiting time between parallel flashing tasks, improving the resource utilization and flashing efficiency of the domain controller and vehicle bus, and shortening the overall flashing time of vehicle parts and the whole vehicle software upgrade time.

[0045] As a specific example, based on actual information, the number of parallel write threads for each domain controller and bus is configured, including: determining the number of parallel write threads that the domain controller can support and the maximum number of parallel write threads for the bus based on actual information; determining the first number of parallel write threads for the domain controller based on the number of parallel write threads that can be supported, and determining the second number of parallel write threads for the bus based on the maximum number of parallel write threads.

[0046] Understandably, the number of parallel write threads that can be supported can be determined based on the domain controller's current processing, scheduling, memory, and data forwarding capabilities, which theoretically allows the domain controller to handle a maximum number of write tasks simultaneously. The maximum number of parallel write threads can be determined based on factors such as the communication rate, available bandwidth, and real-time load rate of a particular bus, which determines the maximum number of write tasks that the bus can support simultaneously.

[0047] For example, assuming that the vehicle domain controller A is connected to CAN1 and CAN2: based on the processing capacity of domain controller A, the number of parallel flashing threads that can be supported is determined to be 4; based on the actual communication bandwidth and load rate of CAN1, the maximum number of parallel flashing threads is determined to be 2; based on the actual communication capacity of CAN2, the maximum number of parallel flashing threads is determined to be 3.

[0048] However, the current ECUs to be flashed and the amount of flashing data indicate that: CAN1 has ECU1, ECU2, and ECU3, of which ECU1 and ECU2 are suitable for flashing simultaneously; CAN2 has ECU4, ECU5, and ECU6, but currently only ECU4 and ECU5 need to be flashed.

[0049] Therefore, the embodiments of this application can be actually configured as follows: the number of first parallel flashing threads of domain controller A is 4; the number of second parallel flashing threads of CAN1 is 2; and the number of second parallel flashing threads of CAN2 is 2.

[0050] This application embodiment improves parallel flashing efficiency and shortens the vehicle software upgrade time by reasonably configuring the number of parallel flashing threads to avoid bus congestion, message transmission delay and mutual blocking of flashing tasks caused by the number of parallel flashing tasks exceeding the domain controller processing capacity or bus communication carrying capacity. At the same time, it avoids insufficient utilization of bus and domain controller resources due to insufficient parallel thread configuration.

[0051] In step S103, an optimized sort with the shortest overall vehicle writing time is generated based on the number of parallel writing threads and the writing time of a single part, and parallel writing of vehicle parts is performed based on the optimized sort.

[0052] The single-part flashing time refers to the actual time required for an ECU corresponding to a single vehicle part to independently perform a complete flashing task. It usually starts from the time the flashing session is established or the flashing data is transmitted, until the ECU completes the data writing, verification and returns a successful flashing result.

[0053] According to the embodiments of this application, the controller can be arranged in all threads of the domain controller according to the single-item writing time value of the controller being written, so as to minimize the total writing time, reduce thread idle waiting and task blocking, and ensure the parallelism and writing speed of the writing process.

[0054] For example, the embodiments of this application assume that the domain controller is responsible for flashing BUS A-BUS D, with 4 buses, the number of parallel flashing threads of the master controller is 4, and the maximum number of parallel flashing threads per bus is 2. The following will describe step by step the process of generating the optimized sorting with the shortest whole vehicle flashing time.

[0055] First, such as Figure 2As shown, the embodiments of this application can convert the above business logic into a mathematical problem. AB CD represent four buses that a master controller / domain controller is responsible for writing. A1 A2 ... in the table represent a controller in the bus. The number after the controller, such as A1:10, represents the part writing time.

[0056] The requirement for generating the optimized sorting with the shortest vehicle flashing time in this embodiment can be interpreted as follows: 1. The number of threads supported for parallel writing by the master controller / domain controller can be customized; in this embodiment, it is temporarily defined as 4. 2. Each bus has a limit on the number of parallel threads, meaning that the numbers in A, B, C, and D can only be allocated in a limited number of threads at the same time. The number can be customized. In this embodiment, it is temporarily defined as 2, that is, the numbers in A, B, C, and D can only appear in two threads at the same time. 3. Under the premise of satisfying 2, assign all numbers in A, B, C, and D to threads, and minimize the difference in the sum of numbers in all threads; 4. Minimize calculation time as much as possible.

[0057] One possible approach is to generate an optimized ranking of the shortest overall vehicle flashing time based on the number of parallel flashing threads and the flashing time of a single part. This includes: grouping vehicle parts according to the number of second parallel flashing threads to obtain a first group and its corresponding flashing time; allocating the flashing time in the first group according to the number of first parallel flashing threads to obtain a second group; and generating an optimized ranking of the shortest overall vehicle flashing time based on the second group.

[0058] It is understandable that there is often more than one optimal solution to the above problem. To obtain the optimal solution, it is necessary to find all possible permutations, calculate all possible time steps, find the permutation with the smallest sum, and then select one from them. This approach results in high algorithm complexity and long computation time. Therefore, the embodiments of this application aim to find an algorithm that is both computationally efficient and yields results close to the optimal solution.

[0059] In the embodiments of this application, such as Figure 3 As shown in (a) of the application, due to the limitation in requirement 2, the numbers in A, B, C and D can appear in at most two threads at the same time. In this embodiment, the numbers in each group can be divided into two parts, and the difference between the sums of the two parts is minimized.

[0060] Furthermore, such as Figure 3 As shown in (b) of this application embodiment, the sum of the numbers grouped together in the figure above is calculated.

[0061] The grouping in this embodiment ensures that when numbers are subsequently assigned to threads, the numbers in A, B, C, and D will not appear in three or more threads.

[0062] Subsequently, as Figure 3 As shown in (c) of this application, the embodiments of this application can... Figure 3 The numbers in (b) are distributed among four threads to minimize the difference in the sum of the numbers in each thread.

[0063] Finally, as shown in the figure Figure 3 As shown in (d) in the present application, the embodiments can be used to... Figure 3 The numbers in (c) are restored to the corresponding parts.

[0064] It is understood that the core of this application's embodiments is to divide a set of integers into N arrays, such that the difference between the sum and the average of each array is minimized. The algorithmic concept of this application's embodiments may include: (1) All parts in a bus are divided into two groups to obtain the first group; (2) Divide the grouped numbers into 4 groups to obtain the second group.

[0065] In actual execution, the brushing duration in the first group is allocated according to the number of the first parallel brushing threads to obtain the second group. This includes: sorting the brushing durations in descending order to obtain a sequence of brushing durations and calculating the average value of the sequence; based on the average value, with the goal of minimizing the difference between the sums of the brushing durations, traversing each duration in the sequence in turn until the traversal is completed to obtain the second group.

[0066] For example, in this embodiment of the application, a set of integers 18,28,2,27,35,22,10,6,500,5,3,2,1 is divided into four groups to determine the second grouping.

[0067] First, the embodiments of this application can be sorted in descending order, and the sorted order is: 500, 35, 28, 27,22, 18, 10, 6, 5, 3, 2, 2, 1.

[0068] Secondly, the embodiments of this application can calculate the average value, which needs to be divided into four groups, so the sum is divided by 4, which yields: (500, 35, 28, 27, 22, 18, 10, 6, 5, 3, 2, 2, 1) / 4 = 164.75.

[0069] Subsequently, as Figure 4 As shown, in this embodiment of the application, the array is traversed with the goal of minimizing the difference between the sum of the write and refresh times.

[0070] 1) In the first round, determine whether the first value is greater than the average value of 164.75.

[0071] If 500 > 164.75, take 500 as a separate group, such as... Figure 4 As shown in (a) of the diagram.

[0072] Subsequently, the average value is recalculated in this embodiment. The average value after removing 500 from the number set is calculated. Since 500 occupies one group, only 3 arrays remain to be allocated, resulting in: (35, 28, 27, 22, 18, 10, 6, 5, 3, 2, 2, 1) / 3=53.

[0073] 2) In the second round, the first number 35 < 53, so 35 is placed in the second group, as shown below. Figure 4 As shown in (b) of the diagram.

[0074] 53-35=18; Iterate through the second number, 28. Since 28 > 18, continue iterating through the next number. The next number is 27. Since 27 > 18, continue iterating to the next number. The next number is 22. Since 22 > 18, we iterate through the next number. The next number is 18, and 18 = 18, so we put 18 into the second array, as shown below. Figure 4 As shown in (c) in the figure.

[0075] Subsequently, in this embodiment of the application, the average value is recalculated. 35 and 18 are removed from the number set, and the average value of the remaining numbers is calculated. Since the second array has already been allocated, only two arrays remain that can be allocated, resulting in: (28, 27, 22, 10, 6, 5, 3, 2, 2, 1) / 2=53.

[0076] 3) In the third round, 28 < 53, so 28 is placed in the third array, such as... Figure 4 As shown in (d) in the figure.

[0077] 53-28=25; Iterate through the second number, 27. Since 27 > 25, continue iterating through the next number. The next number is 22, because 22 < 25. Next, we compare the size of (27-25) and (25-22).

[0078] Since (27-25) < (25-22), put 22 into a temporary array and then calculate: 25-22=3; Continue iterating through the set of numbers. 10 > 3, 10 - 3 = 7, so let's choose the next number. 6 > 3, 6 - 3 = 3, so let's choose the next number. 5 > 3, 5 - 3 = 2, so let's choose the next number. 3=3, 3-3=0, put 22 and 3 into the third array, such as Figure 4 As shown in (e) in the diagram.

[0079] 4) Since the three groups are already determined, the remaining groups don't need to be traversed; they should all be placed in the last group, such as... Figure 4 As shown in (f) in the figure.

[0080] As can be seen, in this embodiment, the average value can be calculated first, and then it can be determined that numbers larger than the average value are placed in a separate group, and numbers smaller than the average value are found in the remaining numbers that are equal to or closest to the average value and placed in a group. This process is repeated until the N-1th array is allocated, and finally the remaining numbers are placed in the last group.

[0081] Optionally, in one embodiment of this application, parallel flashing of vehicle parts according to optimized sorting includes: transmitting flashing data to the corresponding vehicle parts according to optimized sorting, and obtaining the flashing status of each vehicle part and the communication load of the corresponding bus in real time; after detecting that the vehicle part has completed flashing, releasing the parallel flashing thread occupied by the vehicle part, and allocating the subsequent vehicle parts to be flashed to the parallel flashing thread according to the available flashing resources of the current domain controller and bus, so as to execute the parallel flashing of vehicle parts.

[0082] This application embodiment can use real-time writing status and resource usage as feedback to dynamically release and fill in vehicle part writing tasks, and continuously maintain parallel writing within the limits of domain control processing capacity and bus communication capacity, thereby reducing thread idleness and bus resource waiting, and shortening the total writing time of all vehicle parts.

[0083] In one embodiment of this application, before performing parallel flashing of vehicle parts according to the optimized sorting, the method further includes: detecting whether the target vehicle parts meet the preset flashing conditions; if the target vehicle parts meet the preset flashing conditions, controlling the target vehicle parts to enter the flashing mode, and allowing parallel flashing to begin until all target vehicles are in the flashing mode.

[0084] Preset flashing conditions refer to the prerequisites that must be met before flashing vehicle parts, used to determine whether the flashing operation is safe and feasible. For example: the target vehicle part establishes normal communication with the domain controller; the part's power supply voltage is within a preset range; the vehicle is stationary or in a safe state; the part is currently fault-free; the storage space meets the firmware writing requirements; the target part's software version matches the software package to be flashed; and the bus communication status is normal. Only when these conditions are met is the next stage allowed.

[0085] Flash mode is when a vehicle component switches from normal operation to a state specifically for receiving and executing firmware flashing data. In this mode, the vehicle component typically stops or restricts normal business functions while enabling flashing communication, data reception, data erasure, program writing, and verification functions, while maintaining the flashing communication link with the domain controller.

[0086] As a specific example, in this embodiment of the application, when performing parallel flashing of three vehicle parts A, B, and C, the system first checks whether A, B, and C meet the flashing conditions such as power supply, communication, fault status, and software version. Once A meets the conditions, it enters flashing mode; once B meets the conditions, it enters flashing mode; and if C does not meet the conditions, it continues to wait. Only after all three parts (A, B, and C) have entered flashing mode does the domain controller officially issue flashing data and initiate parallel flashing, thereby avoiding inconsistencies in flashing timing or communication conflicts caused by some parts starting flashing while others are still in normal operation.

[0087] This application embodiment verifies the state of the target vehicle parts before flashing and switches the state uniformly by flashing conditions and flashing modes. This ensures that each target vehicle part enters the flashing mode after the communication, power supply, fault status and software environment meet the requirements. Parallel flashing is started after all target vehicle parts have entered the flashing mode, thereby ensuring the timing consistency and execution security of parallel flashing and reducing the risk of flashing failure or communication abnormalities due to some parts not being ready.

[0088] According to the parallel flashing method for vehicle parts proposed in this application, the number of parallel flashing threads for each domain controller and bus is configured according to the actual communication capability of the vehicle bus, so that the parallel flashing tasks are matched with the processing capacity of the domain controller and the carrying capacity of the bus, avoiding bus congestion or domain controller resource contention caused by too many threads; furthermore, the tasks are sorted according to the single flashing time of each vehicle part, so that the flashing tasks with longer time consumption are reasonably scheduled, and the idle time of threads and task waiting time are reduced, thereby reducing the total flashing time of the whole vehicle while ensuring the stability of the flashing process, and improving the vehicle flashing efficiency and resource utilization.

[0089] Next, the parallel writing device for vehicle parts according to an embodiment of this application is described with reference to the accompanying drawings.

[0090] Figure 5 This is a block diagram of a parallel brushing device for vehicle parts according to an embodiment of this application.

[0091] like Figure 5 As shown, the parallel writing device 10 for vehicle parts includes: a determination module 100, a configuration module 200, and a writing module 300.

[0092] The determination module 100 is used to determine the actual information of the vehicle bus capability.

[0093] Configuration module 200 is used to configure the number of parallel write threads for each domain controller and bus based on actual information.

[0094] The flashing module 300 is used to generate an optimized sort with the shortest whole vehicle flashing time based on the number of parallel flashing threads and the flashing time of a single part, and to perform parallel flashing of vehicle parts based on the optimized sort.

[0095] Optionally, in one embodiment of this application, the configuration module 200 includes: a first determining unit and a second determining unit.

[0096] The first determining unit is used to determine the number of parallel writing threads that the domain controller can support and the maximum number of parallel writing threads on the bus based on actual information.

[0097] The second determining unit is used to determine the first number of parallel write threads of the domain controller based on the number of parallel write threads that can be supported, and to determine the second number of parallel write threads of the bus based on the maximum number of parallel write threads.

[0098] Optionally, in one embodiment of this application, the writing module 300 includes: a grouping unit, an allocation unit, and a generation unit.

[0099] The grouping unit is used to group vehicle parts according to the number of second parallel flashing threads to obtain the first group and the corresponding flashing time.

[0100] The allocation unit is used to allocate the brushing duration in the first group according to the number of the first parallel brushing threads, so as to obtain the second group.

[0101] The generation unit is used to generate an optimized sort based on the second group, which has the shortest whole vehicle flashing time.

[0102] Optionally, in one embodiment of this application, the generation unit includes: a sorting subunit and a traversal subunit.

[0103] The sorting subunit is used to sort the brush durations from high to low to obtain a sequence of brush durations and calculate the average value of the sequence.

[0104] The sub-units are traversed in turn, with the goal of minimizing the difference between the sums of the brushing durations based on the average value, until the traversal is completed to obtain the second group.

[0105] Optionally, in one embodiment of this application, the determining module 100 includes: a third determining unit, a fourth determining unit, and a fifth determining unit.

[0106] The third determining unit is used to determine the communication path of the vehicle bus based on the vehicle's network topology information.

[0107] The fourth determining unit is used to determine the parallel task processing capabilities of the domain controller and the bus based on the communication path.

[0108] The fifth determining unit is used to determine the actual information based on the parallel task processing capability.

[0109] Optionally, in one embodiment of this application, the writing module 300 includes a transmission unit and a release unit.

[0110] The transmission unit is used to transmit flashing data to the corresponding vehicle parts according to the optimized sorting, and to obtain the flashing status of each vehicle part and the communication load of the corresponding bus in real time.

[0111] The release unit is used to release the parallel writing thread occupied by the vehicle part after detecting that the vehicle part has been written, and to allocate the subsequent vehicle parts to be written to the parallel writing thread according to the available writing resources of the current domain controller and bus, so as to perform parallel writing of the vehicle parts.

[0112] Optionally, in one embodiment of this application, the vehicle parts parallel writing device 10 further includes a detection module and a control module.

[0113] The detection module is used to detect whether the target vehicle parts meet the preset flashing conditions.

[0114] The control module is used to control the target vehicle parts to enter the flashing mode when the target vehicle parts are detected to meet the preset flashing conditions, and to allow parallel flashing to begin when all target vehicles are in the flashing mode.

[0115] It should be noted that the foregoing explanation of the parallel writing method embodiment for vehicle parts also applies to the parallel writing device for vehicle parts in this embodiment, and will not be repeated here.

[0116] According to the parallel flashing device for vehicle parts proposed in this application, the number of parallel flashing threads for each domain controller and bus is configured according to the actual communication capability of the vehicle bus, so that the parallel flashing tasks are matched with the processing capacity of the domain controller and the carrying capacity of the bus, avoiding bus congestion or domain controller resource contention caused by too many threads; furthermore, the tasks are sorted according to the single-part flashing time of each vehicle part, so that the time-consuming flashing tasks are reasonably scheduled and the idle time of threads and the waiting time of tasks are reduced, thereby reducing the total flashing time of the whole vehicle while ensuring the stability of the flashing process, and improving the vehicle flashing efficiency and resource utilization.

[0117] Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of this application. The electronic device may include: The memory 601, the processor 602, and the computer program stored on the memory 601 and capable of running on the processor 602.

[0118] When the processor 602 executes the program, it implements the parallel brushing method for vehicle parts provided in the above embodiments.

[0119] Furthermore, electronic devices also include: Communication interface 603 is used for communication between memory 601 and processor 602.

[0120] The memory 601 is used to store computer programs that can run on the processor 602.

[0121] The memory 601 may include high-speed RAM memory, and may also include non-volatile memory, such as at least one disk storage device.

[0122] If the memory 601, processor 602, and communication interface 603 are implemented independently, then the communication interface 603, memory 601, and processor 602 can be interconnected via a bus to complete communication between them. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of representation, Figure 6 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.

[0123] Optionally, in a specific implementation, if the memory 601, processor 602, and communication interface 603 are integrated on a single chip, then the memory 601, processor 602, and communication interface 603 can communicate with each other through an internal interface.

[0124] The processor 602 may be a central processing unit (CPU), an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of this application.

[0125] This embodiment also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described parallel writing method for vehicle parts.

[0126] This application also provides a vehicle, including the above-mentioned vehicle parts parallel writing device, or electronic device, or computer-readable storage medium, to implement the vehicle parts parallel writing method provided in this application.

[0127] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.

[0128] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this application, "N" means at least two, such as two, three, etc., unless otherwise explicitly specified.

[0129] Any process or method described in the flowchart or otherwise herein can be understood as representing a module, segment, or portion of code comprising one or N executable instructions for implementing custom logic functions or processes, and the scope of the preferred embodiments of this application includes additional implementations in which functions may be performed not in the order shown or discussed, including substantially simultaneously or in reverse order depending on the functions involved, as should be understood by those skilled in the art to which embodiments of this application pertain.

[0130] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (such as a computer-based system, a processor-included system, or other system that can fetch and execute instructions from, an instruction execution system, apparatus, or device). For the purposes of this specification, "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transmit programs for use by, or in conjunction with, an instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of computer-readable media include: an electrical connection having one or more wires (electronic device), a portable computer disk drive (magnetic device), random access memory (RAM), read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic devices, and portable optical disc read-only memory (CDROM). Alternatively, the computer-readable medium may be paper or other suitable media on which the program can be printed, since the program can be obtained electronically by optically scanning the paper or other medium, followed by editing, interpreting, or otherwise processing as necessary, and then stored in a computer memory.

[0131] It should be understood that the various parts of this application can be implemented using hardware, software, firmware, or a combination thereof. In the above embodiments, the N steps or methods can be implemented using software or firmware stored in memory and executed by a suitable instruction execution system. If implemented in hardware, as in another embodiment, it can be implemented using any one or more of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.

[0132] Those skilled in the art will understand that all or part of the steps of the methods in the above embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, the program includes one or a combination of the steps of the method embodiments.

[0133] Furthermore, the functional units in the various embodiments of this application can be integrated into a processing module, or each unit can exist physically separately, or two or more units can be integrated into a module. The integrated module can be implemented in hardware or as a software functional module. If the integrated module is implemented as a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium.

[0134] The storage medium mentioned above can be a read-only memory, a disk, or an optical disk, etc. Although embodiments of this application have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting this application. Those skilled in the art can make changes, modifications, substitutions, and variations to the above embodiments within the scope of this application.

Claims

1. A method for parallel writing of vehicle parts, characterized in that, Includes the following steps: Determine the actual information regarding the vehicle's bus capabilities; Based on the actual information, configure the number of parallel write threads for each domain controller and bus; Based on the number of parallel flashing threads and the flashing time of a single part, an optimized sorting with the shortest flashing time for the entire vehicle is generated, and vehicle parts are flashed in parallel according to the optimized sorting.

2. The method according to claim 1, characterized in that, The configuration of the number of parallel write threads for each domain controller and bus based on the actual information includes: Based on the actual information, determine the number of parallel write threads that the domain controller can support and the maximum number of parallel write threads for the bus. The first number of parallel write threads for the domain controller is determined based on the number of parallel write threads that can be supported, and the second number of parallel write threads for the bus is determined based on the maximum number of parallel write threads.

3. The method according to claim 2, characterized in that, The process of generating the optimized ranking with the shortest overall vehicle brushing time based on the number of parallel brushing threads and the brushing time per component includes: The vehicle parts are grouped according to the number of the second parallel flashing threads to obtain the first group and the corresponding flashing time; The brushing duration in the first group is allocated according to the number of the first parallel brushing threads to obtain the second group; The optimized sorting is generated based on the second group, which determines the vehicle flashing time.

4. The method according to claim 3, characterized in that, The step of allocating the brushing duration in the first group according to the number of the first parallel brushing threads to obtain the second group includes: The write durations are sorted from high to low to obtain a sequence of write durations, and the average value of the sequence is calculated. Based on the average value, with the goal of minimizing the difference between the sum of the writing durations, each duration in the sequence is traversed sequentially until the traversal is completed to obtain the second group.

5. The method according to claim 1, characterized in that, The actual information used to determine the vehicle bus capabilities includes: The communication path of the vehicle bus is determined based on the vehicle's network topology information; The parallel task processing capabilities of the domain controller and the bus are determined based on the communication path. The actual information is determined based on the parallel task processing capability.

6. The method according to claim 1, characterized in that, The parallel writing of vehicle parts according to the optimized sorting includes: According to the optimized sorting, the flashing data is transmitted to the corresponding vehicle parts, and the flashing status of each vehicle part and the communication load of the corresponding bus are obtained in real time. After detecting that the vehicle part has completed the flashing process, the parallel flashing thread occupied by the vehicle part is released, and according to the available flashing resources of the current domain controller and bus, the subsequent vehicle parts to be flashed are allocated to the parallel flashing thread to perform parallel flashing of the vehicle parts.

7. The method according to claim 1, characterized in that, Before performing parallel flashing of vehicle parts according to the optimized sorting, the process also includes: Check whether the target vehicle parts meet the preset flashing conditions; If the target vehicle part is detected to meet the preset flashing conditions, the target vehicle part is controlled to enter the flashing mode, and parallel flashing is allowed to begin when all target vehicles are in the flashing mode.

8. A parallel brushing and writing device for vehicle parts, characterized in that, include: The determination module is used to determine the actual information about the vehicle's bus capabilities. The configuration module is used to configure the number of parallel write threads for each domain controller and bus based on the actual information. The flashing module is used to generate an optimized sort with the shortest whole vehicle flashing time based on the number of parallel flashing threads and the flashing time of a single part, and to perform parallel flashing of vehicle parts based on the optimized sort.

9. An electronic device, characterized in that, include: A memory, a processor, and a computer program stored in the memory and capable of running on the processor, the processor executing the program to implement the parallel writing method for vehicle parts as described in any one of claims 1-7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, The program is executed by the processor to implement the parallel brushing method for vehicle parts as described in any one of claims 1-7.