Bus diagnosis method and vehicle

By using a target header mechanism with preset flag bits in LIN bus diagnostic mode, asynchronous communication is achieved, which solves the problem of unresponsive error frame accumulation and improves the stability and efficiency of bus diagnostics.

CN123185010APending Publication Date: 2026-11-27GREAT WALL MOTOR CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611026080.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-10
Publication Date
2026-11-27

AI Technical Summary

Technical Problem

In LIN bus diagnostic mode, the accumulation of unresponsive error frames and bus congestion caused by the master node sending requests at fixed intervals reduces diagnostic stability and success rate, and the master node may accidentally trigger the fault recovery process.

Method used

By adopting a target header mechanism with preset flag bits, the master node switches its state after receiving the response information from the slave node, realizing an asynchronous communication mode, avoiding the accumulation of unresponsive error frames, and ensuring that only one diagnostic task is being processed at a time.

Benefits of technology

It improves the reliability and efficiency of LIN bus diagnostic communication, reduces the generation of invalid error frames, avoids accidental triggering of fault recovery processes, and enhances diagnostic stability and success rate.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123185010A_ABST
    Figure CN123185010A_ABST
Patent Text Reader

Abstract

The application discloses a bus diagnosis method and a vehicle, relates to the technical field of vehicle bus diagnosis, and is applied to a main controller, wherein the bus diagnosis method comprises the following steps: when entering a bus diagnosis mode, a target header is sent to a communication bus, and the state of the target header is set to a first state, wherein the target header carries preset identification bits, and when the state of the target header is the first state, the sending of a new header to the communication bus is stopped; after receiving response information of the target header from a slave node, the state of the target header is set to a second state based on the response information; and when the state of the target header is the second state, a new header is sent to the communication bus. According to the method, bus conflicts caused by uncertain processing time of the slave node can be effectively avoided, the generation of invalid error frames is significantly reduced, and the reliability and efficiency of bus diagnosis communication are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of vehicle bus diagnostic technology, and more particularly to a bus diagnostic method and a vehicle. Background Technology

[0002] In the LIN (Local Interconnect Network) bus diagnostics and software flashing process of automotive electronic systems, when the system enters diagnostic mode, slave nodes typically need to stop responding to regular application layer periodic messages and focus solely on responding to diagnostic service requests initiated by the master node to ensure the stable and reliable execution of the diagnostic process. To achieve this goal, a synchronous communication scheduling strategy based on a predefined signal matrix is ​​commonly used in related technologies.

[0003] Under this strategy, the master node continuously sends diagnostic request frame headers to the slave node at fixed high-frequency periods (e.g., 10ms, 20ms, etc.) according to a preset signal matrix. This mechanism is based on the assumption that the slave node can quickly process diagnostic services and return responses immediately, and its core lies in maintaining tight timing coupling between "request and response". However, when the diagnostic operation involves non-real-time time-consuming tasks (e.g., flash writing or erasing), the processing speed of the slave node's microcontroller often cannot match the master node's sending frequency. The slave node is busy processing the previous request and cannot respond to the new headers sent by the master node periodically in a timely manner. According to the LIN protocol specification, if there is no response or a response conflict occurs within the specified time slot, the bus will generate an error frame. As the diagnostic process progresses, a large number of unresponsive headers will continuously accumulate on the bus, causing the bus load to appear saturated, but the actual effective communication is almost stagnant, forming ineffective "zombie" communication. This accumulation of unresponsive error frames caused by the mismatch between fixed-period sending and the long-time processing of the slave node is an inherent limitation of the relevant technology.

[0004] The accumulation of these unresponsive error frames can cause a series of problems: the timeout mechanism configured on the master node controller may misjudge a large number of unresponsive states as slave node failures, physical link breaks, or severe electromagnetic interference, thus incorrectly triggering the fault recovery process. This directly interrupts the ongoing diagnostic process, greatly reduces the stability and success rate of diagnostic writes, and prolongs the overall diagnostic time. Therefore, in LIN bus diagnostic mode, how to eliminate unresponsive error frames and bus congestion caused by the master node continuously sending requests at fixed intervals, and avoid the master node mistakenly triggering the fault recovery process, has become an urgent technical problem to be solved. Summary of the Invention

[0005] This application aims to at least partially address one of the technical problems in related technologies. To this end, the first objective of this application is to propose a bus diagnostic method. This method employs a technique whereby, upon entering bus diagnostic mode, the master node sends a target header carrying a preset identifier to the bus and sets the header's state to a first state (i.e., pending claim state), while simultaneously ceasing the transmission of new headers. Furthermore, only after receiving a response from a slave node for the target header does the header's state change to a second state (i.e., responded state), allowing the transmission of the next new header. This successfully transforms the traditional synchronous "request-immediate response" communication mode between master and slave nodes into an asynchronous "request-asynchronous processing-claim response" communication mode. This effectively avoids bus conflicts caused by the uncertain processing time of slave nodes, significantly reduces the generation of invalid error frames, and improves the reliability and efficiency of LIN bus diagnostic communication.

[0006] The second objective of this application is to propose an alternative bus diagnostic method.

[0007] The third objective of this application is to propose a vehicle.

[0008] To achieve the above objectives, a first aspect of this application proposes a bus diagnostic method applied to a master controller. The method includes: upon entering a bus diagnostic mode, sending a target header to a communication bus and setting the state of the target header to a first state, wherein the target header carries a preset flag bit, and stopping the sending of new headers to the communication bus when the target header is in the first state; upon receiving a response information from a slave node to the target header, setting the state of the target header to a second state based on the response information, wherein the response information indicates that the slave node has completed the current diagnostic task and carries the preset flag bit; and sending a new header to the communication bus when the target header is in the second state.

