UDS flashing pipeline parallel method, device and vehicle

By constructing a dynamic thread pool and performing real-time network quality assessment, and dynamically adjusting the number of threads and retransmission strategy, the efficiency and reliability issues of the UDS writing pipeline in dynamic network environments are solved, achieving a highly efficient and stable writing process.

CN122633252APending Publication Date: 2026-08-25WUHAN JIANGXIA CHUNENG AUTOMOBILE TECHNOLOGY R&D CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610758618.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-05-29
Publication Date
2026-08-25

AI Technical Summary

Technical Problem

Existing parallel pipelined methods for UDS brushing are inefficient and unreliable in dynamic network environments, cannot adapt to changes in network quality, and are prone to retransmission storms and brushing failures.

Method used

A dynamic thread pool is constructed to allocate tasks according to the sequential dependencies of UDS instructions. Round-trip time and logical packet loss rate are collected in real time. Network quality is evaluated through a sliding window, the number of threads is dynamically adjusted, and an exponential backoff algorithm is used for retransmission control to ensure instruction order and network adaptability.

Benefits of technology

This improves the efficiency and reliability of the UDS flashing pipeline in dynamic network environments, avoids flashing failures caused by network fluctuations, and ensures the stability and efficiency of the flashing process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122633252A_ABST
    Figure CN122633252A_ABST
Patent Text Reader

Abstract

The application provides a UDS flashing pipeline parallel method, device and vehicle, and belongs to the technical field of automobile electronics. The method comprises the following steps: constructing a dynamic thread pool comprising a plurality of working threads and an idle thread queue; parsing a UDS instruction sequence into a plurality of instruction tasks with sequence constraints according to a sequence dependency relationship, and sequentially distributing the instruction tasks to the idle thread queue for executing and sending in sequence, wherein the sending of subsequent instructions is paused when the sending of previous instructions is not completed; collecting a round-trip time of each UDS instruction in real time during the sending of the instructions, and calculating a logical packet loss rate based on a sliding window statistical logic; evaluating a current network quality by using a segmented decision rule according to the round-trip time and the logical packet loss rate; and dynamically adjusting the number of working threads in the dynamic thread pool according to an evaluation result. The application can adapt to network fluctuations, dynamically adjust concurrency, and improve the efficiency and reliability of UDS flashing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of automotive electronics technology, specifically to a parallel method, apparatus, and vehicle for UDS flashing pipeline. Background Technology

[0002] The Unified Diagnostic Service (UDS) protocol is the mainstream diagnostic communication standard in the automotive electronics field, widely used in scenarios such as software flashing, fault diagnosis, and parameter configuration of electronic control units (ECUs). In the UDS flashing process, the diagnostic tool needs to send a series of commands to the ECU in a prescribed order, including erasing, programming, and verification, and wait for the ECU to return a response. To improve flashing efficiency, existing technologies have proposed a pipelined parallel mechanism based on a fixed number of threads. This involves multiple worker threads sending commands concurrently, causing the ECU's processing time and communication time to overlap, thereby shortening the overall flashing time.

[0003] In the process of developing this invention, the inventors discovered that existing parallel pipeline methods for UDS brushing have at least the following drawbacks: First, the quality of communication links in vehicle diagnostic environments is significantly volatile due to factors such as vehicle driving status, electromagnetic interference, and wiring harness aging. Fixed-thread schemes cannot adapt to changes in network quality—concurrency is relatively insufficient when the network is good, while excessive concurrency exacerbates network congestion when the network deteriorates, leading to an increase in retransmitted packets. Second, existing mechanisms lack real-time awareness of network quality and cannot dynamically adjust parallel strategies based on indicators such as packet loss rate and response latency, failing to maintain the original concurrency level during sudden changes in network quality. Third, in extreme cases of high concurrency and poor network conditions, multiple threads triggering retransmissions simultaneously may cause a retransmission storm, further deteriorating link load and even causing brushing tasks to fail.

[0004] Therefore, existing parallel pipelined UDS writing methods suffer from low writing efficiency and insufficient reliability in dynamic network environments. Summary of the Invention

[0005] In view of this, it is necessary to provide a parallel method, apparatus and vehicle for UDS writing pipeline to solve the technical problems of low writing efficiency and poor reliability caused by the inability of existing methods to adapt to network fluctuations and lack of adaptive adjustment capabilities.

[0006] To address the aforementioned technical problems, in a first aspect, the present invention provides a parallel method for UDS brushing pipeline, comprising: Construct a dynamic thread pool, which contains several worker threads and an idle thread queue; The UDS instruction sequence is parsed into multiple instruction tasks with sequential constraints according to the sequential dependencies between instructions. Then, according to the sequential constraints, each instruction task is assigned to the idle thread queue to perform the corresponding instruction sending operation. When the preceding instruction task on which an instruction task depends has not been completed, the sending of the instruction task is paused. During the instruction sending process, the round-trip time of each UDS instruction is collected in real time, and the logical packet loss rate is statistically calculated based on the sliding window. Based on the round-trip time and the logical packet loss rate, the current network quality is evaluated using segmented decision rules to obtain the network quality evaluation result; Based on the network quality assessment results, the number of worker threads in the dynamic thread pool is dynamically adjusted.

[0007] In one possible implementation, assigning each instruction task to the idle thread queue for sending operations includes: Traverse the multiple instruction tasks, and for the UDS instruction to be sent, determine whether the preceding instruction task on which the UDS instruction to be sent depends has been completed. If the preceding instruction task is not completed, the sending operation of the currently pending UDS instruction is blocked until the preceding instruction task is completed and the blocking is released. If the preceding instruction task has been completed, an idle worker thread is obtained from the idle thread queue through a wait-to-acquire operation, and the currently pending UDS instruction is assigned to the obtained worker thread to perform the send operation.

[0008] In one possible implementation, the step of blocking the transmission operation of the currently pending UDS instruction if the preceding instruction task is not completed, until the blocking is released after the preceding instruction task is completed, includes: A wait counter is set for each instruction task, and the initial value of the wait counter is equal to the number of preceding instruction tasks that the instruction task depends on. The value of the wait counter is decremented whenever a preceding instruction task is completed; When the value of the wait counter is zero, the blocking of the transmission operation of the currently pending UDS instruction is released.