[0009] According to the bus diagnostic method of this application embodiment, when entering the bus diagnostic mode, a target header is sent to the communication bus, and the state of the target header is set to a first state. The target header carries a preset flag bit. While the target header is in the first state, sending new headers to the communication bus stops. After receiving a response from a slave node to the target header, the state of the target header is set to a second state based on the response information. The response information indicates that the slave node has completed the current diagnostic task and carries a preset flag bit. While the target header is in the second state, a new header is sent to the communication bus. Therefore, this method ensures that only one diagnostic task is being processed on the communication bus at any given time, avoiding bus data conflicts caused by multiple diagnostic tasks transmitting simultaneously. This allows diagnostic messages to be transmitted sequentially, improving the stability and reliability of bus diagnostics.

[0010] According to one embodiment of this application, the response information includes diagnosis success and diagnosis failure, wherein when the response information is diagnosis failure, the method further includes: reporting diagnosis execution failure information to the diagnostic instrument.

[0011] According to one embodiment of this application, when sending a target header to a communication bus, the method further includes: storing the target header in a first buffer queue, and setting the state of the target header in the first buffer queue to the first state, wherein the first buffer queue includes a plurality of headers, and the state of each header is the first state or the second state.

[0012] According to one embodiment of this application, setting the state of the header to a second state based on the response information includes: matching the corresponding target header in the first cache queue according to the preset identifier carried in the response information; and updating the state of the matched target header in the first cache queue from the first state to the second state.

[0013] According to one embodiment of this application, the method further includes: after the state of the target header in the first cache queue is set to the second state, deleting the target header from the first cache queue according to the number of headers in the first cache queue or a preset deletion policy.

[0014] According to one embodiment of this application, before sending the header to the communication bus, the method further includes: sending an identifier configuration request frame to the slave node, the identifier configuration request frame containing the preset identifier bit; receiving an acknowledgment response frame returned by the slave node, and determining the preset identifier bit corresponding to the current diagnostic task.

[0015] To achieve the above objectives, a second aspect of this application proposes a bus diagnostic method applied to a slave controller. The method includes: upon entering a bus diagnostic mode, receiving a target header sent by a master controller via a communication bus, wherein the header carries a preset identifier; upon completion of a current diagnostic task, generating response information, wherein the response information indicates completion of the current diagnostic task and carries the preset identifier; and sending the response information to the master controller via the communication bus, so that the master controller sets the state of the target header from a first state to a second state based on the response information.

[0016] According to the bus diagnostic method of this application embodiment, when entering the bus diagnostic mode, a target header sent by the master controller is received via the communication bus, wherein the target header carries a preset identifier bit; if the current diagnostic task is completed, response information is generated, wherein the response information is used to indicate the completion of the current diagnostic task and carries the preset identifier bit; the response information is sent to the master controller via the communication bus, so that the master controller sets the state of the target header from a first state to a second state based on the response information. Therefore, this method can ensure that only one diagnostic task is being processed on the communication bus at any given time, avoiding bus data conflicts caused by multiple diagnostic tasks being transmitted simultaneously, and enabling diagnostic messages to be transmitted sequentially, thus improving the stability and reliability of bus diagnostics.

[0017] According to one embodiment of this application, generating response information upon completion of the current diagnostic task includes: if the current diagnostic task is successfully executed, the response information includes diagnostic success; if the current diagnostic task fails, the response information includes diagnostic failure, wherein the current diagnostic task is determined to have failed if it is not completed within a preset time threshold.

[0018] According to one embodiment of this application, before receiving the target header sent by the main controller, the method further includes: receiving an identifier configuration request frame sent by the main controller, the identifier configuration request frame containing the preset identifier bit; responding to the identifier configuration request frame and returning an acknowledgment response frame to the main controller.

[0019] To achieve the above objectives, a vehicle is provided in a third aspect of this application, including a memory, a processor, and a program stored in the memory and executable on the processor. When the processor executes the program, it implements the bus diagnostic method described above.

[0020] According to the embodiments of this application, by performing the above-described bus diagnostic method, the vehicle can effectively avoid bus conflicts caused by uncertain processing time of slave nodes, significantly reduce the generation of invalid error frames, and improve the reliability and efficiency of bus diagnostic communication.

[0021] 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

[0022] Figure 1 This is a flowchart of a bus diagnostic method according to an embodiment of this application.

[0023] Figure 2 This is a flowchart illustrating an interaction method between a master controller and a slave controller according to an embodiment of this application.

[0024] Figure 3 This is a block diagram of a vehicle according to an embodiment of this application. Detailed Implementation

[0025] 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.

[0026] In LIN bus diagnostics, to enable diagnostic writing to slave nodes, the common practice is for the master node to send diagnostic request headers at fixed intervals based on a signal matrix. Specifically, this scheme periodically sends header frames carrying protocol identifiers to slave nodes through a predefined scheduling table, expecting the slave nodes to complete processing and return a response within a preset time slot. Its basic working principle is that the master node assumes the slave node can quickly process diagnostic service requests and provide an immediate response before the next header arrives. This scheme is widely used primarily because it guarantees real-time delivery of diagnostic requests and deterministic communication timing, facilitating system integration and scheduling.

[0027] However, when slave nodes need to perform complex diagnostic operations, such as non-real-time time-consuming tasks like flash writes or erases, the processing time often far exceeds the header sending cycle. To maintain the speed and periodicity of request delivery, this scheme is inherently designed to be unaware of the actual processing status of slave nodes, causing the master node to continuously send new headers even when slave nodes are busy. Since slave nodes are unable to respond, these headers accumulate on the bus as unclaimed invalid frames. According to the LIN protocol specification, headers that do not receive a response within a specified time will trigger error frames, manifesting as a surge in the number of error frames on the bus, a decrease in the percentage of effective communication, and even causing the master node to misjudge a physical link failure due to continuous lack of response, triggering an error recovery process and interrupting the diagnostic process.

[0028] Analysis revealed a lack of an asynchronous state synchronization mechanism between the master and slave nodes to reflect task processing progress. In related technologies, header transmission and task processing rely entirely on fixed timing coupling. The master node has no way of knowing when the slave node completed its previous task, and therefore can only mechanically send headers within a preset period. This causes a mismatch between the slave node's processing capacity and the header transmission rhythm, ultimately resulting in a large number of unresponsive error frames and bus congestion.

[0029] To address the aforementioned issues, this invention proposes a bus diagnostic method. By introducing a target header carrying a preset identifier, and having the master node mark this target header as pending a response before ceasing the transmission of new headers, slave nodes can proactively backtrack the bus and claim the target header after completing their current diagnostic task, thus decoupling the originally tightly coupled request-response sequence into an asynchronous request-claim mechanism. In this way, without altering the LIN physical layer and basic frame structure, the accumulation of unresponsive error frames caused by periodic transmission is eliminated at its source. This prevents the master node from mistakenly triggering fault recovery due to a large number of error frames, maintaining diagnostic request reachability while reducing the bus error rate. This solves the bus error and misjudgment problems caused by the mismatch between high-frequency requests and long-duration processing, achieving a stable diagnostic flushing process with a low error rate.

[0030] In one embodiment of this application, the bus diagnostic system may include a master controller, at least one slave controller, a communication bus, and a diagnostic tool. The master controller acts as a LIN master node, and the slave controllers act as LIN slave nodes, establishing a communication connection between them via the communication bus. In this embodiment, the communication bus is a LIN bus, which is a single-wire serial communication bus. The diagnostic tool is connected to the master controller via a diagnostic interface, and the diagnostic tool is used to send diagnostic tasks to the master controller and receive feedback on the task execution results.

[0031] During a diagnostic session, the master controller maintains a communication scheduling matrix internally. Based on the rules of this matrix, it periodically sends request headers to the slave controllers via the communication bus. These request headers are broadcast on the bus, and the corresponding slave controller determines whether the task is one that its node needs to handle based on the identifier in the header. Upon receiving its own request header, the slave controller parses the header content and executes the corresponding diagnostic service operations, such as data reading, writing, and erasing.

[0032] After completing the diagnostic service operation, the slave controller generates corresponding response data and sends it to the master controller within the response time slot reserved in the header on the bus. The response data is returned to the master controller via the communication bus. The master controller confirms the task execution status of the slave controller based on the response data and reports the execution result to the diagnostic instrument.

[0033] The frame structure on the communication bus consists of a header segment and a response segment. The header segment, initiated by the master controller, includes a synchronization interval segment, a synchronization segment, and a protected identifier field. The response segment is filled with data by the slave controller within the corresponding time slot, including a data field and a checksum field. The master controller determines whether the communication was completed successfully by monitoring the bus status and checksum results within the response time slot. If the slave controller cannot respond in time within the same communication cycle due to excessive internal processing time, a no-response state will appear on the bus. In this case, the master controller will trigger an error handling procedure according to the configuration.

[0034] The bus diagnostic method and vehicle proposed in this application are described below with reference to the accompanying drawings.

[0035] Figure 1 This is a flowchart of a bus diagnostic method according to an embodiment of this application.

[0036] like Figure 1 As shown, this control method is executed by the main controller. The bus diagnostic method in this embodiment may include the following steps: S1, when entering bus diagnostic mode, sends a target header to the communication bus and sets the status of the target header to the first state. The target header carries a preset flag bit, and when the status of the target header is the first state, it stops sending new headers to the communication bus.

[0037] Specifically, for the master controller, upon entering bus diagnostic mode, it sends a target header to the communication bus and sets the target header's state to the first state. The target header carries a preset flag, and while the target header's state is in the first state, sending new headers to the communication bus ceases. Bus diagnostic mode refers to the communication state established between the master and slave controllers, primarily used for performing diagnostic services. After entering this mode, the slave controller can ignore non-diagnostic periodic and event-triggered messages and only respond to diagnostic requests. As a specific implementation, the master controller can switch to this bus diagnostic mode based on instructions issued by the diagnostic instrument or its own state logic.

[0038] A preset flag is a single bit or combination of bits that both the master and slave controllers can recognize. Its function is to distinguish the target header from regular diagnostic request headers or other periodic messages. This preset flag can be embedded in the high bits of the protected identifier field of the header, or it can be an unassigned standard protocol identifier used as a dedicated identifier. For example, in the LIN protocol, the preset flag can be defined as a specifically encoded PID (Protocol Identifier). This PID is agreed to be used only for "specific flag bit headers" in diagnostic mode. The slave controller pre-registers to listen for this flag, thus identifying which headers are eligible for acknowledgment. The target header carries this preset flag, allowing the slave controller to filter out target headers that require asynchronous processing by detecting headers on the bus.

[0039] After sending the target header, the master controller can set the status of the target header to the first state. The first state indicates that the target header has been sent but no corresponding response information has been received. It can be specifically represented by a flag bit, a state variable, or a state value in a state machine. For example, the first state can correspond to the "waiting for response" or "awaiting for claim" state, indicating that the target header is in a valid waiting state on the bus, and the master controller will pause the transmission of subsequent headers.

[0040] The master controller stops sending new headers to the communication bus, meaning that while the target header is in the first state, the master controller suppresses the sending of periodic request headers triggered by its communication scheduling matrix. This suppression can be achieved based on the judgment of status flags; that is, before preparing to send the next header, the master controller checks the current state of the target header. If the state is the first state, it abandons the current transmission and waits for the state to change. Using this method, a large number of unresponsive headers can be avoided on the bus due to the master controller continuously generating new request headers, thereby reducing error frames caused by unresponsiveness.

[0041] S2, after receiving the response information from the slave node to the target header, sets the state of the target header to the second state based on the response information. The response information indicates that the slave node has completed the current diagnostic task and carries a preset flag bit.

[0042] Specifically, upon receiving a response from the slave node to the target header, the status of the target header can be set to a second state based on the response information. The response information indicates that the slave node has completed the current diagnostic task and carries a preset flag. That is, after the slave controller finishes processing the current diagnostic task, it generates response information and sends it via the communication bus. The preset flag carried in this response information corresponds to the preset flag carried in the target header, enabling the master controller to identify which target header the response information is for.

[0043] In one specific implementation, the master controller monitors the response time slots of the communication bus. When a response frame carrying a preset flag is detected, the master controller parses the task execution status of the slave controller from the data field of the response frame. Based on this response information, the master controller updates the target header status from a first state to a second state. The second state indicates that the target header has been confirmed by the corresponding response information, which can be specifically represented as "responded" or "completed". For example, the second state could indicate that the slave controller has successfully completed the diagnostic task and returned a valid response, or it could indicate that the diagnostic task has been completed but the result may have failed; the specific situation can be distinguished by the data content in the response information.