[0009] In one possible implementation, obtaining an idle worker thread from the idle thread queue through a wait-to-acquire operation includes: A worker thread is obtained by polling the idle thread queue. If a worker thread is acquired, the worker thread is removed from the idle thread queue, and the active thread count is incremented. If no worker thread is available, the main thread is blocked and will be awakened when any worker thread completes its response reception and is re-added to the idle thread queue.

[0010] In one possible implementation, the packet loss rate based on sliding window statistical logic includes: Obtain a sliding window of a preset size, the sliding window being used to record the most recent preset number of diagnostic interactions; For each diagnostic interaction within the sliding window, if no response is received after the UDS command is issued within a preset timeout threshold, or if a negative response code other than waiting for a response is received, it is counted as a logical packet loss. The logical packet loss rate is determined based on the number of logical packet losses within the sliding window and the size of the sliding window.

[0011] In one possible implementation, the preset timeout threshold is determined based on the average round-trip time, which is calculated using an exponentially weighted moving average algorithm based on the round-trip time collected in real time.

[0012] In one possible implementation, the UDS flushing pipeline parallel method includes: When a UDS command times out or an abnormal response occurs, an exponential backoff algorithm is used to calculate the retransmission interval and retransmit the command. The number of worker threads is adjusted in conjunction with the number of retransmissions.

[0013] In one possible implementation, the step of using an exponential backoff algorithm to calculate the retransmission interval for retransmission includes: Get the initial retransmission interval m ; The retransmission interval is calculated using the following formula. S :

[0014] in, n This represents the current number of retransmissions. k These are random perturbation values; When the calculated retransmission interval exceeds the preset retransmission interval threshold, the preset retransmission interval threshold is used as the current retransmission interval; when the number of retransmissions reaches the maximum preset number of retransmissions, retransmission is stopped.

[0015] On the other hand, the present invention also provides a parallel device for a UDS brush writing pipeline, comprising: The thread pool construction module is used to build a dynamic thread pool, which contains a number of worker threads and an idle thread queue. The instruction task sharding module is used to parse the UDS instruction sequence into multiple instruction tasks with sequential constraints according to the sequential dependencies between instructions, and to allocate each instruction task to the idle thread queue in sequence according to the sequential constraints to perform the corresponding instruction sending operation. When the preceding instruction task on which an instruction task depends has not been completed, the sending of the instruction task is paused. The response data acquisition module is used to collect the round-trip time of each UDS command in real time during the command sending process, and to calculate the logical packet loss rate based on the sliding window. The network quality assessment module is used to assess the current network quality based on the round-trip time and the logical packet loss rate using segmented decision rules, and obtain the network quality assessment result. The thread dynamic adjustment module is used to dynamically adjust the number of worker threads in the dynamic thread pool based on the network quality assessment results.

[0016] Thirdly, the present invention also provides a vehicle, a communication interface, a memory, and a processor, wherein, A communication interface for establishing a UDS communication connection with at least one ECU; The memory is used to store programs; The processor, coupled to the memory, is used to execute the program stored in the memory to implement the steps in the UDS flushing pipeline parallel method described in any of the above implementations.

[0017] The beneficial effects of this invention are as follows: The parallel pipeline method for UDS flushing provided by this invention decomposes the UDS instruction sequence into multiple tasks with sequential constraints according to their dependencies, and pauses the sending of subsequent instructions when the preceding task is not completed, ensuring the correct execution of the flushing process and avoiding flushing failures caused by out-of-order instructions. Simultaneously, during instruction sending, round-trip time is collected in real time, and logical packet loss rate is statistically analyzed based on a sliding window, providing a quantitative basis for network quality assessment. Then, based on the round-trip time and packet loss rate, a segmented decision rule is used to assess the current network quality, and the number of worker threads is dynamically adjusted according to the assessment results, allowing the concurrency to automatically increase or decrease with network fluctuations. When the network is good, threads are appropriately increased to shorten the total flushing time; when the network deteriorates, threads are proactively reduced to reduce link load and avoid retransmission storms. This improves the flushing efficiency and reliability of UDS flushing in dynamic network environments. Attached Figure Description

[0018] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0019] Figure 1 A schematic flowchart of an embodiment of the parallel pipeline method for UDS writing provided by the present invention; Figure 2 For the present invention Figure 1 A schematic diagram of an embodiment of S102; Figure 3 For the present invention Figure 2 A schematic diagram of an embodiment of S202; Figure 4 For the present invention Figure 2 A schematic diagram of an embodiment of S203; Figure 5 For the present invention Figure 1 A schematic diagram of an embodiment of S103; Figure 6 This is a schematic flowchart of another embodiment of the parallel pipeline method for UDS brushing provided by the present invention; Figure 7 For the present invention Figure 6 A schematic diagram of an embodiment of S601; Figure 8 A schematic diagram of an embodiment of the parallel device for UDS writing pipeline provided by the present invention; Figure 9 A schematic diagram of an embodiment of the vehicle provided by the present invention. Detailed Implementation

[0020] In the description of the embodiments of the present invention, unless otherwise stated, "multiple" means two or more. "And / or" describes the relationship between related objects, indicating that there can be three relationships. For example, A and / or B can represent three situations: A exists alone, A and B exist simultaneously, and B exists alone.

[0021] The terms "first," "second," etc., used in the embodiments of this invention are for descriptive purposes only and should not be construed as indicating or implying their relative importance or implicitly specifying the number of technical features indicated. Therefore, a technical feature defined with "first" or "second" may explicitly or implicitly include at least one of that feature.

[0022] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of the invention. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.

[0023] This invention provides a parallel method, apparatus, and vehicle for UDS writing pipeline. The technical solutions of the embodiments of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.

[0024] The method provided in this embodiment can be applied to software flashing scenarios for automotive electronic control units (ECUs). Specifically, a vehicle is equipped with one or more ECUs, such as an engine control unit, transmission control unit, or vehicle domain controller. A diagnostic tool or remote upgrade terminal (hereinafter collectively referred to as a flashing device) establishes a physical connection with the vehicle through an on-board diagnostic interface, which supports multiple communication protocols such as CAN, CAN FD, Ethernet, or DoIP. The flashing device and the target ECU conduct diagnostic sessions and data transmission according to the Unified Diagnostic Services (UDS) protocol.