[0044] It should be noted that the process of setting the target header status to the second state based on the response information achieves closed-loop confirmation in the asynchronous claim mechanism. Setting the first state inhibits the sending of new headers, providing sufficient asynchronous processing time for the slave controller; while setting the second state provides the trigger condition for resuming header sending. The synergy of these two processes decouples the originally tightly coupled request-response sequence into an asynchronous request-claim mechanism, resolving the problems of bus congestion and error frame accumulation caused by the mismatch in processing rates between master and slave nodes.

[0045] S3, if the target header is in the second state, send a new header to the communication bus.

[0046] Specifically, after the main controller sets the target header to the second state, it can release the suppression of new header transmission. As one implementation, before each header transmission, the main controller checks if a target header in the first state exists. If not, it indicates that all currently transmitted target headers have received a response. At this point, it can either send the next target header carrying a preset flag according to the diagnostic task sequence or restart regular periodic communication according to the diagnostic instrument's instructions. If a target header in the first state still exists, suppression continues, waiting for the corresponding response information.

[0047] In one implementation, the new header can be another header with the same preset flag as the previous target header, or it can be a header with different preset flags, depending on the configuration of the diagnostic task sequence. Simultaneously with sending the new header, the main controller sets the status of the new header to the first state and repeats the aforementioned state management process. In this way, the main controller can advance the diagnostic tasks in an orderly manner, ensuring that each request has a corresponding response loop while avoiding the continuous accumulation of unresponsive headers.

[0048] Therefore, by setting a target header with a preset flag and adopting a two-state polling scheduling mechanism, asynchronous claiming of diagnostic requests can be achieved without changing the original bus protocol frame structure. When some slave controllers require a long processing time, it will not cause the master controller to continuously send non-response headers and cause bus congestion, nor will it cause the slave controller to fail to respond in time and cause errors due to the master controller continuing to send subsequent messages. This effectively reduces the number of error frames in the bus diagnostic process, improves the stability and communication efficiency of bus diagnostics, and adapts to slave controllers with different processing rates. Asynchronous processing can be completed without adjusting the overall sequence of the original diagnostic tasks, reducing the cost of protocol modification.

[0049] According to one embodiment of this application, the response information includes diagnosis success and diagnosis failure. When the response information is diagnosis failure, the bus diagnosis method further includes: reporting diagnosis execution failure information to the diagnostic instrument.

[0050] Specifically, the response information can include two scenarios: diagnosis success and diagnosis failure. In a preferred embodiment, if the response information is diagnosis failure, it indicates that an error occurred during the execution of the task by the slave controller, such as data write failure, erase timeout, or verification failure. In this case, the master controller can report the diagnosis execution failure information to the diagnostic instrument based on the diagnosis failure response information.

[0051] This limitation allows the master controller to explicitly distinguish between diagnostic execution failure and communication interruption from the response information. In related technologies, if the slave node does not respond, the master node typically relies on a timeout mechanism for judgment, which can easily misjudge diagnostic execution failure as a link failure, triggering unnecessary global resets or timeout retransmissions. In this preferred solution, the slave controller sends an explicit negative response, enabling the master controller to immediately detect task anomalies and report them to the diagnostic tool. This facilitates rapid location of the cause of task failure, improving the observability of the diagnostic process and the efficiency of failure handling.

[0052] Therefore, even in scenarios where diagnostic execution fails rather than a communication link failure, the diagnostic tool can quickly and accurately determine the cause of the failure without having to wait for a timeout to determine the result. This shortens the overall time of the diagnostic process and avoids redundant operations caused by misjudging link failures, further improving the stability and processing efficiency of the vehicle bus diagnostic process.

[0053] According to one embodiment of this application, when sending a target header to a communication bus, the bus diagnostic method further includes: storing the target header in a first buffer queue and setting the state of the target header in the first buffer queue to a first state, wherein the first buffer queue includes multiple headers, and the state of each header is either a first state or a second state.

[0054] Specifically, when sending a target header to the communication bus, the target header can also be stored in a first buffer queue, and its status in the first buffer queue can be set to a first state. The first buffer queue includes multiple headers, each with a first or second state. That is, the first buffer queue is a data storage structure maintained internally by the main controller to manage target headers that have been sent but have not yet completed a response loop. This first buffer queue can be a circular buffer, a linked list, or an array structure. When the main controller sends a new target header, it stores the header's relevant information (such as its preset identifier, sending timestamp, associated diagnostic task ID, etc.) as an entry in the first buffer queue and marks the corresponding status of that entry as a first state.

[0055] By introducing a first buffer queue, the master controller can simultaneously maintain multiple target headers at different processing stages. In one application scenario, the master controller can continuously send multiple target headers and store them in the first buffer queue, each header in a first state. Subsequently, as response information from slave controllers arrives one by one, the corresponding entry state is successively updated to the second state. This parallel management of multiple asynchronous headers awaiting response avoids blocking the entire diagnostic process due to slow responses from a single header, achieves buffering and orderly scheduling of pending tasks, and improves the stability of diagnostic communication when faced with changes in slave node processing time.

[0056] Therefore, by classifying and managing headers of different states through the first buffer queue, the main controller can quickly locate target headers that have been sent but have not received a response, without having to traverse the entire storage area, thus reducing the time spent on status queries and updates and improving the overall processing efficiency of bus diagnostics.

[0057] According to one embodiment of this application, setting the state of the header to a second state based on response information includes: matching the corresponding target header in a first buffer queue according to a preset identifier carried in the response information; and updating the state of the matched target header in the first buffer queue from a first state to a second state.

[0058] Specifically, based on the introduction of a first buffer queue, in order to accurately associate the received response information with the corresponding target header, this application further provides the following preferred solution. In this preferred solution, when the header state is set to the second state based on the response information, the corresponding target header can be matched in the first buffer queue according to the preset identifier carried in the response information, and the state of the matched target header in the first buffer queue is updated from the first state to the second state.