[0025] During the flashing process, the flashing device needs to send a series of UDS commands to the target ECU in sequence. For example, it first sends a "Diagnostic Session Control" command to switch to the programming session, then sends a "Secure Access" command to unlock, followed by a "Request Download" command to prepare for data transmission, then repeatedly sends "Transfer Data" commands to complete the firmware writing, and finally sends a "Routine Control" or "Verification" command to verify the flashing result. There are strict dependencies between the above commands; for example, data transmission commands cannot be sent before secure access authentication is passed.

[0026] The dynamic thread pool and exponential backoff parallel method proposed in this embodiment runs on this flashing device. The flashing device includes a processor, memory, and a communication interface. The processor executes the method steps of this invention, the memory stores the firmware data to be flashed and the state information of the dynamic thread pool, and the communication interface is responsible for UDS message interaction with the target ECU. During command transmission, the processor dynamically creates and manages a thread pool containing multiple worker threads. Each worker thread independently sends UDS commands and receives responses. Simultaneously, the main thread assesses the current communication link quality based on the real-time collected network round-trip time and packet loss rate, and adjusts the thread pool size accordingly. When a transmission timeout or response anomaly occurs, the system automatically triggers exponential backoff retransmission and adjusts the concurrency based on the number of retransmissions, thereby achieving an efficient and stable flashing process in the complex and ever-changing vehicle diagnostic network environment.

[0027] Figure 1 This is a schematic diagram of an embodiment of the parallel pipelined UDS writing method provided by the present invention, as shown below. Figure 1 As shown, the parallel method of UDS flushing pipeline includes: S101. Construct a dynamic thread pool, which contains several worker threads and an idle thread queue. S102. The UDS instruction sequence is parsed into multiple instruction tasks with sequential constraints according to the sequential dependency relationship between instructions. According to the sequential constraints, each instruction task is assigned to the idle thread queue to execute the corresponding instruction sending operation. When the preceding instruction task on which an instruction task depends has not been completed, the sending of the instruction task is paused. S103. During the instruction sending process, the round-trip time of each UDS instruction is collected in real time, and the logical packet loss rate is calculated based on the sliding window. S104. Based on the round-trip time and logical packet loss rate, the current network quality is evaluated using segmented decision rules to obtain the network quality evaluation result. S105. Based on the network quality assessment results, dynamically adjust the number of worker threads in the dynamic thread pool.

[0028] This embodiment first constructs a dynamic thread pool, which contains several worker threads and an idle thread queue for managing idle worker threads. A dynamic thread pool is a thread management mechanism that can dynamically adjust the number of threads at runtime, unlike traditional fixed-size thread pools, where the number of threads can automatically increase or decrease according to preset rules.

[0029] Specifically, in this embodiment, the sequence of UDS instructions to be executed is parsed into multiple instruction tasks with sequential constraints according to the sequential dependencies between instructions. Here, the sequential constraint means that some UDS instructions can only start executing after other instructions have been executed. For example, in the UDS flushing process, the "erase memory" instruction can only be sent after the "enter programming session" instruction has been successfully responded to, and the "write data" instruction can only be executed after the "erase memory" instruction has been completed.

[0030] After parsing, each instruction task is assigned to the idle thread queue in sequence according to the order constraint. The worker threads in the idle thread queue then execute the corresponding instruction sending operation. If the preceding instruction task on which a certain instruction task depends has not yet been completed, the system pauses the sending of that instruction task until the preceding instruction task is completed.

[0031] During command transmission, the system continuously collects the round-trip time (RTT) of each UDS command, which is the time interval between sending the command and receiving the corresponding response. Simultaneously, the system uses a sliding window to calculate the logical packet loss rate. A sliding window is an algorithm used to statistically analyze network interaction status over a recent period; the window size is fixed, and each time a new interaction result arrives, the oldest result is removed from the window. Logical packet loss refers to the situation where a valid response is not received within a reasonable time after a UDS command is sent.

[0032] Furthermore, based on the collected round-trip time and the statistically obtained logical packet loss rate, the system uses segmented decision rules to evaluate the current network quality and outputs the network quality evaluation results. Segmented decision rules refer to mapping continuous network quality parameters to discrete network state levels according to a preset threshold range, such as dividing network quality into multiple levels like excellent, good, medium, and poor.

[0033] Finally, the system dynamically adjusts the number of worker threads in the dynamic thread pool based on the network quality assessment results. When the network quality assessment result is excellent, the number of worker threads is appropriately increased to improve concurrency; when the assessment result is poor, the number of worker threads is actively reduced to reduce network load; when the assessment result is moderate, the current number of threads is kept unchanged or slightly adjusted.

[0034] The method provided in this embodiment can automatically assess network quality based on real-time monitored network round-trip time and packet loss rate, and dynamically adjust the number of concurrent threads according to the assessment results, so that the concurrency of the writing process matches the current network conditions, thereby effectively improving writing efficiency while ensuring transmission reliability.

[0035] In some embodiments of the present invention, the specific judgment logic for evaluating the current network quality using the segmented decision rule is as follows: The system divides the network status into four levels—excellent, good, medium, and poor—based on the logical packet loss rate Loss_Rate obtained from sliding window statistics and the average round-trip time RTT_avg calculated from the exponentially weighted moving average, and then performs corresponding thread pool adjustment actions for each level.

[0036] Specifically, when Loss_Rate is less than 1% and RTT_avg is less than 50 milliseconds, the network is determined to be in an excellent state (low load). At this time, the network has sufficient capacity, and the thread pool performs an incremental expansion operation, that is, adding one worker thread each time to make full use of network bandwidth and shorten the total flushing time.

[0037] When Loss_Rate is between 1% and 3% (i.e., 1% ≤ Loss_Rate < 3%) and RTT_avg is less than 150 milliseconds, the network is considered to be in a good state (lightly loaded). At this time, the network is at its optimal operating point, and the thread pool maintains the current number of worker threads to maintain stable concurrent processing capabilities.

[0038] When Loss_Rate is between 3% and 8% (i.e., 3% ≤ Loss_Rate < 8%) or RTT_avg is greater than 200 milliseconds, the network is determined to be in a medium-level (congestion warning state). At this time, when congestion signs are detected, the thread pool performs a linear shrinkage operation, that is, reduces one worker thread at a time, in order to reduce the link load and prevent retransmission events from occurring.

[0039] When Loss_Rate is greater than or equal to 8% and RTT_avg is greater than 300 milliseconds, the network is determined to be in a poor state (severe congestion). At this time, the network has deteriorated severely, and the thread pool performs a fast convergence operation, forcibly reducing the number of worker threads to a preset minimum (e.g., retaining 1 thread), and optionally pausing the addition of new threads, entering protection mode, and gradually restoring concurrency after the network stabilizes.

[0040] It should be noted that the above thresholds (1%, 3%, 8%, 50ms, 150ms, 200ms, 300ms) are preferred values ​​obtained from experiments in typical vehicle diagnostic network environments (such as CAN bus or DoIP protocol). In practical applications, these thresholds can be adaptively adjusted according to the specific characteristics of the communication link (such as bus speed, typical latency, packet loss tolerance) and the real-time requirements of the flashing task. For example, in a high-speed Ethernet environment, the RTT threshold can be appropriately reduced to improve sensitivity, while in a low-speed CAN network environment, the threshold can be appropriately relaxed to avoid frequent adjustments. This embodiment does not impose a unique limitation on this.

[0041] By adopting the segmented decision rule in this embodiment, the system can map continuous RTT and packet loss rate parameters to discrete network state levels, and execute differentiated thread pool control actions according to different levels. This achieves accurate quantitative mapping from network quality to concurrency, ensuring both improved writing efficiency under good network conditions and protection of system stability under poor network conditions.

[0042] In some embodiments of the present invention, such as Figure 2 As shown, step S102 assigns each instruction task to an idle thread queue for sending operations, including: S201. Traverse multiple instruction tasks. For the UDS instruction to be sent, determine whether the preceding instruction task on which the UDS instruction to be sent depends has been completed. S202. If the preceding instruction task has not been completed, the sending operation of the currently pending UDS instruction will be blocked until the preceding instruction task is completed and the blocking is released. S203. If the preceding instruction task has been completed, then obtain an idle worker thread from the idle thread queue through the wait-to-acquire operation, and assign the UDS instruction to be sent to the acquired worker thread to perform the send operation.

[0043] In this embodiment, the steps of allocating each instruction task to the idle thread queue for sending operation are implemented as follows.

[0044] The main thread iterates through the multiple instruction tasks obtained from parsing. For the UDS instruction to be sent, it first checks whether the preceding instruction tasks that the instruction depends on have been completed. Here, the main thread refers to the control thread responsible for scheduling and allocating instruction tasks, which is different from the worker threads that actually perform the sending operation.

[0045] If the preceding instruction task has not been completed, the sending operation of the currently pending UDS instruction is blocked, that is, the sending process of the instruction is paused and it enters a waiting state until all the preceding instruction tasks it depends on are completed before the blocking is lifted.

[0046] If the preceding instruction has been completed, the main thread retrieves an idle worker thread from the idle thread queue through a wait-and-get operation. The wait-and-get operation (Parallel Operation, P operation) is a thread retrieval mechanism that immediately returns an idle thread when one is available in the idle thread queue; when the idle queue is empty, the calling thread enters a blocked state until an idle thread becomes available.

[0047] Once an idle worker thread is acquired, the main thread assigns the UDS command to be sent to that worker thread, which then performs the actual sending operation.

[0048] For example, suppose the UDS instruction sequence contains three instructions: Instruction A (enter programming session), Instruction B (secure access), and Instruction C (erase memory), where Instruction B depends on Instruction A, and Instruction C depends on Instruction B. The main thread processes them sequentially. When processing Instruction A, since it has no prior dependencies, it directly obtains an idle thread to send it. When processing Instruction B, it determines that Instruction A has not yet completed, so the sending of Instruction B is blocked. After Instruction A returns a response, the blocking of Instruction B is released, and the main thread obtains an idle thread to send Instruction B. The processing flow for Instruction C is similar.

[0049] This embodiment, through the above method, achieves parallel transmission at the instruction level while strictly ensuring the sequential dependency between UDS instructions, avoiding write failures caused by out-of-order instructions, and improving the correctness and stability of the write process.

[0050] In some embodiments of the present invention, such as Figure 3 As shown, in step S202, if the preceding instruction task has not been completed, the sending operation of the currently pending UDS instruction is blocked until the preceding instruction task is completed and the blocking is released, including: S301. Set a wait counter for each instruction task. The initial value of the wait counter is equal to the number of preceding instruction tasks that the instruction task depends on. S302. Decrement the value of the wait counter whenever a preceding instruction task is completed. S303. When the value of the wait counter is zero, release the blocking of the sending operation of the currently pending UDS instruction.

[0051] In this embodiment, the step of blocking the transmission of the currently pending UDS instruction until the preceding instruction task is completed and then unblocking is implemented using a counter-based synchronization mechanism.

[0052] Specifically, the system sets a wait counter for each instruction task. The initial value of this wait counter is equal to the number of preceding instruction tasks that the instruction task depends on. The wait counter is a lightweight synchronization primitive used to track the number of incomplete preceding tasks. Whenever a preceding instruction task completes, the system decrements the value of the wait counter associated with all subsequent tasks corresponding to that instruction task by one.

[0053] When the value of the wait counter for a certain instruction task decreases to zero, it means that all the preceding instruction tasks that the instruction task depends on have been completed. At this time, the system automatically releases the blocking operation for sending the instruction task, and the instruction task enters the sendable state.

[0054] It should be noted that the counting synchronization mechanism used in this embodiment can be implemented in various ways. As a preferred implementation, this embodiment uses the CountDownLatch synchronization primitive to implement the aforementioned wait counter function. CountDownLatch is a synchronization utility class provided in the Java concurrency package, which allows one or more threads to wait for other threads to complete their operations.

[0055] Specifically, a CountDownLatch instance is created for each instruction task, with its initial count set to the number of preceding tasks it depends on. The countDown() method is called to decrement the count when each preceding task completes, and subsequent tasks wait for the count to reach zero by calling the await() method.

[0056] This embodiment uses a wait counter mechanism to achieve sequential constraint protection between instruction tasks in a simple and efficient synchronization method, avoiding the performance overhead and deadlock risk caused by using complex lock mechanisms.

[0057] In some embodiments of the present invention, such as Figure 4 As shown, step S203 retrieves an idle worker thread from the idle thread queue through a wait-to-acquire operation, including: S401. Poll the idle thread queue to obtain a worker thread; S402. If a worker thread is obtained, remove the worker thread from the idle thread queue and increment the active thread count. S403. If no worker thread is acquired, the main thread is blocked and will be awakened when any worker thread completes its response reception and is re-added to the idle thread queue.