[0059] As a specific implementation, after receiving the response information, the main controller extracts a preset identifier bit. Then, it iterates through all entries in the first cache queue that are in the first state, comparing the preset identifier bit stored in each entry with the extracted preset identifier bit to determine the matching target header. Upon successful matching, the state value of the matched entry is changed to the second state. That is, using the preset identifier bit as the association key for matching and state updates ensures a precise one-to-one correspondence between the response information and the request header when multiple headers coexist, avoiding misaligned state updates or the omission of unclaimed headers due to matching errors. Through this mechanism, the determinism of the asynchronous claiming process is guaranteed, each diagnostic request can be reliably tracked and closed-loop, improving the reliability of the diagnostic process.

[0060] Therefore, by accurately matching the preset flag bits, the first cache queue can fully play its role in caching and managing unclaimed headers, and the correspondence between requests and responses in asynchronous response scenarios can be solved. Without adding a complicated interactive verification process, reliable closed-loop management of diagnostic request status can be achieved at low cost without changing the original communication framework.

[0061] According to one embodiment of this application, the bus diagnostic method further includes: after the state of the target header in the first buffer queue is set to the second state, deleting the target header from the first buffer queue according to the number of headers in the first buffer queue or a preset deletion policy.

[0062] Specifically, to promptly release the resources occupied by claimed headers in the first cache queue, this application also provides the following preferred solution. In this preferred solution, after the target header's state is set to the second state in the first cache queue, the target header is deleted from the first cache queue according to the number of headers in the first cache queue or a preset deletion policy. This design aims to solve the problem of limited cache queue capacity. If completed entries are not reclaimed, the queue will eventually fill up, making it impossible to store new tasks awaiting processing. Therefore, by actively cleaning up successfully claimed header entries based on the current queue occupancy or a preset deletion policy, the cache queue can continuously accommodate new headers awaiting processing, achieving dynamic management and recycling of valuable memory resources and avoiding the discarding of new tasks due to queue overflow.

[0063] For example, a preset deletion strategy could be implemented where the master controller immediately triggers a deletion function after each successful update of an entry's status to "accepted." This function marks the entry as invalid and adjusts the queue pointer. Alternatively, to reduce frequent memory operations, the preset deletion strategy could involve setting a timer in the master controller to physically clean up all entries in the second state at preset intervals (e.g., 100 milliseconds). Another strategy could be to determine deletion based on the number of headers; for example, if the number of headers in the queue exceeds a certain threshold (e.g., 50% of the total queue length), all entries in the second state could be physically cleaned up. These deletion operations are preferably executed in a low-priority background loop that does not affect bus communication tasks to avoid blocking critical communication processes.

[0064] Thus, through this dynamic deletion mechanism based on quantity or strategy, the storage resources occupied by the claimed target headers are promptly reclaimed, avoiding the problem of capacity overflow or decreased matching efficiency in the first cache queue due to the accumulation of historical information. This enables the system to continuously execute diagnostic flushing tasks for a long time without performance degradation due to resource leaks.

[0065] According to one embodiment of this application, before sending a header to the communication bus, the bus diagnostic method further includes: sending an identifier configuration request frame to a slave node, the identifier configuration request frame containing a preset identifier bit; receiving an acknowledgment response frame returned by the slave node, and determining the preset identifier bit corresponding to the current diagnostic task.

[0066] Specifically, assuming the asynchronous communication mechanism between master and slave nodes can be correctly started and function effectively, this application provides a further preferred solution for how the master controller and slave controller can reach an agreement on preset flag bits before the diagnostic process begins. In a preferred embodiment, before sending a header to the communication bus, an flag configuration request frame containing preset flag bits is sent to the slave node; then, an acknowledgment response frame returned by the slave node is received, thereby determining the preset flag bits corresponding to the current diagnostic task. This design aims to address the fundamental premise of a specific flag bit header mechanism, namely, that both communicating parties must know a common special flag in advance. Without this initialization negotiation process, subsequent communication cannot proceed. The advantage of this limitation is that by conducting a handshake-style configuration negotiation between the master and slave nodes, it ensures that both parties can synchronously identify the same special header, thus paving the way for the establishment of an asynchronous communication mechanism and avoiding communication failures caused by inconsistent or unknown flag bits.

[0067] For example, the master controller first sends a custom diagnostic service request, the data field of which contains the binary value of a preset flag to be used. Upon receiving this, the slave controller registers the flag in its local filter table and returns a positive response. Upon receiving this positive response, the master controller considers the preset flag to be effective and can begin sending target headers carrying that flag. Conversely, if the slave controller cannot support the flag due to insufficient resources or other reasons, it can return a negative response. The value of the preset flag, for example, is preferably 0x3C, an address not allocated in the standard LINPID list, effectively avoiding confusion with regular communication.

[0068] Thus, the master and slave nodes reach a consensus on which headers are eligible for claiming before formal communication, ensuring that the slave controller can correctly filter and claim the target headers, eliminating response loss or incorrect matching caused by inconsistent identifier configuration, and improving the compatibility and reliability of the asynchronous claiming mechanism.

[0069] In summary, the bus diagnostic method according to the embodiments of this application, upon entering the bus diagnostic mode, sends a target header to the communication bus and sets the state of the target header to a first state. The target header carries a preset flag. While the target header is in the first state, sending new headers to the communication bus is stopped. Upon receiving a response from a slave node to the target header, the state of the target header is set to a second state based on the response information. The response information indicates that the slave node has completed the current diagnostic task and carries a preset flag. While the target header is in the second state, a new header is sent to the communication bus. Therefore, this method ensures that only one diagnostic task is being processed on the communication bus at any given time, avoiding bus data conflicts caused by multiple diagnostic tasks transmitting simultaneously. This allows diagnostic messages to be transmitted sequentially, improving the stability and reliability of bus diagnostics.

[0070] Figure 3 This is a flowchart of a bus diagnostic method according to another embodiment of this application.