[0058] In this embodiment, the step of obtaining an idle worker thread from the idle thread queue by waiting for the acquisition operation is implemented as follows.

[0059] First, the main thread polls the idle thread queue to obtain a worker thread.

[0060] Polling refers to checking the elements in the queue in a certain order (such as first-in, first-out) until an element that meets the conditions is found or the traversal is completed.

[0061] It should be understood that the idle thread queue stores worker threads that are currently not executing any sending tasks and are in an idle state. If a worker thread is successfully acquired, it is removed from the idle thread queue, and the active thread count is incremented, indicating that the number of worker threads currently executing sending tasks has increased by one. If the idle thread queue is empty, meaning there are no available idle worker threads, the main thread enters a blocked state, temporarily relinquishing CPU execution rights, and waits for any worker thread currently executing a sending task to complete its response reception before being automatically awakened.

[0062] Once a worker thread finishes receiving a response, it is re-added to the idle thread queue, triggering the wake-up mechanism to wake up the blocked main thread. The main thread then attempts to retrieve a worker thread from the idle thread queue again.

[0063] Optionally, the active thread count can be used to monitor the current thread pool load. When the active thread count continues to approach the total number of worker threads, it indicates that the thread pool load is high and can be used as one of the reference bases for thread pool expansion.

[0064] It should be noted that before performing the wait-to-acquire operation, this embodiment first checks whether the current diagnostic sequence supports the P operation mode. The P operation mode is a thread synchronization mechanism based on semaphores or resource counting. If the configuration or operating environment of the current diagnostic sequence does not support this operation mode, for example, the thread pool has not initialized the idle queue or the underlying operating system does not support thread blocking primitives, the system throws an exception and prompts the user to check the configuration or downgrade to serial transmission mode. Through this check step, this embodiment can detect problems in incompatible environments in advance and avoid unexpected abnormal behavior during runtime.

[0065] This embodiment achieves efficient scheduling between the main thread and worker threads through idle queue management and a blocking wake-up mechanism. When thread resources are sufficient, the main thread can quickly acquire threads to execute and send tasks; when thread resources are scarce, the main thread actively blocks instead of busy waiting, avoiding unnecessary occupation of CPU resources and improving the overall resource utilization efficiency of the system.

[0066] In some embodiments of the present invention, such as Figure 5 As shown, step S103, based on the sliding window statistical logic packet loss rate, includes: S501. Obtain a sliding window of a preset size. The sliding window is used to record the most recent preset number of diagnostic interactions. S502. For each diagnostic interaction within the sliding window, if no response is received after the UDS command is issued within the preset timeout threshold, or if a negative response code other than the one for waiting for a response is received, it is counted as a logical packet loss. S503. Determine the logical packet loss rate based on the number of logical packet losses within the sliding window and the size of the sliding window.

[0067] In this embodiment, the steps for calculating packet loss rate based on sliding window logic are implemented as follows.

[0068] First, a sliding window of a preset size is obtained. This window is used to record the most recent preset number of diagnostic interactions. A diagnostic interaction refers to a complete UDS request and response process, i.e., the diagnostic tool sends a UDS command and receives a response from the ECU. The size of the sliding window can be preset according to the actual application scenario, for example, it can be set to 20 diagnostic interactions. The window is maintained using a first-in-first-out queue structure.

[0069] For each diagnostic interaction within the sliding window, determine whether the interaction constitutes logical packet loss according to the preset logical packet loss judgment rules.

[0070] Specifically, if no response is received after the preset timeout threshold is exceeded after the UDS command is issued, it is counted as a logical packet loss; or if a response is received, but the response code is a negative response code and the negative response code is not a waiting response code (the waiting response code is usually defined as 0x78 in the UDS protocol, which means that the ECU is processing and the diagnostic tool needs to continue to wait), it is also counted as a logical packet loss.

[0071] It should be noted that a wait response code indicates that the ECU has not yet completed processing but no error has occurred. Upon receiving such a response, the diagnostic tool should continue to wait rather than immediately determine packet loss, and therefore exclude it from logical packet loss statistics. This handling method complies with the UDS protocol specification and avoids misjudging packet loss due to normal ECU processing delays.

[0072] After completing the logical packet loss determination for all diagnostic interactions within the window, the system counts the total number of logical packet losses within the window and divides this number by the size of the sliding window to obtain the current logical packet loss rate. For example, if the sliding window size is 20 and 2 logical packet losses are counted within the window, the logical packet loss rate is 10%.

[0073] This embodiment uses a sliding window method to calculate the logical packet loss rate, which ensures the real-time nature of the statistical results (reflecting the network conditions over a recent period) and avoids drastic fluctuations in statistical values ​​due to single, occasional anomalies, thus providing stable and reliable input data for subsequent network quality assessment.

[0074] In some embodiments of the present invention, the preset timeout threshold is determined based on the average round-trip time, which is calculated using an exponentially weighted moving average algorithm based on the round-trip time collected in real time.

[0075] Specifically, the formula for calculating the preset timeout threshold can be expressed as: Timeout threshold = Sending time + J × Average round-trip time, where J is a proportionality coefficient greater than 1, for example, J can be 3.

[0076] The average round-trip time is calculated using an exponentially weighted moving average (EWMA) algorithm based on real-time collected round-trip times. EWMA is a commonly used smoothing and filtering algorithm that assigns different weights to historical and current data, with the weight of historical data decaying exponentially. Compared to a simple arithmetic mean, EWMA can smooth out instantaneous fluctuations caused by network jitter without introducing a large amount of historical data storage, while maintaining a sensitive response to changes in the actual trend.

[0077] Specifically, the formula for calculating the average round-trip time is as follows: RTT_avg = α × RTT_current + (1 - α) × RTT_prev ,in RTT_current This represents the round-trip time currently collected. RTT_prev This refers to the average round-trip time calculated in the previous calculation. α Smoothing factor. α The value of is between 0 and 1. α The closer the value is to 1, the more sensitive the algorithm is to the current sample value; α The closer it is to 0, the stronger the smoothing effect of the algorithm.

[0078] As a preferred approach, the smoothing factor in this embodiment α The value is set to 0.2, which makes the algorithm sensitive to new changes while retaining historical trend information to avoid drastic fluctuations in the threshold due to occasional jitter.

[0079] It should be noted that, α The specific value can be adjusted according to the actual network environment and application requirements, and this embodiment does not limit it to a single value.

[0080] This embodiment calculates the average round-trip time using an exponentially weighted moving average algorithm and dynamically adjusts the timeout threshold based on the average round-trip time. This allows the timeout threshold to automatically adapt to changes in network quality, avoiding the problems of misjudging packet loss in slow networks and waiting too long in fast networks when using a fixed timeout threshold, thus improving the accuracy of packet loss judgment.

[0081] In some embodiments of the present invention, such as Figure 6 As shown, the parallel method for UDS brushing pipeline includes: S601. When the UDS command timeout or response error occurs, the exponential backoff algorithm is used to calculate the retransmission interval and retransmit. S602. Adjust the number of worker threads in conjunction with the number of retransmissions.

[0082] In this embodiment, the above-mentioned parallel UDS writing pipeline method also includes a retransmission control mechanism.

[0083] When a UDS command times out or receives an abnormal response, an exponential backoff algorithm is used to calculate the retransmission interval, and retransmission is performed based on the calculated retransmission interval. A timeout occurs when no response is received from the ECU within a preset timeout threshold after the UDS command is sent; an abnormal response occurs when the received response is a negative response code (excluding wait response codes), indicating that the ECU failed to process the command correctly.

[0084] Specifically, the exponential backoff algorithm is a backoff strategy where the retransmission interval increases exponentially with the number of retransmissions. Its design aims to gradually increase the waiting time during retransmissions, avoiding exacerbating network congestion due to consecutive retransmissions in a short period. For example, the first retransmission waits for a shorter time, and if it fails again, it waits for a longer time, and so on.

[0085] Meanwhile, the system adjusts the number of worker threads in the dynamic thread pool based on the number of retransmissions. Retransmissions typically indicate poor network quality or insufficient ECU processing capacity. When the number of retransmissions is low, the system maintains the current number of threads. When the number of retransmissions reaches a certain threshold, the system proactively reduces the number of worker threads to lower concurrent load and alleviate network pressure. When the number of retransmissions continues to increase or consecutive timeouts occur, the system rapidly reduces the number of worker threads to the minimum and suspends the creation of new threads, entering protection mode.

[0086] For example, suppose there are currently 4 worker threads in the thread pool concurrently sending commands. Due to a sudden network deterioration, multiple commands time out. After detecting a retransmission event, if the number of retransmissions is 1-2, the number of threads remains unchanged at 4; if the number of retransmissions reaches 3-4, the number of threads is reduced to 2-3; if there are 3 consecutive timeouts or the number of retransmissions reaches 5, the number of threads is quickly reduced to 1, and the addition of new threads is paused. Concurrency is gradually restored after the network stabilizes.

[0087] As a more refined control method, this embodiment also defines a tiered linkage rule based on the number of retransmissions and consecutive timeouts. When the number of retransmissions is 1 or 2, it is determined that there is a slight disturbance in the network. The current number of worker threads remains unchanged, and retransmissions are performed only according to the exponential backoff algorithm. When the number of retransmissions is 3 or 4, it is determined that the network has entered a moderate congestion state. The number of worker threads is proactively reduced by 1 to 2 to reduce concurrent load. When the number of retransmissions reaches 5, or the number of consecutive timeouts reaches 3, it is determined that the network is in a severe congestion state. At this time, the number of worker threads is quickly reduced to a preset minimum value (e.g., 1 thread), and the addition of any new threads is suspended, entering a cool-down period. During the cool-down period, the system does not create new worker threads, and only relies on the existing small number of threads to maintain basic communication. After subsequent command sending returns to normal and the retransmission rate decreases, the number of threads is gradually restored.

[0088] Furthermore, the thread adjustment strategy in this embodiment employs a dual-mode collaborative mechanism: Under normal network conditions, a gradual adjustment mode is used, adding or removing only one worker thread at a time to avoid drastic fluctuations in the number of threads impacting system stability; when network quality deteriorates rapidly (e.g., packet loss rate suddenly increases by more than 8% or average round-trip time exceeds 300 milliseconds) or retransmission rate rises sharply, a rapid degradation mode is switched to, halving the current number of worker threads at once or reducing it directly to the minimum value to achieve a rapid response to sudden network problems. The switching between the two modes is automatically determined by the network quality monitoring module based on real-time collected packet loss rate and round-trip time, requiring no manual intervention.

[0089] This embodiment links the retransmission mechanism with the thread pool adjustment mechanism. When network deterioration triggers retransmission, the link load is reduced by actively decreasing the concurrency, thus avoiding performance crashes caused by the superposition of high concurrency and retransmission storms and improving the system's robustness in network fluctuation environments.

[0090] In some embodiments of the present invention, such as Figure 7 As shown, step S601 uses the exponential backoff algorithm to calculate the retransmission interval and perform retransmission, including: S701. Obtain the initial retransmission interval. m ; S702. The expected retransmission interval is calculated using the following formula. S :

[0091] in, n This represents the current number of retransmissions. k These are random perturbation values; S703. When the calculated retransmission interval exceeds the preset retransmission interval threshold, the preset retransmission interval threshold shall be used as the retransmission interval for this time; when the number of retransmissions reaches the maximum preset number of retransmissions, retransmission shall be stopped.

[0092] First, obtain a preset initial retransmission interval. m The initial retransmission interval is the base waiting time used for the first retransmission. Its value should be set according to the typical response time of UDS communication, for example, it can be set to 50 milliseconds or 100 milliseconds.

[0093] Then, the system calculates the first number according to the exponential growth method. n Retransmission interval of the second retransmission S The random perturbation value refers to adding a small random variable to the deterministic exponential calculation result. Its purpose is to stagger the retransmission times of multiple threads that trigger retransmissions simultaneously, preventing secondary collisions caused by all threads retransmitting at the same moment. k Uniformly distributed random numbers can be used to generate random numbers, and their value range is usually set between 0 and a certain upper limit value, such as 0 to 10 milliseconds.