[0071] like Figure 3 As shown, the control method is executed by the slave controller. The bus diagnostic method of this application embodiment may include the following steps: S11, when entering bus diagnostic mode, receives the target header sent by the master controller through the communication bus, wherein the target header carries preset flag bits.

[0072] Specifically, after entering bus diagnostic mode, the slave controller can continuously monitor the headers on the communication bus. When it detects that the identifier field carried in the header matches a pre-agreed preset flag, the slave controller can determine that the header is the target header that this node needs to process, and receive and parse it. In one embodiment, after receiving the target header, the slave controller can mark it as accepted and extract the diagnostic task request based on the data field in the header.

[0073] S12, upon completion of the current diagnostic task, generate response information, wherein the response information is used to indicate completion of the current diagnostic task and carries a preset flag bit.

[0074] Specifically, after receiving the target header, the slave controller asynchronously executes the corresponding diagnostic task, such as performing time-consuming operations like data writing, erasing, and verification. When the diagnostic task is completed (it may succeed or fail), the slave controller generates a response message. The response message generation process encapsulates the task execution result in a data field and carries a preset flag in the identifier field or specific data bits so that the master controller can identify the target header corresponding to the response.

[0075] S13, send response information to the main controller via the communication bus, so that the main controller can change the status of the target header from the first state to the second state based on the response information.

[0076] Specifically, after the slave controller detects a suitable response slot on the bus, it sends the response information to the communication bus. Since the response information carries a preset identifier, the master controller, upon receiving it, can match the corresponding target header and update its status to the second state, thus completing an asynchronous claiming process. It should be noted that the timing of generating the response information is no longer constrained by the master controller's fixed sending cycle, but rather depends on the completion time of the slave controller's own task processing. After completing its diagnostic task, the slave controller can backtrack the bus to find unresponsive target headers and fill them with responses. This fundamentally decouples the timing of requests and responses, eliminating the accumulation of unresponsive error frames caused by the slave controller's long processing time.

[0077] Therefore, by using preset flags, asynchronous matching of diagnostic requests and responses between master and slave controllers is achieved. The master controller does not need to wait for the slave controller to return results according to a fixed polling cycle, and the problem of request frame accumulation and increased non-response error frames caused by the slave controller taking a long time to process diagnostic tasks is avoided. This effectively improves the communication efficiency of bus diagnostics, reduces the bus resource occupancy rate during the diagnostic process, and adapts to slave controller nodes with different processing speeds, thereby improving the compatibility and reliability of bus diagnostics.

[0078] According to one embodiment of this application, upon completion of the current diagnostic task, response information is generated, including: if the current diagnostic task is successfully executed, the response information includes "diagnosis successful"; if the current diagnostic task fails, the response information includes "diagnosis failed," wherein if the current diagnostic task is not completed within a preset time threshold, it is determined that the current diagnostic task has failed. The preset time threshold can be determined according to actual circumstances.

[0079] Specifically, in order to clearly report the execution abnormality of the diagnostic task to the main controller, this application also provides the following preferred solution. In this preferred solution, when generating response information after completing the current diagnostic task, if the current diagnostic task is executed successfully, the response information includes diagnostic success; if the current diagnostic task fails, the response information includes diagnostic failure. In this case, if the current diagnostic task is not completed within a preset time threshold, it is determined that the current diagnostic task has failed.

[0080] When the controller performs a diagnostic task, it can start a timer. If the task is completed within a preset time threshold and the result is correct, a successful diagnostic response is generated. Otherwise, if the task is not completed within the preset time threshold, or if an error is detected during execution (such as write failure or verification error), a failed diagnostic response is generated, which may include an error code or a failure reason indication. After receiving the failed diagnostic response, the main controller can report it to the diagnostic instrument, thus ensuring that abnormal diagnostic tasks are reflected in a timely manner and avoiding misjudgment of communication interruption due to simple timeout waiting.

[0081] This design aims to provide a clear and reliable mechanism for determining diagnostic results. Without this timeout determination, slave nodes might be unable to send a response indefinitely, causing the master controller to wait indefinitely, if the task execution gets stuck in an infinite loop or hardware failure occurs. The advantage of this limitation is that by setting a reasonable time threshold, the slave controller can accurately determine whether the task execution has timed out and encode the success or failure status into the response information, thereby clearly informing the master controller of the task execution result. Those skilled in the art will understand that the preset time threshold can be a fixed absolute time or a relative time, such as relative to the moment the current target header was sent. This threshold can be dynamically adjusted according to the complexity of the specific diagnostic task. For example, for a simple firmware version number reading task, the threshold can be set to 50 milliseconds; while for a complex flash erase task, the threshold can be set to 5000 milliseconds. When the timer reaches this threshold before generating a success or failure response, the controller will directly determine that the task has failed and generate a failure response.

[0082] Therefore, the timeout determination mechanism can effectively avoid the main controller from being unresponsive for a long time, reduce the waste of system resources, improve the overall efficiency of the vehicle diagnostic process, ensure that the diagnostic results can be fed back in a timely manner, provide a clear and reliable basis for the main controller to carry out the next diagnostic process, reduce the probability of missed or false fault diagnosis, and improve the stability and reliability of the diagnostic interaction of the whole vehicle electronic control system.

[0083] According to one embodiment of this application, before receiving the target header sent by the main controller, the method further includes: receiving an identifier configuration request frame sent by the main controller, the identifier configuration request frame containing a preset identifier bit; responding to the identifier configuration request frame and returning an acknowledgment response frame to the main controller.

[0084] Specifically, on the slave controller side, this application also provides a preferred solution corresponding to the master controller side for how to complete the initial configuration of the preset identifier bits. Before receiving the target header sent by the master controller, the slave controller can receive an identifier configuration request frame sent by the master controller. The identifier configuration request frame contains the preset identifier bits. The slave controller responds to the identifier configuration request frame and returns an acknowledgment response frame to the master controller. This design completes the other half of the handshake protocol, ensuring that the slave controller can actively acknowledge and register the preset identifier bits.