[0094] Furthermore, this embodiment also sets a maximum retransmission interval threshold and a maximum retransmission count limit. The maximum retransmission interval threshold is used to prevent the retransmission interval from growing indefinitely. When the retransmission interval calculated according to the above formula exceeds the threshold, the system uses the preset retransmission interval threshold as the actual interval for this retransmission. The maximum retransmission count limit is used to avoid resource waste caused by infinite retransmissions. When the number of retransmissions reaches the preset maximum number of retransmissions, the system stops retransmission and determines that the instruction has failed to be sent, triggering the corresponding alarm or error handling process.

[0095] It should be noted that the exponent base used in this embodiment is 2, which is a classic and efficient exponential backoff growth method. However, it should be understood that other bases can be used in practical applications, such as bases of 1.5 or 3, and the specific values ​​can be adjusted according to network characteristics and application requirements. Similarly, the specific values ​​of the initial retransmission interval, the maximum retransmission interval threshold, and the maximum number of retransmissions should also be reasonably configured according to the actual application scenario, and this embodiment does not impose a unique limitation on them.

[0096] This embodiment controls the retransmission rhythm through the exponential backoff algorithm and introduces random perturbation values ​​to avoid multiple threads retransmitting at the same time, which effectively reduces the probability of retransmission storms, reduces the waste of network resources caused by disordered retransmissions, and improves the overall stability and write success rate of the system.

[0097] In some embodiments of the present invention, retransmission control and thread pool adjustment form a closed-loop feedback loop.

[0098] Specifically, the total number of retransmissions per unit time is counted, and the retransmission rate (the ratio of retransmissions to total transmissions) is calculated. The retransmission rate, as a core feedback indicator of network quality, is input into the thread pool decision module in real time.

[0099] When the retransmission rate exceeds a preset first threshold (e.g., 5%), a thread reduction operation is triggered; when the retransmission rate falls back below the first threshold and remains stable for a period of time, the number of threads is gradually restored. This closed-loop control chain can be represented as: retransmission monitoring, quality assessment, thread adjustment, and a new retransmission rate. Through this feedback mechanism, the system can proactively reduce concurrency to alleviate congestion when the network deteriorates, and automatically increase concurrency to restore flushing efficiency after the network recovers.

[0100] It should be understood that the above parameters such as retransmission rate threshold, increment / decrement step size, maximum and minimum number of threads can be configured according to the actual application scenario, and this embodiment does not make a unique limitation on this.

[0101] To better implement the parallel pipelined UDS writing method in this embodiment of the invention, based on the parallel pipelined UDS writing method, correspondingly, as follows: Figure 8 As shown, this embodiment of the invention also provides a parallel UDS writing pipeline device 800, which includes: The thread pool construction module 801 is used to construct a dynamic thread pool, which contains a number of worker threads and an idle thread queue. The instruction task sharding module 802 is used to parse the UDS instruction sequence into multiple instruction tasks with sequential constraints according to the sequential dependency relationship between instructions, and to allocate each instruction task to the idle thread queue in sequence according to the sequential constraints to perform the corresponding instruction sending operation. When the preceding instruction task on which an instruction task depends has not been completed, the sending of the instruction task is paused. The response data acquisition module 803 is used to collect the round-trip time of each UDS instruction in real time during the instruction sending process, and to calculate the logical packet loss rate based on the sliding window. The network quality assessment module 804 is used to assess the current network quality based on the round-trip time and the logical packet loss rate using segmented decision rules, and obtain the network quality assessment result. The thread dynamic adjustment module 805 is used to dynamically adjust the number of worker threads in the dynamic thread pool based on the network quality assessment results.

[0102] The UDS writing pipeline parallel device 800 provided in the above embodiments can realize the technical solutions described in the above UDS writing pipeline parallel method embodiments. The specific implementation principles of each module or unit can be found in the corresponding content in the above UDS writing pipeline parallel method embodiments, which will not be repeated here.

[0103] like Figure 9As shown, the present invention also provides a vehicle 900. The vehicle 900 includes a processor 901, a memory 902, a display 903, and a communication interface 904. Figure 9 Only some components of vehicle 900 are shown, but it should be understood that it is not required to implement all of the components shown, and more or fewer components may be implemented instead.

[0104] In some embodiments, processor 901 may be a central processing unit (CPU), microprocessor, or other data processing chip, used to run program code stored in memory 902 or process data, such as the UDS brushing pipeline parallel method of the present invention.

[0105] In some embodiments, processor 901 may be a single server or a group of servers. The server group may be centralized or distributed. In some embodiments, processor 901 may be local or remote. In some embodiments, processor 901 may be implemented on a cloud platform. In one embodiment, the cloud platform may include a private cloud, public cloud, hybrid cloud, community cloud, distributed cloud, intranet, multi-cloud, etc., or any combination thereof.

[0106] In some embodiments, memory 902 may be an internal storage unit of vehicle 900, such as a hard disk or memory of vehicle 900. In other embodiments, memory 902 may also be an external storage device of vehicle 900, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc., equipped on vehicle 900.

[0107] Furthermore, the memory 902 may include both internal storage units of the vehicle 900 and external storage devices. The memory 902 is used to store application software and various types of data installed on the vehicle 900.

[0108] In some embodiments, display 903 may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, or an OLED (Organic Light-Emitting Diode) touchscreen. Display 903 is used to display information about vehicle 900 and to display a visual user interface.

[0109] The communication interface 904 is used to establish a UDS communication connection with at least one ECU (Electronic Control Unit) in the vehicle, send a UDS command sequence to the ECU, and receive response messages returned by the ECU. The communication interface 904 supports diagnostic communication protocols based on CAN, CAN FD, Ethernet, or DoIP.

[0110] The components 901-904 of vehicle 900 communicate with each other via the system bus.

[0111] In one embodiment, when processor 901 executes the UDS flush pipeline parallel program in memory 902, the following steps can be implemented: Construct a dynamic thread pool, which contains several worker threads and an idle thread queue; The UDS instruction sequence is parsed into multiple instruction tasks with sequential constraints according to the sequential dependencies between instructions. Then, according to the sequential constraints, each instruction task is assigned to the idle thread queue to perform the corresponding instruction sending operation. When the preceding instruction task on which an instruction task depends has not been completed, the sending of the instruction task is paused. During the instruction sending process, the round-trip time of each UDS instruction is collected in real time, and the logical packet loss rate is statistically calculated based on the sliding window. Based on the round-trip time and the logical packet loss rate, the current network quality is evaluated using segmented decision rules to obtain the network quality evaluation result; Based on the network quality assessment results, the number of worker threads in the dynamic thread pool is dynamically adjusted.