[0085] In essence, after receiving an identifier configuration request frame, the slave controller extracts candidate values ​​for a preset identifier bit from the frame's data field and determines whether it supports that preset identifier bit. If it does, it sends an acknowledgment response frame. Upon receiving the acknowledgment response frame, both parties officially adopt the preset identifier bit for subsequent communication. Through this negotiation process, the slave controller can clearly identify the conditions for the target header before the diagnostic task begins, avoiding the neglect of valid requests or the incorrect acceptance of non-target headers due to identifier inconsistencies, further improving the reliability of the asynchronous acceptance mechanism.

[0086] Therefore, by receiving configuration requests and returning confirmation responses, the controller can confirm and register preset flag bits, thereby avoiding communication errors caused by flag bit inconsistencies and realizing the correct configuration of specific flag bit header mechanisms on the controller side.

[0087] In summary, the bus diagnostic method according to the embodiments of this application, when entering the bus diagnostic mode, receives a target header sent by the master controller via the communication bus, wherein the header carries a preset identifier bit; upon completion of the current diagnostic task, generates response information, wherein the response information indicates completion of the current diagnostic task and carries the preset identifier bit; and sends the response information to the master controller via the communication bus, so that the master controller sets the state of the target header from a first state to a second state based on the response information. Therefore, this method effectively avoids bus conflicts caused by uncertain processing times of slave nodes, significantly reduces the generation of invalid error frames, and improves the reliability and efficiency of bus diagnostic communication.

[0088] In summary, in the scenario of online firmware upgrades for vehicle electronic control units, the diagnostic tool performs diagnostic flashing on the door control module (a slave controller) through the master controller. The upgrade process requires the master controller to send new firmware data in frames to the slave controller, which then completes the data writing and verification frame by frame. This type of write operation is inherently time-consuming, and the microcontroller inside the slave controller may require hundreds of milliseconds or even longer processing time when erasing flash memory or performing security checks. In related technologies, the master controller strictly follows a predefined communication scheduling matrix, continuously sending diagnostic request headers to the communication bus at fixed millisecond intervals. When the slave controller is in the aforementioned time-consuming operation phase, it cannot respond in time within the current communication cycle, causing each unresponsive header on the bus to trigger an error frame. As firmware data frames are continuously sent, a large number of error frames accumulate on the bus, making it easy for the master controller to misjudge this lack of response caused by processing delays as a physical link disconnection or slave node failure, thereby triggering the error recovery process, interrupting the ongoing flashing task, causing upgrade failure or repeated retries.

[0089] This application decouples the tight temporal coupling between request and response into an asynchronous claiming process by introducing a target header carrying preset identifiers and its state management mechanism. Before formally entering the flashing process, the master controller sends an identifier configuration request frame to the slave controller's communication bus. This request frame contains a set of preset identifiers that can be recognized by both parties. After the slave controller receives this frame and returns an acknowledgment response frame, both parties clarify which headers belong to the claimable category in subsequent diagnostic tasks.

[0090] Subsequently, the master controller generates the first target header carrying the preset flag and sends it to the communication bus. Simultaneously, the master controller stores this target header in its internally maintained first buffer queue and sets its status in the queue to a first state, indicating that the header has been sent but has not yet received a response. During the first state period, the master controller actively suppresses all subsequent new headers sent by its communication scheduling matrix and no longer injects new request frames into the bus. The slave controller continuously listens to the bus, and when it detects the agreed-upon preset flag in the header field, it identifies the target header and marks it as accepted. The slave controller then asynchronously begins to execute this diagnostic task, such as erasing and writing operations to a specified memory area. During this process, the slave controller focuses solely on task execution and is not interrupted or forced to respond by the master controller's periodic header sending. After the diagnostic task is completed, the slave controller generates a response message. This response message carries the same preset flag as the target header and encapsulates the task execution result in the data field, such as successful write or verification failure. The slave controller finds a suitable response slot on the bus and sends the response message back to the master controller.

[0091] After receiving the response information carrying the preset identifier, the main controller iterates through all header entries in the first buffer queue that are in the first state, using the preset identifier as the matching key to accurately locate the corresponding target header. Subsequently, based on the response information, the main controller updates the state of the matched target header in the queue from the first state to the second state, indicating that the header has been claimed and the loop closed. If the response information indicates that the diagnostic task execution failed, the main controller further reports the diagnostic execution failure information to the diagnostic instrument, so that testers can be promptly informed of the task anomaly, thereby quickly locating the problem and avoiding confusion between the task anomaly and communication interruption.

[0092] After the target header state is set to the second state, the main controller, according to a preset deletion strategy (such as when the number of queue entries reaches the limit or when immediate cleanup is required), deletes the target header from the first buffer queue, releasing the storage resources it occupies. At this point, since there are no longer any target headers in the first state in the first buffer queue, the main controller releases the suppression of new header transmission and begins sending the next target header carrying a preset identifier. It then stores this header as a new entry in the first buffer queue and re-marks it as the first state. This process continues until all firmware data frames have been transmitted.

[0093] For example, in a vehicle software over-the-air (OTT) upgrade scenario, the gateway acts as the master controller, while multiple domain controllers (such as door domain controllers and seat domain controllers) act as slave controllers. When entering flashing mode, the master controller first negotiates a preset identifier, such as 0x3C, with one of the slave controllers to be flashed. Then, the master controller sends a target header carrying the 0x3C identifier and stores it in its local queue, setting its status to pending claim. Simultaneously, the master controller stops sending any new headers; only this special placeholder exists on the bus.

[0094] After receiving the target header from the controller, a complex flash memory erase / write operation begins in the background, which may take several seconds. In traditional solutions, the periodic requests from the main controller during this period will result in a large number of error frames, eventually triggering a timeout retransmission and causing the write operation to fail. In the solution of this invention, the main controller waits quietly. After the slave controller completes the erase / write operation, it checks the bus, finds an unclaimed 0x3C header, and immediately generates a response frame containing a success status, carrying the 0x3C identifier in response.