[0112] It should be understood that when the processor 901 executes the UDS flushing pipeline parallel program in the memory 902, in addition to the functions mentioned above, it can also perform other functions, as detailed in the description of the corresponding method embodiments above.

[0113] Accordingly, this application also provides a computer-readable storage medium for storing a computer-readable program or instruction. When the program or instruction is executed by a processor, it can implement the steps or functions of the UDS brushing pipeline parallel method provided in the above-described method embodiments.

[0114] Those skilled in the art will understand that all or part of the processes of the methods described in the above embodiments can be implemented by a computer program instructing related hardware (such as a processor, controller, etc.), and the computer program can be stored in a computer-readable storage medium. The computer-readable storage medium may be a disk, optical disk, read-only memory, or random access memory, etc.

[0115] The above provides a detailed description of the parallel method, apparatus, and vehicle for UDS brushing pipeline provided by the present invention. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.

Claims

1. A parallel pipelined method for UDS brush writing, characterized in that, include: Construct a dynamic thread pool, which contains several worker threads and an idle thread queue; The UDS instruction sequence is parsed into multiple instruction tasks with sequential constraints according to the sequential dependencies between instructions. Then, according to the sequential constraints, each instruction task is assigned to the idle thread queue to perform the corresponding instruction sending operation. When the preceding instruction task on which an instruction task depends has not been completed, the sending of the instruction task is paused. During the instruction sending process, the round-trip time of each UDS instruction is collected in real time, and the logical packet loss rate is statistically calculated based on the sliding window. Based on the round-trip time and the logical packet loss rate, the current network quality is evaluated using segmented decision rules to obtain the network quality evaluation result; Based on the network quality assessment results, the number of worker threads in the dynamic thread pool is dynamically adjusted.

2. The parallel method for UDS brush writing pipeline according to claim 1, characterized in that, The step of assigning each instruction task to the idle thread queue for sending includes: Traverse the multiple instruction tasks, and for the UDS instruction to be sent, determine whether the preceding instruction task on which the UDS instruction to be sent depends has been completed. If the preceding instruction task is not completed, the sending operation of the currently pending UDS instruction is blocked until the preceding instruction task is completed and the blocking is released. If the preceding instruction task has been completed, an idle worker thread is obtained from the idle thread queue through a wait-to-acquire operation, and the currently pending UDS instruction is assigned to the obtained worker thread to perform the send operation.

3. The parallel method for UDS brush writing pipeline according to claim 2, characterized in that, The step of blocking the transmission of the currently pending UDS instruction if the preceding instruction task is not completed, until the preceding instruction task is completed and the blocking is released, includes: A wait counter is set for each instruction task, and the initial value of the wait counter is equal to the number of preceding instruction tasks that the instruction task depends on. The value of the wait counter is decremented whenever a preceding instruction task is completed; When the value of the wait counter is zero, the blocking of the transmission operation of the currently pending UDS instruction is released.

4. The parallel method for UDS brush writing pipeline according to claim 2, characterized in that, The step of obtaining an idle worker thread from the idle thread queue through a wait-to-acquire operation includes: A worker thread is obtained by polling the idle thread queue. If a worker thread is acquired, the worker thread is removed from the idle thread queue, and the active thread count is incremented. If no worker thread is available, the main thread is blocked and will be awakened when any worker thread completes its response reception and is re-added to the idle thread queue.

5. The parallel method for UDS brush writing pipeline according to claim 1, characterized in that, The packet loss rate based on sliding window statistical logic includes: Obtain a sliding window of a preset size, the sliding window being used to record the most recent preset number of diagnostic interactions; For each diagnostic interaction within the sliding window, if no response is received after the UDS command is issued within a preset timeout threshold, or if a negative response code other than waiting for a response is received, it is counted as a logical packet loss. The logical packet loss rate is determined based on the number of logical packet losses within the sliding window and the size of the sliding window.

6. The parallel method for UDS brush writing pipeline according to claim 5, characterized in that, The preset timeout threshold is determined based on the average round-trip time, which is calculated using an exponentially weighted moving average algorithm based on the real-time collected round-trip time.

7. The parallel method for UDS brush writing pipeline according to any one of claims 1 to 6, characterized in that, include: When a UDS command times out or responds abnormally, the exponential backoff algorithm is used to calculate the retransmission interval and retransmit the command. The number of worker threads is adjusted in conjunction with the number of retransmissions.

8. The parallel method for UDS brush writing pipeline according to claim 7, characterized in that, The retransmission interval calculation using the exponential backoff algorithm includes: Get the initial retransmission interval m ; The retransmission interval is calculated using the following formula. S : in, n This represents the current number of retransmissions. k These are random perturbation values; When the calculated retransmission interval exceeds the preset retransmission interval threshold, the preset retransmission interval threshold is used as the current retransmission interval; when the number of retransmissions reaches the maximum preset number of retransmissions, retransmission is stopped.

9. A parallel device for a UDS brush writing pipeline, characterized in that, include: The thread pool construction module is used to build a dynamic thread pool, which contains a number of worker threads and an idle thread queue. The instruction task sharding module is used to parse the UDS instruction sequence into multiple instruction tasks with sequential constraints according to the sequential dependencies between instructions, and to allocate each instruction task to the idle thread queue in sequence according to the sequential constraints to perform the corresponding instruction sending operation. When the preceding instruction task on which an instruction task depends has not been completed, the sending of the instruction task is paused. The response data acquisition module is used to collect the round-trip time of each UDS command in real time during the command sending process, and to calculate the logical packet loss rate based on the sliding window. The network quality assessment module is used to assess the current network quality based on the round-trip time and the logical packet loss rate using segmented decision rules, and obtain the network quality assessment result. The thread dynamic adjustment module is used to dynamically adjust the number of worker threads in the dynamic thread pool based on the network quality assessment results.

10. A vehicle, characterized in that, Includes communication interfaces, memory, and processors, among which, The communication interface is used to establish a UDS communication connection with at least one ECU; The memory is used to store programs; The processor, coupled to the memory, is used to execute the program stored in the memory to implement the steps in the parallel UDS write pipeline method according to any one of claims 1 to 8, wherein the UDS instruction sequence is sent to the ECU through the communication interface and the processor receives the response returned by the ECU.