[0095] Upon receiving the response, the master controller matches the corresponding entry in the queue based on the 0x3C identifier, updates its status to accepted, and removes it from the queue. Then, the master controller sends the next target header with the new identifier and continues writing the next segment of data. If an error occurs during the write process, the slave controller will generate a negative response containing a failure status for the same 0x3C header after a preset timeout (e.g., 5 seconds). Upon receiving this response, the master controller will report the write failure to the upper-level diagnostic tool so that the system can promptly switch to the error handling procedure.

[0096] Therefore, in this scenario, the entire flashing process avoids the generation of invalid error frames, improving the success rate and stability of remote upgrades. The user-perceived value is that the vehicle can complete remote upgrades more reliably and quickly, without having to frequently return to the service station due to flashing failures.

[0097] The following is combined Figure 2 The method described in this application is used to describe the method.

[0098] As a specific example, the interaction method between the master controller and the slave controller in this application may include the following steps: S101, send an identifier configuration request frame to the slave node. The identifier configuration request frame contains preset identifier bits.

[0099] S102, receive the identifier configuration request frame sent by the main controller. The identifier configuration request frame contains preset identifier bits.

[0100] S103, respond to the configuration request frame and return an acknowledgment response frame to the main controller.

[0101] S104, Receive the confirmation response frame returned from the node and determine the preset flag bit corresponding to the current diagnostic task.

[0102] S105, send the target header to the communication bus and set the status of the target header to the first state.

[0103] S106 receives the target header sent by the main controller via the communication bus, wherein the target header carries a preset identifier bit.

[0104] S107, upon completion of the current diagnostic task, generates response information and sends the response information to the main controller via the communication bus.

[0105] S108: After receiving the response information from the slave node to the target header, the state of the target header is set to the second state based on the response information.

[0106] S109: If the target header is in the second state, a new header is sent to the communication bus.

[0107] Corresponding to the above embodiments, this application also proposes a vehicle.

[0108] like Figure 3 As shown, the vehicle 200 in this embodiment may include: a memory 210, a processor 220, and a program stored in the memory 210 and executable on the processor 220. When the processor 220 executes the program, it implements the bus diagnostic method described above.

[0109] According to the embodiments of this application, by performing the above-described bus diagnostic method, the vehicle can effectively avoid bus conflicts caused by uncertain processing time of slave nodes, significantly reduce the generation of invalid error frames, and improve the reliability and efficiency of bus diagnostic communication.

[0110] It should be noted that 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 specifically implemented 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, for example, by optically scanning the paper or other medium, followed by editing, interpreting, or otherwise processing as necessary, and then stored in a computer memory.

[0111] It should be understood that various parts of this application can be implemented using hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented using software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented using any one or a combination 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.

[0112] 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.

[0113] 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, "multiple" means at least two, such as two, three, etc., unless otherwise explicitly specified.

[0114] In this application, unless otherwise expressly specified and limited, the terms "installation," "connection," "joining," and "fixing," etc., should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral part; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; they can refer to the internal communication of two components or the interaction between two components, unless otherwise expressly limited. Those skilled in the art can understand the specific meaning of the above terms in this application according to the specific circumstances.

[0115] 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 bus diagnostic method, characterized in that, Applied to the main controller, the method includes: When entering bus diagnostic mode, a target header is sent to the communication bus and the state of the target header is set to the first state. The target header carries a preset flag bit, and when the state of the target header is the first state, the sending of new headers to the communication bus is stopped. After receiving the response information from the slave node to the target header, the state of the target header is set to a second state based on the response information, wherein the response information is used to indicate that the slave node has completed the current diagnostic task and carries the preset identifier bit; If the target header is in the second state, a new header is sent to the communication bus.

2. The bus diagnostic method according to claim 1, characterized in that, The response information includes diagnosis success and diagnosis failure, wherein when the response information is diagnosis failure, the method further includes: Report diagnostic execution failure information to the diagnostic instrument.

3. The bus diagnostic method according to claim 1, characterized in that, When sending the target header to the communication bus, the method further includes: The target header is stored in a first buffer queue, and the state of the target header in the first buffer queue is set to the first state. The first buffer queue includes multiple headers, and the state of each header is either the first state or the second state.

4. The bus diagnostic method according to claim 3, characterized in that, Setting the header status to a second state based on the response information includes: Based on the preset identifier carried in the response information, the corresponding target header is matched in the first cache queue; The status of the matched target header in the first cache queue is updated from the first status to the second status.

5. The bus diagnostic method according to claim 4, characterized in that, The method further includes: After the target header's state is set to the second state in the first cache queue, the target header is deleted from the first cache queue according to the number of headers in the first cache queue or a preset deletion policy.

6. The bus diagnostic method according to claim 1, characterized in that, Before sending the header to the communication bus, the method further includes: Send an identifier configuration request frame to the slave node, the identifier configuration request frame containing the preset identifier bits; Receive the confirmation response frame returned by the slave node and determine the preset flag bit corresponding to the current diagnostic task.

7. A bus diagnostic method, characterized in that, Applied to a controller, the method includes: When entering bus diagnostic mode, the target header sent by the main controller is received through the communication bus, wherein the target header carries a preset identifier bit; Upon completion of the current diagnostic task, a response message is generated, wherein the response message indicates completion of the current diagnostic task and carries the preset identifier bit; The response information is sent to the main controller via the communication bus, so that the main controller can change the status of the target header from the first status to the second status based on the response information.

8. The bus diagnostic method according to claim 7, characterized in that, Upon completion of the current diagnostic task, the generation of response information includes: If the current diagnostic task is executed successfully, the response information includes "diagnosis successful"; If the current diagnostic task fails to execute, the response information includes diagnostic failure, wherein the current diagnostic task is determined to have failed if it is not completed within a preset time threshold.

9. The bus diagnostic method according to claim 7, characterized in that, Before receiving the target header sent by the master controller, the method further includes: Receive an identifier configuration request frame sent by the main controller, wherein the identifier configuration request frame contains the preset identifier bit; Respond to the identifier configuration request frame and return an acknowledgment response frame to the main controller.

10. A vehicle, characterized in that, include: A memory, a processor, and a program stored in the memory and executable on the processor, wherein when the processor executes the program, it implements the bus diagnostic method according to any one of claims 1-6 or 7-9.